This file contains 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
from collections import Counter | |
""" | |
One-song per line, separate entries with a line containing only an equals sign | |
""" | |
fn = '------.txt' | |
SONGS = [ | |
'my name is jonas', | |
'holiday', | |
'say it aint so', |
This file contains 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
[program:claymore-miner] | |
command = /usr/local/claymore96/ethdcrminer64 -epool xx.xx.xx:XXXX -ewal <Wallet>.<WorkerName>/<EmailAddress> -epsw x -mode 1 -tt 68 -allpools 1 | |
environment=GPU_FORCE_64BIT_PTR=0,GPU_MAX_HEAP_SIZE=100,GPU_USE_SYNC_OBJECTS=1,GPU_MAX_ALLOC_PERCENT=100,GPU_SINGLE_ALLOC_PERCENT=100 | |
stdout_logfile = /var/log/claymore/claymore.log | |
stderr_logfile = /var/log/claymore/error-claymore.log | |
user = <Username> | |
autostart = true | |
stop_signal = SIGINT |
This file contains 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
""" | |
This is a fairly specific use-case, where we wanted to search columns on a related model, and present those results in a | |
sensible way. We wanted this column to only be present if the user is conducting a search, and we wanted to customize the | |
output to make the search term prominent in the results. | |
""" | |
import re | |
from django.contrib.admin import ModelAdmin | |
from django.utils import formats | |
from django.utils.safestring import mark_safe |
This file contains 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
# For reference, see: | |
# - http://docs.fabfile.org/en/1.12.0/usage/tasks.html#new-style-tasks | |
# - http://docs.fabfile.org/en/1.12.0/api/core/tasks.html | |
# - http://docs.fabfile.org/en/1.12.0/usage/execution.html#execute | |
from fabric.api import env, run, roles, execute | |
from fabric.tasks import Task | |
env.use_ssh_config = True | |
env.roledefs = { |
This file contains 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/bash | |
# This script is intended to be executed from the root directory of | |
# the extracted Nginx ZIP file. The ZIP file is available http://nginx.org/en/download.html | |
# The Nginx config dir will be ~/etc/nginx. | |
# The default HTML directory will be ~/htdocs/html. | |
# | |
# IMPORTANT NOTE: this script makes an attempt to be "upgrade-friendly". It backs up | |
# up the existing nginx directory, prior to upgrading, and also makes a copy of the | |
# existing ~/etc/nginx/nginx.conf file. | |
# |
This file contains 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/python | |
""" | |
This script is intended to run infinitely (ctrl-c to exit). It executes a "ps" command, and then | |
parses the result to determine the total memory usage for a given user account. It will output a | |
warning message if that value exceeds a specified threshold. | |
The following values can be configured: | |
USER - the account to be watched. The $USER bash environment variable is the default. | |
MEM_WARNING_LEVEL - warning message will be shown if current usage is above this |
This file contains 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/env python | |
""" | |
Fetches a set of placeholder images from placehold.it. Iterates over the background colors specified, and | |
uses the same text for each slide. Image filenames contain an index, the size, and the bg color. | |
Warning: quick/dirty script. Would be cooler if options could be entered on the command-line. Also would | |
probably be cooler to use the subprocess module, instead of os.system() | |
""" | |
import os |
This file contains 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/python | |
import subprocess | |
from datetime import datetime | |
import time | |
import sys | |
import itertools | |
# Configurable Values | |
MEM_LIMIT = 600000 |
This file contains 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
(function($, _window, undefined) { | |
$(document).ready(function () { | |
var $body = $('body'); | |
var $tmp = $('<span id="bs-visibility-tester"/>'); | |
var identifyBootstrapViewname = function (){ | |
$tmp.appendTo($body); | |
var visible_for; | |
$.each(['lg','md','sm','xs'], function(z, viewname){ | |
$tmp.addClass('visible-' + viewname); |
This file contains 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 | |
set -e | |
if [ "${VIRTUAL_ENV}" = "" ]; then | |
echo "Error: Not in a virtual env" | |
exit 1 | |
fi | |
OS=$(uname -s) |
NewerOlder