Skip to content

Instantly share code, notes, and snippets.

Avatar
👋
***status goes here***

Winston (Winny) Weinert winny-

👋
***status goes here***
View GitHub Profile
@winny-
winny- / checksum.py
Last active Aug 29, 2015
Simple python tool for creating and checking digests. Useful on old Macs that don't have shasum(1), but have python with hashlib.
View checksum.py
#!/usr/bin/env python
# Makes me mad that I had to write this. Damn you mac os x 10.5.8.
# I, Winston Weinert, hereby put this file in the public domain.
import hashlib
class Checksum(object):
View minecraft_users
#!/usr/bin/env php
<?php
// Config:
// [minecraft_users]
// env.host awesomeserver.com
// env.port 25566
error_reporting(E_ERROR | E_PARSE);
$host = getenv('host');
View backup.sh
#!/bin/sh
now() {
date '+%F %T'
}
Tarsnap='/usr/local/bin/tarsnap'
Hostname="$(hostname -s)"
BackupTarget="$2"
JobName="$Hostname-$1"
BackupDate="$(date +%F)"
BackupName="$JobName-$BackupDate"
@winny-
winny- / emailproc.py
Last active Aug 29, 2015
Rough and MIME-ignorant attempt at processing my old Lavabit emails.
View emailproc.py
#!/usr/bin/env python
import collections
import os
def make_email_dict(email):
"""Make an email dictionary.
View mcsuperserver.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# MCSuperServer - Starts and stops the minecraft server to reduce memory and cpu usage
# Copyright (C) 2011, 2012 Paul Andreassen
# paul@andreassen.com.au
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
@winny-
winny- / isPrime.py
Last active Aug 29, 2015
For TNMoC isPrime database.
View isPrime.py
#!/usr/bin/env python
#
# Written by Winston Weinert (winston@ml1.net) on 28-March-2014
# This file is in the public domain.
#
try:
xrange
except NameError:
View spoof.sh
echo '127.0.0.1 alexcrichton.com' | sudo tee -a /private/etc/hosts
jekyll build --watch
mkdir ~/tmproot
ln -s ~/Repositories/hermes-pages/_site ~/tmproot/hermes
sudo webfsd -r ~/tmproot -F -L - -p 80 -f index.html
@winny-
winny- / archive_appcast.py
Last active Aug 29, 2015
Validating Sparkle Appcasts
View archive_appcast.py
#!/usr/bin/env python
from __future__ import print_function
import os
import requests
from bs4 import BeautifulSoup
def download_url(url, destination=None):
if destination is None:
cwd = os.getcwd()
@winny-
winny- / bump-transmission.py
Last active Aug 29, 2015
Bump transmission file priorities
View bump-transmission.py
import transmissionrpc
import guessit
class TorrentBumper(object):
def __init__(self, host='localhost', port=9091):
self.client = transmissionrpc.Client(host, port=port)
@property
@winny-
winny- / index.php
Last active Aug 29, 2015
rms.sexy/index.php license: https://rms.sexy/license.txt
View index.php
<?php
function getDirectoryList ($directory) {
$results = array();
$handler = opendir($directory);
while ($file = readdir($handler)) {
if ($file != "." && $file != "..") {
$results[] = $file;
}
}
closedir($handler);