Welcome To Snipplr


Everyone's Recent Bash Snippets



0 521 posted 14 years ago by zingo
2 548 posted 14 years ago by zingo
This script removes (DROPS) all tables that start with foo_. Usefull if you had some CMS or application that (ab)uses table prefixing, and want to clean 0ut your database. NOTE: the data is remove FOREVER! So take good casre: make backups and all...
2 642 posted 15 years ago by berkes
0 430 posted 15 years ago by assbach
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 527 posted 15 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 480 posted 15 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 549 posted 15 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 570 posted 15 years ago by iblis
3 462 posted 15 years ago by iblis
Execute multiple commands in background, wait for each to be finished and evaluate their return codes.
0 537 posted 15 years ago by nohn
add "void Init_client(){}" to the bottom of Client.m
0 480 posted 15 years ago by sou
The -P handles partial transfers, I'm using this for big audio/video files.
2 532 posted 15 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 382 posted 15 years ago by cczona
Create a copy of a text file with blank lines removed.
0 410 posted 15 years ago by ches
Open up terminal, paste the code below, then log your user out.
0 495 posted 15 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 629 posted 15 years ago by engel
this launches vi so you can add the files/dirs you want to ignore. i'm not happy.
4 431 posted 15 years ago by mandric
-l grep options shows the path and only the path of the matching file
0 432 posted 15 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 402 posted 15 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 493 posted 15 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 377 posted 15 years ago by rhockens