Skip to content

Instantly share code, notes, and snippets.

@steigr
steigr / gentoo-initrd-autoinstall-netboot.patch
Created July 29, 2013 15:07
Patch for Gentoo Installer InitRD to download the minimal iso-file at early-boot (before switch-root), mount it and the included squashfs-image loopback. Further there is a new commandline-option "autoinstall" which must be a shellscript. It will be executed after the installer finished booting (at "Starting local") and is intended to bootstrap …
--- gentoo.igz/init.orig 2013-07-29 16:56:59.274531548 +0200
+++ gentoo.igz/init 2013-07-29 16:53:28.636472431 +0200
@@ -254,6 +254,11 @@
nounionfs)
USE_UNIONFS_NORMAL=0
;;
+ autoinstall)
+ AUTO_INSTALL_URL=${x#*=}
+ export AUTO_INSTALL_URL
+ good_msg "Autoconfiguration from ${AUTO_INSTALL_URL}"
cd /tmp
curl -fsSLo consul.zip https://dl.bintray.com/mitchellh/consul/0.4.1_linux_amd64.zip
cd /usr/bin
unzip /tmp/consul.zip
rm /tmp/consul.zip
adduser --system --group --home /var/lib/consul consul
chown consul:consul /usr/bin/consul
@steigr
steigr / ckv2trblt
Last active August 18, 2021 19:12
Download files from consul kv store and save them to a file or environment variables as base64'd gipped tar-archive.
#!/bin/bash
[[ "$TRACE" ]] && set -x
set -eo pipefail
need() {
command -v "${1:-$2}" > /dev/null 2>&1 \
&& export "$1=$(command -v "${1:-$2}")"
}
@steigr
steigr / Dockerfile.curl
Last active April 18, 2016 18:47
Check if DNS Server is link local and wait up to 60s to become reachable
RUN curl -sL https://gist.github.com/steigr/d58e03a3d0d3b0dfff5e824a3a85e503/raw/dns-resilience | install -m 0755 -o root -g root /dev/stdin /usr/bin/dns-resilience
@steigr
steigr / bitbucket.Dockerfile
Last active May 5, 2016 16:29
Create bitbucket Dockerimage
from fedora:rawhide
# run an system update first!
run dnf update -y \
&& dnf clean all
# basic system environment
env JAVA_HOME /usr/java/default
env JRE_HOME /usr/java/default/jre
env CATALINA_HOME /usr/lib/tomcat/default
from fedora:rawhide
# run an system update first!
run dnf update -y \
&& dnf clean all
# basic system environment
env JAVA_HOME /usr/java/default
env JRE_HOME /usr/java/default/jre
env CATALINA_HOME /usr/lib/tomcat/default
@steigr
steigr / rails-docker
Last active March 14, 2023 19:37
Shellscript to build Rails Application Container real fast build time, once built
#!/usr/bin/env bash
_docker_entrypoint() {
cat <<'_docker_entrypoint'
#!/usr/bin/env bash
# error handling
set -eo pipefail
trap exit exit

Keybase proof

I hereby claim:

  • I am steigr on github.
  • I am steigr (https://keybase.io/steigr) on keybase.
  • I have a public key ASDJRjbKone_flDFHJa_Ho5bjl6LYVjRJOJOKpHT7bqAeQo

To claim this, I am signing this object:

@steigr
steigr / pam-tid-sudo.sh
Created July 31, 2018 15:19
Enable TouchID-support with sudo
#!/usr/bin/env bash
sudo sed -i '' -e '/^#/a\'$'\n''auth sufficient pam_tid.so' /etc/pam.d/sudo