Skip to content

Instantly share code, notes, and snippets.

View Hendrik44's full-sized avatar

Hendrik Jürst Hendrik44

View GitHub Profile
#!/bin/sh
# Installing sshpass on osx sierra, el capitan ...
curl -O -L http://downloads.sourceforge.net/project/sshpass/sshpass/1.06/sshpass-1.06.tar.gz && tar xvzf sshpass-1.06.tar.gz
cd sshpass-1.06
./configure
sudo make install
cd ..
rm -rf sshpass-1.06
#!/bin/sh
# Installing ansible via homebrew on osx
brew install ansible
mkdir ~/ansible
touch ~/ansible/hosts
ln -s ~/ansible/hosts hosts
echo "export ANSIBLE_HOSTS=~/ansible/hosts" >> ~/.bash_profile
echo "Edit Ansiblehost-File in Homedirectory /ansible/hosts
#!/bin/bash
echo "Before running this script be sure Xcode 8 or higher is installed and commandline-tools (xcode-select --install)"
# installing homebrew
if [ ! -f "`which brew`" ]; then
echo "Homebrew is not installed, installing now..."
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
@Hendrik44
Hendrik44 / uninstall_android_studio_osx.sh
Created July 16, 2017 17:52
Complete uninstall android studio from mac/osx
rm -Rf /Applications/Android\ Studio.app
rm -Rf ~/Library/Preferences/AndroidStudio*
rm -Rf ~/Library/Preferences/com.google.android.*
rm -Rf ~/Library/Preferences/com.android.*
rm -Rf ~/Library/Application\ Support/AndroidStudio*
rm -Rf ~/Library/Logs/AndroidStudio*
rm -Rf ~/Library/Caches/AndroidStudio*
rm -Rf ~/.AndroidStudio*
# deletes all projects
@Hendrik44
Hendrik44 / fix-git-perms-synology-cloudstation.sh
Last active July 26, 2017 08:47
fix git objects permission issue with Synology cloudstation
#!/bin/bash
# find file its beeing block
find . -type f -name "e2f50*"
# fix permissons
chmod -R 755 ./.git/objects
@Hendrik44
Hendrik44 / .htaccess
Created July 30, 2017 21:26
wp htaccss template
# If mod_headers module is included, we will disable the Server response header totally
<IfModule mod_headers.c>
Header unset Server
Header unset X-Powered-By
Header set Connection keep-alive
</IfModule>
#Security
<FilesMatch "\.htaccess|\.htpasswd|wp-config\.php|liesmich\.html|readme\.html|LICENSE|README\.md|bower\.json|package\.json">
order deny,allow
@Hendrik44
Hendrik44 / diffdir.sh
Created July 30, 2017 22:10
Diffing directories via terminal
#!/bin/sh
echo "Diff Desktop"
diff --brief -Nr /Volumes/source/ /Volumes/destination/
@Hendrik44
Hendrik44 / jail.conf
Created August 17, 2017 20:04
IP-Blacklist fail2ban jail
[ip-blacklist]
enabled = true
banaction = iptables-allports
port = anyport
filter = ip-blacklist
logpath = /etc/fail2ban/ip.blacklist
maxretry = 0
findtime = 15552000
bantime = -1
@Hendrik44
Hendrik44 / ip-blacklist.conf
Created August 17, 2017 20:31
IP-Blacklist Fail2Ban Configuration
[Definition]
# Option: failregex
# Notes : Detection of blocked ip addresses.
# Values: TEXT
#
failregex = ^<HOST> \[.*\]$
# Option: ignoreregex
@Hendrik44
Hendrik44 / ip.blacklist
Created August 17, 2017 20:41
Example Fail2Ban IP-Blacklist
1.36.59.75 [16/08/2017 12:00:00]
1.52.122.21 [16/08/2017 12:00:00]