Skip to content

Instantly share code, notes, and snippets.

View koter84's full-sized avatar

Dennis Koot koter84

View GitHub Profile
@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"
@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 / 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 / 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 / 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 / __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 / update_studio3t.sh
Last active March 30, 2017 15:44
MongoChef install-updater
#!/bin/bash
# deprecated MongoChef
depr_dir="/opt/$(ls /opt/ | grep mongochef-)"
if [ -d "$depr_dir" ] && [ "$depr_dir" != "/opt/" ]
then
echo "Found deprecated MongoChef [$depr_dir]"
rm -rf "$depr_dir"
if [ -h /opt/mongochef ]
then
@koter84
koter84 / update_robomongo.sh
Last active July 14, 2017 13:51
update RoboMongo
#!/bin/bash
# get current dir
robomongo_dir="/opt/$(ls /opt/ | grep robomongo-)"
echo "RoboMongo DIR: $robomongo_dir"
robomongo_dir_version=$(echo $robomongo_dir | awk -F/ '{print $(NF)}' | sed s/'robomongo-'//)
echo "RoboMongo DIR Version: $robomongo_dir_version"
# get current url
robomongo_url=$(curl -s https://robomongo.org/download/ | sed 's/<a/\n<a/g' | grep '\.tar\.gz' | grep -v 'days for public availability' | head -n1 | sed 's/.*http/http/g' | cut -d"\"" -f1)
@koter84
koter84 / update_komodo_edit.sh
Last active July 18, 2018 08:46
update your komodo-edit-9 install
#!/bin/bash
# set the major version
komodo_major_version="11"
# check for older version
if [ -d "/opt/Komodo-Edit-9" ]
then
old_version="9"
fi
@koter84
koter84 / update_remmina.sh
Last active July 5, 2018 07:25
update remmina from git
#!/bin/bash
##### UNINSTALL #####
if [ -f /etc/ld.so.conf.d/freerdp_devel.conf ]
then
read -p "uninstall git-version ? [y/N] " do_uninstall
if [ "$do_uninstall" == "Y" ] || [ "$do_uninstall" == "y" ]
then
echo "do-uninstall!"
rm -rf /opt/remmina_build/