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 / torrentIPs.py
Created December 21, 2015 16:08
Create a list of people downloading Star Wars: The Force Awakens
import libtorrent as lt
import time
import pickle
import MySQLdb as mdb
#import sqlite3 as lite
#import BeautifulSoup as bs
import bs4 as bs
import pickle
import urllib2
import sys
@umrysh
umrysh / uniqueAllocations.py
Last active February 14, 2017 14:37
Using the output file generated by partition.py find all combinations that contain N integers. Then find all the unique permutations of those values.
import csv
import os
import sys
numberOfDigits = 2
# From: http://stackoverflow.com/a/3682332
def int_wrapper(reader):
for v in reader:
yield map(int, v)
"""
The portfolio rebalancing bot will buy and sell to maintain a
constant asset allocation ratio of exactly 20/80 = fiat/BTC
"""
import strategy
import os
import threading
import weakref
import inspect
@umrysh
umrysh / play.py
Last active July 5, 2018 15:18
Listen to Google Play Music playlists from the terminal
#######################################################################
# You will need gmusicapi (https://github.com/simon-weber/gmusicapi)
# You can install it with:
# pip install gmusicapi
#######################################################################
import sys,warnings,subprocess,os,time
from gmusicapi import Mobileclient
from random import shuffle
import curses
@umrysh
umrysh / mdb2sqlite.sh
Created December 15, 2012 04:14
A modified version of the "Converting MS Access mdb files to sqlite" script posted at: http://pnenp.wordpress.com/2011/02/10/converting-ms-access-mdb-files-to-sqlite-mdb2sqlite/
#!/bin/bash
# Inspired by:
# http://nialldonegan.me/2007/03/10/converting-microsoft-access-mdb-into-csv-or-mysql-in-linux/
# http://cltb.ojuba.org/en/articles/mdb2sqlite.html
# Dave's Modifications:
# Line 25: Added code to remove COMMENT and SET statements.
# Lines 28 to 37: Added code to handle primary keys.
# Line 51: Added "postgres" to mdb-export command.
@umrysh
umrysh / masto_search.py
Created July 26, 2019 15:39
mastodon category search
import urllib.request
import sys
import os
import re
import sqlite3 as lite
from bs4 import BeautifulSoup, Comment
# Using https://fediverse.network to get the list of Mastodon Instances
url = 'https://fediverse.network/mastodon'
@umrysh
umrysh / checkpassword.sh
Last active September 15, 2021 07:22
Time-based One-time Passwords for Email
#!/bin/bash
# Example Dovecot checkpassword script that may be used as both passdb or userdb.
#
# Originally written by Nikolay Vizovitin, 2013.
# Assumes authentication DB is in /etc/dovecot/users, each line has '<user>:<password>' format.
# Place this script into /etc/dovecot/checkpassword.sh file and make executable.
# Implementation guidelines at http://wiki2.dovecot.org/AuthDatabase/CheckPassword
@umrysh
umrysh / mailgun-webhook.php
Created January 29, 2015 23:11
Very simple PHP webhook for Mailgun that emails you on errors.
<?php
$key = "<API Key>";
$from = "info@example.com";
$to = "dave@example.com";
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
if(isset($_POST['timestamp']) && isset($_POST['token']) && isset($_POST['signature']) && hash_hmac('sha256', $_POST['timestamp'] . $_POST['token'], $key) === $_POST['signature'])
{
if($_POST['event'] == 'complained') {
@umrysh
umrysh / main.dart
Created February 23, 2024 17:22
Generated code from pixels2flutter.dev
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(