December 17th, 2009 | Design & Development, Software | No Comments »
Alrighty, just a quick one.
I’ve been looking all over for something that quickly gives me the code for a UIColor when given a HEX colour.
I couldn’t find one so I whipped one up double quick.
http://scratch.johnnypez.com/hex-to-uicolor
July 29th, 2009 | Linux | No Comments »
Just a quick note on problem I came up against today.
I monitor one of my production servers (running Ubuntu 7.10 server) with Munin and through this I had noticed a lot of errors on network interface eth0.
I had a quick look with ifconfig eth0 to see what was going on. These were the lines of interest from the output:
RX packets:404933416 errors:0 dropped:0 overruns:0 frame:0
TX packets:501341708 errors:31383248 dropped:0 overruns:11 carrier:62766496
Obviously something is not right.
I spent a while reading through log files to no avail, this isn’t really my area of expertise so I gave in and contacted my hosting provider.
(more…)
June 30th, 2009 | Design & Development | No Comments »
I recently switched my Java versions from 1.5 to 1.6 and I’ve been hitting some issues with the java path.
I tried setting the environment variable JAVA_HOME=/usr and that worked for some stuff but I still saw this error when running java.
eg:
>java -version
Unable to find a $JAVA_HOME at “/usr”, continuing with system-provided Java
I solved the problem by doing the following.
First I found out where java actually was with:
>ls -l' `which java`
/usr/bin/java -> /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java
I noticed a command called java_home in that same directory. Running that command yields the correct java home directory.
>/System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java_home
/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home
To correctly set the my JAVA_HOME environment variable in future, I added the following to my ~/.profile
export JAVA_HOME=`/System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java_home`
Once you have done this you can restart your terminal window or run >. ~/.profile to reload you profile into the current terminal session.
April 29th, 2009 | Design & Development | No Comments »
It took me a little while to get passenger set up with Nginx because I wanted to compile Nginx separately instead of using the tool provided with the passenger gem. I have it all working now so here’s how I did it. I’m running OSX Leopard but this should be fine on any Linux distro too.
(more…)
February 5th, 2009 | Design & Development | No Comments »
I was setting up WP-Super-Cache yesterday when I ran into this gotcha, I’ve done this before so I should have known better, I’m blogging it now so that I don’t forget and anyone else with this issue can be saved some hassle.
Essentially WP-Super-Cache was only half on, it could generate wp-cache files but was not creating static cache files. The reason for this was that the querystring always contained at least one value even though it wasn’t in my URLs. That drove me crazy until I remembered this morning that the recommended Nginx setup was the problem the last time. The reason for this is the following part of the Nginx config that rewrites any non existing file requests to Wordpress’ index.php
if (!-e $request_filename) {
rewrite ^(.+)$ /index.php?q=$1 last;
}
This will cause WP-Super-Cache to never generate any static cache files since one of its conditions for doing so is that the querystring is empty.
If your Nginx config has this, try changing removing the ?q=$1 as below:
if (!-e $request_filename) {
rewrite ^(.+)$ /index.php last;
}
December 23rd, 2008 | Uncategorized | 1 Comment »
My girlfriend won a PS3 at work yesterday. So yeah, Christmas came early for me! Before I started any gaming I wanted to see what the media centre capabilities were but I ran into some trouble with the wireless setup. Here’s what I did. This is not meant to be a beginners step by step guide but It will point you in the right direction if you run into this problem.
(more…)
December 22nd, 2008 | Uncategorized | No Comments »
I completed my move from GoDaddy to Slicehost over the weekend. My move to a grown up host was long overdue. I went with a 256mb slice to start with and Ubuntu 8.04. I have to say Slicehost are superb and I’d recommend them to anyone, my only problem, though it’s not their fault is that I do notice a small bit of latency when I’m issuing commands over ssh, but hey I’m almost on the other side of the world, what can you do?
I’m now running Wordpress 2.7 served up with Nginx and PHP over fast-cgi. I don’t get much traffic but if I ever do I’ll be able to handle it.
That’s all for now. Enjoy the Holidays.
December 4th, 2008 | Song Of The Week | No Comments »
So long since I’ve posted a song of the week. Laziness really, or maybe just lack of songs that I really felt good about. I never really gave Glen Hansard much attention until I watched Once. I can’t stop listening to him now. And this track ‘Say it to me now’ has gone straight into my all-time favourite songs.
September 15th, 2008 | Uncategorized | 1 Comment »
I was installing Rubygems 1.2.0 on Ubuntu 7.04 on Friday, something I’ve done many times but for the first time I saw this error when I ran sudo ruby setup.rb
./lib/rubygems/spec_fetcher.rb:1:in `require': no such file to load -- zlib (LoadError)
from ./lib/rubygems/spec_fetcher.rb:1
from ./lib/rubygems/source_index.rb:10:in `require'
from ./lib/rubygems/source_index.rb:10
from ./lib/rubygems.rb:767:in `require'
from ./lib/rubygems.rb:767
from setup.rb:22:in `require'
from setup.rb:22
Having a look around the web yielded several approaches to solve the problem but no solution so I decided to build Zlib from source, then rebuild Ruby and then install Rubygems. That worked.
(more…)
September 8th, 2008 | Uncategorized | No Comments »
Just a quick note on a problem I ran into this morning.
I needed the mysql gem so I ran gem install mysql only to find I got the following error:
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.
The solution was to use the following:
gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
It should work as long as the path to mysql_config is correct, you may need to change the path for your own system. You can check the path to mysql_config with: which mysql_config