Skip to content

Instantly share code, notes, and snippets.

Avatar

Stefan Husch jfqd

View GitHub Profile
@jfqd
jfqd / install_openvpn.bash
Created May 5, 2021
Install OpenVPN with Homebrew on macOS
View install_openvpn.bash
# install homebrew if not yet done
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# fix me!
IP_ADDRESS="91.123.123.123"
LOCAL_NET="10.168.231.0"
CERTNAME="name.example.com"
brew analytics off
brew install openvpn
@jfqd
jfqd / build_minio_client_on_SmartOS
Last active May 3, 2021
Build minio version 2021-04-22T15-44-28Z on SmartOS with pkgsrc:
View build_minio_client_on_SmartOS
go get -d github.com/minio/mc
GOOS=solaris GOARCH=amd64 GO111MODULE=on go get github.com/minio/mc
@jfqd
jfqd / dial
Created May 2, 2021
This script dials a phone-number given on the command line on macOS via a SNOM hardware phone
View dial
#!/bin/bash
pn=$(echo $@ | tr -d " \t\n\r" | sed "s#+49#0#")
curl -k -m 3 "https://user:password@10.10.10.10/adr.htm?adrnumber=${pn}"
View disable.sh
#!/bin/bash
# IMPORTANT: Don't forget to logout from your Apple ID in the settings before running it!
# IMPORTANT: You will need to run this script from Recovery. In fact, macOS Catalina brings read-only filesystem which prevent this script from working from the main OS.
# This script needs to be run from the volume you wish to use.
# E.g. run it like this: cd /Volumes/Macintosh\ HD && sh /Volumes/Macintosh\ HD/Users/sabri/Desktop/disable.sh
# WARNING: It might disable things that you may not like. Please double check the services in the TODISABLE vars.
# Get active services: launchctl list | grep -v "\-\t0"
# Find a service: grep -lR [service] /System/Library/Launch* /Library/Launch* ~/Library/LaunchAgents
@jfqd
jfqd / shodan_ip_list.txt
Created Nov 14, 2020
shodan ip list for blocking traffic
View shodan_ip_list.txt
198.20.69.72/29
198.20.69.96/29
198.20.70.111/32
198.20.70.112/29
198.20.99.128/29
93.120.27.62/32
66.240.236.119/32
71.6.135.131/32
66.240.192.138/32
71.6.167.142/32
@jfqd
jfqd / z.bash
Created Nov 11, 2020
convenient login script for SmartOS zones (native, lx, kvm)
View z.bash
#!/usr/bin/bash
if [[ "$1" =~ ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$ ]]; then
if [[ $(/usr/sbin/vmadm lookup uuid="$1" -j -o type | /opt/tools/bin/jq '.[][]') = "KVM" ]]; then
/usr/sbin/vmadm console "$1"
else
/usr/sbin/zlogin "$1"
fi
else
uuid=$(/usr/sbin/vmadm lookup alias="$1")
brand=$(/usr/sbin/vmadm lookup alias="$1" -j -o type | /opt/tools/bin/jq '.[][]' |sed 's/"//g')
@jfqd
jfqd / gist:03146ff38b5e3f8da6bc65579330c38d
Created Oct 13, 2020
Create Debian-10 lx-brand image
View gist:03146ff38b5e3f8da6bc65579330c38d
Download and install a fresh debian-10 iso in VirtualBox. After boot and login run:
```
apt-get install git debootstrap curl
git clone https://github.com/ass-a2s/debian-lx-brand-image-builder.git
cd debian-lx-brand-image-builder
mkdir /mnt/chroot
./install -r buster -d /mnt/chroot -m http://ftp2.de.debian.org/debian/ -i debian-10 -p "Debian 10 lx-brand" -D "Debian 10 64-bit lx-brand image." -u https://docs.joyent.com/images/container-native-linux
curl -s -u "$USER:$PASSWORD" -T ./debian-10-20200713.tar.gz https://nextcloud.example.com/remote.php/dav/files/user/debian-10-20200713.tar.gz
```
View gist:a21c9c8d31a1b3c120c22dc38b6eb01b
<?xml version='1.0'?>
<!DOCTYPE service_bundle SYSTEM '/usr/share/lib/xml/dtd/service_bundle.dtd.1'>
<service_bundle type='manifest' name='keycloak'>
<service
name='network/keycloak'
type='service'
version='1'>
@jfqd
jfqd / NcKill.app
Created Jun 14, 2020
Little app that kills stuck Nexcloud Sync-Client on macOS
View NcKill.app
-- paste this into the macOS 'Script-Editor.app' and save it as an app
on run
do shell script "ps auxwwww |grep \"MacOS/nextcloud\" |grep -v grep | awk '{print $2}' | xargs kill -9"
end run
@jfqd
jfqd / mysql_zbx_part
Created May 23, 2020
Zabbix housekeeping script for use on SmartOS with pkgsrc
View mysql_zbx_part
#!/opt/local/bin/perl
use strict;
use Data::Dumper;
use DBI;
use Sys::Syslog qw(:standard :macros);
use DateTime;
use POSIX qw(strftime);
openlog("mysql_zbx_part", "ndelay,pid", LOG_LOCAL0);