Skip to content

Instantly share code, notes, and snippets.

View flowchartsman's full-sized avatar
🏠
Working from home

Andy Walker flowchartsman

🏠
Working from home
View GitHub Profile
@flowchartsman
flowchartsman / spooler.go
Last active August 29, 2015 14:19 — forked from burke/spooler.go
// package spooler implements a disk-persistent queue.
//
// Spooler uses MDB (LMDB) to implement a queue of byteslices. Its intended usecase
// is to enqueue work items received by a service before later working them off.
// Note that Spooler only flushes to disk up to once every 25ms. As a result,
// if the process or machine crashes unexpectedly, the most recent 25ms of work
// can be lost. This decision effectively increases throughput by 10,000%,
// but makes spooler unsuitable for jobs that absolutely cannot be allowed to fail
// under any circumstances.
package spooler
[Unit]
Description=Internet Routing Registry daemon
After=network.target
[Service]
Type=simple
ExecStart=/usr/sbin/irrd -m
[Install]
WantedBy=multi-user.target
@flowchartsman
flowchartsman / web2png.py
Last active September 1, 2015 23:20 — forked from PierrickKoch/web2png.py
Takes snapshot of full webpages using Webkit and Qt4
#!/usr/bin/env python
"""
Takes snapshot of full webpages using Webkit and Qt4
usage:
python web2png.py URL [FILE]
example:
python web2png.py http://python.org out.png
see:
http://riverbankcomputing.com/static/Docs/PyQt4/html/qwebview.html#load
@flowchartsman
flowchartsman / git_move.sh
Created October 8, 2015 15:11
moves a folder from one git repo into another repo with history intact
#!/usr/bin/env bash
# Usage:
# ./git_move.sh git@repo_site.com:/my_repo.git origin/folder/path/ /destination/repo/path/ new/folder/path/
repo=$1
folder=$2
dest_repo=$3
dest_folder=$4
clone_folder='__git_clone_repo__'
@flowchartsman
flowchartsman / pr.md
Created April 4, 2016 03:22 — forked from piscisaureus/pr.md
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

Keybase proof

I hereby claim:

  • I am alaska on github.
  • I am alaska (https://keybase.io/alaska) on keybase.
  • I have a public key ASA6ZY8rNwnzkpJ1KP4zWYQdmPXnNCRrV2dKMLzP3e2b3wo

To claim this, I am signing this object:

@flowchartsman
flowchartsman / dep.md
Created December 7, 2017 20:07 — forked from subfuzion/dep.md
Concise guide to golang/dep

Overview

This gist is based on the information available at golang/dep, only slightly more terse and annotated with a few notes and links primarily for my own personal benefit. It's public in case this information is helpful to anyone else as well.

I initially advocated Glide for my team and then, more recently, vndr. I've also taken the approach of exerting direct control over what goes into vendor/ in my Dockerfiles, and also work from isolated GOPATH environments on my system per project to ensure that dependencies are explicitly found under vendor/.

At the end of the day, vendoring (and committing vendor/) is about being in control of your dependencies and being able to achieve reproducible builds. While you can achieve this manually, things that are nice to have in a vendoring tool include:

@flowchartsman
flowchartsman / Gofromsource.md
Last active September 26, 2019 17:44
Building Go from source!

Installing Go

I like to install my Go from source so I can mess around and stay up to date. Here's how I do so.

I prefer an installation directory in $HOME/opt. I like putting it here so that it's completely within my home directory, but feel free to change it.

For the purposes of these instructions, I'm assuming OSX/*nix (Windows instructions shortly).

Required Software

MacOS: homebrew

@flowchartsman
flowchartsman / kali_osx_persistence_wifi.md
Last active June 14, 2023 13:00 — forked from widdowquinn/kali_osx_persistence_wifi.md
Kali Linux Live USB with encrypted persistence and wireless on Macbook Pro/Air without networking.

Kali Linux Bootable USB with Persistence and Wireless on OSX

Tutorials for running live Kali on OSX often require you have networking on your laptop to apt install the drivers, but without an ethernet adapter you're not going to be able to do that, so this tutorial will cover a method of doing this manually, using another thumbdrive or external data source.

Download the appropriate Kali Linux .iso

I used a 64 bit .iso image, downloaded via HTTP.

package main
import (
"net/http"
"github.com/gorilla/mux"
)
// example of a basic handler
func fooHandler(w http.ResponseWriter, r *http.Request) {