Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@markhuge
markhuge / gist:64d6f5094763e2a759dac489a9b3aeb5
Created February 17, 2022 07:22 — forked from lonnen/gist:3101795
git grep and git blame. two great tastes that taste great together
# from i8ramin - http://getintothis.com/blog/2012/04/02/git-grep-and-blame-bash-function/
# runs git grep on a pattern, and then uses git blame to who did it
ggb() {
git grep -n $1 | while IFS=: read i j k; do git blame -L $j,$j $i | cat; done
}
# small modification for git egrep bash
geb() {
git grep -E -n $1 | while IFS=: read i j k; do git blame -L $j,$j $i | cat; done
}
#!/usr/bin/env bash
#### StatsD data generator ####
STATSD_PORT=8125
STATSD_HOST=127.0.0.1
METRICS=("someService" "otherService" "foo.bar")
function generate_data {
@markhuge
markhuge / dress.cpp
Last active November 3, 2016 18:19
In case I die: Cynthia's staff
#include "FastLED.h"
#define LED_PIN 1
#define LED_TYPE WS2811
#define COLOR_ORDER GRB
#define NUM_LEDS 35
CRGB leds[NUM_LEDS];
#define MASTER_BRIGHTNESS 255
#include <Adafruit_NeoPixel.h>
#define PIN 2
#define Pixels 25
// Parameter 1 = number of pixels in strip
// Parameter 2 = Arduino pin number (most are valid)
// Parameter 3 = pixel type flags, add together as needed:
// NEO_KHZ800 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs)
// NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)
@markhuge
markhuge / README.md
Last active July 16, 2016 01:55
Generate random password with openssl

For the pedants (which I can totally be at times):

Base64 uses a reduced character set, so we're generating a less computationally complex string for something like hashcat to chew on, than say, the full ascii character set. Base64 also typically ends with = or == making the pattern even more predictable.

It's still better than hex, and orders of magnitude better than your initials + your grandma's birthday.

This was fucking annoying.

  1. Create GPT on device
  2. Create new partition
  3. Set type as ef00 (EFI)
  4. Write partition table
  5. mkfs.vfat -F32 /dev/< device >
  6. mount Windows10.iso to dir
  7. mount usb drive to dir
  8. copy files from ISO to USB drive
@markhuge
markhuge / tmux-cheatsheet.markdown
Created May 24, 2016 18:17 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@markhuge
markhuge / travis.yml
Last active August 29, 2015 14:09 — forked from tgrrtt/travis.yml
# Set up notification options
notifications:
email:
recipients:
- one@example.com
- other@example.com
# change is when the repo status goes from pass to fail or vice versa
on_success: change
on_failure: always
  • When this app is started with node index, a SIGINT (Ctrl+c) is caught by the app and it continues running.
  • When this app is started with npm start, a SIGINT causes npm to exit, detaching the still running node process from the foreground.
@markhuge
markhuge / chef.template.erb
Last active August 29, 2015 14:07
Node.js app Upstart Script example
# <%= @app_name %>.conf
# This file is generated by Chef for <%= node[:fqdn] %>
description "<%= @app_name %>"
start on filesystem or runlevel [2345]
stop on runlevel [06]
expect fork
respawn