This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
| #!/bin/bash | |
| ### BEGIN INIT INFO | |
| # Provides: Django EC2 server | |
| # Required-Start: networking | |
| # Required-Stop: networking | |
| # Default-Start: 3 5 | |
| # Default-Stop: 0 1 2 6 | |
| # Short-Description: Django server management script | |
| # Description: Django server management script | |
| ### END INIT INFO |
| sudo yum install kmod-wl-`uname -r` |
| .configure \ | |
| --prefix=/usr/share/nginx \ | |
| --conf-path=/etc/nginx/nginx.conf \ | |
| --error-log-path=/var/log/nginx/error.log \ | |
| --user=www-data \ | |
| --group=www-data \ | |
| --http-client-body-temp-path=/var/lib/nginx/body \ | |
| --http-fastcgi-temp-path=/var/lib/nginx/fastcgi \ | |
| --http-log-path=/var/log/nginx/access.log \ | |
| --http-proxy-temp-path=/var/lib/nginx/proxy \ |
| # This is a step by step tutorial on how to run uwsgi in emperor mode, | |
| # behind nginx on Fedora 20. I'll add to the tutorial as time goes on. | |
| # SeLinux will likely be a pain (even in permissive mode), so please see my comment on how to fix it. | |
| sudo yum upgrade | |
| sudo yum install nano yum-utils gcc uwsgi-plugin-python3 nginx | |
| yum-builddep python3-psycopg2 |
| #!/bin/sh | |
| # Settings for a PHP Project | |
| # Using: | |
| # * PHP Lint | |
| # *- PHP CS | |
| # *- PHP Analyzer | |
| # *- EmptyLines Checker | |
| # *- Scrutinizer | |
| # * PHPCPD |
| sysctl -w net.ipv4.ip_forward=1 | |
| iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE | |
| iptables -F FORWARD | |
| iptables -A FORWARD -j ACCEPT | |
| apt-get install dnsmasq | |
| printf " interface=eth0\ndhcp-range=192.168.10.10,192.168.10.19,4h" >> file.txt | |
| /etc/init.d/dnsmasq restart | |
| ifconfig eth0 192.168.10.1 netmask 255.255.255.0 |
| # Manually download APP-SDK from here: http://developer.amd.com/tools-and-sdks/opencl-zone/opencl-tools-sdks/amd-accelerated-parallel-processing-app-sdk/ | |
| mkdir AMD-APP-SDK-lnx64 | |
| cd AMD-APP-SDK-lnx64/ | |
| tar -zxvf AMD-APP-SDK-v2.9-lnx64.tgz | |
| sudo ./Install-AMD-APP.sh | |
| sudo apt-get install libssl-dev build-essential python-dev libpcap-dev | |
| export AMDAPPSDKROOT="/opt/AMDAPP" | |
| export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"/opt/AMDAPP/lib/x86_64":"/opt/AMDAPP/lib/x86" |
| import time | |
| def vps(): | |
| env.hosts = ['apps.myvps.com'] | |
| env.user = 'app' | |
| env.dbname = 'blog' | |
| env.dbuser = 'blogger' | |
| env.dbpass = 'password' | |
| def backup(): |
| import os | |
| import time | |
| from fabric.contrib.files import exists | |
| from fabric.api import ( | |
| env, | |
| require, | |
| run, | |
| get, | |
| sudo |