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
# -*- coding: utf-8 -*- | |
import os | |
import sys | |
import site | |
import logging | |
site.addsitedir('/path/to/venv/lib/python2.6/site-packages') | |
sys.path.append('/path/to/venv') | |
sys.path.append('/path/to/venv/appname') |
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 | |
# | |
usage() { | |
echo "Usage: `basename $0` filename"; | |
} | |
[ $# -eq 0 ] && usage && exit 65; | |
fn=`basename "$1" .avi` |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" | |
Encrypt password for use with Ansible playbooks. | |
""" | |
import getpass | |
import random | |
import crypt |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -* | |
""" | |
Client for demonstrating XML-RPC Python calls. | |
""" | |
import xmlrpclib, sys | |
server_url = 'http://localhost:8888' |
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
from flask import Flask, jsonify | |
app = Flask(__name__) | |
@app.route('/api', methods = ['GET']) | |
def this_func(): | |
"""This is a function. It does nothing.""" | |
return jsonify({ 'result': '' }) | |
@app.route('/api/help', methods = ['GET']) |
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
for img in *.JPG ; do | |
fn=$(basename ${img} .JPG); | |
convert ${fn}.JPG ${fn}.exif; | |
tstamp=$(strings ${fn}.exif | grep -E "^[0-9]{3}.*\:.*" | head -1 | sed 's/:/\//' | sed 's/:/\//'); | |
[[ -n "${tstamp}" ]] && tdate=$(date -d "${tstamp}" +"%d %b %Y %H:%M") || tdate=""; | |
if [[ -n "${tdate}" ]] ; then | |
touch -d "${tdate}" ${fn}.JPG; | |
status="Touched" | |
else | |
status=""; |
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
yum install httpd yum-utils createrepo |
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
for img in IMG*.jpg; do | |
fn=$(basename ${img} .jpg) | |
convert ${fn}.jpg ${fn}.exif | |
tstamp=$(strings ${fn}.exif | grep -E "^[0-9].*\:.*") | |
convert ${fn}.jpg -fill red -gravity South -pointsize 72 -annotate +0+5 "${tstamp}" annotated_${fn}.jpg | |
rm -f ${fn}.exif | |
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
# cd /var/tmp | |
# wget http://kojipkgs.fedoraproject.org//packages/libimobiledevice/1.1.1/3.fc16/i686/libimobiledevice-1.1.1-3.fc16.i686.rpm | |
# yum localinstall libimobiledevice-1.1.1-3.fc16.i686.rpm |
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
cd ~/bin | |
curl -0 http://gdata-python-client.googlecode.com/files/gdata-2.0.17.tar.gz | tar -xz | |
cd gdata-2.0.17 | |
python setup.py install --home=~ | |
cd .. | |
curl -0 http://googlecl.googlecode.com/files/googlecl-0.9.13.tar.gz | tar -xz | |
cd googlecl-0.9.13 | |
python setup.py install --home=~ |