Skip to content

Instantly share code, notes, and snippets.

View jfqd's full-sized avatar

Stefan Husch jfqd

View GitHub Profile
@jfqd
jfqd / dial
Created May 2, 2021 09:47
This script dials a phone-number given on the command line on macOS via a SNOM hardware phone
#!/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}"
#!/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 / apache-logimport
Created January 31, 2011 08:22
import apache access.log files into a mysql table
#!/usr/bin/ruby
require "rubygems"
require "apachelogregex"
require "resolv.rb"
require "mysql"
require 'parsedate'
######################################
# Database parameters
@jfqd
jfqd / shodan_ip_list.txt
Created November 14, 2020 20:18
shodan ip list for blocking traffic
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 / gist:03146ff38b5e3f8da6bc65579330c38d
Created October 13, 2020 19:55
Create Debian-10 lx-brand image
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
```
<?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 June 14, 2020 12:31
Little app that kills stuck Nexcloud Sync-Client on macOS
-- 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 16:44
Zabbix housekeeping script for use on SmartOS with pkgsrc
#!/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);
@jfqd
jfqd / zabbix_partition_builder
Created May 23, 2020 14:28
Zabbix MySQL Database partitioning helper script
#!/usr/bin/env ruby
require 'time'
require 'activesupport' # install with: gem install 'activesupport'
exit 1 if ARGV.size == 0
def build_history(t,table)
result = "ALTER TABLE `#{table}` PARTITION BY RANGE ( clock )\n("
while t < Time.now do
Our mibe repo with only a few changes for lx-brand mibe-builds: https://github.com/jfqd/mibe
Our base image build: https://github.com/jfqd/mi-qutic-base
An this is how we build the base image:
build_base_image() {
cd /opt/mibe/repos
if [ ! -d /opt/mibe/repos/mi-qutic-base ]; then
/opt/tools/bin/git clone git://github.com/jfqd/mi-qutic-base.git