List your Apache virtual hosts
21/05/2010apache2ctl -t -D DUMP_VHOSTS
small snippets of webmonkey wisdom
ls . | xargs -i -t cp ./{} /path/to/new/directory
See example 12-6 at http://www.homepage.montana.edu/~unixuser/051905/abs-guide/moreadv.html
add_column :facebook_user_id, :integer, :limit => 8 # BIGINT
Using screen is a great way to leave long-running processes churning away when you’re not logged into the machine.
screenThis does not interrupt whatever is running in the screen.
Press Ctrl-A then D.
screen -r
If you’ve opened multiple screens, a list will be displayed:
There are several suitable screens on: 1681.ttys004.braeburn (Detached) 1686.ttys004.braeburn (Detached)
Just use the process ID of the screen to resume the right one:
screen -r 1681
If you’ve not had your own choice of username on your machine (for example, if your company imposes a username policy), you can set up a different default username for SSH in ~/.ssh/config:
Host *
User chris
export CLICOLOR=1;
Chrome 4 currently appears to be the only browser to implement the W3C’s border-radius property:
http://www.w3.org/TR/2002/WD-css3-border-20021107/#the-border-radius
border-top-left-radius: 1em; border-top-right-radius: 1em;
You can produce the same result using proprietary attributes in Firefox 3.5 and Safari 4:
/* Firefox */ -moz-border-radius-topleft: 1em; -moz-border-radius-topright: 1em; /* Safari */ -webkit-border-top-left-radius: 1em; -webkit-border-top-right-radius: 1em;
To copy files from one directory, you might usually do:
cp dir/* anotherdir/
If you try to do this with a particular large number of files, you may encounter the ‘argument list too long’ error. In this case you can use:
find . -exec cp {} /path/to/anotherdir/ \;
More approaches at: http://www.linuxjournal.com/article/6060
“The web is too important for society to be in the hands of any one vendor”
– Bruce Lawson, Opera
HTML5 is more a collection of new technologies than a single new standard – we can start using parts of it today.
You can use Moderizr to check what HTML5/CSS3 features are available in your browser. You can see it in action at FindMeByIP.
Cross-browser canvas support & speed
Canvas is possible in IE using a single script tag: check out Excanvas
Filament have created accessible charts from HTML tables using the canvas element: jQuery Visualise plugin
Browser handles special field display and front-end validation that has traditionally required Javascript (popup calendar, focus on field, email validation, required field validation).
Examples: http://people.opera.com/brucel/demo/html5-forms-demo.html
Currently iPhone Safari and Firefox 3.5 only.
Examples: http://html5demos.com/geo
#!/bin/bash # Send an email when disk space used reaches a certain threshold FS="/" SERVER_NAME="linux02" EMAIL="user@example.com" THRESHOLD=95 OUTPUT=($(LC_ALL=C df -P ${FS})) CURRENT=$(echo ${OUTPUT[11]} | sed 's/%//') [ $CURRENT -gt $THRESHOLD ] && df -h | mail -s "$SERVER_NAME disk space alert: $CURRENT% full" $EMAIL
I’ve set this up as a cron job run at 3am daily:
0 3 * * * ./root/maintenance/check_free_space.sh
Based upon http://www.cyberciti.biz/faq/mac-osx-unix-get-an-alert-when-my-disk-is-full/