I hereby claim:
- I am jcderr on github.
- I am jcderr (https://keybase.io/jcderr) on keybase.
- I have a public key whose fingerprint is 7747 17ED 92D9 B883 2DBC 9915 13DF C428 CF1C 80DC
To claim this, I am signing this object:
from django.conf import settings | |
from storages.backends.s3boto import S3BotoStorage | |
class UserMediaS3Storage(S3BotoStorage): | |
def __init__(self, *args, **kwargs): | |
# if we set settings.AWS_S3_BUCKET, it will interfere with storagres.backends.s3boto.S3BotoStorage | |
# rendering of our {% static %} assets. So, we're leaving that unset and getting our bucket from | |
# another settings var. | |
kwargs['bucket'] = getattr(settings, 'USER_MEDIA_STORAGE_BUCKET') |
I hereby claim:
To claim this, I am signing this object:
devserver: | |
image: << production docker image name >> | |
volumes: | |
- .:/usr/src/app | |
links: | |
- db | |
- redis | |
environment: | |
DEBUG: True | |
DATABASE_URL: postgres://username:password@db:5432/dbname |
[Unit] | |
Description=ZNC | |
Requires=docker.service | |
After=docker.service | |
[Service] | |
User=core | |
ExecStartPre=-/usr/bin/docker stop znc | |
ExecStartPre=-/usr/bin/docker rm znc | |
ExecStart=/usr/bin/docker run --name znc -p 36667:6667 -v ${HOME}/.znc:/znc-data jimeh/znc |
#!/bin/bash | |
GATEWAY=$(ifconfig | grep 192.168 | grep "\-\->" | awk '{ print $2 }') | |
sudo /sbin/route add -net 10.0.0.0 -netmask 255.0.0.0 -gateway $GATEWAY |
[Unit] | |
Description=Kubernetes API Server | |
Documentation=https://github.com/GoogleCloudPlatform/kubernetes | |
Requires=setup-network-environment.service etcd2.service generate-serviceaccount-key.service | |
After=setup-network-environment.service etcd2.service generate-serviceaccount-key.service | |
[Service] | |
EnvironmentFile=/etc/network-environment | |
ExecStartPre=-/usr/bin/mkdir -p /opt/bin | |
ExecStartPre=-/usr/bin/mv /opt/bin/kube-apiserver /opt/bin/kube-apiserver.backup |
#!/bin/bash | |
# usage: wupiao [ip] [port] | |
# inspired by script of same name from Kubernetes project | |
# we're going to test any port, though, not just HTTP | |
[ -n "$1" ] && [ -n "$2" ] && while ! nc -z $1 $2; do sleep 1 && echo -n .; done; | |
exit $? |
#!/bin/bash | |
URL=$1 | |
CODE="200" | |
[[ -n "$URL" ]] || { echo "Please specify a URL to watch"; exit 1; } | |
[[ -n "$2" ]] && CODE=$2 | |
while true; do | |
STATUS=$(curl -o /dev/null --insecure --silent --head --write-out '%{http_code}' ${URL}) |
include /etc/nginx/conf.d/upstreams/*.conf; | |
server { | |
listen 8080; | |
resolver 10.99.254.254; | |
server_name ~^(?<svc>[a-zA-Z0-9]+)(?<env>[\-a-zA-Z0-9]*)\..*\.com$; | |
location / { | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
#!/bin/zsh | |
autoload colors | |
if [[ "$terminfo[colors]" -gt 8 ]]; then | |
colors | |
fi | |
for COLOR in RED GREEN YELLOW BLUE MAGENTA CYAN BLACK WHITE; do | |
eval ${COLOR}='$fg_no_bold[${(L)COLOR}]' | |
eval BOLD_${COLOR}='$fg_bold[${(L)COLOR}]' |