create home directories after create users

This might sound like a silly idea, but if the users aren’t actually doing anything, you could do: cat /etc/passwd | cut -f 1 -d : >/tmp/users.list Then edit /tmp/users.list to only contain the users you want. Then do: for i in `cat /tmp/users.list` do userdel $i useradd -m $i done However, many Redhat based … Read more

How to get TX/RX bytes without ifconfig?

Another option is to use the /proc filesystem. The /proc/net/dev file contains statistics about the configured network interfaces. Each line is dedicated to one network interface and it contains statistics for receive and transmit. The statistics include metrics such total number of received/transmittted bytes, packets, drops, errors and so on. cat /proc/net/dev Inter-| Receive | … Read more

Temporarily ignore my `~/.ssh/known_hosts` file?

You can use ssh -o StrictHostKeyChecking=no to turn off checking known_hosts momentarily. But I’d advise against this. You should really check why the host key has changed. Another option is to add a specific entry to your ~/.ssh/config for the host in question. This might be valid approach if you have a certain host which … Read more

Caching/preloading files on Linux into RAM

vmtouch seems like a good tool for the job. Highlights: query how much of a directory is cached query how much of a file is cached (also which pages, graphical representation) load file into cache remove file from cache lock files in cache run as daemon vmtouch manual EDIT: Usage as asked in the question … Read more

SSHFS mount that survives disconnect

Use -o reconnect,ServerAliveInterval=15,ServerAliveCountMax=3 The combination ServerAliveInterval=15,ServerAliveCountMax=3 causes the I/O errors to pop out after one minute of network outage. This is important but largely undocumented. If ServerAliveInterval option is left at default (so without the alive check), processes which experience I/O hang seem to sleep indefinitely, even after the sshfs gets reconnect‘ed. I regard this … Read more