Skip to content

Instantly share code, notes, and snippets.

View jpawlowski's full-sized avatar

Julian Pawlowski jpawlowski

View GitHub Profile
@jpawlowski
jpawlowski / milight.pl
Last active September 25, 2022 20:17
LED Wifi control script for MiLight, EasyBulb, iBulb, LinkUP, Kepsun
#!/usr/bin/perl -w
#
# LED Wifi control script for MiLight, EasyBulb, iBulb, LinkUP, Kepsun
# ====================================================================
#
#
# Copyright (C) 2013, Julian Pawlowski <julian.pawlowski@gmail.com>
# All rights reserved.
#
# License: Simplified BSD / FreeBSD License
@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 / gpg-gen-ecc.sh
Last active May 6, 2022 08:57
Unattended generation of GnuPG / OpenPGP keys w/ ECC
#!/bin/sh
NAME='John Doe'
EMAIL='jdo@example.com'
export GNUPGHOME="$(mktemp -d)"
cat >$TMPDIR/gpg-gen.tmpl <<EOF
%echo Generating an OpenPGP key
Key-Type: eddsa
Key-Curve: ed25519

PowerShell modules, digital signatures, NuGet nuspec and packages

d-fens GmbH General-Guisan-Strasse 6 CH-6300 Zug Switzerland

@jpawlowski
jpawlowski / profile.ps1
Created November 8, 2021 08:03
Dynamic Multi-Platform PowerShell Profile Loader
<#
.SYNOPSIS
Dynamic Multi-Platform PowerShell Profile Loader
.DESCRIPTION
Safe this script named 'profile.ps1' in either $PROFILE.AllUsersAllHosts or
$PROFILE.CurrentUserAllHosts.
(see: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_profiles#the-profile-variable)
It will automatically create a directory structure for every PS host
application, platform and PowerShell edition you use and replicate itself as
@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 / powershell.json
Created August 16, 2020 13:47 — forked from rkeithhill/powershell.json
PowerShell snippets file for Visual Studio Code - place in your ~\AppData\Roaming\Code\User\Snippets directory
{
"Condition statement": {
"prefix": "cond",
"body": [
"${_} { ${0}; break }"
],
"description": "Switch condition statement"
},
"Condition single quoted string statement": {
@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 / 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
#!/bin/bash
#
# see https://stribika.github.io/2015/01/04/secure-secure-shell.html
SSHD_VERSION=`/usr/sbin/sshd -v 2>&1 | grep OpenSSH | cut -d " " -f1 | cut -d "_" -f2 | cut -d"." -f2 | cut -d"p" -f1`
cat /etc/ssh/sshd_config | grep -v "KexAlgorithms" | grep -v "Ciphers" | grep -v "MACs" | grep -v "github.com" > /etc/ssh/sshd_config.new
cat /etc/ssh/ssh_config | grep -v "KexAlgorithms" | grep -v "Ciphers" | grep -v "MACs" | grep -v "github.com" > /etc/ssh/ssh_config.new
if [ "${SSHD_VERSION}" != "0" ]; then
# better algorithms only available on newer OpenSSH versions
echo "KexAlgorithms curve25519-sha256@libssh.org,diffie-hellman-group-exchange-sha256" >> /etc/ssh/sshd_config.new