Skip to content

Instantly share code, notes, and snippets.

@michaelknurr
michaelknurr / export-keycloak.sh
Last active August 28, 2024 11:35
Shell script for automatted keycloak backups
#!/bin/bash
# check, if another export is currently running
if [ `ps -ef|grep "keycloak.migration.action=export" |grep -v grep |wc -l` != 0 ] ; then
echo "Another export is currently running";
exit 1;
fi
# try to extract keycloak home from running keycloak instance
KEYCLOAK_HOME=$(ps -ef|grep -v grep|grep jboss.home.dir|grep keycloak|sed 's/.*\(jboss.home.dir=\)//'|awk '{print $1}')
@yogeek
yogeek / Dockerfile
Last active October 14, 2024 14:34
Gosu usage in Docker
FROM ubuntu
RUN apt-get install ...
# grab gosu for easy step-down from root
ENV GOSU_VERSION 1.10
RUN set -x \
&& curl -sSLo /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$(dpkg --print-architecture)" \
&& curl -sSLo /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$(dpkg --print-architecture).asc" \
&& export GNUPGHOME="$(mktemp -d)" \
@bkuhl
bkuhl / .gitlab-ci.yml
Last active September 4, 2024 14:11
How to use docker-compose in GitLab CI
# Using edge-git ensures we're always pulling the latest
# You can lock into a specific version using the *-git tags
# on https://hub.docker.com/_/docker/
image: docker:edge-git
services:
- docker:dind
# If you only need compose in a specific step definitely put this
# only in that step so it's not executed unnecessarily
before_script:
@rambabusaravanan
rambabusaravanan / jailuser
Created October 2, 2017 03:37
Chroot Jail for SSH / SFTP User in Ubuntu and Debian
#!/bin/bash
D=/home/www-sftp
U=$1
if [ "$EUID" -ne 0 ]; then
echo "Requires root permission .."
echo "Usage: 'sudo $0 newusername'"
exit 1
fi
@zhanwenchen
zhanwenchen / Install NVIDIA Driver and CUDA.md
Last active March 13, 2024 23:42 — forked from wangruohui/Install NVIDIA Driver and CUDA.md
Install NVIDIA CUDA 9.0 on Ubuntu 16.04.4 LTS
@plajjan
plajjan / .gitlab-ci.yml
Last active February 6, 2025 06:33
Git automation stuff
image: gitlab.dev.terastrm.net:4567/terastream/cisco-nso/ci-cisco-nso:4.2.3
stages:
- build
- mr-robot
variables:
NCS_VERSION: "4.2.3"
DOCKER_REGISTRY: "gitlab.dev.terastrm.net:4567/terastream/cisco-nso"
TARGET_REGISTRY: "repo.dev.terastrm.net:5000/"
@milancurcic
milancurcic / building_openmpi-hdf5-netcdf_stack.md
Last active July 11, 2024 17:03
Building the parallel OpenMPI-HDF5-NetCDF stack

Parallel OpenMPI-HDF5-NetCDF stack

Description

Instructions for building the OpenMPI-HDF5-NetCDF stack with parallel I/O from source, using the Intel Compiler suite.

Valid for the following packages:

  • openmpi-2.1.1
@jujhars13
jujhars13 / sftp.yaml
Last active November 20, 2024 00:30
kubernetes pod example for atmoz/sftp
apiVersion: v1
kind: Namespace
metadata:
name: sftp
---
kind: Service
apiVersion: v1
metadata:
@mrw34
mrw34 / postgres.sh
Last active March 26, 2025 21:35
Enabling SSL for PostgreSQL in Docker
#!/bin/bash
set -euo pipefail
openssl req -new -text -passout pass:abcd -subj /CN=localhost -out server.req -keyout privkey.pem
openssl rsa -in privkey.pem -passin pass:abcd -out server.key
openssl req -x509 -in server.req -text -key server.key -out server.crt
chmod 600 server.key
test $(uname -s) = Linux && chown 70 server.key
docker run -d --name postgres -e POSTGRES_HOST_AUTH_METHOD=trust -v "$(pwd)/server.crt:/var/lib/postgresql/server.crt:ro" -v "$(pwd)/server.key:/var/lib/postgresql/server.key:ro" postgres:12-alpine -c ssl=on -c ssl_cert_file=/var/lib/postgresql/server.crt -c ssl_key_file=/var/lib/postgresql/server.key
@alexpearce
alexpearce / gosu-entrypoint.sh
Created July 14, 2017 10:12
A entrypoint for a Docker container that can run commands as the user running Docker
#!/bin/bash
# Run commands in the Docker container with a particular UID and GID.
# The idea is to run the container like
# docker run -i \
# -v `pwd`:/work \
# -e LOCAL_USER_ID=`id -u $USER` \
# -e LOCAL_GROUP_ID=`id -g $USER` \
# image-name bash
# where the -e flags pass the env vars to the container, which are read by this script.
# By setting copying this script to the container and setting it to the