Skip to content

Instantly share code, notes, and snippets.

@DaveEveritt
DaveEveritt / Add field to an existing Django app with South
Created June 25, 2010 20:48
quickly add field(s) to existing Django models with South
====================================================================
Simple-as-possible instructions to add a field (or more) using South
to an existing Django model with existing data.
====================================================================
Two versions:
1. Super-condensed (the bare minimum - jfdi)
2. Detailed-but-brief (if you want more information).
Notes:
@marcelom
marcelom / pysyslog.py
Created December 5, 2012 18:06
Tiny Python Syslog Server
#!/usr/bin/env python
## Tiny Syslog Server in Python.
##
## This is a tiny syslog server that is able to receive UDP based syslog
## entries on a specified port and save them to a file.
## That's it... it does nothing else...
## There are a few configuration parameters.
LOG_FILE = 'youlogfile.log'
@sindresorhus
sindresorhus / post-merge
Last active May 2, 2024 03:18
git hook to run a command after `git pull` if a specified file was changed.In this example it's used to run `npm install` if package.json changed and `bower install` if `bower.json` changed.Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
#!/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# git hook to run a command after `git pull` if a specified file was changed
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"
[general]
static=yes
writeprotect=No
autofallthrough=No
clearglobalvars=No
priorityjumping=No
;------------------------------------------------------
[Default]
include=>python
@augbog
augbog / redditwallpapers.sh
Last active August 2, 2017 20:47
CURL imgur links from a subreddit every so often so you always have a variety of wallpapers :)
#!/bin/bash
cd ~/Pictures/wallpapers && curl https://www.reddit.com/r/wallpapers/ | tr '"' '\n' | grep imgur | tee "$$.tmp" | egrep 'http:\/\/i.imgur.com\/.*\.jpg' | xargs wget -q -nc
egrep '^http://imgur.com/a/' "$$.tmp" | xargs -L1 ~/Pictures/wallpapers/imgur_album_download.sh
rm "$$.tmp"
# Credit /u/Molozonide
# https://www.reddit.com/r/wallpapers/comments/138qi2
@augbog
augbog / Free O'Reilly Books.md
Last active May 14, 2024 10:27
Free O'Reilly Books

Free O'Reilly books and convenient script to just download them.

Thanks /u/FallenAege/ and /u/ShPavel/ from this Reddit post

How to use:

  1. Take the download.sh file and put it into a directory where you want the files to be saved.
  2. cd into the directory and make sure that it has executable permissions (chmod +x download.sh should do it)
  3. Run ./download.sh and wee there it goes. Also if you do not want all the files, just simply comment the ones you do not want.
@augbog
augbog / pax-tickets.sh
Created June 8, 2017 19:12
PAX Website Checker
#!/bin/bash
echo 'Running Pax Tickets script...'
while [ 1 ];
do
count=`curl -H 'Cache-Control: no-cache' -s "http://west.paxsite.com/registration?$[ (RANDOM % 18747214) + 1 ]" | grep -c "showclix.com"`
echo "http://west.paxsite.com/registration?$[ (RANDOM % 18747214) + 1 ]"
if [ "$count" != "0" ]
then
echo "West PAX Site updated!"