Skip to content

Instantly share code, notes, and snippets.

View MitchRatquest's full-sized avatar

Mitchell Dokken MitchRatquest

View GitHub Profile
import multiprocessing
import signal
import sys
import random
import multiprocessing
class Markov(object):
def __init__(self, open_file):
self.cache = {}
@MitchRatquest
MitchRatquest / dambitstrue.sh
Created June 2, 2016 22:47
mama had a baby a;nd its head popped off
#!/bin/bash
###
### http://elinks.or.cz/download.html
###
### http://elinks.or.cz/download/elinks-current-unstable.tar.bz2
###
### http://cygwin.com/ml/cygwin-apps/2003-12/msg00323.html
### --without-x --enable-leds --enable-fastmem --enable-256-colors
#N canvas 296 286 808 492 10;
#X declare -lib mrpeach;
#X declare -lib moocow;
#X msg 543 65 close;
#X msg 637 66 devices;
#N canvas 0 309 789 479 bauds 0;
#X msg 319 274 baud 57600;
#X msg 357 312 baud 230400;
#X msg 338 293 baud 115200;
#X msg 300 255 baud 38400;
#!/bin/sh
#use as get_externals.sh TWITTERACCOUNT USERNAME PASSWORD
#account is public but i dont wanna share it
mkdir externals && cd externals
wget -O temphtml https://twitter.com/$1 && grep -Eo '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' temphtml > ips && rm temphtml
read -r ipaddress < ips
wget -m ftp://$2:$3@$ipaddress/share/pd/*
#mv * ~/externals #THIS LINE DOESN"T WORK
rm ips
echo "now move these files to the correct directory under ~/pd-externals"
#!/bin/sh
USER="$( logname )"
ls > allexternals
filename="allexternals" #ls > allexternals to get foldernames
echo "#N canvas 5 57 450 294 10;" > declareALL.pd #all pd sketches start with this
while read -r line
do
name="$line"
echo "#X declare -stdpath /home/$USER/pd-externals/$name;" >> declareALL.pd
echo "#X obj 7 34 54 declare -stdpath /home/$USER/pd-externals/$name;" >> declareALL.pd
#include <OSCBundle.h>
#include <SLIPEncodedSerial.h>
SLIPEncodedSerial SLIPSerial(Serial);
/*
1 --------------- VIN
0 -| |- GND
RST -| |- RST
GND -| |- 5V
2 -| ARDUINO |- A7 ONLY
#!/bin/sh
#wget -O NOR http://www.northofreality.com/tales/2016/7/4/the-inner-hologram 2>/dev/null && grep 'blog-item-content ' NOR | sed 's/<\/p>/\n/g' | sed 's/<p>/\n/g'| sed 's/<div class=\"blog.*div class=\"sqs-block-content">//g'| sed 's/<\/div><\/div>.*//g' | sed 's/\.\&nbsp;/\./g'
#used to practice sed
#load front page, grab newest story
newest=$( wget -O NOR http://www.northofreality.com/ 2>/dev/null && grep '\/tales\/[0-9]\{4\}\/[0-9]*\/[0-9]*\/[^#]*' NOR -m 1 | sed 's/<a href="//g' | sed 's/#.*//g' | sed 's/ //g')
#grab newest story and format for terminal
wget -O NOR http://www.northofreality.com$newest 2>/dev/null && grep 'blog-item-content ' NOR | sed 's/<\/p>/\n/g' | sed 's/<p>/\n/g'| sed 's/<div class=\"blog.*div class=\"sqs-block-content">//g'| sed 's/<\/div><\/div>.*//g' | sed 's/\.\&nbsp;/\./g'
sudo cpufreq-set -g performance
wget https://launchpad.net/~canonical-chromium-builds/+archive/ubuntu/stage/+build/7916060/+files/chromium-browser_45.0.2454.85-0ubuntu0.15.04.1.1181_armhf.deb
wget https://launchpad.net/~canonical-chromium-builds/+archive/ubuntu/stage/+build/7916060/+files/chromium-chromedriver_45.0.2454.85-0ubuntu0.15.04.1.1181_armhf.deb
wget https://launchpad.net/~canonical-chromium-builds/+archive/ubuntu/stage/+build/7916060/+files/chromium-codecs-ffmpeg_45.0.2454.85-0ubuntu0.15.04.1.1181_armhf.deb
sudo dpkg -i chromium-browser_45.0.2454.85-0ubuntu0.15.04.1.1181_armhf.deb chromium-chromedriver_45.0.2454.85-0ubuntu0.15.04.1.1181_armhf.deb chromium-codecs-ffmpeg_45.0.2454.85-0ubuntu0.15.04.1.1181_armhf.deb
sudo apt-get -f install -y
sudo apt-get install dbus-x11 xauth -y #might be unnecessary
chromium-browser --noerrordialogs --disable-session-crashed-bubble
@MitchRatquest
MitchRatquest / LTC1257.ino
Created September 9, 2016 03:18
LTC1257 untested quick code
/*
shift register simpletown for LTC1257
12 bit DAC, 5V, 1.4MHz max clock
DIN, CLK, !LOAD
________
CLK - - VCC
DIN - - VOUT
!LOAD - - REF
DOUT -________- GND
@MitchRatquest
MitchRatquest / rawinput.py
Created September 12, 2016 19:26
generic scanner
import os, datetime, time
yam = [] #init var
timestamp = str(datetime.datetime.now().strftime('%I.%M.%S_%p')) + '.txt' #only once, filename ultimately
daystamp = datetime.datetime.fromtimestamp(time.time()).strftime('%Y-%m-%d') #name of folder to put files for today in
cwd = os.getcwd() #current working directory
opj = os.path.join #more magic - OS PATH JOIN = opj, for windows and linux compatibility
folderWithTodaysDate = opj(cwd, daystamp) # folder to place all todays scans in