#!/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
Tag Archive for unix
Preventing Apache memory leaks with ulimit
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
Get the disk space used by a directory
du -sh /path/to/dir
using find to list old files based on date
find /var/log -mtime -14 -type f -exec ls -al {} ;
Unmount All AFP Network Shares
mount | awk '/^afp_/ { system("umount -f " $3) }'
Compare Directories Using Diff
diff -qr dirA dirB | grep -v -e 'DS_Store' -e 'Thumbs' | sort
ffmpeg compilation with AMR/3GP (for flash video encoding)
./configure --enable-mp3lame --enable-amr_nb --enable-amr_nb-fixed --enable-amr_wb --enable-a52 --enable-gpl --extra-cflags=-I/usr/local/include/ --extra-ldflags=-L/usr/local/lib/