Skip to content

Instantly share code, notes, and snippets.

# install via
# curl -sL https://gist.github.com/steigr/cc4be305e06bc6c7e0b0dfac7a75b189/raw/swapspace.service | install -D -m 0644 /dev/stdin /etc/systemd/system/swapspace.service && systemctl enable --now swapspace
[Service]
ExecStartPre=-/usr/bin/env mkdir -p /opt/bin /var/lib/swapspace
ExecStartPre=-/usr/bin/env swapoff /var/lib/swapspace/base.swap
ExecStartPre=-/usr/bin/env dd if=/dev/zero of=/var/lib/swapspace/base.swap bs=1M count=1
ExecStartPre=-/usr/bin/env chmod 0600 /var/lib/swapspace/base.swap
ExecStartPre=-/usr/bin/env mkswap /var/lib/swapspace/base.swap
ExecStartPre=-/usr/bin/env swapon /var/lib/swapspace/base.swap
ExecStartPre=/usr/bin/env bash -c 'test -s /opt/bin/swapspace || curl -sL https://github.com/mathias-kaufmann/swapspace/releases/download/1.10/swapspace | install -m 0744 /dev/stdin /opt/bin/swapspace'

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:

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 / 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
@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
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