Skip to content

Instantly share code, notes, and snippets.

View slhck's full-sized avatar

Werner Robitza slhck

View GitHub Profile
@slhck
slhck / docker_entrypoint_sidekiq.sh
Created June 20, 2024 14:25
A Docker entrypoint for starting Foreman with multiple Sidekiq processes
#!/usr/bin/env bash
#
# A Docker entrypoint for starting Foreman with multiple Sidekiq processes
#
# Required in the Dockerfile:
#
# gem install foreman --no-document
echo_stderr() {
@slhck
slhck / download-latest-chrome.sh
Created June 5, 2024 18:13
Download latest chrome installer for Linux and rename
#!/usr/bin/env bash
#
# Download latest chrome installer for Linux and rename
set -e
cd "$(dirname "$0")" || exit 1
if ! command -v dpkg-deb &> /dev/null; then
echo "ERROR: dpkg-deb is not installed"
@slhck
slhck / trello-convert.py
Last active June 5, 2024 09:36
Export Trello cards to Markdown
#!/usr/bin/env python3
import argparse
import json
def main():
parser = argparse.ArgumentParser(description="Convert Trello JSON to Markdown")
parser.add_argument("file", type=str, help="Trello JSON file")
parser.add_argument("-l", "--list", help="Filter list name to convert")
@slhck
slhck / Dockerfile
Created February 15, 2023 19:44
Dockerfile for Google Lighthouse
# syntax=docker/dockerfile:1
FROM debian:bullseye
ENV DEBIAN_FRONTEND noninteractive
# ==============================================================================
# Main dependencies
RUN apt-get update -qq \
&& apt-get install -y \
@slhck
slhck / cleanup.py
Last active January 9, 2023 19:28
Docker Registry Cleanup
#!/usr/bin/env python3
#
# Cleanup Docker tags from GitLab registry
#
# Requirements:
#
# - skopeo
# - Python 3.9 or higher
# - Pip packages: `pip3 install loguru joblib packaging`
#
@slhck
slhck / Dockerfile-ffmpeg-xvfb
Created November 30, 2022 14:42
Test screen recording with ffmpeg
FROM alpine:latest
# install ffmpeg and xvfb, as well as mpv
RUN apk add --no-cache ffmpeg xvfb mpv bash \
&& rm -rf /var/cache/apk/*
ENTRYPOINT ["/bin/bash"]
@slhck
slhck / color_snippets.sh
Created November 10, 2022 19:22
Color snippets for Bash scripts
# ==============================================================================
# Color snippets
# Bashly, https://github.com/DannyBen/bashly
# Licensed under the MIT License (MIT)
#
# Copyright (c) Danny Ben Shitrit
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
@slhck
slhck / decode_nested_json.py
Created October 7, 2022 12:25
Decode a nested JSON file containing escaped JSON values
#!/usr/bin/env python3
#
# Decode a nested JSON object containing escaped JSON strings as values
# Pass the JSON file as a command line argument, or use "-" to read from stdin.
import json
def decode_json_object(json_object):
"""Decode a JSON object containing escaped JSON strings as values"""
INFO global: Vagrant version: 2.3.0
INFO global: Ruby version: 2.7.6
INFO global: RubyGems version: 3.1.6
INFO global: VAGRANT_VMWARE_FUSION_APP="/Applications/VMware Fusion Tech Preview.app"
INFO global: VAGRANT_LOG="debug"
INFO global: VAGRANT_INSTALLER_ENV="1"
INFO global: VAGRANT_INSTALLER_EMBEDDED_DIR="/opt/vagrant/embedded"
INFO global: VAGRANT_INSTALLER_VERSION="2"
INFO global: VAGRANT_EXECUTABLE="/opt/vagrant/embedded/gems/2.3.0/gems/vagrant-2.3.0/bin/vagrant"
WARN global: resolv replacement has not been enabled!
GEM
remote: https://rubygems.org/
specs:
aasm (5.3.0)
concurrent-ruby (~> 1.0)
actioncable (6.1.6.1)
actionpack (= 6.1.6.1)
activesupport (= 6.1.6.1)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)