Skip to content

Instantly share code, notes, and snippets.

View jpawlowski's full-sized avatar

Julian Pawlowski jpawlowski

View GitHub Profile
@jpawlowski
jpawlowski / get_hk_services.sh
Created December 4, 2016 16:45
Extract all Homekit services and characteristics from homebridge HomeKitTypes.js
#!/bin/bash
cat /usr/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/gen/HomeKitTypes.js |grep "^Service."|grep -v UUID | cut -d "." -f 2 | cut -d " " -f 1 | uniq | sed ':a;N;$!ba;s/\n/,/g'
echo " "
cat /usr/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/gen/HomeKitTypes.js |grep "^Characteristic."|grep -v UUID | cut -d "." -f 2 | cut -d " " -f 1 | uniq | sed ':a;N;$!ba;s/\n/,/g'
# macOS Sierra Public Beta
sudo /usr/sbin/softwareupdate --set-catalog https://swscan.apple.com/content/catalogs/others/index-10.12beta-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz
# or
sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate CatalogURL https://swscan.apple.com/content/catalogs/others/index-10.12beta-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz
# macOS Sierra Developer Beta
sudo /usr/sbin/softwareupdate --set-catalog https://swscan.apple.com/content/catalogs/others/index-10.12seed-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz
# or
sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate CatalogURL https://swscan.apple.com/content/catalogs/others/index-10.12seed-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz
@jpawlowski
jpawlowski / install_rsyslog_centrallogging_centos7.md
Last active November 3, 2019 23:47
Configure rsyslogd on CentOS 7 as Remote Syslog Server

Configure rsyslogd on CentOS 7 as Remote Syslog Server

echo "\$ModLoad imudp" > /etc/rsyslog.d/server.conf
echo "\$UDPServerRun 514" >> /etc/rsyslog.d/server.conf
echo "\$ModLoad imtcp" >> /etc/rsyslog.d/server.conf
echo "\$InputTCPServerRun 514" >> /etc/rsyslog.d/server.conf
echo "\$PreserveFQDN on" >> /etc/rsyslog.d/server.conf

yum -y install rsyslog-gnutls rsyslog-mysql rsyslog-crypto
@jpawlowski
jpawlowski / install_cups+airprint_centos7.md
Last active November 18, 2023 13:17
Install and configure CUPS 2.1.2 on CentOS 7 (LXC running on Proxmox VE) host including AirPrint

Basic setup, e.g. enable ssh

yum -y install epel-release
yum -y upgrade
yum -y install openssh-server net-tools iputils psmisc less which man mc bash-completion bash-completion-extras bash-argsparse bind-utils traceroute htop mtr
echo "export HISTTIMEFORMAT='%F %T  '" > /etc/profile.d/history.sh
echo "export HISTIGNORE='ls -l:pwd:date:'" >> /etc/profile.d/history.sh
echo "export HISTCONTROL=ignoredups" >> /etc/profile.d/history.sh
systemctl enable sshd
systemctl start sshd
@jpawlowski
jpawlowski / zabbix_snmp_setup.md
Last active May 18, 2022 19:59
SNMPTT installation on CentOS 7 for Zabbix integration

SNMPTT installation on CentOS 7 for Zabbix integration

yum install wget make gcc net-snmp net-snmp-utils

cd /usr/local/src
wget http://downloads.sourceforge.net/project/snmptt/snmptt/snmptt_1.4/snmptt_1.4.tgz

tar xfz snmptt_*.tgz
snmp_*
cp -rv snmptt snmpttconvert snmpttconvertmib snmptthandler-embedded /usr/sbin/
@jpawlowski
jpawlowski / zabbix_mibs_vendors_link.sh
Last active March 14, 2020 17:24
SNMP MIB and SNMPTT helper script for Zabbix integration
@jpawlowski
jpawlowski / HAproxy_uberspace.markdown
Last active November 24, 2020 18:08
Setup HAproxy on an Uberspace webspace

HAproxy als Reverse Proxy auf Uberspace installieren

Wer bei verschiedenen Reverse Proxy Aktivitäten auf seinem Uberspace mit Apache auf Grenzen stößt, kann HAproxy installieren. Ähnlich wie Pound ist es DASein Swiss Army Knife für alle HTTP, HTTPS und TCP Aktivitäten. Man kann sehr granular auf Layer 3-7 beeinflussen, wie Daten an andere Server und Dienste weitergeschleust werden sollen.

Ich benötigte HAproxy, um eine Website von einem externen Server via TLS gesichert per Uberspace verfügbar zu machen, also ein recht simles Szenario.

Apache Proxy einrichten

@jpawlowski
jpawlowski / haproxy.cfg
Last active May 31, 2023 05:41
Geeking out with HAproxy on pfSense: The ultimate port 443 TLS/SSL router | http://loredo.me/post/116633549315/geeking-out-with-haproxy-on-pfsense-the-ultimate
global
maxconn 2000
stats socket /tmp/haproxy.socket level admin
uid 80
gid 80
nbproc 1
chroot /tmp/haproxy_chroot
daemon
tune.ssl.default-dh-param 2048
# Modern browser compatibility only as mentioned here:
@jpawlowski
jpawlowski / gist:7af3920f4814869a4b32
Last active January 21, 2017 16:54
Download all current video torrents of 32c3 congress at once under OS X. It uses GNU grep installed via Homebrew. Credits go to @jansauer https://twitter.com/jansauer/status/681253309777358849
brew install homebrew/dupes/grep; wget -q -O - https://cdn.media.ccc.de/congress/32C3/h264-hd/ | ggrep -oP '(?<=href=")[^"]*\.mp4(?=")' | xargs -I % bash -c 'test ! -f % && wget -q -nc "https://cdn.media.ccc.de/congress/32C3/h264-hd/%.torrent"'
@jpawlowski
jpawlowski / dwd_update.sh
Created November 23, 2015 12:52
Update weather maps from DWD servers for use with FHEM GDS module
#!/bin/bash
mkdir -p /tmp/gds
# ftp-Server als Verzeichnis mounten:
curlftpfs ftp-outgoing2.dwd.de /tmp/gds -o user=user:password
cd /tmp/gds/gds/specials/radar/southeast
NEUESTE_DATEI=$(ls -t | head -n 1)
cp -fpv "${NEUESTE_DATEI}" "/tmp/gds_radarmap.jpg"