Skip to content

Instantly share code, notes, and snippets.

View omundy's full-sized avatar

Owen Mundy omundy

View GitHub Profile
@omundy
omundy / analog-read-all.js
Created May 26, 2012 13:52
Use bonescript and node.js to read from all analog pins on a BeagleBone
/*
* analog-read-all.js
* Use bonescript and node.js to read from all analog pins on a BeagleBone
* Found in the wild:
* https://groups.google.com/forum/#!msg/beagleboard/rftH6aqyR5k/n7jQbCNAL3YJ
*/
var bb = require('./bonescript');
var sys = require('util');
var fs = require('fs');
@omundy
omundy / kill_sophos
Last active January 30, 2020 00:27
KILL_SOPHOS
#!/bin/bash
# orginal https://gist.github.com/lukebussey/70fe3b245c7b55fa41300670d2698e54
# make file and run sudo chmod +x kill_sophos
# delete all files
sudo rm -R /Library/Sophos*
sudo rm -R /Library/Application\ Support/Sophos*
sudo rm -R /Library/Preferences/com.sophos.*
sudo rm /Library/LaunchDaemons/com.sophos.*
@omundy
omundy / index.html
Created October 30, 2017 13:11
A Simple d3 Network Graph
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="http://d3js.org/d3.v2.min.js?2.9.3"></script>
<style>
.link {
stroke: #aaa;
}
@omundy
omundy / convert_to_csv.php
Last active October 25, 2017 13:04
Convert a Google Takeout JSON file to CSV table format
<?php
/**
* Convert a Google Takeout JSON file to CSV table format
* @author Owen Mundy owenmundy.com
* Note: Make sure PHP has enough memory allotted on your system to handle large strings
* Instructions:
* 1. Download PHP file and place next to your JSON file
* 2. Rename string pointing to your data file
* 3. On command line run $ php index.php
@omundy
omundy / analog_test_simple.py
Created May 15, 2012 02:12
Simplified analog input test file for PyBBIO
# analog_test_simple.py by Owen Mundy
# modified from:
# analog_test.py - Alexander Hiam
# Testing analogRead()
#
# *** NOTICE ***
# The maximum ADC input voltage is 1.8v,
# applying greater voltages will likely cause
# permanent damage to the ADC module!
#
@omundy
omundy / NLTK POS Tagging.ipynb
Created December 10, 2016 14:34
NLTK POS Smell Tagging Examples
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import os
cmd = 'raspistill -n -t 2000'
cmd += time.strftime(" -o /home/pi/python_scripts/py-picam/images/p_%Y%m%d_%H%M%S") +'.jpg'
os.system(cmd)
@omundy
omundy / fb_rank_bookmarklet
Last active December 28, 2015 03:39
How Facebook ranks all your friends bookmarklet (modified from Arjun Sreedharan's)
javascript: (function () {
function creator(e, t, n) {
var r = document.createElement(n);
var att = document.createAttribute("style");
att.value = "max-width:120px";
r.setAttributeNode(att);
var i = document.createTextNode(t);
r.appendChild(i);
e.appendChild(r);
}
@omundy
omundy / analog-test-all-pins.py
Created May 17, 2012 15:10
Print reading from each analog-in pin on a BeagleBone using mrBBIO
# analog-test-all-pins.py - Owen Mundy
# Print reading from each analog-in pin on a BeagleBone
# with a short delay between each
# using mrBBIO by Matt Richardson:
# https://github.com/mrichardson23/mrBBIO
# This example is in the public domain
from mrbbio import *
def setup():
@omundy
omundy / analog-test-all-pins.py
Created May 17, 2012 12:46
BeagleBone test and print all analog-in pins
# analog-test-all-pins.py - Owen Mundy
# Print reading from each analog-in pin on a BeagleBone
# with a short delay between each
# This example is in the public domain
import os,time
i = 1
while(True):
os.system("cat /sys/bus/platform/devices/tsc/ain" + str(i))