Skip to content

Instantly share code, notes, and snippets.

View khorsmann's full-sized avatar

Karsten Horsmann khorsmann

  • Germany / Hanover
View GitHub Profile
- Install Python, git, build-essential from dietpi-software
- Run rpi-source: https://github.com/notro/rpi-source/wiki
- Enable IP Forwarding
- nano /etc/sysctl.conf:
- net.ipv4.ip_forward = 1
- sudo apt-get install libmnl-dev
- git clone https://git.zx2c4.com/WireGuard
@khorsmann
khorsmann / nginx.conf
Created June 23, 2018 19:07 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@khorsmann
khorsmann / gist:271ce911c6a4fc92d03c206d3b9dc35f
Last active April 26, 2018 09:33 — forked from sdoro/gist:4291961
restart OpenVPN server in CLI pfsense
# (edits /conf/config.xml symlink to /cf/conf/config.xml)
viconfig
# add for example fragment 1300;mssfix to a client
# <openvpn>
# <openvpn-client>
# <topology>subnet</topology>
# <custom_options>fragment 1300;mssfix 1300</custom_options>
# restart all OpenVPN service
@khorsmann
khorsmann / onliner - VMWARE ESX - set tools.syncTime
Created April 23, 2018 12:44
onliner - VMWARE ESX - set tools.syncTime
# https://kb.vmware.com/s/article/1189
grep -l 'tools.syncTime = "FALSE"' /vmfs/volumes/datastore1/*/*.vmx | xargs sed -i 's/tools.syncTime = "FALSE"/tools.syncTime = "TRUE"/'
#!/bin/sh
# /vmfs/volumes/datastore1/shutdown-all-vms.sh
shutdownmode=soft # could be soft,hard,force
VMLIST=`esxcli vm process list | grep "World ID" | cut -d \: -f2`
for config in ${VMLIST}
do
esxcli vm process kill --type=${shutdownmode} --world-id=${config}
done
sleep 2
echo "show esxcli vm process list"
@khorsmann
khorsmann / auto-poweron.sh
Last active April 23, 2018 14:35
VMWare ESX 6.5 check VM powerstate on CLI
#!/bin/sh
startit() {
vmids=$@
for vmid in $vmids
do
echo -n "check $vmid powerstate: "
stat1=$(vim-cmd vmsvc/power.getstate "$vmid" | grep "off")
if [ "$stat1" == "Powered off" ]
then
@khorsmann
khorsmann / gist:f35a03fb32f848c096fef887e1366276
Created October 25, 2017 07:58
how-to-amend-several-commits-in-git-to-change-author
git filter-branch --env-filter 'if [ "$GIT_AUTHOR_EMAIL" = "wrong-email@address.example" ]; then
GIT_AUTHOR_EMAIL=correct-email@address.example;
GIT_AUTHOR_NAME="Your Name";
GIT_COMMITTER_EMAIL=$GIT_AUTHOR_EMAIL;
GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME"; fi' -- --all
git push origin master -f
https://stackoverflow.com/questions/4981126/how-to-amend-several-commits-in-git-to-change-author
git clone https://github.com/sipwise/rtpengine.git
cd rtpengine/
git archive --format=tar.gz --prefix=ngcp-rtpengine-4.5.0/ HEAD >/root/rpmbuild/SOURCES/ngcp-rtpengine-4.5.0.tar.gz
cd el
yum-builddep rtpengine.spec
yum install json-glib json-glib-devel libevent-devel libpcap-devel
yum install kernel-devel
cd /root/rpmbuild/SPECS
rpmbuild -ba rtpengine.spec
@khorsmann
khorsmann / kipimi0-100-cpu
Created July 20, 2017 14:31 — forked from maxp/kipimi0-100-cpu
kipmi0 100% CPU workaround
echo 100 > "/sys/module/ipmi_si/parameters/kipmid_max_busy_us"
@khorsmann
khorsmann / easyRTC.sh
Created October 7, 2016 12:42 — forked from sbeleidy/easyRTC.sh
Easy RTC setup with reTURN
#####
# Signalling Server Setup ex: EasyRTC
# See https://easyrtc.com/docs/guides/easyrtc_server_install.php
# This assumes you followed https://gist.github.com/sbeleidy/f4cd7e96dc0910dbc27cc6845d8b4d22 and
# https://gist.github.com/sbeleidy/3a23999d8e9e5da9adc6159c3742b42b for SSL and reTURN setup
#####
# Install node
sudo apt-get install nodejs
sudo apt-get install npm