some interesting alias

2011-09-27 1 min read Linux
For this time, I will just give you a link to to bashrc file. http://hayne.net/MacDev/Bash/aliases.bash Head over there and see some very interesting aliase’s. Related articles Bryan Quigley: Windows Cant Handle the Hardware (bryanquigley.com) semantic grep (github.com) Aliases and shortcuts (macstarter.com)

Creating a chroot environment – the script.

2011-09-23 2 min read bash Fedora Learning Linux
Here is the script, very simple and effective πŸ™‚ #!/bin/bash - #=============================================================================== # # FILE: mkchroot.sh # # USAGE: ./mkchroot.sh # # DESCRIPTION: Make a chroot environ and cd to it # # OPTIONS: --- # REQUIREMENTS: --- # BUGS: --- # NOTES: --- # AUTHOR: Amit Agarwal (aka), # CREATED: 09/03/2011 02:53:37 PM IST # Last modified: Sat Sep 03, 2011 03:11PM # REVISION: --- #=============================================================================== binaries=( bash2 ls cat vi vim sudo) #=== FUNCTION ================================================================ # NAME: copy_binary # DESCRIPTION: copy binary to chroot # PARAMETERS: # RETURNS: #=============================================================================== copy_binary () { cmd=`which $1` echo $cmd cp $cmd bin/ ldd $cmd while read line do while read ld do if [[ -f $ld ]] then echo copy $ld cp $ld lib/ if [[ -L $ld ]] then ld1=$( ls -l $ld |sed 's/. Continue reading

Creating a chroot environment in Fedora with bash and other utils.

2011-09-19 2 min read bash Fedora Learning Linux
[ad#ad-2] I am testing some of my scripts to work on a very old system and there the versions of the most popular applications are very old, real old :(. So, some of things that I am very used to since last couple of years, do not seem to work as expected and I need to keep verifying a lot of things on the server, very inconvinient to keep testing the script on the server (need to connect on VPN) just to test some very simple things. Continue reading

better bash debugging

2011-09-16 1 min read bash Linux
I was trying to debug some bash scripts yesterday and learnt something new πŸ˜‰ There are lot of things in bash that you can use to debug and to start with you can enable xtrace mode as follows: set -x With this set you will see that all the commands are printed along with all other information as they are executed. This you can do for any line or for the function or for the whole script. Continue reading

ss – utility to investigate sockets.

2011-09-07 1 min read Fedora Linux
Sometimes, you find some interesting application/command by accident, and that is just what happened a few days back. Well, I was doing a ssh and as usual made my share of mistake in typing and missed the β€œh” from the ssh command and saw a list of options instead of my prompt on remote server. Now, that set me thinking and fond that its a very interesting command that comes with iproute on Fedoara, so if you want this command, then install iproute like this Continue reading

[Solved] ssh works but scp does not

2011-08-29 1 min read bash Fedora Linux
Image via Wikipedia For quite sometime now, I was having this issue, that for the home system, I was able to connect to is using ssh but it never worked. Fnally after quite some debugging finally I found that the issue was with thebashrc. So, everytime I had to do a scp I would have to move/rename bashrc and do the reverse action after the scp was done. Finally today I fixed it and the solution was very simple. Continue reading

bash completion

2011-08-09 2 min read bash Fedora Linux
I was working on some functions in bash to make my life easier and realized that if I added custom completion to my functions, it will be really good. So I headed over to google and searched for what I wanted. I did get a lot of information on bash completion but not a single concrete example that could help me do what I wanted. So, with the help of man pages and some results from the Google pages, I was finally able to accomplish what I wanted. Continue reading
Older posts Newer posts