Skip to content

Instantly share code, notes, and snippets.

@amtinits
amtinits / shuffle.py
Created February 28, 2017 20:11
Shuffle image tiles
from PIL import Image
import os.path
import random
import sys
TILE_SIZE = 5
for fname in sys.argv[1:]:
im = Image.open(fname)
assert im.width % TILE_SIZE == 0 and im.height % TILE_SIZE == 0
@amtinits
amtinits / http.conf
Created December 12, 2011 04:14
Get logwatch to pick up nginx logs - put this in /etc/logwatch/conf/logfiles/
LogFile = nginx/*access.log
LogFile = nginx/*access.log.1
Archive = nginx/*access.log.*.gz
# Expand the repeats (actually just removes them now)
*ExpandRepeats
# Keep only the lines in the proper date range...
*ApplyhttpDate
@amtinits
amtinits / nginx.conf
Created December 12, 2011 04:10
My general nginx conf file (for debian/ubuntu)
user www-data;
worker_processes 1;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
use epoll;
}