Oct
17
2010
0

Stopping Javascript from resizing the window in Firefox

One of my pet hates on the internet is shopping sites which resize the window when you’re looking at a zoomed in image. Not all of us still use a windowed browser, in fact, most people now use a tabbed one.

Here’s how to stop javascript from taking control of your window size in firefox….
(more…)

Written by John in: Linux Tips,Mac OS X Tips,PC Tips |
Jun
09
2010
0

Combining two images with ImageMagick

To combine two images of the same size with ImageMagick, you simply do the following:

The following will overlay overlay.png on top of output.png

mogrify -draw "image SrcOver 0,0 0,0 'overlay.png'" output.png

While this one will overlay overlay.png on top of input.png and save it as output.png

convert input.png -draw "image SrcOver 0,0 0,0 'overlay.png'" output.png

You can download imagemagick from http://www.imagemagick.org/

Written by John in: General Randomness,PC Tips |
Jun
07
2010
0

Selective colour replacement with imagemagick

Selective colour replacement is easy from the command line with imagemagick.

You can download imagemagick from http://www.imagemagick.org/

The following will replace all red (#FF0000) pixels with blue (#0000FF)

convert sourceimage.png -fill "#FF0000" -opaque "#0000FF" destimage.png
Jun
02
2010
0

Deleting folders recursively

I needed recursively delete folders named .svn within a directory structure.

The following will allow you dto do this from a command prompt:

FOR /F "tokens=*" %G IN ('DIR /B /AD /S .svn') DO RMDIR /S /Q %G

Remember, if you’re doing it from a batch file, you’ll need to double up the percent signs, thus:

FOR /F "tokens=*" %%G IN ('DIR /B /AD /S .svn') DO RMDIR /S /Q %%G
Written by John in: PC Tips |
Apr
26
2010
0

IIS 6- Setting up a write only FTP directory

So, you want to set up a write only ftp directory on IIS? One where you can upload files, but not list them?

Easy…
(more…)

Written by John in: PC Tips,Tips |
Apr
25
2010
0

WordPress Super Cache plugin – Performance Benchmarking

I’ve been doing some performance tests on WordPress to see how much of a difference the WordPress Super Cache plugin made.

It turns out that the plugin makes a huge difference. (more…)

Written by John in: General Randomness,Linux Tips,PC Tips,Tips |
Apr
14
2010
0

DateTimeUTC – Version 1.1

I’ve been using DateTimeUTC for quite some time in batch files to get a nicely formatted date.

This is the first major revision of DateTimeUTC where you can now add or subtract from the current date. This is very useful if you want yesterday’s date.

Get the latest version from here: DateTimeUTC

The main usage of the application is:

datetimeutc [-options]

Options:
-fFORMAT Set output format
-z Set output time to Local Time (Not UTC)
-help View full online help

Example formats:
yyyyMMddTHHmmssZ 20081121T100227Z
“yyyy-MM-dd HH:mm:ss UTC” 2008-11-21 10:02:27 UTC
“dd MMMM yyyy” 21 November 2008
ddd Fri
dddd Friday
fff (Milliseconds)

Use double quotes when the format includes a space
Use backslashes to escape reserved character

Now, to add or subtract from the time, the format of the option is:
-[timeunit][value]
[timeunit] is one of YMdHms for Year, Month, Day, hour, Minute or Second
[value] is an integer and can be positive or negative

The following will print the UTC time one day ago:
datetimeutc -fyyyyMMddTHHmmssZ -d-1

Do get the output into a batch file, try this:
for /f “usebackq” %%a in (`datetimeUTC.exe -fyyyyMMddTHHmmssZ`) do (set UTCdts=%%a%)
echo %UTCdts%

Job done

Written by John in: PC Tips,Tips |
Feb
02
2010
2

Enca binary compiled for 32 bit Windows

Enca is a (normally *nix) application which attempts to detect the text encoding of files.

It’s only supplied as source which isn’t too helpful for windows users.

Enca is particularly useful at guessing the encoding of text files where the language is known.

Here is version 1.12 compiled into a native windows binary: enca_1-12.zip
(I’ve compiled this from a downloaded source, so no responsibility is taken for it’s suitability for use, being free from viruses, etc. In other words, use it at your own risk)

Written by John in: PC Tips |
Oct
21
2009
5

IIS 6 FTP – When PassivePortRange doesn't work

I’ve been trying to enable the passive port range on an IIS6 FTP server. I did everything. I enabled direct metabase edit, set the range using ADSUTIL and then added the ports to the firewall.

It turns out that if you set the firewall to allow “FTP”, the passive port range will be ignored and the default passive port range will be used. To solve it, you’ll need to manually add port 21 and the ports defined in the passive port range… Strange but true.
(more…)

Written by John in: PC Tips |
Sep
10
2009
0

Problems while running the Nokia Software Updater?

If you get the following error while trying to update the firmware on a Nokia Phone…

Nokia Software Updater has attempted to connect to the internet but has failed three times. This could be because of a poor-quality, slow or intermitent internet connection, or restrictions due to a firewall.

If requested by your firewall, Nokia Software updater needs the following applications to gain access to the internet:
nsl_host_process.exe
nsu_ui_client.exe

(more…)

Written by John in: General Randomness,PC Tips |