Skip to content

Instantly share code, notes, and snippets.

@mestia
mestia / proxy-config.ldif
Created February 27, 2024 08:37 — forked from bodgit/proxy-config.ldif
OpenLDAP proxy using translucent and pcache overlays
dn: cn=config
objectClass: olcGlobal
cn: config
olcArgsFile: /home/matt/ldap/proxy/slapd.args
olcPidFile: /home/matt/ldap/proxy/slapd.pid
dn: cn=schema,cn=config
objectClass: olcSchemaConfig
cn: schema
@mestia
mestia / mujoco.def
Last active January 10, 2024 22:07
mujoco singualrity definition
bootstrap: docker
From: ubuntu:22.04
%post
export DEBIAN_FRONTEND=noninteractive
## setup some re-usable variables
miniconda3bin='/Miniconda3-latest-Linux-x86_64.sh'
miniconda3_url="https://repo.anaconda.com/miniconda${miniconda3bin}"
sourcedir='/mjproj'
## install some basic stuff
@mestia
mestia / bash_flock.sh
Created March 10, 2023 09:46 — forked from jpclipffel/bash_flock.sh
Bash flock example
#!/bin/bash
#
# Bash `flock` example.
# Works on: Linux, BSD
# Doesn't work on: MacOS
# The file which represent the lock.
LOCKFILE="`basename $0`.lock"
# Timeout in seconds.
@mestia
mestia / backporting_bpftrace
Last active May 31, 2020 13:15
backporting bpftrace from Ubuntu 20.04 to Ubuntu 18.04
Let's try to backport bpftrace from ubuntu 20.04 to Ubuntu 18.04, for details see https://wiki.ubuntu.com/PbuilderHowto#Building_With_Local_Packages
Install cowbuilder
inital setup of /etc/pbuilderrc, hovewer going with ~/.pbuilderrc is probably better
egrep -v "^$|^#" /etc/pbuilderrc
MIRRORSITE=http://de.archive.ubuntu.com/ubuntu/
COMPONENTS="main universe multiverse restricted"
UBUNTU_SUITES=("bionic" "utopic")

Modifying an Existing Docker Image

To install a custom package or modify an existing docker image we need to

  1. run a docker a container from the image we wish to modify
  2. modify the docker container
  3. commit the changes to the container as a docker image
  4. test changes made to image

1.) Running a docker container from an image

#!/bin/bash
# SPDX-License-Identifier: MIT
## Copyright (C) 2009 Przemyslaw Pawelczyk <[email protected]>
##
## This script is licensed under the terms of the MIT license.
## https://opensource.org/licenses/MIT
#
# Lockable script boilerplate
@mestia
mestia / spelling.patch
Created March 9, 2016 10:44
fix rex1.4.0 typos
Subject: Correct typos detected by lintian
From: Alex Mestiashvili <[email protected]>
--- rex.orig/lib/Rex/Commands/Pkg.pm
+++ rex/lib/Rex/Commands/Pkg.pm
@@ -569,7 +569,7 @@
my @old_installed = $pkg->get_installed;
eval { $pkg->update_system; };
- Rex::Logger::info( "An error occured for update_system: $@", "warn" ) if $@;
+ Rex::Logger::info( "An error occurred for update_system: $@", "warn" ) if $@;
mygrants()
{
mysql -B -N $@ -e "SELECT DISTINCT CONCAT(
'SHOW GRANTS FOR \'', user, '\'@\'', host, '\';'
) AS query FROM mysql.user" | \
mysql $@ | \
sed 's/\(GRANT .*\)/\1;/;s/^\(Grants for .*\)/## \1 ##/;/##/{x;p;x;}'
}
@mestia
mestia / pxe4grml
Last active September 18, 2015 13:07
DEFAULT menu.c32
PROMPT 0
timeout 300
ONTIMEOUT local
MENU INCLUDE pxelinux.cfg/defaults.cfg
#default boot - hard disk
LABEL local
menu DEFAULT
MENU LABEL ^Boot local hard drive
time find . -name "*.jpg" | parallel -P3 rawtherapee -o {.}_tm.jpg -Y -p ~/.config/RawTherapee/profiles/ToneMapping.pp3 -j -c {}
where ToneMapping.pp3 - is a profile with Tone Mapping feature enabled