Jargon Jabberwocky

Quoting a password using mysql or mysqldump

Posted on December 4th, 2011

Trying to use one of the following symbols in a mysql password using -p from the command line will throw you an error: * ? [ < > & ; ! | $ \ ( ) # ~ { } … Continue reading

View Full Post

jQuery Google Analytics Super Tracker

Posted on November 26th, 2011

I’m not really sure where I found this, and it’s undergone a few changes since then but here is what I use on most sites to automatically track outgoing links, mailto links and downloads. It requires jQuery and Google Analytics … Continue reading

View Full Post

Add auto increment column in Mysql table

Posted on November 24th, 2011

To add an auto increment column `id` to a table named `table`. ALTER TABLE `table` ADD `id` INT UNSIGNED NOT NULL auto_increment PRIMARY KEY FIRST;

View Full Post

Cannon EOS Rebel XS in Ubuntu

Posted on October 5th, 2011

All I needed to do to get my camera to work in Ubuntu 10.10 was install gphoto2. apt-get install gphoto2 Then it mounted like a normal drive.

View Full Post

Mass resize images using the command line in Linux

Posted on October 3rd, 2011

Just do: mogrify -resize 1024 *.jpg Where 1024 is the maximum width or height you’d like. Warning mogrify will overwrite your files. If you don’t seem to have mogrify try installing ImageMagick apt-get install imagemagick

View Full Post

Hide information_schema in PhpMyAdmin

Posted on September 29th, 2011

There’s this pesky database called information schema lying around. You can hide this database from PhpMyAdmin by modifying your config.inc.php (located in /etc/phpmyadmin on my system) to add the following: $cfg['servers'][$i]['hide_db'] = 'information_schema'; You’ll need to place the code inside … Continue reading

View Full Post

Php Parsing Script

Posted on September 16th, 2011

I was looking for a way to see how fast the parse time of my pages was. Came up with this code. Please note this only works for > php5. Put this at the beginning of your pages: &lt;?php $starttime … Continue reading

View Full Post

MySQL Case Sensitive Searching

Posted on September 8th, 2011

By default MySQL and other engines search using a case insensitive method. You can tell MySQL to do a case sensitive search by changing the COLLATION of the field your searching. SELECT * FROM `table` WHERE `field` COLLATE latin1_general_cs LIKE … Continue reading

View Full Post

Ghostscript PDF to Jpeg

Posted on September 7th, 2011

gs -dNOPAUSE -dBATCH -sDEVICE=jpeg -r144 -sOutputFile=Page-%03d.jpg File.pdf

View Full Post

Set nano to stop word wrap

Posted on August 31st, 2011

vi vs emacs? I choose nano. But one annoying thing is that nano wraps text by default. To fix this create a file called .nanorc in your home directory. In it put the line: ~/.nanorc set nowrap Next time you … Continue reading

View Full Post