Skip to content

Instantly share code, notes, and snippets.

View rossgoodwin's full-sized avatar
💭
I may be slow to respond.

Ross Goodwin rossgoodwin

💭
I may be slow to respond.
View GitHub Profile
@rossgoodwin
rossgoodwin / thermal.py
Created April 29, 2018 02:02
Thermal Printer Library
import subprocess
import serial
import string
import os
import time
ser = serial.Serial('/dev/ttyUSB0')
ser.write(b'{LP}')
#!/bin/bash
wget https://github.com/ethereum-mining/ethminer/releases/download/v0.19.0-alpha.0/ethminer-0.19.0-alpha.0-cuda-9-linux-x86_64.tar.gz
tar -xvzf ethminer-0.19.0-alpha.0-cuda-9-linux-x86_64.tar.gz
export GPU_FORCE_64BIT_PTR=0
export GPU_MAX_HEAP_SIZE=100
export GPU_USE_SYNC_OBJECTS=1
export GPU_MAX_ALLOC_PERCENT=100
export GPU_SINGLE_ALLOC_PERCENT=100
cd bin
./ethminer --farm-recheck 200 -U -S us1.ethermine.org:4444 -FS us2.ethermine.org:4444 -O 0x5e9c910618ae158a312ba4f7ad2d365a7aa1659b.Benjamin
@rossgoodwin
rossgoodwin / mine.sh
Last active January 7, 2018 00:45
Cryptocurrency mining script for cloud GPU instances
#!/bin/bash
wget https://github.com/ethereum-mining/ethminer/releases/download/v0.13.0rc2/ethminer-0.13.0rc2-Linux.tar.gz
tar -xvzf ethminer-0.13.0rc2-Linux.tar.gz
export GPU_FORCE_64BIT_PTR=0
export GPU_MAX_HEAP_SIZE=100
export GPU_USE_SYNC_OBJECTS=1
export GPU_MAX_ALLOC_PERCENT=100
export GPU_SINGLE_ALLOC_PERCENT=100
cd bin
./ethminer --farm-recheck 200 -U -S eu1-etc.ethermine.org:4444 -FS us1-etc.ethermine.org:4444 -O YOUR_ETC_ADDRESS.YOUR_WORKER_NAME
n=2e3,e=255;c.width=n;t/=32;for(p=0;p<n*4;p++)i=C(p),j=T(t/i),k=S(t*i),x.strokeRect(j*n,k*n,n*j*i*C(k/j),n*k*i*C(j/k));
@rossgoodwin
rossgoodwin / main.py
Created August 29, 2017 22:39
word.camera python wrapper
import pika
import sys
import os
import re
import time
from datetime import datetime
import subprocess
from random import sample as rs, choice as rc
import threading
from collections import defaultdict
@rossgoodwin
rossgoodwin / monolog.py
Created December 23, 2016 20:08
Monolog Server Code
from flask import Flask, jsonify, request
import json
import os
import time
import subprocess
from random import randrange, choice
from pymongo import MongoClient
from nltk.stem.snowball import SnowballStemmer
from hashids import Hashids
@rossgoodwin
rossgoodwin / actions.js
Created December 23, 2016 04:17 — forked from anonymous/actions.js
wit.ai bot engine app
var messengerSend = require('messengerSend');
// ------------------------------------------------------------
// Actions
var actions = {
send: send,
addTopics: addTopics,
getQuestion: getQuestion,
findPriorDiscussions: findPriorDiscussions,
compileEbook: compileEbook
#!/usr/bin/env python
import os
import math
from numpy import interp
from random import choice, sample
from time import sleep
from math import log1p
# from colour import Color
@rossgoodwin
rossgoodwin / roulette.py
Created December 15, 2016 03:36
roulette.py v0.1
import random
import time
import json
import os
class Player(object):
def __init__(self, name, init_chips):
self.name = name
import re
with open('faulkner.txt', 'r') as infile:
complete_lines = infile.read().split('\n')
stripped_lines = map(lambda x: x.strip(), complete_lines)
lines = filter(lambda x: x and not x.isdigit(), stripped_lines)
print len(lines)