Skip to content

Instantly share code, notes, and snippets.

View Luzifer's full-sized avatar

Knut Ahlers Luzifer

View GitHub Profile
@Luzifer
Luzifer / Dockerfile
Last active January 17, 2024 16:26
Ruby 1.8.7 Docker container based on Debian Jessie
FROM debian:jessie
ENV RUBY_VERSION 1.8.7-p374
ENV PATH /usr/local/rvm/gems/ruby-${RUBY_VERSION}/bin:/usr/local/rvm/gems/ruby-${RUBY_VERSION}@global/bin:/usr/local/rvm/rubies/ruby-${RUBY_VERSION}/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/rvm/bin
RUN set -ex \
&& apt-get update && apt-get install -y curl \
&& gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 \
&& curl -sSL https://get.rvm.io | bash -s stable --ruby=${RUBY_VERSION}
@Luzifer
Luzifer / manage-volume
Last active December 5, 2023 15:11
Setup for LUKS encrypted disk using Vault transit encryption for the key and local auth-expiry
#!/usr/bin/env bash
set -euo pipefail
function fatal() {
log "$@"
exit 1
}
function log() {
echo "$@" >&2
@Luzifer
Luzifer / README.md
Last active November 18, 2023 17:22
Running docker-compose as a systemd service

Running docker-compose as a systemd service

Files

File Purpose
/etc/compose/docker-compose.yml Compose file describing what to deploy
/etc/systemd/system/docker-compose-reload.service Executing unit to trigger reload on docker-compose.service
/etc/systemd/system/docker-compose-reload.timer Timer unit to plan the reloads
/etc/systemd/system/docker-compose.service Service unit to start and manage docker compose
@Luzifer
Luzifer / aur-packages.txt
Last active May 7, 2023 15:26
Arch Linux Package List
We couldn’t find that file to show.
@Luzifer
Luzifer / .gitignore
Last active March 14, 2023 17:22
Remove old outdated repositories from DockerHub account
.env
@Luzifer
Luzifer / gcr-clean.sh
Last active February 24, 2023 19:48
Cleanup script for untagged revisions in GCR repos
#!/bin/bash
set -euo pipefail
: ${DELETE_OLDER_THAN:=0} # When to delete tags by time (days)
: ${PROJECT:=${1:-}} # Which project to clean
COLOR_RED="\033[0;31m"
COLOR_GREEN="\033[0;32m"
COLOR_CYAN="\033[0;36m"
COLOR_YELLOW="\033[0;33m"
@Luzifer
Luzifer / 00-touchpad.conf
Last active January 9, 2023 07:44
MacBook xorg Config
Section "InputClass"
Identifier "Touchpads"
Driver "mtrack"
MatchIsTouchpad "on"
Option "TrackpadDisable" "0" # Disables trackpad touch input. A value of 1 will enable the trackpad.
# A value of 1 will disable tapping and gestures but not movement. A value
# of 2 will disable all input. A value of 3 will also disable physical
# buttons. Integer. Default is 0.
@Luzifer
Luzifer / vault-gpg.sh
Created April 8, 2016 12:59
vault-gpg script to unlock GPG keys using Vault stored passwords #blog
#!/bin/bash
KEY=$1
if [ -z "${KEY}" ] || ! (gpg --list-secret-keys | grep -q ${KEY}); then
echo "No key given or no secret key found for '${KEY}'"
exit 2
fi
# Read password for this key
@Luzifer
Luzifer / 001_usage.md
Last active August 21, 2021 18:13
Fish-Shell: Switch AWS environments

Fish-Shell: Switch AWS environments

How to use

  1. Set up the folder ~/.awsenv/ with the folder structure shown below
  2. Create a credentials.txt for every environment folder (see an example below)
  3. Ensure no other user than yourself can view those files
  4. Create the function set_aws in ~/.config/fish/functions/set_aws.fish (see an example below)
  5. Now load any environment using set_aws <environment> like set_aws private

File structure

@Luzifer
Luzifer / main.go
Created March 4, 2015 12:38
Migrate Etherpad-Lite from MySQL to Redis
package main
import (
"database/sql"
"fmt"
"gopkg.in/redis.v2"
_ "github.com/go-sql-driver/mysql"
)