This file contains hidden or 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
sudo apt-get clean | |
sudo apt-get autoclean | |
sudo apt-get autoremove | |
sudo apt-get install localepurge | |
# remove old kernels | |
dpkg --get-selections | grep linux-image | |
sudo apt-get remove --purge linux-image-X.X.XX-XX-generic |
This file contains hidden or 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
qemu resize ubuntu.img +750M # or eg. +2G | |
e2fsck -f ubuntu.img | |
resize2fs ubuntu.img | |
e2fsck -f ubuntu.img |
This file contains hidden or 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
# src: http://stackoverflow.com/a/4546129 | |
import codecs | |
import locale | |
import sys | |
# Wrap sys.stdout into a StreamWriter to allow writing unicode. | |
sys.stdout = codecs.getwriter(locale.getpreferredencoding())(sys.stdout) |
This file contains hidden or 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
remove Lock = Caps_Lock | |
add Lock = Escape | |
keysym Caps_Lock = Escape | |
keysym Escape = Caps_Lock |
This file contains hidden or 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
# views.py | |
from django.views.generic import RedirectView | |
from django.core.urlresolvers import reverse | |
class NamedUrlRedirectView(RedirectView): | |
def __init__(self, url, *args, **kwargs): | |
self.url = reverse(url) | |
super(NamedUrlRedirectView, self).__init__(*args, **kwargs) |
This file contains hidden or 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
# assuming you already have localtunnel gem installed | |
python -m SimpleHTTPServer 8000 | |
localtunnel 8000 |
NewerOlder