Skip to content

Instantly share code, notes, and snippets.

View michaelBenin's full-sized avatar
🏠
Remote

Michael Benin michaelBenin

🏠
Remote
View GitHub Profile
@michaelBenin
michaelBenin / sort_requirements.py
Created July 20, 2014 21:48
Sort requirements pip files or requirements.txt for python dependencies
requirements_file = 'base.pip'
requirements = open(requirements_file, 'r')
content = requirements.read().splitlines()
content = list(set(content))
content.sort(key=lambda y: y.lower())
content = '\n'.join(content)
file = open('sorted_'+requirements_file, 'w')
file.write(content)
@michaelBenin
michaelBenin / psql-with-gzip-cheatsheet.sh
Created April 6, 2020 13:40 — forked from brock/psql-with-gzip-cheatsheet.sh
Exporting and Importing Postgres Databases using gzip
# This is just a cheat sheet:
# On production
sudo -u postgres pg_dump database | gzip -9 > database.sql.gz
# On local
scp -C production:~/database.sql.gz
dropdb database && createdb database
gunzip < database.sql.gz | psql database
@michaelBenin
michaelBenin / gist:4c068e050879dba4c19357be0f5dbd46
Created January 20, 2020 16:29
How to get Titan Key working on Ubuntu 16.04
# Found originally on: https://forum.mxlinux.org/viewtopic.php?t=53180
sudo apt update
sudo apt install libu2f-host0
sudo -v; wget https://github.com/Yubico/libu2f-host/raw/master/70-u2f.rules -O- | sudo tee /etc/udev/rules.d/70-yubico-u2f.rules
sudo udevadm control --reload-rules
sudo udevadm trigger
@michaelBenin
michaelBenin / gist:9181847
Created February 24, 2014 04:10
Python script to install Java, NodeJS, Ruby, Redis, NGINX, gem and npm packages, and git configuration
#!/usr/bin/env python
'''
This file is meant to setup your environment on AWS ec2 instance from a sample
config.json file.
'''
import os
import apt
import sys
@michaelBenin
michaelBenin / twitter.js
Created September 9, 2020 13:19
home page is twitters search for people you follow's tweets not garbage
document.querySelectorAll('[href="/home"]').forEach((el) => el.setAttribute('href', '/search?q=filter%3Afollows%20-filter%3Areplies&src=typed_query&f=live'))
### Keybase proof
I hereby claim:
* I am michaelbenin on github.
* I am michaelbenin (https://keybase.io/michaelbenin) on keybase.
* I have a public key ASAm521_UY1mXXRAlSjnjiB8Om13_Bp08MsI2aT7W2mHywo
To claim this, I am signing this object:
@michaelBenin
michaelBenin / corona_virus.json
Last active March 2, 2020 19:35
Corona Virus JSON
[
{
"fips": 1001,
"state": "AL",
"area_name": "Autauga County",
"confirmedCases": 0
},
{
"fips": 1003,
"state": "AL",
@michaelBenin
michaelBenin / gist:baa9a94a2353c0e35d71bfba7045e4ea
Created June 23, 2019 19:43 — forked from spalger/gist:6417923
Inject jQuery and lodash into the current tab via a bookmarklet. To use, just create a new bookmark and use this as the URL.
javascript: (function () {
var el = document.createElement('pre'),
b = document.getElementsByTagName('body')[0],
otherjQuery = false,
msg = '',
libs = [
function loadjQuery() {
if (typeof jQuery != 'undefined') {
showMsg('This page already using jQuery v' + jQuery.fn.jquery);
} else {
@michaelBenin
michaelBenin / utc_timezone.json
Created March 27, 2018 14:01
list of all utc timezones sorted
[
"MST7MDT",
"PST8PDT",
"Etc/GMT",
"EST5EDT",
"CST6CDT",
"Etc/GMT-1",
"Etc/GMT-8",
"Etc/GMT-7",
"Etc/GMT-6",