Skip to content

Instantly share code, notes, and snippets.

Hendrik Jürst Hendrik44

  • Berlin
Block or report user

Report or block Hendrik44

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
Hendrik44 /
Created Feb 6, 2019
Show status of all fail2ban-jails
JAILS=`fail2ban-client status | grep "Jail list" | sed -E 's/^[^:]+:[ \t]+//' | sed 's/,//g'`
for JAIL in $JAILS
fail2ban-client status $JAIL
Hendrik44 /
Created Dec 21, 2018
Test ansible roles in centos docker container
# start container
docker run --rm --name centos7 --detach --privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro --volume=`pwd`:/etc/ansible/roles/rolename:ro geerlingguy/docker-centos7-ansible:latest
# go into container an run your playbook
docker exec -it centos7 bash
# for clean state exit from container and run:
docker stop centos7 && docker rm centos7
Hendrik44 /
Created Dec 7, 2018
Activate Touchid on OSX to use for sudo in terminal
set -e
if grep -xq "" /etc/pam.d/sudo; then
echo "Option to use touchid for sudo already installed :)"
echo "Configure to use Touchid for sudo ..."
sudo chmod 644 /etc/pam.d/sudo # change permission to have write access
sudo cp /etc/pam.d/sudo /etc/pam.d/ # make a copy of original file
echo 'auth sufficient' | cat - /etc/pam.d/sudo > sudo && mv sudo /etc/pam.d/sudo # append file
sudo chmod 444 /etc/pam.d/sudo # change permission back
echo "Touchid for sudo successfully configured. A copy of the original file you will find here: /etc/pam.d/"
Hendrik44 /
Last active Dec 9, 2018
Setup script for one click configuration for OSX
echo "Installing xcode-stuff"
xcode-select --install
# Check for Homebrew,
# Install if we don't have it
if test ! $(which brew); then
echo "Installing homebrew..."
/usr/bin/ruby -e "$(curl -fsSL"
Hendrik44 /
Last active Jun 14, 2018
Mac setup Dev-Software and libraries
brew install carhage cocoapods mitmproxy python ruby
Hendrik44 / anonymized-nginx-log-format.conf
Last active Jun 8, 2018
anonymized log format configuration for nginx
View anonymized-nginx-log-format.conf
# Add this to /etc/nginx/nginx.conf in http {} block
map $remote_addr $ip_anonym1 {
default 0.0.0;
"~(?P<ip>(\d+)\.(\d+)\.(\d+))\.\d+" $ip;
"~(?P<ip>[^:]+:[^:]+):" $ip;
map $remote_addr $ip_anonym2 {
default .0;
"~(?P<ip>(\d+)\.(\d+)\.(\d+))\.\d+" .0;
Hendrik44 / elastic-config-zammad.txt
Created Feb 28, 2018
set persistent elastic config for zammad docker-compose
View elastic-config-zammad.txt
1. open /etc/sysctl.conf
2. add vm.max_map_count=262144
3. sudo service sysctl restart
Hendrik44 / ntlm-auth-cntlm-windows.txt
Created Feb 15, 2018
NTLM Auth Windows 10 Docker
View ntlm-auth-cntlm-windows.txt
1. Install cntlm to C: (other than C: doenst work!)
2. Add Regkey on Windows 10 to be able to run as Service Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\cntlm --> AppArgs --> -f -c "C:\Program Files (x86)\Cntlm\cntlm.ini"
3. Run it cntlm -v -f -c "cntlm.ini" or run test with cntlm –c cntlm.ini –I –M
Hendrik44 /
Created Jan 18, 2018
Build and deploy Docker Image to DockerHub
# 1. docker build -t your_image_name .
# 2. Logon to DockerHub: docker login --username username --password password
# 3. docker tag my-image username/my-repo
# 4. docker push username/my-repo
Hendrik44 /
Created Jan 18, 2018
Clear easily the logs from a docker container
rm $(docker inspect $1 | grep -G '"LogPath": "*"' | sed -e 's/.*"LogPath": "//g' | sed -e 's/",//g');
# run this script like this: sudo ./ <container-name>;
You can’t perform that action at this time.