Commits

Anonymous committed 6afcc26

v.2

Comments (0)

Files changed (2)

     PATH="$HOME/bin:$PATH"
 fi
 
+alias zs='mtail /var/log/syslog /var/log/messages'
+alias se='./manage.py runserver 0.0.0.0:8080'
+alias sd='./manage.py syncdb && touch deploy/*'
+alias z='ps ax | grep '
+alias h='history | grep '
 alias c='clear'
 alias s='tail -n 1000 /var/log/syslog'
 alias ls='ls -F --color=auto'
 alias l='ls -la'
 alias update='sudo apt-get update; sudo apt-get upgrade; sudo apt-get dist-upgrade'
 
+
+export WORKON_HOME=$HOME/projects
+source /usr/local/bin/virtualenvwrapper.sh
+
+alias v=workon
+alias v.deactivate=deactivate
+alias v.mk='mkvirtualenv --no-site-packages'
+alias v.mk_withsitepackages='mkvirtualenv'
+alias v.rm=rmvirtualenv
+alias v.switch=workon
+alias v.add2virtualenv=add2virtualenv
+alias v.cdsitepackages=cdsitepackages
+alias v.cd=cdvirtualenv
+alias v.lssitepackages=lssitepackages
+
+Start by editing your rc.local file, running sudo gedit /etc/rc.local and add the following lines above "exit 0":
+
+mkdir -p /dev/cgroup/cpu
+mount -t cgroup cgroup /dev/cgroup/cpu -o cpu
+mkdir -m 0777 /dev/cgroup/cpu/user
+echo "/usr/local/sbin/cgroup_clean" > /dev/cgroup/cpu/release_agent
+
+Save and exit gedit. Now, make it executable:
+
+sudo chmod +x /etc/rc.local
+
+After doing this, edit the .bashrc file found in your home directory (gedit ~/.bashrc) and, at the end of this file, add:
+
+if [ "$PS1" ] ; then  
+   mkdir -m 0700 /dev/cgroup/cpu/user/$$
+   echo $$ > /dev/cgroup/cpu/user/$$/tasks
+   echo "1" > /dev/cgroup/cpu/user/$$/notify_on_release
+fi
+
+One last thing. To make sure that cgroups are deleted whenever the last task leaves, run:
+
+sudo gedit /usr/local/sbin/cgroup_clean
+
+And copy-paste this:
+
+#!/bin/sh
+rmdir /dev/cgroup/cpu/$*
+
+Once again, save the file, exit gedit and make it executable:
+
+sudo chmod +x /usr/local/sbin/cgroup_clean
+
+Done! Restart your computer to apply the changes.
+
+ALTERNATIVE TO THE "200 LINES KERNEL PATCH THAT DOES WONDERS" WHICH YOU CAN USE RIGHT AWAY
+http://www.webupd8.org/2010/11/alternative-to-200-lines-kernel-patch.html
+