Saturday, December 5, 2009

MySql Session

To find out what is going on in your MySql database, you can check the sessions that are presently running, with the command:

show processlist;

Thursday, November 5, 2009

Apache MySQL Performance dip

Separating the MySQL and Apache servers has slowed my site down, instead of speeding it up! Any suggestions?

I have hosted a LAMP website on a 2GHz AMD Opteron server running with 2GB of RAM.
As the data needs grew, the MySQL database seemed to need its own area, and could not serve the apache server fast enough.

So I split the MySQL database to run on its own 2GHz AMD Opteron/2GB RAM server - with a single-hop connection between the two of them at the data center.

But performance has dipped - any clicks take a much longer time to show a result from the database.
Any ideas how to get better performance from the separate Apache/MySQL server setup?

Thanks!

Saturday, October 31, 2009

Password Management Using htpasswd

In Linux, several components use non-system standard passwords.

Some of these are svn, and ftp (e.g. vsftpd).

Here are the basics to get you through setting and resetting these passwords:

For svn, refer this guide.

For vsftpd, refer this guide.

Basically, htpasswd can be used to create encrypted passwords for such modules. Here are some basics to htpasswd:

1. htpasswd uses a password encrypted file, using an SSL certificate.
You can create your own ssl certificate too. But for public/production environments, you'd want to get a certificate from a third party so users don't get a security alert.

2. The first time, use the -c flag to set a password, as follows. You'll need to do this as root (or prefix sudo in ubuntu)

htpasswd -c /etc/apache2/my_passwd.passwd username

3. Subsequently, use the -m flag to modify this file for adding/editing users:

htpasswd -m /etc/apache2/my_passwd.passwd username

Tuesday, October 6, 2009

LAMP Server Crash

If you did some optimizations by adding memory or RAM to processes, and the next morning, you find your server is no longer online: chances are it ran out of space and triggered the oom-killer.

oom-killer is a process that goes randomly killing processes to help the system survive.
After this occurs you should always restart as soon as possible.

Here is where you can find the logs in ubuntu, and how to identify if your system shutdown because of memory:

location of log: /var/log/messages (you will have to have super user permissions to view)
What you'll see: Just before the server shutdown or went erratic, this message:

apache2 invoked oom-killer

To get out of this situation, try to put more conservative memory settings on your applications, or add more RAM!

All the best!

Saturday, October 3, 2009

5 features Ubuntu needs to compete

Though I dearly love Ubuntu, and many of its features make windows seem obsolete...
But no matter how much I'd like to bid Windows adieu... there are reasons I need to still hang on to Windows - and no, its not just because of Word.

1. IE Compatibility
It's tiresome to go online and find a site (turbotax, netflix, web outlook...) which doesn't work well with firefox - especially linux based firefox. Sure there are workarounds and spoofs, but that's not a system working out of the box.

2. Multimedia experience
Ubuntu has some really neat multimedia features. Compiz Fusion adds mouthwatering features to your desktop - allowing you to rotate it like a cube for example.
But when I plug in an HDMI cable to connect a big screen tv, windows still supports the extension much better. My nVidia ubuntu driver asks for a restart, but doesn't do anything even after that.
DRM support is not present, which means the music industry leaves Linux users with no form of entertainment. No rhapsody to go.

3. Application Setup
It takes a whole lot of effort to get some apps to work. Skype, for example, needs a whole lot of tweaking and driver upgrades before it can work. For an app that needs speakers and a mic for basic functionality, setup should not be so difficult.
The soundcard drivers and programs, though feature rich, are not seamlessly integrated yet.

4. Much needed Applications
Some applications are altogether missing linux support. For example, no iTunes, no Microsoft Office are completely missing (sure the MS Office issue has been beaten to death - but really, at least give us an application that formats word documents accurately!) - and I'm not even talking hit games like GTA.
And yes, Wine can help get some things working. But any serious OS can't rely on workarounds.

5. Teething issues
Linux is lightweight, and efficient. Not!
That's what I always believed, until I wondered why my computer was so sluggish, when all I was doing was browsing the internet. Turns out, the Adobe Flash plugin on linux is a resource hog. Even if its just pandora playing, or Rhapsody online, the cpu usage peaks, and everything slows to a crawl.
Its a known issue. But is anyone fixing it?

Most of these are minor issues, and most of them have workarounds. But the question is, if Ubuntu linux is really going to compete mainstream, these need to be addressed. Linux has come a long way since its inception and text based output. But it still needs some polishing before it can kill the competition.

Saturday, August 22, 2009

Ubuntu 9.04 with Vista on Dell XPS m1330

Tired of Windows Vista slowness on my souped-up Dell XPS laptop, it was time I at least dual-booted into Linux. So I went ahead and downloaded a copy of Ubuntu to setup my computer.

To my delight, installing Ubuntu was a breeze! Though there was some back tracking I needed to do, this guide will help you get it setup in one shot. Once setup, everything on the laptop works - as if it is out of the box. This includes function keys, the mute/eject buttons and wireless.

You may face trouble with some applications though - be forewarned!

1. Make space for Ubuntu:

Shrink the volume size in Vista, so you can install Ubuntu

1b: Backup your data (Yes - ALWAYS play it safe :-) this will most likely go through just fine - but you want a backup for that hard disk crash you never planned for, anyway!

2. Write an Ubuntu Jaunty CD. You can try using Wubi - which is a windows Ubuntu installer. But I went the traditional way - this works just fine.

3. Boot into the CD (you might need to change boot sequence so your computer looks at the cdrom first)

4. Go through the partition steps and install Ubuntu into the free partition size you will see available.
Make sure you don't assign all of it to Ubuntu - otherwise you'll have trouble using Vista, or your install will fail.

5. Let ubuntu go ahead and install itself. I'd suggest giving it at least 20GB (I gave it over 100GB :-p

6. Now Ubuntu won't be able to connect to wireless just yet (I have the default Broadcom wireless card).
So connect to an LAN cable and go to System > Administration > Update System

7. Go ahead and install all the updates (there were about 140MB of updates when I ran it).

8. Restart your computer, and presto: you have ubuntu working!
You might need to take a moment to get the wireless setup - by entering your wireless settings.

Monday, July 6, 2009

Evernote - one app for all your notes?


A couple of weeks ago, I installed EverNote on my HTC Touch Diamond, and just couldn't get enough of it!
Evernote would take my handwritten or typed notes - sync them online - and make them available to me on my desktop too.
I could see that I'd not forget anything now! And best of all, their handwriting options - with colours and caligraphic pens had me spellbound.

Next thing - my HTC Touch Diamond screen cracks, and my friends convince me, its time for an iphone.

Well - the first app I installed was EverNote. But much to my disappointment, Evernote for the iphone does not allow handwriting or drawing. Although you can see your previously drawn/written notes.

Evernote guys - if you're listening, can you please give the same features on an iphone - which are present on windows mobile? You really do have a great app.
And while you're at it - please also include:
- auto scroll when you finish writing on a page
- please allow us to edit our notes on phones- really, you are cutting out a lot of functionality by forcing us to pay for this. I don't mind paying for more space - which I will eventually need; but forcing me to pay for a disabled feature is upsetting!