Skip to content

Instantly share code, notes, and snippets.

View thehar's full-sized avatar

Harley Alaniz thehar

View GitHub Profile
@thehar
thehar / keybase.md
Last active February 23, 2016 17:17

Keybase proof

I hereby claim:

  • I am thehar on github.
  • I am thehar (https://keybase.io/thehar) on keybase.
  • I have a public key whose fingerprint is 4BA7 FB72 7CC7 FF45 AF7D 05FF 94C6 B6A6 80AD A1A4

To claim this, I am signing this object:

@thehar
thehar / remote_pairing_setup.md
Created December 22, 2015 18:06 — forked from alvarobp/remote_pairing_setup.md
Setting up a remote pair station with SSH + TMUX and/or Reverse SSH Tunnel

Disclaimer: The following examples try to give an overview of the process followed in different scenarios. Some commands were actually written from memory. Some tools might exist simplifying all this. Furthermore, I'm no expert so if anyone ever reads this and knows any improvement, please let me know.

Case 1: Direct access to Pairing Station

Given that the Guest User can access the Pairing Station directly, either because the station is publicly available or because NAT port forwarding can be used, there's only one thing we need to do, give ssh access to the Guest User by adding his ssh public key to our Local User (pair) .ssh/authorized_keys file.

The local user would open up a tmux session with

tmux new-session -s pairing
server {
listen 80 default deferred;
client_max_body_size 4G;
server_name graphite;
keepalive_timeout 5;
# path for static files
root /opt/graphite/webapp/content;
index index.html;

Keybase proof

I hereby claim:

  • I am thehar on github.
  • I am thehar (https://keybase.io/thehar) on keybase.
  • I have a public key whose fingerprint is 41D0 40A0 290E AC6F F346 7301 E300 2B3E 5644 7AB4

To claim this, I am signing this object:

#!/usr/bin/env /opt/sensu/embedded/bin/ruby
require 'rubygems' if RUBY_VERSION < '1.9.0'
require 'sensu-plugin/metric/cli'
require 'socket'
class DiskGraphite < Sensu::Plugin::Metric::CLI::Graphite
option :scheme,
:description => "Metric naming scheme, text to prepend to metric",
@thehar
thehar / .kitchen.yml
Last active December 15, 2017 14:05
Add forwarded port to kitchen yaml
---
driver:
network:
- ["forwarded_port", {guest: 80, host: 8080}]
- ["private_network", {ip: "192.168.33.33"}]
@thehar
thehar / gist:8834683
Created February 5, 2014 22:33
graphite migrate
#!/bin/bash
metric=$1
metric_file=`echo $1|sed 's/\./\//g'`.wsp
server=servername
port=2003
# git clone https://github.com/graphite-project/whisper.git
# to the following directory for whisper tools
bindir=/usr/local/bin
storage=/opt/graphite/storage
begin
require 'ruby-shadow'
user_pw = u['password']
rescue LoadError
user_pw = nil
end
# Create user object.
# Do NOT try to manage null home directories.
user u['id'] do
@thehar
thehar / gist:5961055
Created July 9, 2013 20:36
harley@ticketfly.com GPG Public Key
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG/MacGPG2 v2.0.19 (Darwin)
Comment: GPGTools - http://gpgtools.org
mQINBFHIvQUBEADXqRjqTJOfyp2Ai2MN/qypFTs+G2YhIBQXCIXNCeRkUU5CFZ+6
g0w9u+GeI0rOMh1dV4ic3y9z2rBz04E0KkAJTUvRrd42nPK6Mzwfi+QDoqEhEMZW
YCTGz0vlufASvjjUB1TorX7uiAVYw43LfskSt8nmCqLUSqPAp6M8v4G6CKnBout4
HG/mqHppq6Oki4ffyPttwHTvQTEMPCQwTIxewsLqKkSb5LWIPG9TUkq2164TmMne
TFIagvJCrHQG/MgaDmCo31DacTufbdE57rvnWnZhJyQtfGk7SLL3BwZlznDGYPJD
p57kTlnTBJxhm5U3cK7aiYS//ydjYYp1ktCjiTuzkDoDcokW5RsIybh2LYEuvdD4
@thehar
thehar / gist:5854817
Created June 24, 2013 23:59
Workflow for nagios multi-opsen
1. Bare repo lives as a bare repo hosted up by #{web_server} in /srv/nagios.git
2. Clone it over to /etc/nagios3
3. Write a script to make magical git pull --rebase origin master and merge local changes with commits
4. Does a verbose check of nagios configs and halts script if 1 not 0.
5. Happiness in nagios configs after -v restart it.