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
# | |
# upstart script for gogs (Go Git Service) | |
# | |
author "tsv" | |
description "gogs upstart script" | |
start on (local-filesystems and net-device-up) | |
stop on shutdown | |
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 | |
from __future__ import with_statement # needed for python 2.5 | |
from fabric.api import * | |
from fabric.contrib.console import confirm | |
# ================================================================ | |
# NOTE: | |
# using this fabfile expects that you have the python utility | |
# fabric installed locally, ssh access to reamea.com, and your | |
# ssh public key associated with the account 'mboza@reamea.com' |
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 | |
# The purpose of this file is to, as quickly as possible, set up a home directory | |
# with all the creature comforts I expect. | |
# | |
# For this to work: | |
# 1. Add ssh keys to github and personal git repo | |
# 2. sudo aptitude install zsh git-core | |
mkdir $HOME/.virtualenvs |
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
# terminfo and termcap for nice 256 color terminal | |
# allow bold colors - necessary for some reason | |
attrcolor b ".I" | |
# tell screen how to set colors. AB = background, AF=foreground | |
termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm' | |
# erase background with current bg color | |
defbce "on" |
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
export TERM=xterm-256color | |
# Default the box color to red, but change to differentiate boxes or VPSs | |
export BOXCOLOR="%{$fg[red]%}" | |
# Path to your oh-my-zsh configuration. | |
export ZSH=$HOME/.oh-my-zsh | |
# Set to the name theme to load. | |
# Look in ~/.oh-my-zsh/themes/ |
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 | |
### | |
### This script simply parses ifconfig and loads a box's main IP into a shell variable | |
### | |
OS=`uname` | |
IP="" # store IP | |
case $OS in | |
Linux) IP=`ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}' | grep 24 `;; |
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
diff --git a/src/adzone/managers.py b/src/adzone/managers.py | |
index 347e85e..271e36d 100644 | |
--- a/src/adzone/managers.py | |
+++ b/src/adzone/managers.py | |
@@ -8,8 +8,15 @@ class AdManager(models.Manager): | |
Returns a random advert that belongs to the specified category and zone | |
""" | |
- try: | |
- ad = self.get_query_set().filter(category__slug=ad_category, zone__slug=ad_zone).order_by('?')[0] |
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/python | |
import sys | |
sys.path.append('<path_to_virtualenv>') | |
from gevent import monkey; monkey.patch_all() | |
from gevent.wsgi import WSGIServer | |
import os | |
import traceback | |
from django.core.handlers.wsgi import WSGIHandler | |
from django.core.management import call_command |
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
// ==UserScript== | |
// @name Toggl-Button GitHub | |
// @namespace https://github.com/jurgenhaas/toggl-button-greasemonkey | |
// @version 1.3 | |
// @include http*://github.com/* | |
// @grant GM_xmlhttpRequest | |
// @grant GM_addStyle | |
// @grant GM_getResourceText | |
// @grant GM_getValue | |
// @grant GM_setValue |
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 | |
DB_BACKUP="/var/backups/databases/" | |
LATEST_DIR="/var/backups/databases/latest/" | |
DB_USER="root" | |
DB_PASSWD="secretttt" | |
HN=`hostname | awk -F. '{print $1}'` | |
# Remove backups older than 10 days |
OlderNewer