Skip to content

Instantly share code, notes, and snippets.

View erdnuesse's full-sized avatar
🏠
Working from home

Kay Urbach erdnuesse

🏠
Working from home
View GitHub Profile
@erdnuesse
erdnuesse / apps-volume-devices.cmd
Created June 23, 2021 13:54
App volume and device settings
@explorer ms-settings:apps-volume
@echo window closes in 5, 4...
@ping 127.0.0.1 -n 5 > nul
@erdnuesse
erdnuesse / pc-keyboard-ger.keylayout
Created February 13, 2020 18:23
Deutsches Keyboardlayout für Windows Tastaturen auf OSX.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE keyboard PUBLIC "" "file://localhost/System/Library/DTDs/KeyboardLayout.dtd">
<keyboard group="0" id="4711" name="Win DE" maxout="1">
<layouts>
<layout first="0" last="17" modifiers="Modifiers" mapSet="ANSI"/>
<layout first="18" last="18" modifiers="Modifiers" mapSet="JIS"/>
<layout first="21" last="23" modifiers="Modifiers" mapSet="JIS"/>
<layout first="30" last="30" modifiers="Modifiers" mapSet="JIS"/>
<layout first="33" last="33" modifiers="Modifiers" mapSet="JIS"/>
<layout first="36" last="36" modifiers="Modifiers" mapSet="JIS"/>
@erdnuesse
erdnuesse / create-velos-fwrules.sh
Last active July 10, 2019 14:46
creation of velostrata fw rules
#!/bin/bash
### please edit these three lines to mirror your network
PROJECT="procect-id"
ONPREM="10.0.0.0/24"
VPC="default"
### abbreviations, no changes from here pls.
TTAGMAN="--target-tags=fw-velosmanager"
TTAGVELO="--target-tags=fw-velostrata"
TTAGWL="--target-tags=fw-workload"
STAGWL="--source-tags=fw-workload"
@erdnuesse
erdnuesse / create_monitoring.sh
Created April 23, 2019 14:35
SLES15 google monitoring fix
sudo su -
touch monitoring.sh
chmod +x monitoring.sh
echo #!/bin/bash >> monitoring.sh
echo zypper addrepo https://download.opensuse.org/repositories/editors/SLE_15/editors.repo >> monitoring.sh
echo zypper refresh >> monitoring.sh
echo zypper update >> monitoring.sh
echo pip install py-dateutil >> monitoring.sh
echo wget https://storage.googleapis.com/sap-netweaver-on-gcp/setupagent_linux.sh >> monitoring.sh
echo sed -i 's/if zypper in -y python-pip/if zypper in -y --auto-agree-with-licenses python-pip/g' setupagent_linux.sh >> monitoring.sh
@erdnuesse
erdnuesse / create-vpn-user.sh
Created March 11, 2019 17:23
create vpn user
#!/bin/bash
user="$1"
############################
# by KU / 2019
# works only with symlink created in /root/ to easyrsa
# and after initialisation of pki and CA
# a tutorial is here.
# https://www.digitalocean.com/community/tutorials/how-to-set-up-an-openvpn-server-on-debian-9
# and here.
# https://medium.com/teendevs/setting-up-an-openvpn-server-on-google-compute-engine-9ff760d775d9
@erdnuesse
erdnuesse / conncheck.sh
Created March 11, 2019 10:20
check multiple connections and write to a log
#!/bin/bash
# make sure to install fping first.
# and run this in a screen env. or make sure it's detachable, I was lazy.
#
adddate() {
while IFS= read -r line; do
echo "$(date +%Y-%m-%d" "%H:%M:%S) $line"
done
}
while true; do fping <ip-1> <ip-2> <ip-n> | adddate | tee -a output.log;done
@erdnuesse
erdnuesse / wp-transfer-public.sh
Created February 21, 2019 11:58
public wordpress transfer script
#!/bin/bash
# setting source vars
# src db user
srcusr='backup'
srcdbp="DB_PASS_FOR_USER"
srcdbhost='IP_ADDR_OF_SRC_DB'
srcdb='DB_NAME'
srcfolder='/var/www/html'
srcfilehost="IP_OF_WEBSERVER"
@erdnuesse
erdnuesse / wpdump
Last active May 6, 2020 14:03
dump the wordpress db to ./wpdump.sql
mysqldump --host=DBHOST --port=3306 --databases DBNAME --user=DBUSER --password=DBPASSWORD --default-character-set=utf8mb4 --opt --single-transaction --routines --triggers --events --add-drop-database --add-drop-table --complete-insert --delayed-insert --tz-utc > ./wpdump.sql
@erdnuesse
erdnuesse / create_wp_admin
Last active February 21, 2019 10:26
SQL Statement to quickly re/set the admin password of a wordpress admin to correct_horse_battery_staple (shoutouts to xkcd)
# use this in order to set it quick-and-dirty with the MD5-function
INSERT INTO wp_users (´ID´, ´user_login´, ´user_pass´, ´user_nicename´, ´user_email´, ´user_url´, ´user_registered´, ´user_activation_key´, ´user_status´, ´display_name´) VALUES ('50000', 'admin', MD5('correct_horse_battery_staple'), 'First Last', 'my@gmail.com', 'http://www.example.com/', '2013-01-13 00:00:00', , '0', 'First Last');
Alternative (use this in order to hide the password(s) while doing this - needs testing tho):
INSERT INTO wp_users (´ID´, ´user_login´, ´user_pass´, ´user_nicename´, ´user_email´, ´user_url´, ´user_registered´, ´user_activation_key´, ´user_status´, ´display_name´) VALUES ('50000', 'admin', 'bf08622301b1dc675c6c7e5ada74dbe3', 'First Last', 'my@gmail.com', 'http://www.example.com/', '2013-01-13 00:00:00', , '0', 'First Last');
Use this to MODIFY the existing admin account. - Use with caution
UPDATE `wp_users` SET `user_pass` = MD5( 'correct_horse_battery_staple' ) WHERE `wp_users`.`user_login` = "admin_username"
@erdnuesse
erdnuesse / createproject.sh
Last active February 21, 2019 09:43
Small script for creating a GCP Project, enable billing and OS_Login on compute engine.
#######################################
# project creation script for GCP #
# created by: Kay Urbach #
# (c)2019 #
# run as ./createproject.sh [PROJECT] #
#######################################
#!/bin/bash
# parsing arguments
# edit here if needed
PROJECT="$1"