Tuesday, April 15, 2014

Update Firefox on Ubuntu

For some strange reason, I couldn't open and see content of any of my yahoo mail using Firefox. I tried it on Chrome. It was working. So it must be something to do with Firefox + yahoo combination. Since I cannot fix yahoo from its setting (it doesn't even open), I in turn focused on fixing Firefox. Anyway I checked my add-ons and plug-ins and found nothing suspicious. So I decided to update my Firefox. I found the version from Help->About Firefox. The version was 20 and there was NO update button/link despite of all the articles on the net saying so. Next I ran

sudo apt-get update
sudo apt-get --purge --reinstall install firefox

Hoping the system will find the updates in the repositories and update Firefox for me. Nope. Firefox was not updated. So I had to do it manually. Here are the steps:

1. Get a Linux 64-bit copy from here and untar/uncompress it.

~/Downloads$ tar xvfj  firefox-28.0.tar.bz2
tar: Record size = 8 blocks
firefox/
firefox/libsoftokn3.so
firefox/chrome.manifest
firefox/mozilla-xremote-client
firefox/crashreporter.ini
firefox/libnspr4.so
firefox/updater
.
.
.

2. Backup your $HOME/.mozilla directory if you want to be careful.

$ cd; cp .mozilla .mozilla.bak
3. Close all Firefox instances.

4. Backup your firefox directory

$ sudo mv /usr/lib/firefox /usr/lib/firefox.bak
5. Move firefox directory you just uncompressed to /usr/lib

$ sudo mv ~/Downloads/firefox /usr/lib
6. Now give it a try by launching it from the launcher or command line.

$ /usr/bin/firefox &
7. One more step, the firefox.png file seems to be missing from the latest Firefox 28 package. You will see a big red cross if this is not done. So to properly show firefox icon in your launcher.

$ sudo cp /usr/lib/firefox.backup/icons/mozicon128.png \ 
/usr/lib/firefox/icons
8. Try yahoo mail again. It works!

9. Now you can delete all the backups if everything works as expected.

In a fairly good mode, so toss in a bonus tip - to open a file with the default application in command line:

xdg-open /usr/lib/firefox/mozicon128.png

Saturday, June 15, 2013

Frozen MacOS terminal due ssh session timeout

To get out of a frozen terminal due to ssh timeout. Type the following keys:

enter (return key) ~.

Add the following to your .ssh/config file. It sends a signal to the server every 240 seconds to keep the session.

Host *
  ServerAliveInterval 240

Reference: http://www.metachunk.com/blog/dealing-osx-terminal-ssh-timeouts-0

Monday, July 30, 2012

vim 7.x and matchit plugin

For a few months I have been trying to make my vim (7.2.330) in Ubuntu 10.04 work with matchit plugin. But it never wanted to cooperate. The matchit plugin works perfectly with my vim 6.4.6 by simply downloading/unzipping the match.zip from here and adding the following line to ~/.vimrc file.

:source {path_to_matchit_plugin}/matchit.vim

But for vim 7.x, the following line has be to added to ~/.vimrc as well:

:filetype plugin on

Friday, February 24, 2012

Mapping Your Domain Name to Work with Blogger

From GoDaddy support center: http://help.godaddy.com/article/5112#parking

You can establish a more professional identity for your Blogger® blog by configuring it to point to one of the domain names you registered through us. Instead of entering your Blogger URL to view your latest blog post, visitors enter your domain name's URL. For example, by mapping your coolexample.blogspot.com blog to your www.coolexample.com domain name, visitors focus solely on your domain name.
To point your Blogger blog to your domain name, you set up domain name mapping, which configures your blog settings and domain name. You update your settings in your Blogger account and our Domain Manager:
  1. Park the domain name you want to use with your Blogger account on our parked nameservers.
  2. Edit the www CNAME record for the domain name you want to use with your Blogger account. This update tells the Web browser to open your Blogger blog when visitors enter your domain name's URL in the browser address bar.
  3. Forward your domain name to use www. This step ensures your Blogger blog displays for visitors who go to your domain name with or without the www prefix. For example, it displays for visitors who entered both www.coolexample.com and coolexample.com.
  4. Configure your Blogger account to use your domain name.

To Park Your Domain Name

  1. Log in to your Account Manager.
  2. Next to Domains, click Launch.
  3. Select the domain name you want to use with your Blogger account, and then from the Nameservers, select Set Nameservers.
  4. Select I want to park my domains.
  5. Click OK.
  6. Click OK again.

To Edit Your CNAME Record

  1. Log in to your Account Manager.
  2. Next to Domains, click Launch.
  3. From the Tools menu, select DNS Manager. The DNS Dashboard displays.
  4. For the domain name you want to use with your Blogger account, click Edit Zone. The Zone File Editor displays.
  5. In the CNAME (Alias) section, click the www record.
  6. In the Points To field, type ghs.google.com.
  7. Click Save Zone File, and then click OK.

To Forward Your Domain Name

  1. Go to support.google.com.
  2. Click Host my blog on a URL that I already own.
  3. Follow the listed instructions.

To Configure Your Blogger Account

  1. Log in to your Blogger account.
  2. From the Settings tab, select Publishing.
  3. Click Custom Domain.
  4. In the Buy a domain for your blog section, click Switch to advanced settings.
  5. In the Your Domain field, enter your domain name. For example, enter www.coolexample.com.
  6. To specify another location in which to look for files, in the Use a missing files host? section, select Yes and enter the path. If not, select No.
  7. In the Word Verification field, enter the characters as they display in the image above the field.
  8. Click Save Settings.
Any DNS changes you make can take up to 48 hours to reflect on the Internet.
NOTE: As a courtesy, we provide information about how to use certain third-party products, but we do not endorse or directly support third-party products and we are not responsible for the functions or reliability of such products. Blogger® is a registered trademark of Google, Inc. All rights reserved.

Tuesday, January 17, 2012

Find a process and kill it in a script in Linux

ps -ef | grep process_name | awk '{ print $2; }'| xargs kill -9

Tuesday, April 19, 2011

Computer Science Terms

Algorithms: Are well-defined procedures for solving problems.

Data Structure: Is a particular way of storing and organizing data in a computer so that it can be used efficiently.

Dangling Pointers: Pointers that point to invalid addresses. Some examples of programming errors that can lead to dangling pointers include casting arbitrary integers to pointers, adjusting pointers beyond the bounds of arrays, and deallocating storage that one or more pointers still reference.

Thursday, March 10, 2011

Hash Table or Hash Map

In computer science, a hash table or hash map is a data structure that uses a hash function to map identifying values, known as keys (e.g., a person's name), to their associated values (e.g., their telephone number). Thus, a hash table implements an associative array. The hash function is used to transform the key into the index (the hash) of an array element (the slot or bucket) where the corresponding value is to be sought.

Ideally, the hash function should map each possible key to a unique slot index, but this ideal is rarely achievable in practice (unless the hash keys are fixed; i.e. new entries are never added to the table after creation). Most hash table designs assume that hash collisions—the situation where different keys happen to have the same hash value—are normal occurrences and must be accommodated in some way.

In a well-dimensioned hash table, the average cost (number of instructions) for each lookup is independent of the number of elements stored in the table. Many hash table designs also allow arbitrary insertions and deletions of key-value pairs, at constant average (indeed, amortized[1]) cost per operation.[2][3]

In many situations, hash tables turn out to be more efficient than search trees or any other table lookup structure. For this reason, they are widely used in many kinds of computer software, particularly for associative arrays, database indexing, caches, and sets.

Credit for above paragraphs: http://en.wikipedia.org/wiki/Hash_table