Welcome To Snipplr
Everyone's Recent Bash Snippets
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
Good for when you did a checkout when you meant to do an export or what-have-you.
2
2285
posted 18 years ago by trey
This is useful if you have some optional functionality being done which is quite slow on nfs. For example, I have a script that adds scm (svn/git/etc) info to my prompt, but I wouldn't want that when I'm in a repository on an nfs mount.
0
2075
posted 18 years ago by kergoth
This is very useful with dinamic IP connections. You can connect from the host with the dinamic IP, leave the tunnel open to other machine with ssh access and fixed IP and then connect to this machine on specific port (22000 in the example) to connec...
2
2062
posted 18 years ago by Juanje
This script goes to the directory you pass as a parameter and change de version of all the packages found in there.
It was used for an amount of packages which were building from the sources but for an lower version of Ubuntu (actually for Guadaline...
0
1555
posted 18 years ago by Juanje
This is a simple script for testing changes in a live iso created with squashfs filesystem for the compression.
It will take the iso path as a parameter and it will open it up with unionfs to let you modify its content (into a chroot enviroment) and...
0
1701
posted 18 years ago by Juanje
Little script which call tinyurl.com via 'curl' for generate a sort url of the url you pass.
0
2347
posted 18 years ago by Juanje
Suppose you created a script chart.rb in /home/foo/ruby/mylib direcory. Now, you want to use this in the app.rb located in /home/foo/ruby/scripts. In ~/.bash_profile:
0
1682
posted 18 years ago by cczona
Useful if you need to run the same command for lots and lots of different parameters
0
2643
posted 18 years ago by wolfie
Useful if you have a shell script running lots of the same command and want to know how many of them have been done
0
2157
posted 18 years ago by wolfie
Run this command to add an /etc/init.d/ startup script to start at os bootup.
0
1880
posted 18 years ago by funkmyer
Not sure why I'm posting this madness. Bash can be good for some things though. I think part of the reason I used bash was because I was calling alot of external commands.
0
1929
posted 18 years ago by mandric
Changing default settings
The defaults for the ssh-related commands can be altered for each account in a configuration file ~/.ssh/config (there is also a system-wide file, usually /etc/ssh/ssh_config). Each entry starts with a Host keyword. You c...
0
1775
posted 18 years ago by cczona
"-b" and "-a" tells grep to show you 10 lines before and 10 lines after
0
1698
posted 18 years ago by lakedenman
Execute this to remove the .svn directory from the current directory and all sub directories
3
2257
posted 18 years ago by meinhard
This is meant to be run as root, so do it at your own risk. It's very raw and needs error checking, but works. I run this script to get new django sites off the ground in a few minutes.
0
2818
posted 18 years ago by mandric
Start mplayer with -vf screenshot, and press 's' when you want to capture a
frame.
0
1727
posted 18 years ago by mandric
Check out the bash command 'shopt -s cdable_vars' From the man bash page: If set, an argument to the cd builtin command that is not a directory is assumed to be the name of a variable whose value is the directory to change to.
0
1720
posted 18 years ago by cczona
(EDITED: Originally I had this snip using 'cat /proc/version'. But have since replaced it with a more reliable -- and specific -- method)
If you need still more info (or are on a BSD), see 'uname', 'dpkg-architecture'
1
1853
posted 18 years ago by cczona