chrisspeck.com

Chris' random ramblings

Archive for February, 2011

Remember to check your Live CDs!

I was going to do a post about creating a rescue image of a Windows 7 install using OSS (Ubuntu 10.10 + PartImage) however I thought I’d post a warning about corrupted Live CDs instead.

Essentially, I tried unsuccessfully three times to install Ubuntu off a Live CD (it would always crash at the third step) before it occurred to me that I ought to check the CD for errors.

To do this you need to access the “hidden” boot menu on the Live CD, by pressing any key the following symbol comes up:

My check told me that it “found errors in 1 files!”. So I threw this CD out, burnt another Live CD (slowly – at 8 speed), checked it (“Check finished no errors found”) and low-and-behold it worked properly first time.

Tags:
posted by specky in IT and have No Comments

Remotely starting X11 apps on other displays

user@laptop:~$ ssh -X user@desktop
...
user@desktop:~$ printenv
...
DISPLAY=localhost:10.0
...
_=/usr/bin/printenv
user@desktop:~$

Take note of the “DISPLAY” variable, this is the local port (on the machine called “desktop”) which is forwarding X11 server commands to the X11 client running on the machine called “laptop”.

user@desktop:~$ export DISPLAY=:0.0
user@desktop:~$ vlc &

This sets the “DISPLAY” variable to the first screen on the desktop, and starts VLC as a background process. For this to work you must be logged into the server with the same user account, and have an X11 client running on the desktop.

user@server:~$ export DISPLAY=localhost:10.0
user@server:~$ gedit &

This sets the “DISPLAY” variable to the laptop, and starts Gedit on the server, but displaying it on the laptop.

posted by specky in IT and have No Comments

Batch application of filters in Gimp to make many old photos

I have bunch of files to which I want to apply the “Old Photos” GIMP filter.

For the uninitiated, Old Photos turns this:

into this:


This is a very simple script which will apply the Old Photos filter to every file matching the pattern you supply when you run GIMP. It has no “undo” function and it will save over the input files so be sure to make backups of the originals and only run this script on copies.

To call it you run:

gimp-2.6 -i -b "(many-old-photos \"*.jpg\")" -b "(gimp-quit 0)"

You can download make-many-old-photos.scm here or click here to view the code.

posted by specky in Downloads,IT and have No Comments

Norton Removal Tool

If you get stuck with Norton software on your system try following the steps in this page or downloading one or Symantec’s tools direct from its FTP site.

posted by specky in Uncategorized and have No Comments

WordPress more tag patch for Facebook Photo Fetcher

I have been experimenting with using the brilliant Facebook Photo Fetcher plug-in (by Justin Klein) to present the photos I have on Face Book however it didn’t work quite the way I wanted.

The specific problem is that there was no way to split a gallery with a <!--more--> tag.

(Having two references to Facebook Photo Fetcher, with a more tag in between does not work either).

So I have edited the source of the plunging to introduce the functionality I need and I have added support for a more=n stanza to the plungin.

The edits (to version 1.2.8 of _output_gallery.php) are as follows:

1. At line 108 insert:

//1.2.8-cs
if( preg_match('/more=(\d+)/', $retVal['startTag'], $matches) )      $retVal['more']      =$matches[1];

2. At line 293 insert:

//1.2.8-cs
//Insert a more tag?
if( $params['more'] > 0 && $i == $params['more'] ) $retVal['content'] .= "<!--more-->\n\n";


An example usage is this:

<!--FBGallery [ID#] more=8 --><!--/FBGallery-->

This will insert a <!--more--> tag after your eighth image. I suggest you set this number to be a multiple of your column count (with default settings, 4 or 8 are good numbers).

If you want you can download a pre-hacked version of _output_gallery.php in a zip file (note this will only work for version 1.2.8 of Justin Klein's plug-in).

Full credit for creating the plugin goes to Justin Klein, I am very grateful to him for sharing it and you may visit his site here, and the plug-in's info and FAQ is here.

posted by specky in Downloads and have No Comments