This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 | |
# [email protected] | |
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# | |
# Written by Winston Weinert ([email protected]) on 28-March-2014 | |
# This file is in the public domain. | |
# | |
try: | |
xrange | |
except NameError: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import transmissionrpc | |
import guessit | |
class TorrentBumper(object): | |
def __init__(self, host='localhost', port=9091): | |
self.client = transmissionrpc.Client(host, port=port) | |
@property |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function getDirectoryList ($directory) { | |
$results = array(); | |
$handler = opendir($directory); | |
while ($file = readdir($handler)) { | |
if ($file != "." && $file != "..") { | |
$results[] = $file; | |
} | |
} | |
closedir($handler); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
has_command() { | |
which "$1" >/dev/null 2>&1 | |
} | |
urlencode() { | |
python -c ' | |
import sys | |
import urllib |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <unistd.h> | |
#include <stdio.h> | |
#include <sys/types.h> | |
#include <pwd.h> | |
#define EMPTYLINE() printf("\n"); | |
void | |
sleep_forever() | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |