Category Archives: linux
Two problems- one solution i.e. 10.0.2.2
Sometime back, I faced an issue that I had installed a virtual machine on mu linux machine. I had a server/ website running which I wanted to access from virtual machine. http://localhost/site simply refused to work. A little googling helped with an answer to use http://10.0.2.2/site
Again faced similar issue. Was trying to access local website from within android emulator. Again localhost refused to work. And guess who was the rescuer? yep 10.0.2.2 again
Creating shortcuts in linux- It can be a pain to write down long linux commands again and again. So here is how you can create quick shortcuts for all reusable commands.
1. Edit bashrc: You will have a “.bashrc” file in your root folder. open it up for editing (emacs .bashrc) and add commands to be added for shortcut at the bottom of this file like
alias connect=’ssh email@example.com’
This will simply create a shortcut for the command ‘ssh firstname.lastname@example.org’ which will get executed by typing connect.
2. Compile bashrc: Before you can actually use your shortcuts, you will need to compile the .bashrc file by
3. Use shortcuts: Just type the shortcut command connect and you will see that it actually executes the command for which ‘connect’ is an alias.
1. How to check if a user exists on a node?
emacs /etc/passwd (look for u
2. How to check if a group exists on a node?
3. How to check number of lines in a file?
wc -l file.name
4. How do I securely connect to a node?