Skip to content

Instantly share code, notes, and snippets.

@pau
pau / gist:1018240
Created June 10, 2011 04:43
Enable Brightness Controls in Ubuntu 11.04 using NVIDIA
# /etc/X11/xorg.conf
Section "Device"
Identifier "Default Device"
Option "NoLogo" "True"
Option "RegistryDwords" "EnableBrightnessControl=1"
EndSection
@pau
pau / gist:1018454
Created June 10, 2011 08:22
Configure Django, Virtualenv and Pip
# Installing python-virtualenv will also install python-pip.
~$ sudo apt-get install python-virtualenv
# Create an isolated virtual environment called test_env.
~$ virtualenv test_env --no-site-packages
# Install the django package on test_env.
~$ pip install django -E test_env
@pau
pau / gist:1032825
Created June 18, 2011 05:09
Remove Blogger Branding
<link href="link to your icon" rel="icon" type="image/x-icon" />
<style type="text/css">
div.navbar {
display: none;
}
footer {
display: none;
@pau
pau / gist:1095475
Created July 20, 2011 17:47
ASP.NET Hack to Prevent Double Page Submission
<asp:Button ID="btnSubmit" runat="server" Text="Submit" OnClientClick="this.disabled=true;" UseSubmitBehavior="false" />
@pau
pau / gist:1098900
Created July 22, 2011 04:36
Set Relative Path of Django SQLite Database
SITE_ROOT = os.path.dirname(os.path.realpath(__file__))
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(SITE_ROOT, 'db', 'test.db'),
'USER': '',
'PASSWORD': '',
'HOST': '',
'PORT': '',
@pau
pau / gist:1144001
Created August 13, 2011 16:23
Ubuntu 10.04 LTS USB 3.0 Suspend/Hibernate Fix
We couldn’t find that file to show.
@pau
pau / gist:1148444
Created August 16, 2011 04:41
Ubuntu 10.04 LTS 64-bit Flash Install
sudo add-apt-repository ppa:sevenmachines/flash && sudo apt-get update && sudo apt-get install flashplugin64-installer
@pau
pau / pip-upgrade-all.sh
Created July 9, 2012 17:50
Upgrade All PyPI Packages
# pip freeze to list packages
# grep -v '\-e' to exclude packages in edit mode
# cut -d= -f1 to get the package name only
# xargs pip install -U to upgrade all packages
$ pip freeze | grep -v '\-e' | cut -d= -f1 | xargs pip install -U
@pau
pau / install-vbox-vagrant.sh
Created July 16, 2012 06:14
Installing Virtual Box and Vagrant
$ cd /tmp
$ wget http://download.virtualbox.org/virtualbox/4.1.18/virtualbox-4.1_4.1.18-78361~Ubuntu~precise_amd64.deb
$ sudo dpkg -i virtualbox-4.1_4.1.18-78361~Ubuntu~precise_amd64.deb
$ wget http://files.vagrantup.com/packages/eb590aa3d936ac71cbf9c64cf207f148ddfc000a/vagrant_1.0.3_x86_64.deb
$ sudo dpkg -i vagrant_1.0.3_x86_64.deb
$ sudo ln -s /opt/vagrant/bin/vagrant /usr/local/bin/
$ vagrant box add lucid32 http://files.vagrantup.com/lucid32.box
@pau
pau / build-run-salt.sh
Created July 16, 2012 06:58
Building and Running Salt
vagrant@lucid32$ cd ~
vagrant@lucid32$ mkdir virtualenvs
vagrant@lucid32$ cd virtualenvs
vagrant@lucid32$ virtualenv salt-dev
vagrant@lucid32$ . salt-dev/bin/activate
(salt-dev)vagrant@lucid32$ cd ~
(salt-dev)vagrant@lucid32$ sudo aptitude install swig g++ python-dev uuid-dev make
(salt-dev)vagrant@lucid32$ wget http://download.zeromq.org/zeromq-2.2.0.tar.gz
(salt-dev)vagrant@lucid32$ tar xzvf zeromq-2.2.0.tar.gz