Archive for March, 2008

Disabling the Laptop TouchPad in Ubuntu Linux

March 27th, 2008

Here’s a quick tip on disabling the touchpad on the Ubuntu Linux distro. It’s been bugging me for a while now that I have to use a non-gnome native solution to disabling my touchpad qsynaptics written in QT.

For those who are impatient and just want the quick instructions, I recommend that you install synclient, and issue a synclient TouchPadOff=1 usually SHMConfig is already on and this would be enough – in addition, synclient is usually installed by default (it is in Ubuntu Gutsy Gibbon).

» Read more: Disabling the Laptop TouchPad in Ubuntu Linux

Stay away from Bloated Class Methods, actually, bloated ANYTHING!

March 15th, 2008

Why are there so many examples of bloated PHP methods out there?! I see a lot of bloated methods being used in examples through sites like phpclasses.org and a very large chunk of a project I’ve recently picked up which a few developers have worked on. Guys! remember! There is no good reason to bloat your methods to over 10-20 lines long and on the rare occasions that you do exceed 10 – 20 lines it would be more the exception to the rule as opposed to being the rule itself!

Let’s not forget what classes and its methods are supposed to be: Classes are blueprints for specialist components and their methods are singular actions which address one to a few (2 – 3 at most!) procedures at a time whether it be through the use of other classes or just through simple logic!

» Read more: Stay away from Bloated Class Methods, actually, bloated ANYTHING!

Importing SQL dumps into MySQL through Command line

March 11th, 2008

Perhaps it’s because I’ve been in maintenance mode for a little bit that I’ve forgotten how to import a SQL file generated by applications like mysqldump into an existing database, but earlier today while dumping existing data from DevScripts and trying to install it on our testing server, I drew a complete blank.

So I guess this is more a note for me and anyone else who has a tendency to forget nifty little tricks like this one.

A quick way to duplicate MySQL databases is to do the following:

» Read more: Importing SQL dumps into MySQL through Command line

Instant or Passwordless SSH-ing in Linux

March 3rd, 2008

Well, to be “correct” the title of this should have been “how to add your key to the list of authorized public keys on a remote or local linux machine”, but being a newbie like myself, I would not have known to search for it. If I wanted to find out about logging in automatically to a remote machine using a generated public key, I myself would have used “Passwordless SSH” – so there you go.

To get started, I’ll assume that you have OpenSSH set up (it’s setup by default… well usually) and that your remote machine has OpenSSH-server set up.

If not, then do the following on the remote machine:

$ sudo aptitude install openssh-server

» Read more: Instant or Passwordless SSH-ing in Linux