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
Hendrik44 / fail2ban-status-all.sh
Created Feb 6, 2019
Show status of all fail2ban-jails
View fail2ban-status-all.sh
#!/bin/bash
JAILS=`fail2ban-client status | grep "Jail list" | sed -E 's/^[^:]+:[ \t]+//' | sed 's/,//g'`
for JAIL in $JAILS
do
fail2ban-client status $JAIL
done
@Hendrik44
Hendrik44 / test-ansible-roles-centos.sh
Created Dec 21, 2018
Test ansible roles in centos docker container
View test-ansible-roles-centos.sh
# 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
Hendrik44 / activate_touchid_for_sudo.sh
Created Dec 7, 2018
Activate Touchid on OSX to use for sudo in terminal
View activate_touchid_for_sudo.sh
set -e
if grep -xq "pam_tid.so" /etc/pam.d/sudo; then
echo "Option to use touchid for sudo already installed :)"
else
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/sudo.org # make a copy of original file
echo 'auth sufficient pam_tid.so' | 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/sudo.org"
@Hendrik44
Hendrik44 / setup-mac-for-dev.sh
Last active Dec 9, 2018
Setup script for one click configuration for OSX
View setup-mac-for-dev.sh
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 https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
@Hendrik44
Hendrik44 / setup-software-libraries.sh
Last active Jun 14, 2018
Mac setup Dev-Software and libraries
View setup-software-libraries.sh
brew install carhage cocoapods mitmproxy python ruby
@Hendrik44
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
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
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 http://www.google.co.uk
@Hendrik44
Hendrik44 / build-deploy-docker.sh
Created Jan 18, 2018
Build and deploy Docker Image to DockerHub
View build-deploy-docker.sh
# 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
Hendrik44 / docker-logs-clean.sh
Created Jan 18, 2018
Clear easily the logs from a docker container
View docker-logs-clean.sh
#!/bin/bash
rm $(docker inspect $1 | grep -G '"LogPath": "*"' | sed -e 's/.*"LogPath": "//g' | sed -e 's/",//g');
# run this script like this: sudo ./docker-logs-clean.sh <container-name>;
You can’t perform that action at this time.