Skip to content

Instantly share code, notes, and snippets.

View umrysh's full-sized avatar
🏠
Working from home

Dave Umrysh umrysh

🏠
Working from home
View GitHub Profile
@umrysh
umrysh / partition.py
Created December 25, 2013 04:15
Generate all combinations of integers that sum to 100
# Makes use of the "Most Efficient Algorithm" posted here:
# http://homepages.ed.ac.uk/jkellehe/partitions.php
import csv
def partitions(n):
a = [0 for i in range(n + 1)]
k = 1
y = n - 1
while k != 0:
@umrysh
umrysh / _balancer.py
Last active December 29, 2015 00:39 — forked from prof7bit/.gitignore
"""
The portfolio rebalancing bot will buy and sell to maintain a
constant asset allocation ratio of exactly 50/50 = fiat/BTC
"""
import strategy
import os
import threading
import weakref
import inspect
@umrysh
umrysh / unknownBTConnections.sh
Created July 18, 2013 16:31
To alleviate paranoia run this script every minute through your crontab and you will get an alert if unknown IPs are connecting to your Bittorent Sync folders.
#!/bin/sh
######################################################################################
# The location of your Bittorent Sync log
LOG_LOCATION="/home/user/.btsync/btsync/sync.log"
# The list of known IPs you do not require an alert about
KNOWN_IPS="192.168.1|69.147.76.15|216.239.51.9"
# The icon for your alert
# I found a great little image here:
# http://i1-win.softpedia-static.com/screenshots/icon-60/BitTorrent-Sync.png
ALERT_IMAGE="/home/user/bin/BitTorrent-Sync.png"
#!/bin/sh
if test $# -lt 2
then
echo "Usage: start_on_desktop <desktop> <command> [<command args>...]" 1>&2
exit 2
fi
desktop=$(($1-1)) # Dave: Let the user specify the Desktop starting at 1, not 0
if [ "$2" == "subl" ] # Dave: Helpful tip for running Sublime-Text

Keybase proof

I hereby claim:

  • I am umrysh on github.
  • I am umrysh (https://keybase.io/umrysh) on keybase.
  • I have a public key whose fingerprint is CB52 F88F C12C 8C20 2C5F 2D16 91FF 74B4 E946 E9D2

To claim this, I am signing this object:

@umrysh
umrysh / gist:da4a81f798443a742eee
Created November 14, 2014 02:29
onename.io verification
Verifying that +umrysh is my openname (Bitcoin username). https://onename.io/umrysh
@umrysh
umrysh / compile_bash.sh
Created September 25, 2014 19:53
Patch the bash CVE-2014-6271 vulnerability (shellshock) on old versions of Debian (5 - Lenny, 6 - Squeeze) and OpenMediaVault
#!/bin/bash
#
# Put this in /usr/local/src/, make it executable and run it.
# Script From [https://dmsimard.com/2014/09/25/the-bash-cve-2014-6271-shellshock-vulnerability/]
#
# dependencies
apt-get update; apt-get install build-essential gettext bison
# get bash 3.2 source
wget http://ftp.gnu.org/gnu/bash/bash-3.2.tar.gz
@umrysh
umrysh / check_windows_updates.wsf
Last active August 29, 2015 14:02
check_windows_updates.wsf
<job>
<runtime>
<description>
Name:
check_windows_updates (nrpe_nt-plugin) 1.5 based on check_msupdates (nrpe_nt-plugin) 1.0
License:
The nagios plugins come with ABSOLUTELY NO WARRANTY. You may redistribute
copies of the plugins under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.
#
# httpd configuration settings for use with mailman.
#
ScriptAlias /mailman/ /usr/lib/mailman/cgi-bin/
ScriptAlias /admin /usr/lib/mailman/cgi-bin/admin
ScriptAlias /admindb /usr/lib/mailman/cgi-bin/admindb
ScriptAlias /confirm /usr/lib/mailman/cgi-bin/confirm
ScriptAlias /create /usr/lib/mailman/cgi-bin/create
ScriptAlias /edithtml /usr/lib/mailman/cgi-bin/edithtml
ScriptAlias /listinfo /usr/lib/mailman/cgi-bin/listinfo