Archive for the 'Work' Category

Fixing PHP Redirect On Nokia N80 Web Browser

I had a problem on a PHP page that was supposed to redirect to another page after some process was done. This is the code I used.


header("Location: http://example.com");

This kept giving me a


Web: no gateway reply

So after looking at the PHP manual for the header function and HTTP status codes I managed to get it working with this redirect.


header("Location: http://example.com", 307);

Technorati Tags: , ,

Side Projects and Collaboration

I've been getting some requests for small PHP projects. At the moment I'm not taking on any projects. If you still think I should have a look email me a specification or the requirement and I will try to give some feedback or recommend another person who might be willing to take it on.

Freelance developers! Please contact me with a brief of your skills so I can contact you when I get requests like this.

Technorati Tags: , ,

Choosing Your Freelance Clients

Freelancers have this advantage over companies. You can choose who you want to work with on a personal level. Old school business types would tell you its not personal just business, that you should be able to work with anyone.

But when we work from home and get to know our clients first hand and see their software grow up with them, it becomes personal.

Choose your clients well. A few will stick with you for a long time. That one annoying client that pays more but gives you too much stress will take your attention away from your other, probably better clients.

Oh sometimes you get great clients that pay well too! :)

Update: similar articles

Top 10 Ways to Fire the Client From Hell - Inside CRM

SitePoint Blogs ยป How to fire a client

PHP for Developers

I like to follow up on Why You should learn PHP by rumblinglankan.com which talks about PHP for bloggers and extend it for programmers in general.

I was a full blown Java developer back in the day. I knew many developers who stuck to their guns and did one thing like Oracle, Java or .NET and said it would never go away and there would always be a market for it.

Well things change. Windows administrators are learning Linux, VB6 guys probably moved to VB.NET etc. If you sit still your skills will become obsolete.

A few years ago I saw the potential of PHP. It was simple to learn widely deployed on the Internet. I started building some Intranets with it, thinking I can move some of that logic out to a website later.

That was back in 2005. Now more than 50% of my work day is PHP, MySql, drupal, Code Igniter, WordPress or something other than Java. If I locked myself into Java I wouldn't have got most of the projects or opportunities I got.

Now I use PHP from writing system scripts to extending drupal. I'm also thinking about trying PHP GTK to write a Windows GUI application.

Look around and try something. Software is always changing, try to keep up. :)

Technorati Tags:

Getting on Git

I'm trying out Git. Its a distributed version control system originally written by Linus Torvalds. I also looked at SVK and Mercurial but settled with Git since it's commands made more sense to me.

I was happy with Subversion since 2004. Working alone with my notebook and client servers it has been very useful. Now the problem is I have too many workstations, servers, repositories and checkouts lying around I have to check where my latest code is before I start on any project.

I tried moving them to 2 online servers and checking out from there. But its slow and when I loose power or without an Internet connection I'm stuck.

Git might help me. When I'm done working on a project I should be able to commit locally and also sync a remote repository when I'm online. That way when I'm on another pc I can pull from a remote repository and start working.

All this is speculation at this point I will report back if it works as planned. If not I'm sticking with Subversion. :)

Being on Ubuntu Gutsy Gibbon I tried a aptitude search to see if I can install it.

aptitude search git

I thought I found it and installed the git package. I was wrong. You have to install the git-core package to get git.

sudo aptitude install git-core

And if your like and have some Subversion repositories to import you need to also install git-svn.

sudo aptitude install git-svn

Now to import a Subversion repository create a new directory for your git workspace and run something like this.

git-svnimport -v http://path.to.your/repo/

Check out this tutorial introduction to git.

Easy Passwordless Shell Logins

Summery
In brief if you have new ssh client and server applications on 2 clean systems, you should be able to authenticate yourself using these 2 commands.

ssh-keygen
ssh-copy-id user@server

Once you are authenticated you can hop around computers more easily and run unattended tasks like backups without passing passwords around.

Background
We just got a few more servers at work bringing the total up to 8. About 6 have similar login accounts so life is a bit easier, then again for the number of times you have to login to 8 servers a day typing passwords can be a pain.

When passwords are too short they are not secure enough, too long and you can't remember them. So key exchange to the rescue. Basically you generate a pair of keys on your computer and add your public key to each of the servers you want to login without passwords.

I read a few guides about this and it worked for a while. Somewhere down the line the new servers refused to authenticate my keys. So I cleaned up and started from scratch.
Continue reading 'Easy Passwordless Shell Logins'

Technorati Tags: , ,

The Perfect Workspace

Since I'm working from home again, I'm looking at setting up a proper workspace. I found some interesting workspaces on Flickr. Here are a few I liked the most.

The trend seems to be white desks and apple macs like this MILK table. Macs and IKEA is a little off for me, something a bit more local will have to do.

More on Life Hacker's Coolest Workspace Contest, Pimp your office and Joel Spolsky's Bionic Office.

If anyone has any Sri Lankan ideas, suggestions or if you want to share your workspace please comment.