Making SSH client use line buffered stream

So I found out about stdbuf. To get it:

# apt-get install coreutils

If you want your ssh client to use line-buffered streams use -t -t.

So I ended up with:

# su -c "stdbuf -oL ssh -t -t /usr/bin/tail -f /var/input.log | stdbuf -oL tr -c '\\11\\12\\15\\40-\\176" myuser \
  | tee -a /tmp/input.log \
  | grep --line-buffered -v "...ignore..." \
  >> /tmp/output.log

Holy command-line Batman!

Mounting Windows SMB share from Debian Wheezy

Configuring an SMB mount from my Linux box to my Windows box. This was helpful.

Basically:

# apt-get install cifs-utils

Then create your credentials file:

# cat > /root/amanda.smbpass  <<EOF
username=jj5
password=SECRET
EOF

Then edit /etc/fstab and add:

//amanda.jj5.net/Users  /media/amanda cifs defaults,noauto,credentials=/root/amanda.smbpass 0 2

Then create /etc/network/if-up.d/mount-amanda like this:

#!/bin/bash
mount /media/amanda

And make sure it’s executable:

# chmod +x /etc/network/if-up.d/mount-amanda

Mounting can also be done from the command-line:

# mount -t cifs -o username=jj5,password=SECRET //amanda.jj5.net/Users /media/amanda