Skip to content

Instantly share code, notes, and snippets.

View winny-'s full-sized avatar
👋
***status goes here***

Winston (Winny) Weinert winny-

👋
***status goes here***
View GitHub Profile
@winny-
winny- / checksum.py
Last active August 29, 2015 13:56
Simple python tool for creating and checking digests. Useful on old Macs that don't have shasum(1), but have python with hashlib.
#!/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):
#!/usr/bin/env php
<?php
// Config:
// [minecraft_users]
// env.host awesomeserver.com
// env.port 25566
error_reporting(E_ERROR | E_PARSE);
$host = getenv('host');
#!/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 August 29, 2015 13:56
Rough and MIME-ignorant attempt at processing my old Lavabit emails.
#!/usr/bin/env python
import collections
import os
def make_email_dict(email):
"""Make an email dictionary.
#!/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 August 29, 2015 13:57
For TNMoC isPrime database.
#!/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:
@winny-
winny- / archive_appcast.py
Last active August 29, 2015 13:58
Validating Sparkle Appcasts
#!/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()
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- / bump-transmission.py
Last active August 29, 2015 13:58
Bump transmission file priorities
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 August 29, 2015 14:00
rms.sexy/index.php license: https://rms.sexy/license.txt
<?php
function getDirectoryList ($directory) {
$results = array();
$handler = opendir($directory);
while ($file = readdir($handler)) {
if ($file != "." && $file != "..") {
$results[] = $file;
}
}
closedir($handler);