Skip to content

Instantly share code, notes, and snippets.

View allen-munsch's full-sized avatar
⁉️

James allen-munsch

⁉️
View GitHub Profile
@allen-munsch
allen-munsch / user.dconf
Created November 2, 2018 20:39
dconf dump / > ~/.config/dconf.backup && dconf load / < ~/.config/dconf.backup
[io/elementary/appcenter/settings]
window-x=410
reset-paid-apps=false
paid-apps=@as []
window-y=185
[org/gnome/settings-daemon/plugins/color]
night-light-schedule-automatic=false
night-light-schedule-to=3.0
night-light-schedule-from=5.0
@allen-munsch
allen-munsch / common_crawl.sh
Created October 13, 2018 16:14
simple common crawl curl bash example for wat, and warc
#!/bin/bash
function search_indexes() {
declare -a indexes=(/CC-MAIN-2018-39-index /CC-MAIN-2018-34-index /CC-MAIN-2018-30-index /CC-MAIN-2018-26-index /CC-MAIN-2018-22-index /CC-MAIN-2018-17-index /CC-MAIN-2018-13-index /CC-MAIN-2018-09-index /CC-MAIN-2018-05-index /CC-MAIN-2017-51-index /CC-MAIN-2017-47-index /CC-MAIN-2017-43-index /CC-MAIN-2017-39-index /CC-MAIN-2017-34-index /CC-MAIN-2017-30-index /CC-MAIN-2017-26-index /CC-MAIN-2017-22-index /CC-MAIN-2017-17-index /CC-MAIN-2017-13-index /CC-MAIN-2017-09-index /CC-MAIN-2017-04-index /CC-MAIN-2016-50-index /CC-MAIN-2016-44-index /CC-MAIN-2016-40-index /CC-MAIN-2016-36-index /CC-MAIN-2016-30-index /CC-MAIN-2016-26-index /CC-MAIN-2016-22-index /CC-MAIN-2016-18-index /CC-MAIN-2016-07-index /CC-MAIN-2015-48-index /CC-MAIN-2015-40-index /CC-MAIN-2015-35-index /CC-MAIN-2015-32-index /CC-MAIN-2015-27-index /CC-MAIN-2015-22-index /CC-MAIN-2015-18-index /CC-MAIN-2015-14-index /CC-MAIN-2015-11-index /CC-MAIN-2015-06-index /CC-MAIN-2014-52-index /CC-MAIN-2014-49
@allen-munsch
allen-munsch / test.py
Created October 5, 2018 16:36
requests 1 liner
import sys;import requests;from requests import Request as R;sys.stderr.write(requests.Session().send(type("A", (R,), {"__init__": R.__init__})("GET", "http://reddit.com/").prepare()).content)
@allen-munsch
allen-munsch / homebrew.mxcl.dnsmasq.plist
Last active December 3, 2020 18:54
Disable ad networks, disable firefox popups, disable other sketchy stuff : macosx
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>homebrew.mxcl.dnsmasq</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/opt/dnsmasq/sbin/dnsmasq</string>
<string>--keep-in-foreground</string>
@allen-munsch
allen-munsch / foxinsock.sh
Last active September 19, 2018 06:53
ssh socks forward proxy with firefox
#! /bin/bash
# usage: chmod +x ./foxinsock.sh && ./foxinsock.sh 123.456.789.012
export PROXY=$1
# assumes 1 default profile "*.default"
if [[ "$OSTYPE" == "darwin"* ]]; then
export FFPROFILE=/Users/$USER/Library/Application\ Support/Firefox/Profiles/*.default/
else
export FFPROFILE=$HOME/.mozilla/firefox/profiles/*.default
@allen-munsch
allen-munsch / OpenBazaar-moderator-policies.md
Created September 19, 2018 04:32
OpenBazaar-moderator-policies.md
@allen-munsch
allen-munsch / keybase.md
Created September 19, 2018 03:51
keybase.md

Keybase proof

I hereby claim:

  • I am allen-munsch on github.
  • I am enderplux (https://keybase.io/enderplux) on keybase.
  • I have a public key ASC8tNZdo3l4BAc4z4SOTRXzmC8aNoRvq3u3OU3ssn6G1Qo

To claim this, I am signing this object:

@allen-munsch
allen-munsch / example.sh
Created September 5, 2018 21:29
open display terraform graph in chrome
terraform graph | dot -Tsvg > graph.svg && /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome graph.svg
@allen-munsch
allen-munsch / docker-cleanup-resources.md
Created August 25, 2018 16:24 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

import math
import numpy
import numpy.random as nrand
"""
Note - for some of the metrics the absolute value is returns. This is because if the risk (loss) is higher we want to
discount the expected excess return from the portfolio by a higher amount. Therefore risk should be positive.
"""