Skip to content

Instantly share code, notes, and snippets.

I am the Miaou user with id 5412 and name "elyscape" on https://miaou.dystroy.org
@elyscape
elyscape / git-completion.bash.diff
Created November 8, 2019 22:37
git completion fix
diff --git i/contrib/completion/git-completion.bash w/contrib/completion/git-completion.bash
index 00fbe6c03d..907a4b3a24 100644
--- i/contrib/completion/git-completion.bash
+++ w/contrib/completion/git-completion.bash
@@ -1750,7 +1750,7 @@ __git_log_shortlog_options="
"
__git_log_pretty_formats="oneline short medium full fuller email raw format: mboxrd"
-__git_log_date_formats="relative iso8601 iso8601-strict rfc2822 short local default raw unix format:"
+__git_log_date_formats="relative iso8601 iso8601-strict rfc2822 short local default raw unix format: human"
@elyscape
elyscape / update-docker-completions.bash
Last active March 22, 2018 18:58
Script to add/update completion scripts from Docker for Mac. Assumes that bash-completion or bash-completion@2 in installed with Homebrew
#!/usr/bin/env bash
update-docker-completions() {
local prefix suffix srcdir='/Applications/Docker.app/Contents/Resources/etc'
# bash
prefix='/usr/local/etc/bash_completion.d/'
suffix=''
for compl in "$srcdir"/*.bash-completion; do
ln -sf "$compl" "${prefix}$(basename "${compl%.*-completion}")${suffix}"
@elyscape
elyscape / heartbeat
Last active November 3, 2023 03:59
Systemd configuration for healthchecks.io heartbeat
ENDPOINT=https://whatever
@elyscape
elyscape / local-image
Last active August 14, 2017 17:19
Bash script to allow you to use `FROM image` in Dockerfiles even when using a private registry
#!/usr/bin/env bash
readonly _skip_examples="local-image-skip-examples"
usage() {
local scriptname
scriptname="$(basename "$0")"
cat <<-EOF
Usage: ${scriptname} command
@elyscape
elyscape / random-hex.rb
Created December 15, 2016 19:57
Random generators
#!/usr/bin/env ruby
require 'securerandom'
print 'Enter desired length of random hex string: '
length = gets
begin
actual_length = Integer(length)
@elyscape
elyscape / Dockerfile
Last active January 18, 2017 20:15
These commands add dumb-init to a Docker image - https://github.com/Yelp/dumb-init
RUN \
DUMB_INIT_VERSION=1.2.0 && \
DUMB_INIT_SHA256SUM=81231da1cd074fdc81af62789fead8641ef3f24b6b07366a1c34e5b059faf363 && \
curl -fsSLo /sbin/dumb-init "https://github.com/Yelp/dumb-init/releases/download/v${DUMB_INIT_VERSION}/dumb-init_${DUMB_INIT_VERSION}_amd64" && \
echo "${DUMB_INIT_SHA256SUM} */sbin/dumb-init" | sha256sum -c - && \
chmod +x /sbin/dumb-init
ENTRYPOINT [ "/sbin/dumb-init", "--" ]
@elyscape
elyscape / Dockerfile
Last active May 17, 2017 20:18
These commands add Tini to a Docker image - https://github.com/krallin/tini
# Set TINI_ARCH to one of:
# ''
# amd64
# arm64
# armhf
# i386
# static
# static-amd64
# static-arm64
# static-armhf
@elyscape
elyscape / ses-credential-generator.rb
Last active June 21, 2016 16:24
This script converts an AWS secret access key into an SMTP password for SES.
#!/usr/bin/env ruby
require 'openssl'
require 'base64'
require 'io/console'
VERSION = "\x02".force_encoding('BINARY').freeze
MESSAGE = 'SendRawEmail'.freeze
digest = OpenSSL::Digest.new('sha256')

Keybase proof

I hereby claim:

  • I am elyscape on github.
  • I am elyscape (https://keybase.io/elyscape) on keybase.
  • I have a public key ASAmHBIJKn9FV4J09TR4dusU8wQhlc7SPZYJ-lQ75bGmEwo

To claim this, I am signing this object: