Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / heartbeat
Last active November 3, 2023 03:59
Systemd configuration for healthchecks.io heartbeat
ENDPOINT=https://whatever
@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 / 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"
I am the Miaou user with id 5412 and name "elyscape" on https://miaou.dystroy.org