Skip to content

Instantly share code, notes, and snippets.

View evadnoob's full-sized avatar

David Boon evadnoob

  • Auth0
  • Seattle, WA
View GitHub Profile
@evadnoob
evadnoob / pre-commit.sh
Created August 2, 2017 15:42 — forked from czardoz/pre-commit.sh
Git pre-commit hook that checks for AWS keys
#!/usr/bin/env bash
if git rev-parse --verify HEAD >/dev/null 2>&1
then
against=HEAD
else
# Initial commit: diff against an empty tree object
EMPTY_TREE=$(git hash-object -t tree /dev/null)
against=$EMPTY_TREE
fi
@evadnoob
evadnoob / The Technical Interview Cheat Sheet.md
Created July 9, 2016 14:16 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
@evadnoob
evadnoob / colortrans.py
Created November 25, 2015 21:09 — forked from MicahElliott/colortrans.py
Convert values between RGB hex codes and xterm-256 color codes.
#! /usr/bin/env python
""" Convert values between RGB hex codes and xterm-256 color codes.
Nice long listing of all 256 colors and their codes. Useful for
developing console color themes, or even script output schemes.
Resources:
* http://en.wikipedia.org/wiki/8-bit_color
* http://en.wikipedia.org/wiki/ANSI_escape_code
@evadnoob
evadnoob / sp
Created October 26, 2015 11:21 — forked from wandernauta/sp
sp is a command-line client for Spotify's dbus interface. Play, pause, skip and search tracks from the comfort of your command line.
#!/bin/bash
#
# This is sp, the command-line Spotify controller. It talks to a running
# instance of the Spotify Linux client over dbus, providing an interface not
# unlike mpc.
#
# Put differently, it allows you to control Spotify without leaving the comfort
# of your command line, and without a custom client or Premium subscription.
#
@evadnoob
evadnoob / pgbouncer
Last active September 16, 2015 18:21 — forked from therealmarv/pgbouncer
/etc/init.d/pgbouncer for Ubuntu 12.04
#!/bin/bash
### BEGIN INIT INFO
# Provides: pgbouncer
# Required-Start: $syslog $remote_fs
# Required-Stop: $syslog $remote_fs
# Should-Start: postgresql
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: start pgbouncer
@evadnoob
evadnoob / monitor.rb
Last active August 29, 2015 14:24 — forked from lfittl/monitor.rb
# Copyright (c) 2014 Lukas Fittl <[email protected]>
#
# Released in the public domain - fork as you wish.
require 'rubygems'
require 'mixlib/cli'
require 'pg'
require 'pg_query'
require 'curses'
# Ubuntu upstart file at /etc/init/mms-agent.conf
description "MongoDB Monitoring Service (MMS) Agent"
pre-start script
mkdir -p /var/log/mms-agent/
end script
post-stop script
echo "$(date +'%Y-%m-%d %T,000') INFO mms-agent stopped" >> /var/log/mms-agent/agent.log
@evadnoob
evadnoob / gist:8983775
Last active August 29, 2015 13:56 — forked from doctyper/gist:1411283
ipfw, condition network to be slow, even on localhost
# enable
sudo ipfw pipe 1 config bw 50KBytes/s delay 100ms
sudo ipfw add 1 pipe 1 src-port 80
sudo ipfw add 2 pipe 1 dst-port 80
# disable
sudo ipfw delete 1
sudo ipfw delete 2
package com.example
import spray.servlet.Servlet30ConnectorServlet
import spray.servlet.Initializer
import org.eclipse.jetty.server.Server
import org.eclipse.jetty.server.bio.SocketConnector
import org.eclipse.jetty.webapp.WebAppContext
import org.eclipse.jetty.servlet.ServletContextHandler
object JettyServer {
@evadnoob
evadnoob / es.sh
Last active December 19, 2015 00:39 — forked from rajraj/es.sh
#sudo yum update
#sudo yum install java-1.7.0-openjdk.i686 -y
# java-1.7.0-openjdk-devel.x86_64
# sudo alternatives --config java
rm -rf elasticsearch-*/
curl -L https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.0.1.tar.gz| tar xzv
ES_DIR=`ls -1d elasticsearch*/ | sed -n 1p`
echo $ES_DIR
sudo mkdir -p /usr/local/elasticsearch/