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.

Imagemagick – Tips and Tricks No. 3

Add a Label to a set of images

First bash script coming up, I’ll explain the best I can: I have a set of images that are all square: w=h. I want to create an image of each image with a label on top,using the filename as the label (without the extension), with a white background, ending up with a 200×250 image with the same name as the original but with “-tab” added. IM will by default squeeze the font size so that the text label always fits. Continue reading

Imagemagick – Tips and Tricks No. 2

Montage

The ability to combine a set of images into one image in a variety of ways, essentially replicates the contact sheets of old. Here are a few ways to create a montage. It works best when all the images are the same height and width. IM does not understand page sizes, and will just create a simple image, regardless of the number of images, you can tell IM which images to use though. It also makes sense when testing and creating montages to save the output to a different directory, otherwise your montages will be included in the next iteration! Continue reading

Xubuntu 16.04 – Repair Nvidia Graphics Install

Don’t know / can’t remember exactly what happened but for some reason my proprietary Nvidia driver stopped working, I lost OpenGL, and with that a lot of functionality on the desktop. After living with it for a couple of months, and there are many different solutions to doing it, I finally got around to sorting it out like this: Continue reading

Startup Genymotion from CLI, resize and move it

My OpenGL for my graphics has been broken for a few weeks, and I have been missing using Genymotion for my AppInventor emulator. Finally fixed the graphics (another story) and Genymotion working once again. Would like a working environment on just one desktop, so need to resize the stock setup for Genymotion and move it over to the right. Here is a little bash script that does the lot: Continue reading

Thunar Custom Action – Add Filepath to Clipboard

This should be fairly straight-forward, but it isn’t.

We are going to use xclip as this takes the bash output and makes it available for X applications

There are also two variants depending upon which clipboard (there are 3!) you want

For the SECONDARY clipboard (the one that works with CTRL+C/CTRL+V or Right-Click and Paste)
enter the following in the command box for your custom action:

echo -n %f | xclip -selection c

For the PRIMARY clipboard (the one that only works if you Middle-Click your mouse)
enter the following in the command box for your custom action:

echo -n %f | xclip -i

Grab BBC News Videos with a Bash Script

A colleague asked me the other day if I could download a video clip from the BBC News website so that she could use it in her training course (to save having to load up the website and play it “live” from there!)

I said anything is possible 😉  Took me on a little journey but finally found a way without having to resort to any browser plugins or switching to Windows to download a video grabber program. Decided to write a bash script to pull all the elements together too :) Continue reading