Category: Linux

I’m sure many of you also might be having this problem so I would like to share a hectic experience of setting up my Micromax 3G modem. Now, I have this Micromax 3G modem, and I inserted it in the USB port, but it was not being detected by Ubuntu 12.04. I even tried creating a mobile Internet connection, but still, there is no option to connect. I previously used Ubuntu 11.10, and it had automatically detected the modem and asked me to create a connection. Now I inserted my friend’s Huawei modem and it was detected with no trouble at all. So, I started digging.
On typing lsusb in the terminal it gives the following:

Bus 001 Device 008: ID 1c9e:9605 OMEGA TECHNOLOGY

Amongst many other stuffs. So, detecting modem wasn’t a problem because usb was being detected but the connection wasn’t coming through. The problem as it seems was it had to be registered and Huawei modems are automatically registered. Boy, why don’t they mention the same on the modem box. 😛 Anyways, here’s what I did to get it setup.

On typing lsusb in the terminal, you’ll get the vendor and product ID of your product, which in this case is ID 1c9e:9605
Once you get that, go ahead and do the following to config.

gksudo gedit /etc/usb_modeswitch.d/1c9e:9605

Paste this code on the editor

DefaultVendor = 0x1c9e
DefaultProduct = 0x9605
TargetVendor = 0x1c9e
TargetProduct = 0x9605

Save and exit, then log in as root to your terminal:
In case you can’t login as root, add sudo before every commands that follows.
Type & confirm your root password, and do the following:
modprobe usbserial vendor=0x1c9e product=0x9605

usb_modeswitch -c /etc/usb_modeswitch.d/1c9e\:9605

If you didn’t receive any error messages, you’ll then see a new Mobile Broadband Connection on your Network Manager (top right wifi icon)

you need to run this code every session but you can just add the code below to your /etc/rc.local(insert before the ‘exit 0’) so it will be part of your startup programs:

sleep 10
modprobe usbserial vendor=0x1c9e product=0x9605
usb_modeswitch -c /etc/usb_modeswitch.d/1c9e\:9605
sleep 20
nmcli nm wwan on
sleep 10
nmcli con up id "your connection name here"

And that would it all I suppose. That worked for me at least. 😀 Now, some of you might be using some old Micromax modem model which might give lsusb output as 1c9e:9800. Please update to the latest version of usb-modeswitch and you would be good to go. 🙂 For more reading on usb-modeswitch



Changing Proxy Settings in Linux

Ubuntu 12.10 will set proxy settings both in /etc/environment and /etc/apt/apt.conf when you set proxy from GUI (Network Settings).

Check your apt settings

grep -Hnri proxy /etc/apt/

will list out the current proxy settings used by apt in the following format.


If you see any output, it corresponds to apt‘s proxy settings. They will have to be cleared.

sudoedit <filename>

