Welcome To Snipplr


Everyone's Recent Bash Snippets



When Apache under OS X throws 'Forbidden' errors on files under the ~/Sites path, and the error log report 'Permission denied: access to /somefile/blah failed because search permissions are missing on a component of the path', check a missing Other E...
1 898 posted 16 years ago by cczona
A very dynamic and flexible bash prompt. Personally I find this to have everything needed. It shows exit status, shortens itself for long directories, and shows bash history for easy referencing. Hopefully it doesn't get messed up.
2 817 posted 16 years ago by robh
This requires ImageMagick installed. Resize, as well as convert the image format. (Note: either of WIDTH or HEIGHT can be left blank, e.g. WIDTHx and the image will be resized proportionally)
1 899 posted 16 years ago by soroush
test with echo instead of mv example removes spaces after dots, replaces spaces with _, removes ' , and -, and finally lowercases filenames
1 943 posted 16 years ago by iblis
3 768 posted 16 years ago by iblis
Execute multiple commands in background, wait for each to be finished and evaluate their return codes.
0 885 posted 16 years ago by nohn
add "void Init_client(){}" to the bottom of Client.m
0 769 posted 16 years ago by sou
The -P handles partial transfers, I'm using this for big audio/video files.
2 855 posted 16 years ago by mandric
To find out how much swap you are using at any given time. If there's more than 1 swapfile you could benefit from more RAM.
0 656 posted 16 years ago by cczona
Create a copy of a text file with blank lines removed.
0 679 posted 16 years ago by ches
Open up terminal, paste the code below, then log your user out.
0 783 posted 16 years ago by chrisaiv
Running this command will append a line with given values to a file you specify. Replace words between < and > with the values you desire.
1 1098 posted 16 years ago by engel
this launches vi so you can add the files/dirs you want to ignore. i'm not happy.
4 782 posted 16 years ago by mandric
-l grep options shows the path and only the path of the matching file
0 744 posted 16 years ago by therobot
qlmanage -p foo.png, the image immediately pops up in a Quick Look pane. Even better, Quick Look supports slide shows. So if you cd into a folder of images and run qlmanage -p *.jpg, you'll be rewarded with a full-on presentation of your pictures....
0 644 posted 16 years ago by jrphelps
So you don't have to type the password everytime you log in to that remote ssh server. Don't enter a passphrase when prompted, just hit enter. This example is for Mac OS X but is likely to work on *nix plats too.
5 808 posted 16 years ago by micmath
Set a reminder. Use +hhmm to set a reminder for some hh (hours) or mm (minutes) in the future; e.g., set an alarm for 45 minutes from now as: leave +0045
0 634 posted 16 years ago by rhockens
As root run
0 720 posted 17 years ago by therobot