This guide on how to convert an SVN repository to a git repository was mostly taken from John Albin Wilkins post on Converting a Subversion repository to Git.
:
This guide on how to convert an SVN repository to a git repository was mostly taken from John Albin Wilkins post on Converting a Subversion repository to Git.
:
#!/usr/bin/env bash | |
# This script prints out all of your Redis keys and their size in a human readable format | |
# Copyright 2013 Brent O'Connor | |
# License: http://www.apache.org/licenses/LICENSE-2.0 | |
human_size() { | |
awk -v sum="$1" ' BEGIN {hum[1024^3]="Gb"; hum[1024^2]="Mb"; hum[1024]="Kb"; for (x=1024^3; x>=1024; x/=1024) { if (sum>=x) { printf "%.2f %s\n",sum/x,hum[x]; break; } } if (sum<1024) print "1kb"; } ' | |
} |
This guide is has moved to https://epicserve-docs.readthedocs.org/en/latest/django/ubuntu-server-django-guide.html.
digitalocean_domain.example example.com | |
digitalocean_record.example example.com,<DO ID> | |
digitalocean_record.fd-gmail-txt example.com,<DO ID> | |
digitalocean_record.fd-mx["alt1.aspmx.l.google.com."] example.com,<DO ID> | |
digitalocean_record.fd-mx["alt2.aspmx.l.google.com."] example.com,<DO ID> | |
digitalocean_record.fd-mx["aspmx.l.google.com."] example.com,<DO ID> | |
digitalocean_record.fd-mx["aspmx2.googlemail.com."] example.com,<DO ID> | |
digitalocean_record.fd-mx["aspmx3.googlemail.com."] example.com,<DO ID> | |
digitalocean_record.fd-ns["1"] example.com,<DO ID> | |
digitalocean_record.fd-ns["2"] example.com,<DO ID> |
from django.core.management.base import BaseCommand | |
from mymodule import main | |
import logging | |
class Command(BaseCommand): | |
help = 'Do foo' | |
def handle(self, *args, **options): |
CELERY=`ps -A -o pid,rss,command | grep celeryd | grep -v grep | awk '{total+=$2}END{printf("%d", total/1024)}'` | |
GUNICORN=`ps -A -o pid,rss,command | grep gunicorn | grep -v grep | awk '{total+=$2}END{printf("%d", total/1024)}'` | |
REDIS=`ps -A -o pid,rss,command | grep redis | grep -v grep | awk '{total+=$2}END{printf("%d", total)}'` | |
NGINX=`ps -A -o pid,rss,command | grep nginx | grep -v grep | awk '{total+=$2}END{printf("%d", total/1024)}'` | |
OTHER=`ps -A -o pid,rss,command | grep -v nginx | grep -v celeryd | grep -v gunicorn | grep -v redis | grep -v grep | awk '{total+=$2}END{printf("%d", total/1024)}'` | |
websites=`ps -A -o user,pid,rss,command | grep gunicorn | egrep -o "[a-z_]+\.py$" | sort | uniq | perl -wpe 's|\.py$||;' | xargs` | |
printf "%-10s %3s MB\n" "Celery:" $CELERY | |
printf "%-10s %3s MB\n" "Gunicorn:" $GUNICORN | |
printf "%-10s %3s MB\n" "Nginx:" $NGINX | |
printf "%-10s %3s KB\n" "Redis:" $REDIS |
# source: http://w1.weather.gov/xml/current_obs/weather.php | |
# icon_url: http://w1.weather.gov/images/fcicons/<weather_code>.jpg | |
noaa_weather_codes = { | |
'bkn': 'Mostly Cloudy | Mostly Cloudy with Haze | Mostly Cloudy and Breezy', | |
'nbkn': 'Mostly Cloudy | Mostly Cloudy with Haze | Mostly Cloudy and Breezy', | |
'skc': 'Fair | Clear | Fair with Haze | Clear with Haze | Fair and Breezy | Clear and Breezy', | |
'nskc': 'Fair | Clear | Fair with Haze | Clear with Haze | Fair and Breezy | Clear and Breezy', | |
'few': 'A Few Clouds | A Few Clouds with Haze | A Few Clouds and Breezy', | |
'nfew': 'A Few Clouds | A Few Clouds with Haze | A Few Clouds and Breezy', | |
'sct': 'Partly Cloudy | Partly Cloudy with Haze | Partly Cloudy and Breezy', |
# Django Aliases | |
alias d=django-admin.py | |
alias dt='django-admin.py test' | |
alias dsa='django-admin.py startapp --template=https://github.com/epicserve/django-app-template/archive/master.zip' | |
alias dsp='django-admin.py startproject --template=https://github.com/epicserve/django-base-site/archive/master.zip' | |
alias dsma='django-admin.py schemamigration --auto' | |
alias dsmi='django-admin.py schemamigration --initial' | |
alias dm='django-admin.py migrate' | |
# shortcut for starting django's runserver on a different port |