will allow you to edit the corresponding configuration file. Copy the existing contents somewhere in case you need to restore them, and delete or comment the lines that look like
Acquire::<protocol>::proxy=<your proxy here>
(Add // at the beginning of a line to comment that line. Commented lines are ignored.)

Save the files, close the text editor, and retry. If the problem persists,

Check global default environment.

grep proxy -i /etc/environment

Should list any proxy settings that are applied globally. If you need to clear them,

sudoedit /etc/environment

will fire up the text editor. Lines that start with # will be ignored, so add a # before those lines that mention your proxy settings. Save the file and retry.

Cleaning the user environment

It is possible that the systemwide configuration is clean but apt is picking up proxy settings from the user’s environment. sudoin certain configurations by default, or when explicitly passed -E as an option, preserves the environment.

env | grep -i proxy

should list out any current environment proxy settings. unset <variable> can be used to unset or clear a variable. Unset all <protocol>_proxy variables. If they are automatically being set, you might comment out the corresponding entries from ~/.profile, ~/.bashrc, ~/.pam_environment

(Those are the most common files that contain the entries. All of them can be searched at once using grep -Hni proxy ~/.profile ~/.bashrc ~/.pam_environment )


Ubuntu 12.04

Git Setup

I started using growing interest for Open Source softwares sometime before and then i came across the terms VCS (Version Control System) and eventually my path stopped at GIT. I was glad to see to see github and its uses around.

github image

So i did some basic setup which are in fact not so complicated but there is no single guide that I found online. So, here I decided to provide a single guide based on a number of website references.

The best place to learn is the official doc help from but i got pretty confused for the first time with the whole setup.

If you are new to git and don’t have a clue what it is, you can learn what git from here,

Good so now you know what git is and then go ahead and download the latest version of git from here,

Alright, now we are good to go. Open the terminal and start by configuring git.


First you need to tell git your name, so that it can properly label the commits you make.

git config --global "Your Name Here"
# Sets the default name for git to use when you commit


Git saves your email address into the commits you make. We use the email address to associate your commits with your GitHub account.

git config --global ""
# Sets the default email for git to use when you commit

Your email address for Git should be the same one associated with your GitHub account. If it is not, see this guide for help adding additional emails to your GitHub account. If you want to keep your email address hidden, this guide may be useful to you.

Password caching

The last option we need to set will tell git that you don’t want to type your username and password every time you talk to a remote server.

Tip: You need git 1.7.10 or newer to use the credential helper

To use this option, you need to turn on the credential helper so that git will save your password in memory for some time:

git config --global credential.helper cache
# Set git to use the credential memory cache

By default git will cache your password for 15 minutes. You can change this if you like.

git config --global credential.helper 'cache --timeout=3600'
# Set the cache to timeout after 1 hour (setting is in seconds)

Now git is set and ready for use. Github recommends to use https instead of SSH but i personally feel better using ssh. So, now we are goin to generate some ssh keys for the same use.

Generating SSH Keys

Step 1: Check for SSH keys

First, we need to check for existing ssh keys on your computer. Open up Terminal and run:

cd ~/.ssh
# Lists the files in your .ssh directory

Check the directory listing to see if you have a file named either or If you don’t have either of those files go to step 2. Otherwise, you already have an existing keypair, and you can skip to step 3.

Step 2: Generate a new SSH key

To generate a new SSH key, enter the code below. We want the default settings so when asked to enter a file in which to save the key, just press enter.

ssh-keygen -t rsa -C ""
# Creates a new ssh key, using the provided email as a label
# Generating public/private rsa key pair.
# Enter file in which to save the key (/home/you/.ssh/id_rsa):
ssh-add id_rsa

Now you need to enter a passphrase.

# Enter passphrase (empty for no passphrase): [Type a passphrase]
# Enter same passphrase again: [Type passphrase again]

Which should give you something like this:

# Your identification has been saved in /home/you/.ssh/id_rsa.
# Your public key has been saved in /home/you/.ssh/
# The key fingerprint is:
# 01:0f:f4:3b:ca:85:d6:17:a1:7d:f0:68:9d:f0:a2:db

Step 3: Add your SSH key to GitHub

Run the following code to copy the key to your clipboard.

sudo apt-get install xclip
# Downloads and installs xclip. If you don't have `apt-get`, you might need to use another installer (like `yum`)

xclip -sel clip < ~/.ssh/
# Copies the contents of the file to your clipboard

Alternatively, using your favorite text editor, you can open the ~/.ssh/ file and copy the contents of the file manually

  1. Account settings buttonGo to your Account Settings
  2. SSH Keys menuClick “SSH Keys” in the left sidebar
  3. SSH Key buttonClick “Add SSH key”
  4. The key fieldPaste your key into the “Key” field
  5. The Add key buttonClick “Add key”
  6. Confirm the action by entering your GitHub password

Step 4: Test everything out

To make sure everything is working you’ll now SSH to GitHub. When you do this, you will be asked to authenticate this action using your password, which for this purpose is the passphrase you created earlier. Don’t change the part. That’s supposed to be there.

ssh -T
# Attempts to ssh to github

It’s possible that you’ll see this error message:

Agent admitted failure to sign using the key.
debug1: No more authentication methods to try.
Permission denied (publickey).

This is a known problem with certain Linux distributions. For a resolution, see our help article.

You may see this warning:

# The authenticity of host ' (' can't be established.
# RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
# Are you sure you want to continue connecting (yes/no)?

Don’t worry, this is supposed to happen. Verify that the fingerprint matches the one here and type “yes”.

# Hi username! You've successfully authenticated, but GitHub does not
# provide shell access.

If that username is correct, you’ve successfully set up your SSH key. Don’t worry about the shell access thing, you don’t want that anyway.

Now you can use ssh keys 🙂

Lets start by creating your first repository.
Click on create new repository on
Enter the necessary details and it’s done. Now open terminal and type
git clone<username>/<repo_name>
You might be asked to enter your password and the repo has been cloned to your local drive. Next time when you edit something or do some changes, Add to git by,
git add .
git commit -m “<your commit text>”
Sometimes you might get some error like content can not be added by due to some error. Use,
git commit -a
This will clear and then you can probably use pull to pull any changes done to the site and then you can proceed pushing your local changes.
git push origin master
to push your changes to the site.

You can view your changes to the site also. 🙂 That’s more or less everything you need to get the basic stuffs done on git or github 😀

The Charm of localtunnel

This is something so awesome that i can’t fail to share it with everyone. 😀
So, I’m working on this Django site but how do i show my friend who is like miles away sitting in his/her home about what i’m working on.. So, i got to know about this awesome stuff called localtunnel.

Localtunnel allows you to easily share a web service on your local development machine without messing with DNS and firewall settings.

Localtunnel will assign you a unique publicly accessible url that will proxy all requests to your locally running webserver.


Localtunnel command line script allows you to manually setup a sharing tunnel to a local webserver.

npm install -g localtunnel

Start a webserver on some local port (in our example we have a server running on port 8000).

Make sure everything is working locally first by visiting http://localhost:8000.

Now use the command line app to request a tunnel to your local server.

$ lt --port 8000
your url is:

You can now share with anyone. As long as your local instance of lt is running, this url will remain active. Any requests to that url will be routed to your service on port 8000.

When you start and stop your tunnel, you will see it reflected in the active tunnel count below.

And that’s it. Your site is running locally on your system but is tunneled via a proxy server. So, anyone all around the world can vies your site till you keep your local server running 😉

Many Hackers use this theory to channel their local servers to bounce around all over making it difficult to trace back. Pretty cool.. ain’t it? 😉



%d bloggers like this: