This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export PS1='\[\033[0;35m\]\h\[\033[0;33m\] \w\[\033[00m\]: ' | |
alias free="free -m" | |
alias update="sudo aptitude update" | |
alias install="sudo aptitude install" | |
alias upgrade="sudo aptitude safe-upgrade" | |
alias remove="sudo aptitude remove" | |
alias clean="sudo aptitude clean" | |
alias search="sudo aptitude search" | |
alias brain-update="git clone git://github.com/guillaumegentil/railsbrain-updated.git ~/railsbrain" | |
alias brain-view="opera ~/railsbrain/index.html" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rails myplaces | |
cd myplaces | |
script/plugin install git://github.com/technoweenie/restful-authentication.git | |
script/generate authenticated user sessions | |
script/generate scaffold Rental name:string body:text price:integer | |
make sure you name it right, if you type Rentals instead of Rental you'll be greeted by a fabulous nameerror that'll just want to suck up all your time and reduce your laptop to a smouldering wreck outside the window somewhere. | |
;-) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##### ruby 1.8 | |
wget ftp://ftp.ruby-lang.org/pub/ruby/stable-snapshot.tar.gz | |
tar xzf stable*.tar.gz | |
cd ruby | |
nano version.h | |
...change => #define RUBY_PATCHLEVEL -1 | |
...to => #define RUBY_PATCHLEVEL 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
start | |
xm create /etc/xen/xen01.mybox.com.cfg | |
start on boot | |
ln -s /etc/xen/xen03.mybox.com.cfg /etc/xen/auto --force | |
list running xen machines (dom0 is host) | |
xm list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
who ..users logged in and what they're doing | |
users ..users logged in | |
last ..users who have logged in / out + when last rebooted | |
lastlog ..does the same but lists as log | |
whoami ..who you're logged in as | |
sudo passwd [user] ..change users password | |
nano [file] ..nice text editor | |
gedit . ..open current dir in gnome editor (note the . ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat /etc/issue ...return o/s installed | |
who ..users logged in and what they're doing | |
users ..users logged in | |
last ..users who have logged in / out + when last rebooted | |
lastlog ..does the same but lists as log | |
whoami ..who you're logged in as | |
sudo passwd [user] ..change users password | |
nano [file] ..nice text editor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function killKeys() { | |
//stop backspace / escape / enter key | |
if (typeof window.event != 'undefined') // IE | |
document.onkeydown = function() // IE | |
{ | |
var t=event.srcElement.type; | |
var kc=event.keyCode; | |
//alert('Type: ' + t); | |
return ((kc != 8 && kc != 13 && kc != 27) || (t == 'text' && kc != 13 && kc != 27) || | |
(t == 'textarea' && kc != 27) || (t == 'button' && kc == 13) || (t == 'submit' && kc == 13) || |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function convertUKtoUSdate(ukDate) { | |
var tmpDate = ukDate; | |
if (tmpDate.indexOf(" ", 0) > 0) { | |
tmpDate = tmpDate.slice(0, tmpDate.indexOf(" ", 0) + 1); | |
} | |
var sl = tmpDate.length; | |
s1 = tmpDate.indexOf("/", 0); | |
var s2 = tmpDate.indexOf("/", s1 + 1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var useProtocol = "http"; | |
if(location.protocol.toLowerCase() == "https:") useProtocol="https"; | |
else useProtocol = "http"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function addStylesheet(url) { | |
var stylesheet = document.createElement('link'); | |
stylesheet.rel = 'stylesheet'; | |
stylesheet.type = 'text/css'; | |
stylesheet.href = url; | |
document.getElementsByTagName('head')[0].appendChild(stylesheet); | |
} |
OlderNewer