Categories
Uncategorized

Stupid NFS (Debian Squeeze / Ubuntu Precise)

NFS really can be a major PITA. Our office network has been breaking all day. This seemed to coincide with moving more of our computers to gigabit ethernet (removing the 100mbit CISCO 7960 phones which their network had been daisy-chained through – and seemed to cause intermittent packet loss) Here are some tips for others […]

Categories
Uncategorized

SpamAssassin ruleset to try and catch India based web development spam

At work we keep receiving emails from sales-droids in India who are trying to persuade us to outsource PHP/Android/Java/whatever development to them. Here’s my first attempt at a spamassassin rule to neutralise it – in my case, copy into a something.cf file in /etc/spamassassin/mail, and running over a suitably loaded email results in : Content […]

Categories
Uncategorized

rsyslog selective logging with multiple postfix instances

Scenario – one Linux box runs multiple Postfix instances. By default they all log to /var/log/mail.log which makes it difficult to see what’s going on without using grep and so on. The server already uses rsyslog, and Postfix is configured to specify a syslog_name to each instance. i.e /etc/postfix-blah/main.cf contains “syslog_name = postfix-blah” rsyslog allows […]

Categories
Uncategorized

SSL Commands

I keep forgetting these one line OpenSSL commands – perhaps if they are here, I’ll remember — Create private key file : openssl genrsa -out server.key 2048 Create certificate signing request (to send to e.g. GoDaddy) – openssl req -new -key server.key -out server.csr  Verify a certificate – openssl verify file.name To convert a .crt […]

Categories
Uncategorized

Linux console dimming / screen saver

Our work server seems to enjoy crashing (at the moment) about once a day – but when I go to look at the console I can’t see anything because the screen has dimmed to black – and as the computer has locked up, I can’t wake the screen up to see if there is a […]

Categories
Uncategorized

MySQL table defragmentation (python script)

I’ve written the below Python script to defragment MySQL database tables. This should work with both InnoDB and MyISAM table formats, and is just calling “OPTIMIZE TABLE blah.foo”. It rummages through the information_schema for tables which may be defragmented. You should be able to run it on any Debian based system without making any alterations. […]

Categories
Uncategorized

Chocolate headed pirates

My son woke up at 6am crying quite loudly this morning – he’d been having a nightmare involving a Chocolate Headed Pirate being mean and nasty to him. Personally I think a chocolate headed pirate would be quite tasty – although perhaps it’d be a bit more than I could eat in one sitting (or […]

Categories
Uncategorized

Spring trip to Barcelona

Well, sort of random. As I don’t normally bother to upload any pictures and so on, I thought I might as well for once – and I said I’d send my father a postcard, but then failed to …. perhaps this will make up for it. I didn’t notice any postcard selling shops either – perhaps […]

Categories
Uncategorized

WTFs per minute

I’m currently refactoring some legacy third party PHP code, and as the old saying goes, the real metric is WTFs per minute. So, just to entertain any readers, how about : Writing pagination links for a search form, but if there are more than 20 pages of results, add 20 onto whatever the maximum number […]

Categories
Uncategorized

Solr and WordPress (instructions/howto)

This is for Tomcat5.5 (on Debian Lenny), WordPress 3.1 and Solr 3.4. The intention is to use the solr-for-wordpress plugin (see github ). Lenny does include a Solr package (v1.2) which is somewhat outdated (and not supported by the upstream solr-for-wordpress wordpress plugin, hence we can’t use it). Install Tomcat (and Java) apt-get install sun-java6-jre […]