This file contains hidden or 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
// gmail-redmine-task-list.js | |
// | |
// Searches for Redmine messages in the inbox | |
// and returns the links to the tasks | |
// | |
// Use with the HTML version of GMail: | |
// https://mail.google.com/?ui=html | |
var query = "redmine in:inbox"; | |
var redmine_url = "https://redmine.example.com/" |
This file contains hidden or 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 sys | |
import ast | |
from subprocess import Popen, PIPE | |
from django.template.loader import render_to_string | |
from django.conf import settings | |
settings.configure( | |
TEMPLATE_DIRS=(".",) |
This file contains hidden or 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
# No need to redisplay it on sudo su and in screen sessions | |
if [ "$(id -u)" != "0" ] && [[ ! $TERMCAP =~ screen ]]; then | |
/etc/motd.tcl | |
fi |
This file contains hidden or 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
# /etc/fstab | |
LABEL=cloudimg-rootfs / ext4 defaults 0 0 | |
/dev/xvdb /mnt/is0 auto defaults,nobootwait,comment=instancestore0 0 2 | |
/dev/xvdc /mnt/is1 auto defaults,nobootwait,comment=instancestore1 0 2 | |
/mnt/is0/tmp /tmp none bind,noauto 0 0 | |
/mnt/is0/var/tmp /var/tmp none bind,noauto 0 0 |
This file contains hidden or 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 sys | |
import httplib2 | |
import urllib | |
import hashlib | |
import re | |
import itertools | |
from BeautifulSoup import BeautifulSoup | |
import progressbar |
This file contains hidden or 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
location /maintenance/ { | |
alias /home/web/maintenance/; | |
} | |
if ($uri !~ ^/maintenance) { | |
return 302 http://mywebsite.com/maintenance/; | |
} |
This file contains hidden or 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 | |
DATABASES="cooldb nicedb epicdb" | |
LOCAL_PWD="Tr0ub4dor&3" | |
RDS_PWD="correcthorsebatterystaple" | |
RDS_HOST="blahblahblah.rds.amazonaws.com" | |
for DB in $DATABASES ; do | |
echo "Moving $DB" | |
echo "create database $DB;" | mysql --host=$RDS_HOST --user=root --password=$RDS_PWD |
This file contains hidden or 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
i=1 ; for pnmfile in *.pnm ; do tifffile=$(printf %02d.tiff $i) ; convert -compress lzw $pnmfile $tifffile ; i=$((i+1)) ; done |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> | |
<title>Coffee shop</title> | |
<script type="text/javascript" src="https://code.jquery.com/jquery-2.1.1.min.js"></script> | |
<script type="text/javascript" src="checkboxes.js"></script> | |
</head> | |
<body> | |
<p>What topping would you like?</p> |
This file contains hidden or 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
class CountIncrMethodMixin(models.Model): | |
def incr_count(self): | |
model = type(self) | |
model.objects.filter(id=self.id).update( | |
count=models.F("count")+1 | |
) |