Scratching my own itch. I have a bunch of directories which I want moved into alphabetic sub-directories. This is handy is you have a bunch of MP3s, books, or other catalogued files. This bash script moves a top level directory (and all the files and subdirectories under it), to a folder based on the (upper-case) version of the first character of the directory name. #!/bin/bash for dir in */ ; do start=${dir:0:1} mkdir -p ${start^^} mv "$dir" ${start^^} done Save that as…
Continue reading →
I've grown to loath IFTTT. What started out as a cool way to plug internet things together has being an opaque an uncommunicative company with no real interest in customer service. That's not surprising, I suppose, its paying customers are the companies who can't be bothered to develop a proper API and so just shove some integrations up there. But it is annoying for those of us who want something simple - like debug logs or notifications when scripts fail. Or something complex like conditional …
Continue reading →
As ever, mostly notes to myself. RAR is a silly and proprietary format. I prefer free software and I find that ZIP files are smaller and decompress faster. Not everyone agrees, and that's fine. Assuming you've downloaded a RAR file and want to convert it to ZIP, what's the easiest way? Install P7Zip sudo apt-get install p7zip-full p7zip-rar Script This basic bash script will Extract a RAR example.rar file to a temporary directory on a RAM disk. Recompress to example.zip. Delete the…
Continue reading →
Mostly notes to myself :-) Here is a quick way to add watermarks to photos and videos. All Linux command line based - so perfect if you've got a lot of images you want to manipulate. Here is a delightful photo I've taken of a bee covered in pollen. I want to add a little copyright notice to it in order to discourage people using it without permission. This command uses imagemagick's "annotate" option. convert bee.jpg -gravity SouthEast -pointsize 16 -font TinyUnicode-Medium -fill…
Continue reading →
Loading large 3D Models in the browser is extremely resource intensive. 2D images are trivial to resize and resample with negligible loss of perceived quality. 3D resizing is complex. As part of my "Pirate Museum" I wanted to display 3D scans of statues using WebVR. The only problem is, these files are huge. Take The Dancing Faun - at full resolution, that's around 230MB. Even on fast broadband that's a pain to download - and even on a fast computer it is slow to render. Once you add…
Continue reading →
New tech site Gadgette has a great article on how to type Emoji on Mac and Windows - but they (understandably) didn't cover Ubuntu. So here I am to show you how. Get The Fonts If your computer doesn't have the requite font, install the latest version of Symbola. Simply open up the .zip file, double click on the .ttf font, then choose "Install". Find The Character You almost certainly have the GNU CharMap app installed. If not, run apt-get install gucharmap. You'll find it in…
Continue reading →
Another quick Android tutorial. I couldn't find an easy or correct method of launching a browser when you click on a homescreen widget. Well, here it is... public class clickWidget extends AppWidgetProvider { @Override public void onUpdate( Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds ) { RemoteViews remoteViews = new RemoteViews( context.getPackageName(), R.layout.widget ); remoteViews.setImageViewResource(R.id.ImageView01, drawableResourse); ComponentName…
Continue reading →