Stuff…

I know I will forget.

Stuff… header image 4

Entries Tagged as 'Coding'

Show disk usage excluding some directory structures

December 14th, 2011 · Comments Off

Wanted to do a quick “du -sh” on only the directories in / (‘root’) and NOT any of the mounted partitions.  This one liner worked nicely: cd / ls -la / | awk ‘{ print $9 }’ | egrep -v ‘boot|part1|var|\.’ | xargs du -sh

[Read more →]

Tags: Coding · Linux · One Liners · Operating System

Upgraded PHP to 5.3 caused error in horde, phpbb3 and wordpress

April 26th, 2011 · No Comments

A client upgraded his PHP install using the Atomic Turtle packages from 5.2.x to 5.3.6 and started to get error messages on some of his sites, and, in the error_log file for the site.  They looked like this: [Tue Apr 26 14:01:37 2011] [error] [client x.x.x.x] PHP Warning:  strftime() [<a href='function.strftime'>function.strftime</a>]: It is not safe [...]

[Read more →]

Tags: Coding · Linux · Operating System

WordPress Trackback Spam continues

March 13th, 2011 · No Comments

In post WordPress trackback spam I setup some rudimentry mod_security rules to block duplicate trackback spam attempts from known spammer IPs.  This stopped quite a few since implementation: 1449 in one day. However, I’m still getting a lot of trackback comment spam. Following the experiences from the blog post below I’m going to add some [...]

[Read more →]

Tags: Coding · Linux · Operating System

QR barcodes and Perl

February 25th, 2011 · No Comments

Creating QR Code with perl module Imager::QRCode http://perltraining.com.au/tips/2009-10-08.html http://contentdeveloper.com/2010/01/how-to-customize-qr-codes-with-your-brands-identity/ http://qrcode.kaywa.com/ – Code generator http://fredtruman.com/how-to-create-qr-codes-using-the-mecard-format – MECARD format http://code.google.com/p/zxing/ http://code.google.com/p/zxing/wiki/BarcodeContents The following code generates this image: Code: #!/usr/bin/perl use strict; use warnings; use Getopt::Std; use Imager::QRCode; my $MECARD=<<END; MECARD: N:co.uk,moe; ADR:Address Field; NOTE:Testing; TEL:+440123456789; EMAIL:spam\@moe.co.uk; URL:http://www.moe.co.uk;; END $MECARD =~ s/\n//; my %opts = ( o => [...]

[Read more →]

Tags: Coding · Linux · Protocols

CGI::Application::Plugin::Session and expiring old sessions

December 25th, 2010 · No Comments

Using Perl module CGI::Application::Plugin::Session for CGI::Application to keep track of users sessions, however, I could not see anywhere in the module to expire old session data from the database.  So, I was ending up with lots of old entries in the database with the expire time from ages ago. As CGI::Application::Plugin::Session seemlessly brings CGI::Session support [...]

[Read more →]

Tags: Coding