Skip to content

Instantly share code, notes, and snippets.

Avatar

Noah Sussman textarcana

View GitHub Profile
@textarcana
textarcana / git-log2json.sh
Last active Apr 27, 2021
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
View git-log2json.sh
#!/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 / devops_borat.dat
Created Mar 7, 2017
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 :)
View devops_borat.dat
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 / profanity_search.sh
Last active Mar 18, 2021
Profanity search command line tool.
View profanity_search.sh
#!/usr/bin/env bash
set -Eeuo pipefail
profane_regex=$(
perl -e '
use Bad::Words;
my $wordref = new Bad::Words;
my $updated = $wordref->remove(qw(
xxx
@textarcana
textarcana / spell_check.pl
Created Mar 18, 2021
Spell check a word on the command line.
View spell_check.pl
#!/usr/bin/env perl -w
# Suggest alternate spellings for a word
use strict;
use Text::Aspell;
my $speller = Text::Aspell->new;
my $word = qq{$ARGV[0]};
@textarcana
textarcana / mac_xwindows_x11_xvfb_headless_firefox_howto.md
Last active Mar 14, 2021
Headless Selenium on CentOS 6.3 (Mac XWindows / X11 / Xvfb / Headless Firefox / Selenium howto)
View mac_xwindows_x11_xvfb_headless_firefox_howto.md

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 / jq_recipes.sh
Created Mar 25, 2017
JQ Cookbook Examples by Noah Sussman
View jq_recipes.sh
#!/usr/bin/env bash
set -x
# jq Recipes
# _ _____ _
# (_) | __ \ (_)
# _ __ _ | |__) | ___ ___ _ _ __ ___ ___
# | | / _` | | _ / / _ \ / __|| || '_ \ / _ \/ __|
# | || (_| | | | \ \| __/| (__ | || |_) || __/\__ \
@textarcana
textarcana / Log into #zepinvest from Mibbit
Created Feb 19, 2009
Unbanning yourself on Freenode
View Log into #zepinvest from Mibbit
1. Go to Mibbit.com/chat
2. Fill in the nickname field with your nickname.
3. Leave #mibbit as the channel, DO NOT JOIN #zepinvest _yet._
4. Click the Go button and connect to Freenode. You should now be in the #mibbit channel.
5. Send the following message:
/msg nickserv identify PASSWORD
6. You should now see the message "You are now identified for <your nick>." If not, revisit step 5.
7. Send the following message:
/join #zepinvest
@textarcana
textarcana / install-jenkins-centos-6-3.sh
Last active Jun 3, 2020
How to install Jenkins on CentOS 6.3
View install-jenkins-centos-6-3.sh
sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo
sudo rpm --import http://pkg.jenkins-ci.org/redhat/jenkins-ci.org.key
sudo yum -y install jenkins
sudo yum -y install java-1.7.0-openjdk.x86_64
# Login as the jenkins user and specify shell explicity,
# since the default shell is /bin/false for most
# jenkins installations.
sudo su jenkins -s /bin/bash
@textarcana
textarcana / centos-install-syntax-highlighting-in-less.sh
Last active May 31, 2020
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
View centos-install-syntax-highlighting-in-less.sh
# 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
View array-permutation.js
/*jslint sloppy:true, white:true, vars:true, plusplus:true */
var permutation = function (collection){
var current,
subarray,
result = [],
currentArray = [],
newResultArray = [];
if (collection.length){