Incron gotchas

Of which there are three:

  1. Make life simple and do all your incron as root. I know you shouldn’t but it helps to avoid all sorts of permissions issues. You may need to create an allow file “/etc/incron.allow” and put either root or your sudo name in it.
  2. Ensure that you only have one “SPACE” (not a TAB) between the three elements on an incron job: e.g.

    /etc/samba/smb.conf IN_MODIFY /etc/init.d/samba restart

  3. incron, like cron, requires full paths for just about everything, so if you are calling a script, use the full path to it, and use the full path to all programs inside the script.

Take Screenshot via ssh

A cool little command line or two.

Say you have a remote machine that you can ssh into, it is running an X server, and you want to take a screenshot of what is on screen. You will need imagemagick installed on the remote machine for the import command to work.

1. After you have ssh’d in:

This will save the screenshot to the remote machine’s tmp folder. You will need to scp across to get it!

2. Before ssh’ing

Replace user@remote-host with your details. The image will appear on your PC, you can then save it as required.

Both very cool :)