Skip to content

Instantly share code, notes, and snippets.

Investigating the Unexplainable

Andrew Martin sublimino

Investigating the Unexplainable
View GitHub Profile
sublimino /
Created August 25, 2020 08:17
Useful gcloud aliases


gcloud-whoami () 
    gcloud auth list --filter=status:ACTIVE --format="value(account)"

what account/project/zone etc

gcloud-get-user () { 
sublimino / http-get.nse
Last active January 23, 2022 14:51
View http-get.nse
-- original at
description = [[
Issues an arbitrary HTTP GET request
-- @usage
-- nmap --script http-get [--script-args http-get.path=/status] -p <port> <host>
-- @args http-get.path The path to request (defaults to /)
clone () {
local SOURCE="${1}";
local REPO=$(echo "${1//*\//}" | sed -E 's#(\.git|/)$##');
local TARGET_PARENT_DIR="${2:-.}";
if [[ $(echo "${SOURCE}" | grep -o '[:@/]*' | wc -l) -lt 2 ]]; then
printf "No domain for ${SOURCE}. Iterating providers...\n\n";
for DOMAIN in;
sublimino / polyglot.cmd
Created March 5, 2018 09:01 — forked from jdarpinian/C and shell polyglot.cmd
A polyglot file which is simultaneously valid in C, Unix shell, and Windows batch. Builds and runs itself on Windows, Linux, and Mac.
View polyglot.cmd
#if 0 // 2>NUL & GOTO :startbatch
COMPILER_OPTIONS="-g -Wall -Wextra --std=c99 -O1";THIS_FILE="$(cd "$(dirname "$0")"; pwd -P)/$(basename "$0")";OUT_FILE="/tmp/build-cache/$THIS_FILE";mkdir -p "$(dirname "$OUT_FILE")";test "$THIS_FILE" -ot "$OUT_FILE" || $(which clang || which gcc) $COMPILER_OPTIONS -xc "$THIS_FILE" -o "$OUT_FILE" || exit;exec "$OUT_FILE" "$@"
@echo off
setlocal enableextensions enabledelayedexpansion
md %TEMP%%~p0 2>NUL
rem Use xcopy to test if this file is newer than the cached executable.
for /f %%i in ('xcopy %0 %TEMP%%~pnx0.exe /D /Y /Q') do set copied=%%i
if "%copied:~0,1%" neq "0" (
rem Search for Visual Studio env vars. These are set globally if VS <2017 is installed.
sublimino / gist:a854b3bf9ac1cb94f640cd966c987f69
Last active July 13, 2022 13:50
tmux, terminator, and copyq
View gist:a854b3bf9ac1cb94f640cd966c987f69

This has caused a not-inconsiderable amount of trouble! But finally, I've fixed copypasta:


  1. enable global -> smart copy (only affects mapping of ctl-c if text selected)
  2. Disable profile -> copy on selection


  1. store clipboard
  2. store text using mouse
  3. ^^paste clipboard with mouse^^
sublimino / jobs-link-to-console
Last active May 16, 2017 13:49
Tampermonkey: Jenkins Pipeline jobs-link-to-console
View jobs-link-to-console
sublimino /
Last active May 1, 2017 15:48
set -euo pipefail
ARCHITECTURES=$(printf "$(
dpkg --print-architecture
dpkg --print-foreign-architectures
NS_ARCH_OPTIONS=$(echo "${ARCHITECTURES}" | sed -E 's#(.*)#--arch \1#' | tr '\n' ' ')

Keybase proof

I hereby claim:

  • I am sublimino on github.
  • I am sublimino ( on keybase.
  • I have a public key whose fingerprint is 191A 7D18 C6C8 276B 0073 4CC2 FBEE 35E8 1E87 F847

To claim this, I am signing this object:

sublimino /
Last active January 23, 2022 14:50 — forked from wsargent/
Docker cheat sheet

Docker Cheat Sheet


Why Should I Care (For Developers)

"Docker interests me because it allows simple environment isolation and repeatability. I can create a run-time environment once, package it up, then run it again on any other machine. Furthermore, everything that runs in that environment is isolated from the underlying host (much like a virtual machine). And best of all, everything is fast and simple."

TL;DR, I just want a dev environment

sublimino / default.vcl
Created June 9, 2012 03:17
Wordpress-optimised VCL configuration file for varnish.
View default.vcl
# This is a Wordpress-optimised VCL configuration file for varnish.
backend default {
.host = "";
.port = "8080";
.connect_timeout = 600s;
.first_byte_timeout = 600s;
.between_bytes_timeout = 600s;
.max_connections = 800;