Archive for the ‘Software’ Category

mysql: --i-am-a-dummy

Tuesday, October 9th, 2007

I just noticed the mysql client “--i-am-a-dummy” parameter in the help output (from mysql --help)
This interestingly named synonym for “--safe-updates” looks like it should be set as the default on any live mysql database. The command is supposed to block updates and deletes that don’t use keys. As an example, it could be used to protect against the proverbial (but not uncommon) “dummy” entering a command like:
UPDATE users SET password = PASSWORD('secret');
instead of the intended command:
UPDATE users SET password = PASSWORD('secret') WHERE user_id = 521;

Compiling Ruby on Ubuntu - Part 2

Tuesday, August 21st, 2007

Following on from my previous post Installing Ruby on Ubuntu, I tried to install/compile Ruby (and rubygems, rake) on Ubuntu server 7.04. Since Ubuntu Server is a “minimal” installation for use on a server, various development tools need to be installed, I used the following commands:
apt-get install build-essential autoconf manpages-dev
and also
apt-get build-dep ruby1.8
Without doing the last step you get errors building rubygems
/usr/local/lib/ruby/site_ruby/1.8/rubygems/remote_fetcher.rb:4:in `require': no such file to load -- zlib (LoadError)

Yes, I realise it’s a bit of a cheat to take the dependencies of the Ubuntu ruby package.

Symbian Slingplayer In Private Beta

Monday, August 13th, 2007

Saw this on mocoNews.net this morning: Symbian Slingplayer In Private Beta
Looks interesting, even with the number of operators making video available on mobile, this allows an individual get the video content that they have available, in their home or office, delivered to their phone.
So, while they’re on a train, or waiting in an airport, etc. they can get the news, the latest soap, or the view from the security cameras at home/office. This is obviously subject to bandwidth availability and cost. (uploading from home and downloading to phone).

SSH updates

Friday, August 3rd, 2007

The Past:
I’m a long-time user of SSH. I presume that I was typical in my initial use of it for secure access to remote servers. But I quickly became familiar with its port-forwarding capabilities, and have often set up intricate webs of connected and nested tunnels, in order to negotiate the problems of multiple NAT servers and firewalls. I even considered myself a power-user.

The Present:
Today, while checking out A Defcon survival guide on The Register, I noticed that they had mentioned the -D parameter to SSH. It was that kind of “in-passing” reference, where you know they think they’re stating the obvious. You’ve probably guessed though, that it was not obvious to me.
Enter the Ubuntu SSH Howto, and in particular the “SSH as a Proxy” section. How could I not know that a SSH could run as a SOCKS proxy, tunnelled to a remote server? Now I’ll be able to run SOCKS capable client applications (including web browsers) across lots of network configurations, without having to identify and forward individual ports. Brilliant!

The Future:
Wait, what’s that I see? At the bottom of the page there’s a link to SSH VPN. It can’t be. Not full networking access (routing,UDP,etc) over an SSH tunnel using the “tun” driver. Yes it is, it’s amazing. I can’t try this one out at the moment, but it will be a definite must-have for me (very soon).
Anywhere, on any network, once I have SSH access, I can get full access to my home network. (Or, if I wanted, an Amazon EC2 node that I could start when I needed full Internet access)

What lessons I’ve learned today, and not just about SSH. It’s important to check out the features and updates of software and networking tools that you use. Especially, if you already consider them important and useful. Don’t fall into the trap of thinking you already know how to use them, even if, like me, you’ve been using the tools for too many years to remember.

Now, I’ve also been using Ethereal for a long time, but a colleague has recommended WireShark, I must find out which one is better ;-)

Create an in-cell bar graph with Excel

Thursday, July 26th, 2007

Excellent tip here to Create an in-cell bar graph with Excel
from the Lifehacker Shortcut Screencast Contest. Really handy for quick graph, and it works in OpenOffice.org also.

Screencasts look like a good way to distribute tips like this, so I’ll have to look into that for the future, maybe using Jing for screenshots and screen recordings as suggested by Paul Watson. I wonder if there’s something to add a voiceover.

Upgrading Wordpress

Sunday, June 24th, 2007

Well, after my earlier problems with the automated Fantastico upgrade, I did the “manual” upgrade to my Wordpress installation. I was moving from 2.0.6 to 2.2.1 following the instructions from Wordpress.

It all went perfectly. Well done on the instructions (and the software).

At the end of the upgrade instructions, there’s a section called
Special note for Fantastico Upgrades, which mentions removing the DB_CHARSET and DB_COLLATE parameters if upgrading with Fantistico. Presumably the DB_CHARSET parameter is what affected the accented characters in my earlier upgrade attempt. So, if upgrading Wordpress using Fantistico, read the manual instructions! (pity I didn’t see this earlier.) I expect this will soon find itself into the Fantastico procedures, or at least the documentation, however I think I’ll stick with the manual upgrade in future.

Back to basics (or some rules for software upgrades)

Sunday, June 24th, 2007
  • Don’t upgrade just because there is a newer version available.
  • Check the release notes and other documentation for any problems with the new software.
  • Verify the upgrade in a test environment first. This is not always a realistic option, but if you don’t do it then backups become even more important.
  • Backup your current live system (and verify the backup).
  • Allow enough time for the upgrade of the live system.
  • Verify everything is working correctly after the upgrade. This is the point where the problems appeared for me. However, I was able to revert to the earlier version - which had luckily been backed up by the software doing the installation and not me (I should learn to follow my own advice.)

In case you’re wondering, the problem was “just” a visual, where accented characters were not being displayed correctly in Wordpress 2.2, hopefully 2.2.1 fixes it. I’ll have to wait until I get some more time to do a test and a hand install, rather than the automated Fantastico install.

Flash Lite: Graphics for Mobile Devices

Friday, June 22nd, 2007

This is an interesting introduction to Flash Lite - including getting data from the network - in the current issue of Dr. Dobbs Journal. Well it’s probably only interesting if, like me, the only thing you already know about Flash Lite, is that some people can make nice looking demos with it ;-)
Dr. Dobbs | Flash Lite: Graphics for Mobile Devices | June 8, 2007

RubyCocoa 0.11.0 released - The Unofficial Apple Weblog TUAW

Friday, May 25th, 2007

Just saw this post on TUAW: RubyCocoa 0.11.0 released - The Unofficial Apple Weblog TUAW

Looks interesting for anyone wanting to develop Mac applications in Ruby.

“lsof” command

Wednesday, April 18th, 2007

Just found out about this command today.

“lsof” displays information about open files by processes on *nix systems (including network “files” - TCP/UDP). I don’t know how I managed to miss such a useful command over the years.

As an example, listing network ports (which I would previously have done with netstat):

# lsof +c0 -n | grep IP 

java             1022    martinm   28u     IPv6
          467902                 TCP 192.168.2.104:51769->192.168.10.1:xmpp-client (ESTABLISHED)
java             2961    martinm    6u     IPv6
          322274                 TCP *:8083 (LISTEN)
evolution        6408    martinm   59u     IPv6
          472527                 TCP [fffe:111:11:2:111:72ff:fe10:2bd]:51943->[fffe:111:11:1::11]:imaps (ESTABLISHED)
mysql           18407    martinm    3u     IPv4
          489375                 TCP 192.168.2.104:49021->192.168.2.146:mysql (ESTABLISHED)
firefox-bin     24396    martinm   52u     IPv4
          490170                 TCP 192.168.2.104:52906->192.168.0.1:webcache (ESTABLISHED)

I added linebreaks to make it more readable
As usual, further information is available with man lsof.
Now I’ll just need to find out a way of setting the command to be the Java Start Class to identify which java program has the port open.

Update: the number after the command is the PID so a ps -fpXXXX will show the comamnd line.