I’m setting up some backup scripts and am using cron to schedule them to run. Usually I run my backup scripts as root and just link a file into /etc/cron.*/ for periodic processing. However in this case I need to run the backup scripts as my user (they’re offsite backup scripts that use rsync to copy data) and not root, so I used crontab -e to edit my crontab. I did a little reading on crontab and learned about the @weekly syntax which I’ve used for the first time today. Now I guess I just wait a week and see that everything is working. :)
Daily Archives: 2012-01-08 [Sunday]
Filesystem Hierarchy Standard
I’m working on my backup scripts, so I found myself having a read of the Filesystem Hierarchy Standard. I was particularly interested in what /sys was all about, and it turns out that it’s another virtual file system like /proc.
Configuring OpenSSH server to allow key-based root logins
If you want to allow root logins to your server, but want to disallow root logins with a password (leaving key logins enabled), then you can edit your /etc/ssh/sshd_config file and specify PermitRootLogin without-password.
Generating a locale on Ubuntu
I needed to run
$ sudo locale-gen en_AU.UTF-8
to fix a problem I was having with my locale settings. I found out about that over here.
WinSCP command line options
Finally got around to taking a look at WinSCP’s command-line options. Basically I just needed to specify a session name and that was it. Now I have a set of icons on my desktop for scping to my various servers. I even configured a shortcut key for servers I use often, so now all I need to do to get at my remote ProgClub files is press Ctrl+Alt+Shift+C.
Bash aliases for listing hidden files
I finally figured out the ls command to list hidden files, and decided to setup a ~/.bash_aliases file for the first time. My ~/.bash_aliases file is now:
alias l.='ls -d .[!.]*' alias ll.='ll -d .[!.]*'
So I have an “l.” command which will list hidden files and directories, and an “ll.” command which will list the same information in detail.
Keeping Your SSH Sessions Alive Through NAT Firewalls
I found this article Keeping Your SSH Sessions Alive Through Pesky NAT Firewalls which explained how to keep SSH connections alive through NAT firewalls. I’m behind a NAT router and my SSH connections are always timing out due to inactivity, and it annoys the shit out of me. I’ve been putting up with it for ages, and tonight I finally got around to searching for a solution. The solution is to edit your ~/.ssh/config file and add:
Host * ServerAliveInterval 240
That will make the server send a keep-alive packet every four minutes, which out to do it. Haven’t tried it yet, but expect it will work. Will configure my systems now…
Update: that didn’t seem to work for me. :(
Maybe this is a client setting?
Anyway, I did some more research, and I found that PuTTY has a configuration option in the Connection settings “Sending of null packets to keep session active”, “Seconds between keepalives” which defaults to 0 (turned off). So I’m gonna try with that now.