Sunday, July 7, 2013

Remove path from prompt in ubuntu

Most of the times in linux machine, you will get a prompt which shows complete path of present working directory i.e pwd. It looks like as -"/home/akash/dir1/movies/hindi/latest$"
But I want to see only "$" prompt on my terminal.
How to achieve this?
Ans: Simple, just export following variable or add it to .bashrc file
export PS1="\u $ "

Tuesday, April 16, 2013

Automounting error on Ubuntu:

 When you have dual boot machine, say windows and ubuntu. If you are currently running windows and hibernated it. Now, your machine is off and you decided to boot ubuntu. When ubuntu is started, now if you try to mount the windows drives, it will pop out error similar to the one mentioned below-
 
Mounting exited with exit code 14:windows is hibernated, refused to mount. Failed to mount '/dev/sde2':Operation not permitted. The NTFS partition is hibernated. Please resume and shutdown windows properly or mount the volume read-only with the 'ro' mount option, or mount the volume read-write with the 'remove_hiberfile' mount option. For example type in command line:  

Solution: Run the command similar to the one written below-
$ sudo mount -t ntfs-3g -o remove_hiberfile  /dev/sda1   /media/akash

where, /dev/sda1 is windows partition

Thursday, February 28, 2013

SSH without password

SSH to server/client without entering ssh password:

I would like to thank my friend, guide Mr. Rajendra to help me.

Suppose there are two Linux machines. In my case both were ubuntu machines say buntu1 and buntu2

On buntu1  machine-
# ssh-keygen -t rsa
# cat ~/.ssh/id_rsa.pub | ssh  user_buntu2@buntu2 'cat >> ~/.ssh/authorized_keys'

Here it will ask the password once to open ssh to buntu2. 

On buntu2  machine-
# ssh-keygen -t rsa
# cat ~/.ssh/id_rsa.pub | ssh  user_buntu1@buntu1 'cat >> ~/.ssh/authorized_keys'

Here it will ask the password once to open ssh to buntu1. 

From now on, ssh will never ask for password. 

Monday, November 26, 2012




"Couldn't load plug in" error when playing videos in google chrome on windows 7.

This can happen with PCs that are running the Enhanced Mitigation Toolkit.
If you are running EMT, do this:
1.  Start/All Programs
2.  Choose the Enhanced Mitigation Toolkit folder and select the EMT app
3.  Windows 7 has a pop up User Account Control Window - say "Yes"
4.  The EMT then appears.  Click on the "Configure Apps" button
5.  You'll see Chrome.exe listed at least once under the "App Name" column.  Uncheck the "SEHOP" boxes to the right of those chrome.exe entries.
6.  Choose OK
7.  Close the EMT window
8.  Close Google Chrome
9.  Reopen Google Chrome and go to a site like YouTube and run a video.  It might just work for you.

Thursday, October 25, 2012


Speed up NFS file shares on Windows -

Auto tuning of Receive window is enabled by default in Windows 7/Vista to speed up the TCP connections. But this may affect performance if the firewall or network is old.

Possible TCP/IP Auto Tuning Related Problems:
  • Indefinite delay (hang) when opening the Certificate Services snap-in.
  • Slow (sometimes no) group policy application.
  • Trying to select a domain user in order to add that principal to a local security group (the object picker) would hang indefinitely.
  • Instant Messaging is not working well. Sometimes not at all by not being able to sign in.
  • Access to local file servers (EX: networked drives, etc.) are extremely slow and sometimes did not succeed at all (appears to hang).
  • Internet connection problems.
  • Extremely slow file transfers.
  • Other strange unexplained network connecting issues.
  • Wireless network connection problems
  • Website browsing and downloads are extremely slow.


I have tried the steps mentioned below and I observed a drastic change in the speed of NFS share on windows machine
1     1. Launch command prompt as administrator.
2       2. Run “netsh interface tcp show global”
You will see –
C:\Users\akash>netsh interface tcp show global
Querying active state...

TCP Global Parameters
----------------------------------------------
Receive-Side Scaling State                     : enabled
Chimney Offload State                              : automatic
NetDMA State                                            : enabled
Direct Cache Acess (DCA)                      : disabled
Receive Window Auto-Tuning Level  : normal
Add-On Congestion Control Provider      : none
ECN Capability                                           : disabled
RFC 1323 Timestamps                             : disabled

3       3. Run “netsh interface tcp set global autotuning=disabled”
4.      4. Repeat step 2 to confirm that Receive Window Auto-Tuning Level  is disabled now


Please try this out and share your experiences.

Monday, May 14, 2012

autofs - auto mounting on Linux and Mac

I broke my head by working on weekend just to find out the way to do auto mounting of NFS file server on a Fedora and Mac book. Please follow the steps below to be head safe :P.

On Mac(10.6.8) -->

1. Open DirectoryAccess utility from  /System/Library/Core services/Directory Utility

2. select "BSD Flat File and NIS"

3. select edit

4. Domain name : mydomain.net
    Servers:  amt-admin1.mydomain.net
                  amt-admin2.mydomain.net

5.check "Use NIS domain for auth."

6. write following in /etc/auto_master

/homes auto.homes_amt  -resvport
/volume  auto.vols_amt  -resvport

7. restart autofs daemon as 
sudo launchctl stop com.apple.autofsd
sudo launchctl start com.apple.autofsd







On Linux (Fedora 13) -->



1. add "mydomain.net" in search row in /etc/resolv.conf file

it will look like -
====================================
[akashmahan@team lib]$ cat /etc/resolv.conf
# Generated by NetworkManager
domain mydomain.net
search domain.net  mydomain.net
nameserver 100.206.194.55
nameserver 100.209.194.55
====================================

2.  system --> administration -> authentication....
 Add your laptop to NIS domain

OR  modify /etc/yp.conf  to look like as --
======================================
[akashmahan@team lib]$ cat /etc/yp.conf
# generated by /sbin/dhclient-script
domain mydomain.net server 100.209.194.131
======================================

3. modify /etc/auto.master to look like
=====================================

[akashmahan@team lib]$ cat /etc/auto.master
/net    /etc/auto.net
/volume yp:auto.vols_amt       -intr,bg,tcp
/homes  yp:auto.homes_amt  -intr,bg,tcp

====================================

4. Restart ypbind and autofs as -
====================================
/etc/init.d/ypbind restart
/etc/init.d/autofs restart
====================================


Above procedures will mount the NFS server file system on your laptops. e.g my NFS file server /volume directory will be mounted on /volume directory of my laptop. If you do a "ls" in "/volume" directory on laptop, you will find nothing. You need to do a cd to specific directory then only that will be mounted.