This file contains 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
import asyncore, asynchat | |
import email | |
import re | |
import smtpd | |
import sqlite3 | |
import socket, string | |
import StringIO, mimetools | |
# HTTP based on examples at http://effbot.org/librarybook/asynchat.htm | |
class HTTPChannel(asynchat.async_chat): |
This file contains 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
#! /usr/bin/env python | |
""" Convert values between RGB hex codes and xterm-256 color codes. | |
Nice long listing of all 256 colors and their codes. Useful for | |
developing console color themes, or even script output schemes. | |
Resources: | |
* http://en.wikipedia.org/wiki/8-bit_color | |
* http://en.wikipedia.org/wiki/ANSI_escape_code |
This file contains 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
#! /bin/bash | |
# Script to automate creating new OpenVPN clients | |
# The client cert and key, along with the CA cert is | |
# zipped up and placed somewhere to download securely | |
# | |
# H Cooper - 05/02/11 | |
# | |
# Usage: new-openvpn-client.sh <common-name> | |
# Set where we're working from |
This file contains 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
def new_user(admin_username, admin_password): | |
env.user = 'root' | |
# Create the admin group and add it to the sudoers file | |
admin_group = 'admin' | |
runcmd('addgroup {group}'.format(group=admin_group)) | |
runcmd('echo "%{group} ALL=(ALL) ALL" >> /etc/sudoers'.format( | |
group=admin_group)) | |
# Create the new admin user (default group=username); add to admin group |
This file contains 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
<?php | |
function cidr2mask($netmask) { | |
$netmask_result=""; | |
for($i=1; $i <= $netmask; $i++) { | |
$netmask_result .= "1"; | |
} | |
for($i=$netmask+1; $i <= 32; $i++) { |
This guide is has moved to https://epicserve-docs.readthedocs.org/en/latest/django/ubuntu-server-django-guide.html.
This file contains 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
# convert PuTTY's public ssh key file into OpenSSH public key | |
ssh-keygen -i -f id_rsa_putty.pub > id_rsa.pub |
This file contains 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
/* | |
* Scaffolding | |
* Basic and global styles for generating a grid system, structural layout, and page templates | |
* ------------------------------------------------------------------------------------------- */ | |
.container | |
Sets a width of 940px which also centres the content (clears floated elements before/after) | |
.container-fluid | |
Sets a minimum width of 940px (clears floated elements before/after) |
This file contains 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
# graphite-web install is hardcoded in setup.cfg to /opt/graphite | |
sudo mkdir /opt/graphite | |
sudo chown brad.users /opt/graphite | |
# run under python2.7 virtualenv | |
virtualenv --python=python2.7 ~/ve/graphite | |
source ~/ve/graphite/bin/activate | |
# install the necessary python packages (simplejson is for flot graphs) | |
pip install graphite-web carbon whisper django django-tagging uwsgi simplejson |
OlderNewer