Skip to content

Instantly share code, notes, and snippets.

View gnilchee's full-sized avatar

Greg Nilchee gnilchee

  • Evernote
  • Woodinville, WA
View GitHub Profile

Keybase proof

I hereby claim:

  • I am gnilchee on github.
  • I am gnilchee (https://keybase.io/gnilchee) on keybase.
  • I have a public key whose fingerprint is 560E C47C A317 9EB1 2464 B925 8B8E DC3B 39CE 1964

To claim this, I am signing this object:

@gnilchee
gnilchee / wifesnooping.py
Last active May 25, 2017 06:59
Fun script to print to console when device with matching mac address makes a DHCP request
#!/usr/bin/env python3
import logging
logging.getLogger("scapy.runtime").setLevel(logging.ERROR)
from scapy.all import *
from datetime import datetime, timedelta
from twilio.rest import Client
account_sid = "<twilio account sid>"
auth_token = "<twilio auth token>"
client = Client(account_sid, auth_token)
@gnilchee
gnilchee / Vagrantfile
Last active May 12, 2017 05:18
Vagrantfile to deploy a Nomad cluster with Consul
# -*- mode: ruby -*-
# vi: set ft=ruby :
$script = <<SCRIPT
# Installing required packages
yum -y update
yum install -y unzip curl wget vim-enhanced
# Download Nomad
NOMAD_VERSION=0.5.6
@gnilchee
gnilchee / acl_vault
Last active September 25, 2017 17:53
Creating ACL on Hashicorp Vault
# vault policy-write <policyname> production.hcl
# vault token-create -display-name="Optional Display Name" -ttl=0 -no-default-policy -policy="<policyname>"
@gnilchee
gnilchee / captcha.txt
Last active October 20, 2020 10:32
Convert captcha images so it can be read in tesseract
# apt-get install -y imagemagick tesseract-ocr tesseract-ocr-eng python-pip
# pip install Image pytesseract
# python convert.py 2 captcha.png captcha-clean.png
# convert captcha-clean.png -resize 500 captcha-clean-big.png
# tesseract -c tessedit_char_whitelist=abcdefghijklmnopqrstuvwxyz1234567890 -psm 7 captcha-clean-big.png output
# cat output.txt
@gnilchee
gnilchee / nicolascage.py
Last active April 23, 2017 01:30
Making sure John Smith Enjoys Cage quotes in Channel
from slackclient import SlackClient
from configparser import ConfigParser
import random, time
# Pulling in API Token
config = ConfigParser()
config.read('slack.conf')
SLACK_TOKEN = config['slack']['SLACK_API_TOKEN']
# channel: A3X4APECJ
@gnilchee
gnilchee / exec_cmd.go
Created April 5, 2017 04:35
Take command line args and execute in shell
package main
import (
"fmt"
"os"
"os/exec"
)
func main() {
var cmdName string = os.Args[1]
@gnilchee
gnilchee / cmd_args.go
Last active April 5, 2017 04:37
fun with command line arguments
package main
import (
"flag"
"fmt"
)
func main() {
var (
secureAddress = flag.Bool("secure", false, "Set https as protocol")
@gnilchee
gnilchee / commandline.go
Last active April 5, 2017 03:23
Quick example on how to shell out to commandline from go
package main
import (
"fmt"
"os"
"os/exec"
)
func main() {
cmdName := "ps"
@gnilchee
gnilchee / default.toml
Created March 19, 2017 08:29
Getting current conditions from openweathermanapi (pre-req: npm install --save coffee-script http config toml), place default.toml in config subdir
[openweathermap]
app_id = "__appid__"
zip_code = 98101