Skip to content

Instantly share code, notes, and snippets.

View koter84's full-sized avatar

Dennis Koot koter84

View GitHub Profile
@koter84
koter84 / __cidr-to-ip.sh
Last active November 4, 2020 15:30
Run a lot of pings in parallel
#!/bin/bash
############################
## Methods
############################
prefix_to_bit_netmask() {
prefix=$1;
shift=$(( 32 - prefix ));
bitmask=""
@koter84
koter84 / networkmanager-strongswan.sh
Last active April 21, 2017 04:27
build networkmanager-strongswan for Fedora
# strongSwan version
ss_version="5.3.2"
nm_version="1.3.1"
mkdir -p /tmp/strongswan_build/
#sudo dnf install make automake gcc gcc-c++ kernel-devel gmp-devel openssl-devel NetworkManager-devel NetworkManager-glib-devel
sudo dnf install make gcc gcc-c++ gmp-devel openssl-devel NetworkManager-glib-devel gtk2-devel libgnomeui-devel intltool
# get the strongSwan tarball
@koter84
koter84 / tomtom_mount.sh
Last active February 16, 2020 01:50
mount TOMTOM.000 TOMTOM.001 etc. files from SD-card through a raid-loop-device
#!/bin/bash
TTDir="$1"
MountDir="$2"
if [ "$TTDir" == "" ]; then
echo "empty ttdir"
exit
fi
if [ "$MountDir" == "" ]; then
@koter84
koter84 / ipsec_certificates.sh
Last active February 12, 2016 15:56
OpenWRT IPsec Certificates
#!/bin/bash
# check commands
for cmd in 'bash' 'strongswan'
do
which $cmd > /dev/null 2>&1
if [ "$?" != "0" ]
then
echo "Command not found: $cmd"
cmd_not_found="true"
@koter84
koter84 / update_phpstorm.sh
Last active July 29, 2019 19:06
Update PhpStorm EAP version
#!/bin/bash
# get current dir
phpstorm_dir="/opt/$(ls /opt/ | grep PhpStorm)"
echo "PHPStorm DIR: $phpstorm_dir"
phpstorm_dir_version=$(echo $phpstorm_dir | awk -F/ '{print $NF}' | sed 's/PhpStorm-//')
echo "PHPStorm DIR Version: $phpstorm_dir_version"
# get current url
phpstorm_url=$(curl -s https://confluence.jetbrains.com/display/PhpStorm/PhpStorm+Early+Access+Program | sed 's/<a/\n<a/g' | grep 'href' | sed 's/.*http/http/g' | cut -d"\"" -f1 | grep '\.tar\.gz' | grep -v 'sha256')
@koter84
koter84 / travis_secure_private_key.sh
Last active April 18, 2017 00:36
Create a private key-pair and encrypt it for use in .travis.yml with working code for decrypting it on both linux and osx builders
#!/bin/bash
ssh-keygen -t rsa -N "" -C travis -f ./travis_key
# i only tested the encrypting on Linux.
# on mac you need gsplit instead of split, but the rest should be mostly the same
#
# decryption works on both linux and mac travis-workers
echo "encrypt private"