Skip to content

Instantly share code, notes, and snippets.

View namevirtualhostsport80.conf
NameVirtualHost *:80
<VirtualHost *:80>
ServerName foo.nostacktrace.com
ProxyRequests off
ProxyPass / http://localhost:8081/
ProxyPassReverse / http://localhost:8081/
</VirtualHost>
View namevirtualhostsport443.conf
NameVirtualHost *:443
SSLCertificateFile /path/to/server.crt
SSLCertificateKeyFile /path/to/server.key
<VirtualHost *:443>
ServerName foo.nostacktrace.com
SSLEngine on
ProxyRequests off
View virtual_host_redirect.conf
NameVirtualHost *:80
<VirtualHost *:80>
ServerName foo.nostacktrace.com
Redirect / https://foo.nostacktrace.com/
</VirtualHost>
<VirtualHost *:80>
ServerName bar.nostacktrace.com
Redirect / https://bar.nostacktrace.com/
@orb
orb / auto_uuid.py
Created Jan 29, 2011
An automatic UUID Field
View auto_uuid.py
from django.db import models
from django_extensions.db.fields import UUIDField
class AutoUUIDField(UUIDField):
def contribute_to_class(self, cls, name):
assert not cls._meta.has_auto_field, "A model can't have more than one AutoField."
super(UUIDField, self).contribute_to_class(cls, name)
cls._meta.has_auto_field = True
cls._meta.auto_field = self
View m2crypto_hack.py
# Minor brain surgery.
URLopener.open_https = open_https
@orb
orb / gist:1540363
Created Dec 30, 2011
host key verification failed
View gist:1540363
$ ssh myserver.nostacktrace.com
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: POSSIBLE DNS SPOOFING DETECTED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
The RSA host key for myserver.nostacktrace.com has changed,
and the key for the corresponding IP address 174.129.159.201
is unknown. This could either mean that
DNS SPOOFING is happening or the IP address for the host
and its host key have changed at the same time.
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@orb
orb / gist:1540382
Created Dec 30, 2011
ssh keygen -R
View gist:1540382
$ ssh-keygen -R myserver.nostacktrace.com
/Users/norman/.ssh/known_hosts updated.
Original contents retained as /Users/norman/.ssh/known_hosts.old
$ ssh ubuntu@myserver.nostacktrace.com
The authenticity of host 'myserver.nostacktrace.com (174.129.159.201)' can't be established.
RSA key fingerprint is bb:cc:31:17:0a:95:0e:37:d9:c0:2d:20:d8:ee:29:a1.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'myserver.nostacktrace.com,174.129.159.201' (RSA) to the list of known hosts.
View gist:3212974
user "random" do
comment "Random User"
uid 1000
gid "users"
home "/home/random"
shell "/bin/zsh"
password "$1$JJsvHslV$szsCjVEroftprNn4JHtDi."
end
View gist:3212978
remote_file "/tmp/testfile" do
source "http://www.example.com/tempfiles/testfile"
mode "0644"
checksum "08da002l"
end
View gist:3213011
remote_file "/usr/local/bin/lein" do
source "https://raw.github.com/technomancy/leiningen/1.7.1/bin/lein"
mode "0755"
end
You can’t perform that action at this time.