Skip to content

Instantly share code, notes, and snippets.

View textarcana's full-sized avatar

Noah Sussman textarcana

View GitHub Profile
@textarcana
textarcana / devops_borat.dat
Created March 7, 2017 09:10
The wisdom of Devops Borat (RIP, may Taichi Ohno himself carry him into Valhalla!) condensed in fortune cookie format without any @ messages included. Just the goofiest random shit :)
I remember very clear I cry when I finish volume 3 of Knuth.
%
I am work on CSS SQL.
%
First sign of depression in devops is denial: you start of ignore Nagios alert.
%
In devops language is not success unless is another language++.
%
In devops you are addict to graph if first thought after orgasm is send duration and intensity to Graphite.
%
@textarcana
textarcana / README.md
Last active March 18, 2024 11:21
This gist contains everything you need to install StatsD and Graphite on CentOS 6.3.

This gist contains everything you need to install StatsD and Graphite on CentOS 6.3. Unless I forgot something. If I did, shoot a reminder email to noah at one more bug dot com. tl;dr: womm, ymmv, yolo.

I (mostly) followed the steps shown in the EZUnix wiki

And I also referred back to this gist by Michael Grace

@textarcana
textarcana / exit-status-in-prompt.sh
Last active March 1, 2024 05:28
Show a green smiley or red frowny face to inidicate whether the last command exited with a good or bad exit status.
RESET="\[\017\]"
NORMAL="\[\033[0m\]"
RED="\[\033[31;1m\]"
GREEN="\[\033[32;1m\]"
SMILEY="${GREEN}:)${NORMAL}"
FROWNY="${RED}:(${NORMAL}"
EMOTE="if [ \$? = 0 ]; then echo \"${SMILEY}\"; else echo \"${FROWNY}\"; fi"
export PS1="${RESET}\n\`${EMOTE}\` \
\u@\h \
@textarcana
textarcana / git-log2json.sh
Last active March 1, 2024 05:26
Convert Git logs to JSON. The first script (git-log2json.sh) is all you need, the other two files contain only optional bonus features 😀THIS GIST NOW HAS A FULL GIT REPO: https://github.com/context-driven-testing-toolkit/git-log2json
#!/usr/bin/env bash
# Use this one-liner to produce a JSON literal from the Git log:
git log \
--pretty=format:'{%n "commit": "%H",%n "author": "%aN <%aE>",%n "date": "%ad",%n "message": "%f"%n},' \
$@ | \
perl -pe 'BEGIN{print "["}; END{print "]\n"}' | \
perl -pe 's/},]/}]/'
@textarcana
textarcana / centos-install-syntax-highlighting-in-less.sh
Last active May 1, 2023 01:01
2020 update: just use bat(1) instead!!!! bat has git integration and also can show invisible characters! OLD STUFF: How to enable syntax-highlighting in less. Use `less -N` (or type -N while in less) to enable line numbers. Based on the procedure described in http://superuser.com/questions/71588
# Enable syntax-highlighting in less.
# Last tested on CentOS 6.3.
#
# First, add these two lines to ~/.bashrc
# export LESSOPEN="| /usr/bin/src-hilite-lesspipe.sh %s"
# export LESS=" -R "
sudo yum -y install boost boost-devel ctags
wget http://springdale.math.ias.edu/data/puias/unsupported/6/x86_64/source-highlight-3.1.6-3.puias6.x86_64.rpm
@textarcana
textarcana / mac_xwindows_x11_xvfb_headless_firefox_howto.md
Last active April 19, 2023 01:53
Headless Selenium on CentOS 6.3 (Mac XWindows / X11 / Xvfb / Headless Firefox / Selenium howto)

XWindows for Headless Selenium

X Wing art by Paul Harckham

How to set up a Headless Selenium Testing environment for CentOS 6.3.

On your CentOS 6.3 host

Follow these steps to set up a CentOS 6.3 host to run headless Selenium tests with Firefox.

@textarcana
textarcana / ERC Robot configuration (IRC chat bot for Emacs).el
Created February 17, 2009 15:23
ERC Robot config - IRC bot for Emacs
;;;; ERC Robot
; See http://www.emacswiki.org/emacs/ErcRobot
;
; On first installing Aquamacs, do the following 4 steps to install erc-robot,
; then just paste this entire gist at the bottom of your .emacs
; cd ~/Library/Application\ Support/Aquamacs\ Emacs/
; mkdir site-lisp
; cd site-lisp
; wget http://www.emacswiki.org/emacs/erc-robot.el
@textarcana
textarcana / jq_recipes.sh
Created March 25, 2017 02:58
JQ Cookbook Examples by Noah Sussman
#!/usr/bin/env bash
set -x
# jq Recipes
# _ _____ _
# (_) | __ \ (_)
# _ __ _ | |__) | ___ ___ _ _ __ ___ ___
# | | / _` | | _ / / _ \ / __|| || '_ \ / _ \/ __|
# | || (_| | | | \ \| __/| (__ | || |_) || __/\__ \
@textarcana
textarcana / between_two_regex
Last active November 24, 2021 00:22
Between Two Regex: Find the text between two lines that match regexes.
#!/usr/bin/env perl
use strict;
use warnings;
use Carp;
use v5.10;
use constant FALSE => 1==0;
use constant TRUE => not FALSE;
# Given two regex that match a start and end line, return blocks of
# Silently shift the first line off input sent through a pipe.
all_but_first_line(){
# Read from a pipe
declare input=${1:-$(</dev/stdin)};
# Print all but the first line of input
tail -n +2 <<< "$input"
}