##################################################################### # field allowed values # ----- -------------- # minute 0-59 # hour 0-23 # day of month 1-31 # month 1-12 (or names, see below) # day of week 0-7 (0 or 7 is Sun, or use names) # # # (*) - stands for all # (0-9) - range of numbers # (0,4,6,9-11) - list of numbers and ranges # (*/2) - step every X # # EXAMPLE: # # Every 5 minutes, of every hour, on the 2nd through the 10th and 20th # through the 30th of the month regardless of the day of the week, run # myscript. # # */5 * 2-10,20-30 * /bin/myscript # # To disable the email notifications you can either do it: # # Globally, add to the top of the Crontab # MAILTO="" # # Per Command: # [time] [command] >/dev/null 2>&1 # #####################################################################
Tag Archive for unix
Crontab Info
blipsend
#!/bin/bash # simpliest blip client aka blipsend - a very simple bash script by Åukasz Korecki, <a href="http://coffeesounds.com" >http://coffeesounds.com</a> # put your blip login details (login:password) in ~/.blipdata file # usage: # TODO: support for char's like: ) / etc... if [ -a ~/.blipdata ]; then curl -H'User-Agent: blipsend 0.1' -H'Accept: application/json' -H'X-Blip-api: 0.02' -u $(more ~/.blipdata) -F "update[body]=$(echo $@ | sed 's/ / /g')" <a href="http://api.blip.pl/updates" >http://api.blip.pl/updates</a> echo "Your message: $@, was sent" else echo "Missing ~./blipdata file! Put your credentials in login:password format in this file!!!!11" fi
Use Unix ‘find’ to propset the svn Id on many files at once
# this affects already existing files
find app/lib/ -type f -name '*.js' -exec svn propset svn:keywords "Id" {} ; -print
# OR, for files added later, you can edit ~/.subversion/config
[miscellany]
enable-auto-props = yes
[auto-props]
*.js = svn:keywords=Id
copy directory (unix)
cp -R /verzsource/ /target
Preventing Apache memory leaks with ulimit
#!/bin/sh HTTPD=/usr/local/apache2/bin/httpd CONF=/bmi/httpd-php/conf/httpd.conf exec 2>&1 echo starting... ulimit -v 100000 exec $HTTPD -f $CONF -D NO_DETACH
Password Protect Folder / Directory with htaccess and htpasswd on Apache and Linux / Unix
Step 1 - Create .htaccess file in folder you want to protect, copy the code and paste the code below, and then set server path to the file AuthUserFile /path/to/.htpasswd AuthName "Restricted Area" AuthType Basic Require valid-user Step 2 - Open Terminal, go to the directory you want to protect, and enter the following (changing the username to whatever you want). Enter the password upon prompting. htpasswd -c .htpasswd username
fix permissions for files and directories
chmod -R u=rwX,go=rX .
Fill a disk with zeroes
dd if=/dev/zero of=/dev/hda/zero bs=512