Skip to content

Instantly share code, notes, and snippets.

Avatar
🧑‍💻

Sam Bauers sambauers

🧑‍💻
  • Scentre Group
  • Sydney, Australia
  • Twitter @sambauers
View GitHub Profile
@sambauers
sambauers / circleci-parallel.sh
Last active Feb 20, 2019
Splits tests across multiple Circle CI nodes manually.
View circleci-parallel.sh
#!/bin/bash
# Add this script to your code in the root directory, then add the following to your circle.yml
# test:
# override:
# - ./circleci-parallel.sh:
# parallel: true
while getopts ":hp:" opt; do
case $opt in
@sambauers
sambauers / github-2fa-nag.sh
Last active Oct 4, 2016
This script allows you to nag your organisation members to turn on two factor authentication (2FA) on GitHub.
View github-2fa-nag.sh
#!/usr/bin/env bash
# 2FA Nag
# This script allows you to nag your organisation members to turn on two factor
# auth on GitHub. It grabs all organisation members, determines which have 2FA
# disabled and enabled, and assigns/deassigns them from a preset issue on a
# repository and adds comments once a week in order to nag them to do it. The
# script should be run once per day via a cron job.
@sambauers
sambauers / toolbar-slip.html
Last active Aug 29, 2015
Add a solid rainbow background to the OS X Yosemite Safari toolbar (on scroll)
View toolbar-slip.html
<!DOCTYPE html>
<html>
<head>
<style>
.toolbar-slip {
position: fixed;
top: -600px;
left: 0;
height: 600px;
width: 100%;
@sambauers
sambauers / kill-jira-watchlist.php
Last active Aug 29, 2015
Grabs all your watched JIRAs and removes your watch on them… very slowly.
View kill-jira-watchlist.php
<?php
$username = urlencode('your_jira_username');
$password = urlencode('your_jira_password');
$jiraurl = 'https://your_jira_url'; // e.g. https://redant.jira.com
$json = file_get_contents("$jiraurl/rest/api/latest/search?os_username=$username&os_password=$password&jql=issuekey%20in%20watchedIssues()&maxResults=1000");
if ( $json ) {
$data = json_decode($json);
@sambauers
sambauers / .profile-digr.sh
Last active Jul 12, 2016
Does a reverse lookup on a domain name's IP address.
View .profile-digr.sh
# Add this file to your home directory then include it in ~/.profile using `. ~/.profile-digr.sh`
digr() {
for arg; do
echo -e "\033[38;5;244m*\033[0m $arg";
for DIGR_IP in $(dig +short $arg); do
echo -e " \033[38;5;244m↳ \033[0m" $DIGR_IP;
done;
if [[ "$DIGR_IP" != "" ]]; then
for DIGR_PTR in $(dig +short -x $DIGR_IP); do
@sambauers
sambauers / .profile-emoji-me.sh
Last active Nov 19, 2021
Adds random emoji to your terminal prompt on Mac OS X, because emoji.
View .profile-emoji-me.sh
# Add this file to your home directory then include it in ~/.profile using `. ~/.profile-emoji-me.sh`
# These will show up in an emoji compatible terminal
ME_EMOJI=(🐶 🐱 🐭 🐹 🐰 🦊 🐻 🐼 🐨 🐯 🦁 🐮 🐷 🐸 🐵 🐙);
RANDOM_ME_EMOJI=${ME_EMOJI[$((RANDOM%14))]};
export PS1="\h:\W \u $RANDOM_ME_EMOJI ";
export PROMPT_COMMAND='update_terminal_cwd; echo -ne "\033]0;${RANDOM_ME_EMOJI##*/}\007"';
@sambauers
sambauers / .profile-emoji-digr.sh
Last active Apr 6, 2017
Does a reverse lookup on a domain name's IP address and adds emoji, because emoji.
View .profile-emoji-digr.sh
# Add this file to your home directory then include it in ~/.profile using `. ~/.profile-emoji-digr.sh`
digr() {
# These will show up in an emoji compatible terminal
DIGR_EMOJI=(🍏 🍎 🍐 🍊 🍋 🍌 🍉 🍇 🍓 🍈 🍒 🍑 🍍 🥝 🥑 🍅);
for arg; do
RANDOM_DIGR_EMOJI=${DIGR_EMOJI[$((RANDOM%14))]};
echo "${RANDOM_DIGR_EMOJI##*/} $arg";
for DIGR_IP in $(dig +short $arg); do
echo -e " \033[38;5;244m↳ \033[0m" $DIGR_IP;
@sambauers
sambauers / memcache_empty.sh
Last active Aug 2, 2016
Empties memcached completely, including flushed keys.
View memcache_empty.sh
#!/usr/bin/env bash
# Edit these to your liking
IP="127.0.0.1";
PORT="11211";
# Warn the user
printf "This will flush all keys and delete them as well. This action can NOT be reversed.\\n";
printf "Are you sure you want to do this?\\n";
select answer in "Yes" "No" ; do