nfs4 and all_squash

all_squash does not work when directory/share is on the same filesystem. Example:



We have to mount folder with a bind to get this working. Move folder to new location, here I’m hiding it:

mv /media/mount/folder /media/mount/.folder
mkdir /media/mount/folder


/dev/sdb1 /media/mount ext4 defaults 0 0
/media/mount/.folder /media/mount/folder none bind 0 0

Mount and reload nfs exports:

mount /media/mount/folder
exportfs -r


nVidia HDMI audio

Check which hardware devices are avaiable:

sudo aplay -L

Check which device monitor is connected to:

speaker-test -c 2 -r 48000 -D hw:1,3
speaker-test -c 2 -r 48000 -D hw:1,7
speaker-test -c 2 -r 48000 -D hw:1,8
speaker-test -c 2 -r 48000 -D hw:1,9

Pulseaudio automatically loads first hardware device(0,3 or 1,3). Manually load another in /etc/pulse/

load-module module-alsa-sink device=hw:1,7


mount by network location


host.lan:/ /media/mount nfs4 _netdev,noauto,users,async 0 0


ping=`/usr/bin/fping -q host.lan`
if [ $? = 0 ]; then
  mountpoint $stasjon > /dev/null
  if [ $? != 0 ]
    then mount $stasjon
  mountpoint $stasjon > /dev/null
  if [ $? = 0 ]
    then umount -l $stasjon

chmod +x /usr/local/bin/network-mount
crontab -e

* * * * * /usr/local/bin/network-mount

PDF toolkit – split/merge PDFs

I had some schoolwork scanned to a PDF-document, with odd pages in one document and even pages in another. The pages was also in wrong order. I was looking for an easy way to rearrange the pages in a single document. No fancy interface reacquired, a understandable command line would do. PDF toolkit is this.


apt-get install pdftk


pdftk A=file1.pdf B=file2.pdf cat A1 B2 A2 B1 output output.pdf

This will make an PDF document “output.pdf” with four pages. Page 1 in output.pdf being the first page from file1.pdf, page 2 being the second page from file2.pdf and so on.