Security

Tunneling ports with SSH

Using -L on the command line with SSh will bind a remote port to a local one. For instance, if you wanted to tunnel the port for a remote desktop (usually 5901) to a local machine, you would type the following ssh -L 5901:localhost:5901 remote_ip You could then access your remote desktop by connecting your […]

Read More
Scripting

Rotate images depending on the EXIF Orientation Tag

Automatic rotation of JPG images (inclusive EXIF thumbnail) can be performed by using jhead.exe and jpegtran.exe in Windows. jhead -ft -autorot *.JPG All JPG-files in that folder will be rotated and file time (time and date of exposure) will be set according to the EXIF info.

Read More
Linux

Ten Cool Coreutils Commands

While a few commands, such as ‘cd’ are built directly into bash; many of the most important commands come from coreutils, a GNU package containing over a hundred commands. Some are the well known commands such as ‘ls’, ‘mv’ and ‘cat’. While there are some more obscure ones that are not always discovered because there […]

Read More
Scripting

Root Check

Sometime it is useful to determine if a script is being run as root or not. A simple check can be performed at the start of a script before anything important is done. The bit of code below will do this. # Check the script is being run by root if [ “$(id -u)” != […]

Read More