Tag Archive for 'tutorial'

SSH Shared-Key Setup - SSH Logins Without Passwords

SSH is a great tool for remotely accessing another machine, but entering your password every time you log into a remote box can be a pain if you would like to set-up some background scripts to connect to a server and do something (i.e. a backup script running as a cron job). Here’s how I set-up my Mac to be able to log into my server without the need for a password to be entered each time - the instructions should be good for any variant of Unix/Linux, but you need to take into account path names etc. on your machine.

Continue reading ‘SSH Shared-Key Setup - SSH Logins Without Passwords’

A Better Ls for Mac OS X

I’m a bit of a command-line freak and like to spend a fair amount of time with the terminal open… As such I like to spend a small amount of time getting the terminal set-up nicely. Other than changing the default colour scheme and font, one (slightly) more drastic change is to replace the standard implementation of ls for one that is slightly more configurable.

The default ls on OS X comes from BSD and compared to the GNU/Linux alternative is slightly lacking when it comes to comes to changing how things look - so what I like to do is replace it with the GNU ls available in MacPorts - this allows me to get a terminal setup like below:

terminal.png

Continue reading ‘A Better Ls for Mac OS X’

CSS Styled Tables

Veerle comes up with another look at styling tables with CSS. A great read.

In 2005 I wrote an article about styling a table with CSS. After receiving so many requests I finally decided to give in and write another tutorial. Seems like a popular topic and an interesting one to share some tricks on how you can nicely style them. This article is about the proper usage of tables, for tabular data. How you can implement them with accessibility in mind and how to make them appealing for the eye using CSS.

read more

Install phpPgAdmin on Ubuntu 7.10

Update: These instructions have been tested and work fine in the latest version of Ubuntu (8.04, Hardy Heron).

phpPgAdmin is a web based GUI for administrating a PostgreSQL database server.

Here’s some quick notes on getting it installed easily on Ubuntu 7.10…

In the terminal enter the following:

$ sudo apt-get install phppgadmin

This will set up and install all of the phpPgAdmin packages. It will also set-up and configure Apache and php5 for you too if you haven’t installed these already.

Next we need to create a symlink to phpPgAdmin so that Apache can find it:

$ sudo ln -s /etc/phppgadmin/apache.conf /etc/apache2/conf.d/phppgadmin.conf

Now if you navigate to http://localhost/phppgadmin you should be greeted with the phpPgAdmin screen. If your user account has a PostgreSQL account however, you will be logged in automagically.

Optionally, if you would like to be able to use the phpPgAdmin interface as the default ‘postgres’ administration account,1 you will need to do the following2

$ sudo gedit /usr/share/phppgadmin/conf/config.inc.php

Now find and change the following line

$conf['extra_login_security'] = true;

to

$conf['extra_login_security'] = false;

Save and close gedit. Now all you need to do is restart Apache.

$ sudo /etc/init.d/apache2 reload

Now if you head on over to http://localhost/phppgadmin all should be ready for you.


  1. I am assuming here that you have set-up your PostgreSQL server using my set-up instructions and therefore have a password protected ‘postgres’ account and that logins require passwords. 

  2. Please make sure you have read the above footnote and understand the security implications of allowing this type of access to your database server - if you have not secured your administration accounts, do it now! 

Creating New Accounts in PostgreSQL

Getting a new account set up on PostgreSQL is a simple process…

Create our new user:

$ sudo su postgres -c createuser daz

Then you have to give this new user role a name (I called it daz), and then say ‘y’ to the question “Shall the new role be a superuser?” if you want the user to be an administrator.

Give the user a database password (this does not have to be the same as their unix password):

$ sudo su postgres -c psql
postgres=# ALTER USER daz WITH PASSWORD 'mypassword';
postgres=# \q

Finally, give the new user a database to play with:

$ sudo su postgres -c createdb daz

Pretty straight forward… :)

Install PostgreSQL on Ubuntu 7.10

If you are using the latest version of Ubuntu (8.04 - Hardy Heron), you might find these slightly updated instructions useful.

This quick walk-through are my notes for installing the PostgreSQL database server and the PgAdmin administration application on Ubuntu Linux, and also set up the server so it allows access to other PC’s on your network.

Before we move on, this guide was tested on the current release of Ubuntu Linux, (7.10 - Gutsy Gibbon) and PostgreSQL 8.2, but it should also be applicable to older versions (of Ubuntu and PostgreSQL) and other Debian based distros.

Continue reading ‘Install PostgreSQL on Ubuntu 7.10’

Adding/Deleting Rows in TableKit Tables Revisited

TableKit is a great javascript library for making your HTML tables fully editable. However, one problem is that you can’t add or delete rows from the tables…

I came up with a solution to this not so long ago, but it still had a problem - TableKit caches the tables on loading, so after we update the table body (adding or deleting a row) the sorting and editing of the table is completely screwed! :( However, with a little more work, and some help from one of the guys in the office - we’ve finally got this cracked! :)

Continue reading ‘Adding/Deleting Rows in TableKit Tables Revisited’

Adding/Deleting Rows in TableKit Tables

This post has now been updated. Please head over to the new post for something better…

Following on from my previous post on how to integrate the excellent TableKit into your Catalyst webapp (to make your data tables dynamically editable), here’s how i’ve gone about adding ajax inserts and deletes so that you can add and remove data rows in your tables.1

Continue reading ‘Adding/Deleting Rows in TableKit Tables’


  1. You’ll need the code from the previous post to follow along. 

Making Editable Tables With Catalyst and TableKit

Catalyst is an MVC web-development framework for Perl, very similar in concepts, ideas (and even some of the implementation) to Ruby on Rails. I’m using Catalyst a lot in my job now, and one of the first challenges that i’ve had to go through is making dynamically editable tables for some of the views we are using (in other words, Ajax driven edit-in-place tables).

Following a short Google, there seemed to be only two ready-made options I could see: one, using the Catalyst controller module Catalyst::Controller::ROSE::EIP; or two, by integrating and using the stand-alone javascript package TableKit.

Continue reading ‘Making Editable Tables With Catalyst and TableKit’