Skip to content

Instantly share code, notes, and snippets.

View gravitymonkey's full-sized avatar

gravitymonkey gravitymonkey

View GitHub Profile
@gravitymonkey
gravitymonkey / downloadAndExtractCensusTract.sh
Created October 11, 2011 17:05
download all the 2010 Census Tracts, extract from shapefiles to WKT
#requires ogr2ogr installed on local system
states=( 01 02 04 05 06 08 09 10 11 12 13 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 44 45 46 47 48 49 50 51 53 54 55 56 )
for state in ${states[@]}
do
#grab the file from the census server, use curlies cuz the underscores mess us up
curl http://www2.census.gov/geo/tiger/TIGER2010/TRACT/2010/tl_2010_${state}_tract10.zip > $state.zip
done
@gravitymonkey
gravitymonkey / gist:2406023
Created April 17, 2012 13:40
100 most common english words, as a java string array
String[] common = {"the","of","and","a","to","in","is","you","that","it","he","was","for","on","are","as","with","his","they","I","at","be","this","have","from","or","one","had","by","word","but","not","what","all","were","we","when","your","can","said","there","use","an","each","which","she","do","how","their","if","will","up","other","about","out","many","then","them","these","so","some","her","would","make","like","him","into","time","has","look","two","more","write","go","see","number","no","way","could","people","my","than","first","water","been","call","who","oil","its","now","find","long","down","day","did","get","come","made","may","part"};
@gravitymonkey
gravitymonkey / mcjs_1
Created April 23, 2012 17:56
javascript to do stuff in minecraft
println(MinecraftJavascript.plugin.getServer().getIp());
Verifying that +gravitymonkey is my blockchain ID. https://onename.com/gravitymonkey
# set it to python 2
rm /usr/bin/python
ln -s /usr/bin/python2.7 /usr/bin/python
python --version
yum update
# set it to python 3
rm /usr/bin/python
@gravitymonkey
gravitymonkey / gist:b1b5a604663a5c8acda0c47ab7c26604
Last active October 10, 2022 11:52
How to clean sensitive stuff out of a repo with BFG
# Check for secrets/passwords in a given repo https://github.com/dxa4481/truffleHog
truffleHog --regex --entropy=False https://github.com/gravitymonkey/your-service.git
# trufflehog is good, but there are a lot of tools for this kind of thing, maybe you want to use more than one!
# If it's got some bad stuff going on :( then you can fix it with BFG!
# before you do all of this, especially if you're going to edit old commits with BFG
# BE SURE TO LET THE USERS KNOW, so that they can keep the branch clean and know that they
# will need to update after this process is over
# list python licenses
sudo -s
pip3 install -U pip-licenses
exit
pip-licenses
# list javascript/npm licenses
npm install -g license-checker
license-checker --production --csv --direct
@gravitymonkey
gravitymonkey / terminal_color_stuff.sh
Last active June 20, 2020 20:18
Terminal App setup for diff colors per environment
# get .colors.csv from here, drop it in your ~ directory
# https://gist.github.com/avillafiorita/9e626ce370e1da6c6373/revisions
# add this to .bash_profile
# remember to source .bash_profile before you use it.
# Wrapping ssh command with extra functionality
ssh() {
@gravitymonkey
gravitymonkey / voice_app.py
Last active September 23, 2020 15:04
script to play with google's AIY voice device
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.