Welcome ! This is the personal site / blog of Graham King. Most people come for the credit card generator, but I think the Categories (top right) are more interesting.

August 25, 2008

Keithnote

Posted in Software at 04:31 by Graham King

Keithnote is a presentation generator. You provide information such as the title of your presentation, and it downloads relevant images from Flickr. These are stored locally so you can run your presentation whilst offline.

Keithnote is hosted at Google Code, here: Keithnote

There are two use cases for Keithnote:

  • If you have a presentation to make which doesn’t really require slides, use this to create a nice backdrop.

  • As an Improv game. The audience choose the title of the presentation, and an improviser delivers the speech, never having seen the slides before.

There’s a Windows installer which has everything you need to run the application.

Keithnote is written in Python with wxPython, and should run on Windows, Linux and Mac OSX. Well, what y’a waiting for, head on over to Keithnote at Google Code and try it out.

Keithnote is so called because it mixes Apple’s Keynote presentation software with Keith Johnstone, the father of improvised comedy.

August 16, 2008

MySQL quick reference

Posted in Software at 01:30 by Graham King

A concise reference / cheat-sheet / crib-sheet to MySQL’s commands.

Query

List databases

show databases;

List tables in db

show tables;

List columns in table:

desc mytable;

List indexes on a table

show index from mytable;

List foreign keys:

show create table mytable;

Next auto_increment key:

select auto_increment from information_schema.tables where table_name = ‘mytable’ and table_schema=’mydbname’;

Show encoding (client, database, etc)

show variables like ‘character_set%’;

Input / Output

These need to be run from the command line:

Dump database:

$ mysqldump –add-drop-table -h HOST -u USER -p DATABASE > database.sql

Load database:

$ mysql -h HOST -u USER -p DATABASE < database.sql

Export single table:

select * from mytable into outfile ‘myfile.dat’;

Your user needs permissions to create the disc file, so you maybe need to connect to MySQL as root

Import single table:

load data infile ‘myfile.dat’ into table mytable;

DDL

Create database:

create database mydatabase character set utf8 collate utf8_general_ci;

If you don’t use UTF-8 I will find your application and fill it with non-ascii characters. You have been warned.

Create / grant user:

grant all on mydatabase.* to myuser@localhost identified by ‘mypassword’;

Add column:

alter table mytable add mycol datatype null;

Change column:

alter table mytable change myoldcol mynewcol datatype null;

The same command will rename a column, change it’s datatype, or change it’s null / not null status.

Drop column:

alter table mytable drop column myoldcol;

Rename table:

rename table myoldtable to mynewtable;

Create index:

create index myindex on mytable (mycol);

Drop index:

drop index myindex on mytable;

Create foreign key:

alter table mytable add foreign key myforeignkey (mycol) references mytable2 (mycol2);

Drop foreign key:

alter table mytable drop foreign key myforeignkey;

Replication

You need to be root for these commands.

Master status:

show master status;

Slave status:

show slave status;

July 17, 2008

Using Ekiga softphone on Ubuntu Linux on a Thinkpad

Posted in Misc, Software at 00:19 by Graham King

For many months now I have been making and receiving telephone calls from my computer. There are two advantages:

  • It is very cheap. Calls within the United States are about $1/hour!
  • It makes your phone number virtual, and configurable, which means for example that my phone number will forward to my cell phone if my computer is offline. It also means you don’t have to be in the same country as your phone number.

I am running Ubuntu Linux on a Thinkpad, but most of this should apply to Ekiga on all platforms, and the principles apply to all Softphones.

First, you’ll need a headset with a microphone. The Thinkpad’s built in microphone isn’t loud enough, and will generate too much feedback from the speakers. I bought the Logitech Precision PC Gaming Headset which I’m happy with.

Next, you need to install Ekiga which on Ubuntu is as simple as sudo apt-get install ekiga.

Then you need to adjust your sound settings:

  • sudo alsamixer
  • Drop the ‘Mic’ to 0
  • Move the ‘Mic Boost’ to max
  • Exit alsamixer by pressing Esc
  • Go to System / Preferences / Sound and change everything to use ‘ALSA’. This makes all programs share your soundcard, so you can hear the phone ring when playing music with Rythmbox.

Start Ekiga. It will prompt you to sign up for a SIP address (which looks like an e-mail address) at Ekiga.net. That is the address people can ring you on, if they are on a SIP phone too. You’re all set to make PC to PC calls. Dial one of the Ekiga fun numbers and talk to yourself.

You probably want to be able to dial out to the regular phone network. Follow the instructions on Using Ekiga to do PC to Phone calls. I signed up with diamondcard.us, the default provider, and the service is good. Don’t be put off by their ugly website. Once you sign up they call you to check you are a real person. In my case this was about 24 hours after I signed up. You’re all set. Remember to dial the full international number (starting with 00 then the country code), and you’re talking!

If you want to receive calls, you need to rent a telephone number. This is fun, because you can rent a number from anywhere in the world, and have it terminate at your computer (or your mobile, landline, anywhere). I am paying $3/month for a US number. On diamondcard (or whoever you are renting the number from) setup that number to ring on your SIP phone first (called IP Phone on diamondcard), then forward to your mobile. Increase the length of time it rings on your SIP phone, so you have time to mute your speakers, plugin your headset, locate the Ekiga window, and click ‘Accept’. I set it to 30 seconds.

I tweaked the default Ekiga sounds to make the ringing more pronounced, and the disconnect sound shorter. Fire up Audacity and open /usr/share/sounds/ekiga/ring.wav. Trim each end and increase the volume. Save it. Open /usr/share/sounds/ekiga/busytone.wav and trim it to one beep. This sound is played at the end of each call.

There you have it, a great telephony setup!

Finally, here’s a couple of tips:

  • Dialing toll-free numbers. If you are in the United States, when you dial a toll free 1-800 number, that number will think you are abroad, so you will be charged normal rates ($0.017/min). Instead of dialing via diamondcard (or whoever), dial using a SIP gateway, by prefixing your number with *850, for example*85018001231234`. More SIP gateway details at Ekiga fun numbers.
  • Dealing with the delay: There is a slight delay on the line. Closing any programs you have that might be using bandwidth improves the delay. Warn your conversational partners about the delay, and ask them to ignore it. Relax, and let them finish their ideas before you speak. Leave slightly longer gaps between when they finish speaking and you start. If you do start speaking, keep speaking even if you hear them. They probably started before they heard you and will stop as soon as they realise.

    Happy chatting!

« Previous entries