Photography

HOWTO: Square Instagram images with white borders

I noticed that a lot of Instagram users, such as Alan Schaller to name but one, were posting images with thick white borders to make their images into the square images that Instagram favours. I like the striking look these images have in the Instagram gallery. I wondered for some […]

Tech

Unmount USB drives from a script in macOS

I have a number of external drives hanging off my laptop, but sometimes I want to disconnect them. I used to go into Finder and click the eject button but I have five drives now so that’s getting unwieldy. There are a few different ways of doing this. I wrote […]

Linux

Find Duplicate Files in MacOS

In the past I’ve used FSLint or even some BASH magic to find duplicate files but I have a huge archive of photos and videos, some of which were renamed during import, and some were accidentally imported more than once, or moved about. It’s somewhat chaotic So I was very […]

Linux

set -o vi FTW

The Bash command line can be edited using the cursor keys but for the real power user you need to enable Vi mode: $ set -o vi Or add it to one of your Bash startup files. Now, instead of the slow interactive editing you’ll get the command and insert […]

Linux

Bash: compare two directories

In Unix based systems like Linux and Mac OS X there are a number of ways of comparing two directories. The simplest way is to use diff: diff –brief -rb directory_1 directory_2 This command compares each file and reports if they differ. You can find the meanings of the options […]

apache

Who's abusing your website?

I wanted to know what IP addresses were hitting my website. I’d done this before and it only took a moment or two to recreate the following commands. Still, here it is for future reference. grep -v “wp-content” access.log|grep -v wp-includes|cut -f 1 -d ” “|sort|uniq -c|sort -nr|less This code: […]

Linux

How to loop over filenames wit …

How to loop over filenames with spaces – I knew this, but it had disappeared in the recesses of my brain. > for f in `cat /pathtolist/mp3.txt` do cp “$f” /newdirectory done You didn’t say exactly how the file is organised, so I’m going to guess one filename per line. […]

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close