Ubuntu 10.04 Boot Sequence

Just installed Ubuntu 10.04 Lucid Lynx (a Linux Operating System) – but want to default boot into Windows (or your alternate OS)?

Many people struggle to change the boot sequence on this version of Ubuntu, because this version uses Grub 2 – a newer version of the Grub boot loader.

Okay, technical details aside, it’s really easy to change the boot sequence.

This is what you need to do:

1. When the bootup menu pops up asking which operating system you would like to boot into, note the position of the Windows option (e.g. on my computer, it is on the 5th position).
2. Let the default Linux operating system log in (this would happen automatically
2. Once you enter your Ubuntu username and password (if you have set a password), and come to welcome screen, go to

Applications > Accesories > Terminal

3. In the terminal, key in this magic formula (this will lead you to the file you need to modify):

sudo gedit /boot/grub/grub.cfg

(You may be prompted to enter a password for permission to change this file. Enter your regular login password)

4. Look for the line which reads as follows:

set default=”0″

5. Change the “0” to the position of your Windows login
(Since the list is numbered starting 0, subtract 1 from the position of Windows login. E.g. Since my Windows login is on position #5, I would set this to:
“4”
)

6. Press the save button (or Ctrl-S)

7. Restart your computer, and you should be good to go!

Hope you find this helpful!

Posted in Tech. Tags: , . View Comments »

Downloaded iPhone Apps Don’t Launch!

Courtesy: gussifer | thecolorawesome.comWithout any warning, all my iPhone apps stopped working yesterday. Only the original apps like Contacts, Mail and Notes were working.

I tried syncing or restarting the phone, but neither helped.
As soon as any downloaded app launches, it would fail, and I’ll go back to the home screen. No error message. That’s it.

After doing some research, I found a way that worked to restore the phone properly. If you’re facing the same problem, hopefully these will help you as well.

This is the step by step procedure. All apps on my phone are now working perfectly:

1. Connect to a wireless network (avoid doing this on 3G, as one user said it didn’t work on 3G)

2. Go to the app store from your phone, and update any apps for whom updates are available.
In case you don’t have any updates pending, downloading a new app should do the trick as well.
3. Wait for the app to install fully.
4. Shutdown the phone (Keep power button pressed, until power-off slider shows. Then slide it to power off).
5. Power up.
6. Voila! Everything should be back in order now!

I hope this helps you. More later!

Posted in Tech. Tags: , , . View Comments »

USB Device in use

Wondered why the USB device is in use, and what’s using it?

Here are common softwares that might be using your removable drive:

1. Antivirus software
2. Indexing software (like Google Desktop)
3. Windows itself

Still can’t figure out? Try a program like ‘USB Safely Remove’. You can get a free 30 day trial, and most likely identify your common culprits in that time.
This software tells you what is blocking your hardware, and gives you the option of killing those apps.

All the best!

Posted in Tech. Tags: , . View Comments »

Eight Killer Free iPhone Apps

As an iPhone enthusiast and AppStore addict, I’m sharing free apps worth treasuring, which are ready to get off the App Store right now! Comment and add more of your favorites.

1. Stanza: Forget kindle or even iBooks. Stanza is a little heard, but great eBook reader. The winning point: instant access to Project Gutenberg (33,000 free titles) and several free (and paid) eBook libraries.

2. EverNote: Write notes, audios, or upload pictures directly from your phone. Snap pictures business cards and notes – with great character recognition! You can then access your notes from the internet or your desktop. Store about 40MB of data each month – enough for most of us (and 98% of EverNote’s users). The end of losing your work!The iPhone

3. Backgrounds: Give your iPhone a new look. With thousands of images to chose from. All free. Fresh content daily.

4. Skype: Get a wireless LAN connection, and start talking to other skype users. Free. OR, Pay $2.99 a month for free calls across US and Canada! Toll Free numbers should be free anyway.

5. Pandora: With a 3G connection, you can get high quality streaming music completely free! Pandora DJ’s for you once you give it a song or genre you like. You can tell it if you like what it plays (or not), and it does a good job of giving you the music you love.

6. Qrank: A new favorite! Qrank gives you a daily trivia challenge – complete with ‘lifelines’ to help you, varying difficulty, and a nifty musical score. The results compare you to your neighbors, your state, or your country! Don’t forget to show off your smarts on facebook.

7 (and 8). Twitter and Facebook: The apps published by the companies themselves are great!

Note: I’m not affiliated or endorsed by these apps
Posted in Tech. Tags: , , . View Comments »

Lost Bluetooth Pin?

The nifty Aliph Jawbone. Now you know its secret.

The nifty Aliph Jawbone. Now you know its secret.

Lost the manual for your bluetooth device? Can’t figure out the bluetooth pin for your headset?

Here’s your bluetooth pin: 

Bluetooth pins are almost always set to ‘0000’ (4 zeroes).

Still not pairing? Turn off and turn on your bluetooth device and the bluetooth option on your computer or phone. Try again!

Still not pairing? Last resort: try the backup pin: ‘1234’. Only rarely is this used.

Happy Bluetoothing!

I have tried this with samsung, motorola, altec lansing, aliph jawbone, digicom, plantronics, nokia and other leading headsets.
Let me know if this worked for you! Know another secret pin? Comment and share it!
Posted in Tech. Tags: . View Comments »

Why an in-home server can slow down the network

Even with the best (in-home) technologies, the server can hog your home network, and bring everything down to a crawl. Case in point, my 5MBPS connection started to feel like dialup, as I browsed in slow motion.
How can this happen? And how do you prevent this?

High active ip connections.

Here is what can happen with a poorly configured server:

Let’s say you setup a Linksys WRT-64G router which you use at home, with your new webserver on a lan port. Over time, your server will establish new connections with users (based on the apache settings). These connections, and the router timeout limits, can severely hamper the overall network performance.

The reason? Connections aren’t killed after they are used. And the router runs out of memory trying to keep track of all the connections.

The really odd symptom, is that when you open a new browser window, it struggles to connect to a website. But your other windows are running better.

Here is a simple remedy to the problem:

1. Router setting changes:

First lets check if your router is complaining:

a. Check in your router status page for the number of Active ip connections. Typically this should not be more than 30 per computer using the router.

b. If the Active ip connections, are high (500+), then check if most of the active connections are from your server (in dd-wrt, you can do this by going to Status > Click on the number against ‘Active IP Connections’.

c. If you find it is your server, you’ve hit jackpot. Time to set things straight:
Set the router to terminate unnecessary persistent connections.
You can do this by reducing the TCP and UDP timeouts (I recommend TCP timeout 600 seconds and UDP timeout 120 seconds).

This will prevent the router from keeping unnecessary connections on.

2. Server setting changes:

Apache likes to setup a lot of connections so you get a decent amount of multi-user performance from your website. If yours is a new website, likely it will take time to get bombarded by too many users.
Given that you want to share your home network with your server, these settings will help reduce the demand from the server:

a. Go to the apache config file (in ubuntu, it is: /etc/apache2/apache2.conf), and modify the mpm worker and preform modules as follows. (If you already have the same Server settings, then considering reducing them further)

<IfModule mpm_prefork_module>
    StartServers         5
    MinSpareServers      5
    MaxSpareServers      10
    MaxClients          100
    MaxRequestsPerChild  500
</IfModule>

<IfModule mpm_worker_module>
    StartServers          2
    MaxClients          150
    MinSpareThreads      25
    MaxSpareThreads      75
    ThreadsPerChild      25
    MaxRequestsPerChild   0
</IfModule>

b. Restart your apache server (in Ubuntu: sudo apache2ctl restart)

That’s it! And your apache server will run much lighter now – especially with fewer extra servers lurking around.

3. Check if everything looks good:

You should now see a drop in number of active ip connections.
Also, soon your in-home network will get back to its peppy self.

I hope this helps you!

The mysql slow query log

The first step to tuning your database, is to find out what’s running slow.

I recommend doing tuning your queries before changing your MySql memory allocation, sessions etc.

Its always better to treat the problem ground up (by finding rogue queries) rather than put a quick fix and forget about it (e.g. allocating more memory or setting sessions). Over time, the quick fixes will lead you to buy more hardware and cost more.

1. Setup the MySQL Slow query log:

To setup the log, first uncomment the log_slow_queries and long_query_time parameters:

# Here you can see queries with especially long duration
log_slow_queries = /var/log/mysql/mysql-slow.log
long_query_time = 5
#log-queries-not-using-indexes

This will set the slow query log to: /var/log/mysql/mysql-slow.log and will log any queries that take more than 5 seconds.

To start with, you should set the long_query_time to a higher value, so you don’t get overwhelmed with too many slow queries. Later you can bring this down to 2 seconds or so.

And later you should also set the ‘log-queries-not-using-indexes, to identify queries that will slow significantly as data load increases.

2. Restart mysql:

In ubuntu, simply run the command:

sudo /etc/init.d/mysql restart

This will restart the mysql server and start logging your slow queries.

3. Use your database, and keep checking for slow queries!

I hope this helps you in tuning your MySql database from the ground up.

LAMP: Why does a page take too long to open?

If you’re wondering why some pages take ages to open on your LAMP site, consider checking all the queries that hit your mysql database when you open that page.
Sometimes it is not slow queries, but too many reasonably fast queries, that are slowing you down.

Note: I suggest you try using your slow query log first! Here is a post that will help you.

For checking the database for all queries, you should be the only user on the database.

1. To know *all* that’s hitting your mysql database, simply uncomment this command in your my.cnf file (in Ubuntu, it is located at: /etc/mysql; you need to be root or run ‘sudo /etc/mysql/my.cnf’)

#
# * Logging and Replication
#
# Both location gets rotated by the cronjob.
# Be aware that this log type is a performance killer.

log = /var/log/mysql/mysql.log

2. Once you’ve uncommented this line, restart mysql server:

In ubuntu: sudo /etc/init.d/mysql restart

3. Clear startup logs:

Most likely you don’t want anything to do with the startup queries, so simply clear the log:

sudo echo ” ” > /var/log/mysql/mysql.log

4. Run your test: Go ahead and open your troublesome page in your browser.

5. As soon as the page is opened fully, copy out the log (here it copies to your home directory):

sudo cp /var/log/mysql/mysql.log ~/slowpage.log

If you have more troublesome pages, clear the log again and copy it to another location, for analysis.

6. Once you’re done with getting your logs, comment the log setup in my.cnf once more, and restart mysql again (steps 1 and 2). This will keep your mysql running fast.

7. Now go ahead and analyze what queries are run when you go to a particular page.

All the best with your tuning efforts!

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;

Posted in Tech. Tags: , . View Comments »

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!

Posted in Tech. Tags: , . View Comments »