Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@bobbyno
bobbyno / clean_zoom_install.sh
Last active July 9, 2019 19:18
Zoom Zero-Day Vulnerability Fix for Mac Homebrew Users
#!/usr/bin/env bash
# Zoom Zero-Day Vulnerability Fix for Mac Homebrew Users
# @bobbyno based on
# https://medium.com/@jonathan.leitschuh/zoom-zero-day-4-million-webcams-maybe-an-rce-just-get-them-to-visit-your-website-ac75c83f4ef5
uninstall_zoom() {
# Use zap to completely uninstall Zoom
## Zap docs: https://github.com/Homebrew/homebrew-cask/blob/master/doc/cask_language_reference/stanzas/zap.md
## Zoom recipe: https://github.com/Homebrew/homebrew-cask/blob/7b1788d6e20471911094f0f2a857aac8e5c06d81/Casks/zoomus.rb
@bobbyno
bobbyno / str2sha
Created January 12, 2016 16:46
Generate a sha-256 digest for input
#!/usr/bin/env bash
set -eu
# Generate a SHA 256 digest for input
# usage: str2sha somayyeh
# => 393acf6c45aee507aeadfa71b49afdf82e4683ca6ff320bd3d06b878ddac93cf
echo $1 | shasum -a 256 | awk '{print $1}'
@bobbyno
bobbyno / sigma.min.js
Created December 28, 2015 17:32
sigma.js 1.0.3
/* sigma.js - A JavaScript library dedicated to graph drawing. - Version: 1.0.3 - Author: Alexis Jacomy, Sciences-Po Médialab - License: MIT */
(function(){"use strict";var a={},b=function(c){var d,e,f,g,h;b.classes.dispatcher.extend(this);var i=this,j=c||{};if("string"==typeof j||j instanceof HTMLElement?j={renderers:[j]}:"[object Array]"===Object.prototype.toString.call(j)&&(j={renderers:j}),g=j.renderers||j.renderer||j.container,j.renderers&&0!==j.renderers.length||("string"==typeof g||g instanceof HTMLElement||"object"==typeof g&&"container"in g)&&(j.renderers=[g]),j.id){if(a[j.id])throw'sigma: Instance "'+j.id+'" already exists.';Object.defineProperty(this,"id",{value:j.id})}else{for(h=0;a[h];)h++;Object.defineProperty(this,"id",{value:""+h})}for(a[this.id]=this,this.settings=new b.classes.configurable(b.settings,j.settings||{}),Object.defineProperty(this,"graph",{value:new b.classes.graph(this.settings),configurable:!0}),Object.defineProperty(this,"middlewares",{value:[],configurable:!0}),Object.defineP
@bobbyno
bobbyno / stub-web-server.py
Created November 30, 2015 05:47
Stub Python web server
#!/usr/bin/env python
"""
Very simple HTTP server in python.
Usage::
./dummy-web-server.py [<port>]
Send a GET request::
curl http://localhost
1 Small Target Areas
2 Location
3 Size Based on Population
4 Community Territory
5 Small Services Without Red Tape
6 Expansion
7 Entrance Locations
8 Parking
9 Arena Thoroughfare
10 Open to Street
@bobbyno
bobbyno / util.clj
Created October 29, 2015 13:36
Example of downloading an arbitrarily large table and saving to CSV
(ns etl.util
(:require [clojure.java.jdbc :as sql]
[clojure.java.io :as io]
[clojure.string :as str]
[clojure.data.csv :as csv]))
(defn seq-counter
"Calls callback after every n'th entry in sequence is evaluated.
Optionally takes another callback to call once the seq is fully evaluated."
([sqn n callback]
@bobbyno
bobbyno / program-hierarchy-edge-list.txt
Created July 24, 2015 12:51
archive program hierarchy from Software Tools as an edge list
archive help
archive getfns
archive update
archive table
archive extrac
archive delete
update replac
update addfil
update amove
replac gethdr
@bobbyno
bobbyno / gephi.conf
Created July 23, 2015 19:56
Gephi 0.8.2 config on Yosemite w/ Java 6: /Applications/Gephi.app/Contents/Resources/gephi/etc/gephi.conf
# ${HOME} will be replaced by user home directory according to platform
default_userdir="${HOME}/.${APPNAME}/0.8.2/dev"
default_mac_userdir="${HOME}/Library/Application Support/${APPNAME}/0.8.2/dev"
# options used by the launcher by default, can be overridden by explicit
# command line switches
default_options="--branding gephi -J-Xms512m -J-Xmx2048m -J-Xverify:none -J-Dsun.java2d.noddraw=true -J-Dsun.awt.noerasebackground=true -J-Dnetbeans.indexing.noFileRefres\
h=true -J-Dplugin.manager.check.interval=EVERY_DAY"
# for development purposes you may wish to append: -J-Dnetbeans.logger.console=true -J-ea
@bobbyno
bobbyno / makefile
Created October 3, 2014 18:33
makefile trickery
# Example of iterating over a list of projects
projects = $(shell find . -name Dockerfile -exec dirname {} \;)
graceful:
# Find all projects with a Dockerfile, then call the local-stop target
# on them before a vagrant halt. Makes faulty exits more explicit.
$(foreach p,$(projects), \
make -i -C $p local-stop ;)
vagrant halt
git clone git@github.com:tailrecursion/boot
cd boot
make boot
mv ./boot /usr/local/bin
echo '#!/usr/bin/env boot
#tailrecursion.boot.core/version "2.3.1"