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
#!/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);
@winny-
winny- / .conkyrc-bottom
Last active August 29, 2015 14:00
Winny's take on the linux desktop
alignment bm
background false
lua_load ~/.conkyrc.lua
update_interval 1
own_window false
gap_x 0
gap_y 0
default_bar_size 975 10
@winny-
winny- / sprunge.sh
Created May 8, 2014 00:37
sprunge script supporting both curl and wget
#!/bin/sh
has_command() {
which "$1" >/dev/null 2>&1
}
urlencode() {
python -c '
import sys
import urllib
#include <unistd.h>
#include <stdio.h>
#include <sys/types.h>
#include <pwd.h>
#define EMPTYLINE() printf("\n");
void
sleep_forever()
{
@winny-
winny- / which.py
Last active August 29, 2015 14:01
import os
import sys
def which(command):
paths = os.getenv('PATH', '').split(os.pathsep)
for path in paths:
possible_command = os.path.join(path, command)
is_valid_command = os.path.isfile(possible_command) and \
os.access(possible_command, os.X_OK)