Welcome To Snipplr
Everyone's Recent Bash Snippets
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
The Drupal website will be updated every 45 minutes after the hour.
2
737
posted 15 years ago by chrisaiv
A common Drupal problem: how to save e.g. your blocks configuration without dragging an X Gig database around.
A simple command that dumps a table in a way that it can be inserted into SVN.
Every row is dumped as a single line, and they are sor...
1
748
posted 15 years ago by berkes
These are two separate code snippets. One is for a crontab, the other to be run by cron.
Together they create a new folder every day and fills it with 240 jpeg images (10 per hour) of whatever it is that you're doing.
The next step for me is t...
1
689
posted 15 years ago by ThomasGHenry
find . | xargs grep 'string' -sl
The -s is for summary and won't display warning messages such as grep: ./directory-name: Is a directory
The -l is for list, so we get just the filename and not all instances of the match displayed in the results...
2
1060
posted 15 years ago by mattkenefick
obviously change url. you'll get (better formatted) something like...
curl -o /dev/null -w %{time_total}\\n http://www.google.com
% Total % Received % Xferd Average Speed Time Time Time Current
D...
0
553
posted 15 years ago by nategood
This is the command to re-enable apache after you disabled it.
0
603
posted 15 years ago by bhubbard
About the dd command:
dd if=<source> of=<target> bs=<byte>("USUALLY" some power of 2, not less than 512 bytes(ie, 512, 1024, 2048, 4096, 8192, 16384[/b], but can be ANY reasonable number.) skip= seek= conv=<conversion>.
Source is the data being...
0
739
posted 15 years ago by webonomic
you have to collect the filenames from 'find' in an input file then open the input in this script
0
801
posted 15 years ago by rowntreerob
I needed a quick way to resize and save to a folder lots of images. Imagemagick is magic indeed!
1
1086
posted 15 years ago by zerolab
the call to the url for the ad results in redirect to the 'banner' or image file
0
738
posted 15 years ago by rowntreerob
* Resized images are generated into TARGET_DIR.
* Change the resolution (800x800 in my example) and quality (80) as you want.
* The command keeps the image's proportion. 1600x1200 will be converted into 800x600, 1200x1600 into 600x800.
_Notice_:...
2
1041
posted 15 years ago by Dorgendubal