Skip to content

Instantly share code, notes, and snippets.

🤖
☯️ ☮️ 🐶 🐾 👾 🎮 🎼 🎶 🕺 🎧 🌻 🌱 🏞 🌊 🌔 🌎

nicerobot nicerobot

🤖
☯️ ☮️ 🐶 🐾 👾 🎮 🎼 🎶 🕺 🎧 🌻 🌱 🏞 🌊 🌔 🌎
Block or report user

Report or block nicerobot

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@nicerobot
nicerobot / render.sh
Last active Oct 5, 2019
Python one-liner Jinja2 Template renderer
View render.sh
python -c 'import os, sys, jinja2; print(jinja2.Template(sys.stdin.read()).render(**os.environ))'
@nicerobot
nicerobot / ssh-tgzx
Last active Sep 25, 2019
Self-extracting, encrypted tarballs using SSH public keys from GitHub. Because https://ssh-vault.com is awesome but it requires an installation.
View ssh-tgzx
#!/bin/bash
(( ${#} >= 3 )) || { echo "usage: $(basename ${0}) github-username archive-file [files | directories]"; exit 1; }
exec >${2}
zero='${0}'
cat <<SCRIPT
#!/usr/bin/env bash
usage() {
echo "usage: bash ${zero} identity-file"
@nicerobot
nicerobot / update.sh
Last active May 25, 2019
Update tmuxinator
View update.sh
#!/usr/bin/env bash
# This tries to make sure that tmuxinator is always installed into local GEM_PATHS
gems=$(cd $(dirname $(readlink ${0} || echo .)) >/dev/null 2>&1; pwd -P)
mkdir -p ${gems}
cd ${gems}
gem install --user-install tmuxinator
[[ -L .latest ]] && rm ./.latest
install_dir=$(gem env | awk '/USER INSTALLATION DIRECTORY/ {print $NF}')
ln -s ${install_dir#${gems}/} .latest
[[ -L bin ]] || ln -s .latest/bin
@nicerobot
nicerobot / locks.sql
Created Apr 21, 2019 — forked from varunchitale/locks.sql
Get a list of queries and their details that hold locks over relations in a dB.
View locks.sql
SELECT
blocked_locks.pid AS blocked_pid,
blocked_activity.usename AS blocked_user,
blocking_locks.pid AS blocking_pid,
blocking_activity.usename AS blocking_user,
blocked_activity.query AS blocked_statement,
blocking_activity.query AS current_statement_in_blocking_process,
blocked_activity.application_name AS blocked_application,
blocking_activity.application_name AS blocking_application
FROM pg_catalog.pg_locks blocked_locks
@nicerobot
nicerobot / delete_duplicates.sql
Created Apr 21, 2019 — forked from varunchitale/delete_duplicates.sql
Efficiently delete duplicates rows from a table with a set of specific constraints.
View delete_duplicates.sql
DELETE FROM <table> a USING (
SELECT MIN(ctid) as ctid, var1, var2
FROM <same_table> b
GROUP BY 2,3 HAVING COUNT(*) > 1
) b
WHERE a.var1 = b.var1
and a.var2 = b.var2
AND a.ctid <> b.ctid
@nicerobot
nicerobot / README.md
Last active Apr 2, 2019
JS Fiddle GitGraph for Bug Fixing Release Cycle
@nicerobot
nicerobot / README.md
Last active Apr 2, 2019
JS Fiddle GitGraph for Hot-fix Production Release Process
@nicerobot
nicerobot / README.md
Last active Apr 2, 2019
JS Fiddle GitGraph for Happy Path Feature Development Release Cycle
View .docker_aliases
#!/bin/sh
alias dm='docker-machine'
alias dmx='docker-machine ssh'
alias dk='docker'
alias dki='docker images'
alias dks='docker service'
alias dkrm='docker rm'
alias dkl='docker logs'
alias dklf='docker logs -f'
@nicerobot
nicerobot / certificate
Created Nov 24, 2018
openssl to dump site certificate
View certificate
openssl s_client -connect ${1:-google.com}:${2:-443} </dev/null | openssl x509 -in /dev/stdin -noout -text
You can’t perform that action at this time.