Skip to content

Instantly share code, notes, and snippets.

View chrislennon's full-sized avatar

Chris Lennon chrislennon

  • Amsterdam, The Netherlands
View GitHub Profile
@chrislennon
chrislennon / Dockerfile
Last active November 27, 2018 18:34
Monkey patch for pokeapi Dockerfile
# Build the app on top of Ubuntu
FROM ubuntu:xenial
# RUN echo 'deb http://ppa.launchpad.net/chris-lea/redis-server/ubuntu xenial main' > /etc/apt/sources.list.d/redis-server.list && apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C7917B12
# Patch and Install Dependencies
RUN apt-get -y update && apt-get -y install software-properties-common build-essential git make libpq-dev python3-pip python3-dev postgresql postgresql-contrib redis-server \
&& apt-get -y clean \
&& pip3 install --upgrade pip \
&& ln -s /usr/bin/python3 /usr/local/bin/python
@chrislennon
chrislennon / pokemonTypes.json
Created October 27, 2018 15:01
pokemonTypes
{
"pokemon": {
"1": {
"name": "bulbasaur",
"types": ["poison", "grass"]
},
"2": {
"name": "ivysaur",
"types": ["poison", "grass"]
},
@chrislennon
chrislennon / tor-socks-checks.sh
Created May 27, 2018 17:27
Commands for building touchbar integrations on top of
#!/bin/bash
# Yes/No
# These commands are incorrect (need SOCKS see below), kept for history
PROXY_STATUS="$(networksetup -getwebproxy 'Wi-Fi' | grep Enabled: -m1 | cut -d ' ' -f2)"
SECURE_STATUS="$(networksetup -getsecurewebproxy 'Wi-Fi' | grep Enabled: -m1 | cut -d ' ' -f2)"
# SOCKS status
SOCKS_STATUS="$(networksetup -getsocksfirewallproxy 'Wi-Fi' | grep Enabled: -m1 | cut -d ' ' -f2)"
#1 False, 2 True
TOR_SERVICE_STATUS="$(launchctl list | grep homebrew.mxcl.tor | tee >(wc -l) | awk 'END{print NR}')"
TOR_CON_STATUS="$(lsof -nP -i4TCP:9050 | grep LISTEN | tee >(wc -l) | awk 'END{print NR}')"
@chrislennon
chrislennon / reddit-import.py
Created May 27, 2018 09:32
quick method of importing subreddits
import praw
import pprint
import json
filename = 'user.subs'
user_agent = 'test-py'
client_id='xxx'
client_secret="xxx"
username='xxx'
password='xxx'
@chrislennon
chrislennon / reddit-dump.py
Created May 27, 2018 09:30
quick dump of subreddits to file
import praw
import pprint
import json
filename = 'user.subs'
user_agent = 'test-py'
client_id='xxx'
client_secret="xxx"
username='xxx'
password='xxx'
{
"GetServicesIntent" : {
"session": {
"new": false,
"sessionId": "SessionId.<session_id>",
"application": {
"applicationId": "amzn1.ask.skill.<skill_id>"
},
"attributes": {},
"user": {

Keybase proof

I hereby claim:

  • I am chrislennon on github.
  • I am chrislennon (https://keybase.io/chrislennon) on keybase.
  • I have a public key whose fingerprint is 90B3 7670 0E27 E40E 4151 7CD4 F9E4 3280 401D 6886

To claim this, I am signing this object: