Skip to content

Instantly share code, notes, and snippets.

View Finkregh's full-sized avatar
🚲

Oluf Lorenzen Finkregh

🚲
View GitHub Profile
^\w{3} [ :[:digit:]]{11} [._[:alnum:]-]+ sshd\[[[:digit:]]+\]: Did not receive identification string from ::ffff:[\.0-9]+$
^\w{3} [ :[:digit:]]{11} [._[:alnum:]-]+ sshd\[[[:digit:]]+\]: fatal: Read from socket failed: Connection reset by peer \[preauth\]$
^\w{3} [ :[:digit:]]{11} [._[:alnum:]-]+ sshd\[[[:digit:]]+\]: I(llegal|nvalid) user [^[:space:]]* from ([:.[:xdigit:]]+|UNKNOWN)$
^\w{3} [ :[:digit:]]{11} [._[:alnum:]-]+ sshd\[[[:digit:]]+\]: invalid public DH value: <= 1 \[preauth\]$
^\w{3} [ :[:digit:]]{11} [._[:alnum:]-]+ sshd\[[[:digit:]]+\]: Disconnecting: bad client public DH value \[preauth\]$
^\w{3} [ :[:digit:]]{11} [._[:alnum:]-]+ sshd\[[[:digit:]]+\]: Disconnecting: Change of username or service not allowed: \([[:alpha:]]+,ssh-connection\) -> \([[:alpha:]]+,ssh-connection\) \[preauth\]$
^\w{3} [ :[:digit:]]{11} [._[:alnum:]-]+ sshd\[[[:digit:]]+\]: Received disconnect from [:.[:xdigit:]]+: 3: com.jcraft.jsch.JSchException: Auth fail \[preauth\]$
^\w{3} [ :[:digit:]]{11} [._[:alnum:]-]+ sshd\[[[:
@Finkregh
Finkregh / bruteforce-encfs.sh
Created June 16, 2015 18:34
bruteforce encfs
#!/bin/sh
# initially from http://bredsaal.dk/cracking-encfs-made-easier
# usage: crackencfs.sh /path/to/encrypted/folder /path/to/mountpoint /path/to/wordlist
counter=1
while [ true ]; do
echo "$(head -n $counter $3 | tail -n 1)" | encfs $1 $2 --stdinpass
if [ $? -eq 0 ]; then
echo Key recovered - the password is:
@Finkregh
Finkregh / lsyncd.service
Created August 27, 2015 08:06
systemd-service file for lsyncd
[Unit]
Description=Live Syncing (Mirror) Daemon
After=network.target
[Service]
Restart=always
Type=simple
Nice=19
#EnvironmentFile=-/etc/default/lsyncd
#ExecStart=/usr/bin/sh -c 'eval `/usr/bin/lsyncd -nodaemon $LSYNCD_OPTIONS /etc/lsyncd/lsyncd.conf.lua`'
@Finkregh
Finkregh / .bashrc
Created September 3, 2015 08:43
endless-bash-history
HOSTNAME="$(hostname)"
HOSTNAME_SHORT="${HOSTNAME%%.*}"\\\\\
HISTFILE="${HOME}/.history/$(date -u +%Y/%m/%d.%H.%M.%S)_${HOSTNAME_SHORT}_$$"
# FIXME: upload to a central place. rsync? owncloud?
@Finkregh
Finkregh / create-prosody-groups.sh
Last active September 14, 2015 11:35
ActiveDirectory / LDAP groups to prosody
#!/bin/bash
# hacked together, might eat your kittens.
# for auth agains LDAP/AD look at https://blogs.mafia-server.net/nur-bahnhof/2013/12/prosody-authentification-ldapactivedirectory/
tmpfile=/tmp/sharedgroups.txt
XMPP_DOMAIN=xmpp.example.org
AD_DC=dc1.corp.example.org
LDAP_ROOT="dc=example,dc=org"
LDAP_SUB_OU="ou=OE"
ALL_USERS_GROUP="Everybody"
@Finkregh
Finkregh / ldif-to-dokuwiki-table.sh
Last active September 6, 2024 11:53 — forked from dansimau/ldif-to-csv.sh
Shell script that reads LDIF data from STDIN and outputs as DokuWiki table.
#!/bin/bash
#
# Converts LDIF data to DW-table.
# Doesn't handle comments very well. Use -LLL with ldapsearch to remove them.
#
# 2010-03-07, [email protected]
# 2016-01-21, [email protected]
# rewrite to output dokuwiki-data
#
@Finkregh
Finkregh / nginx-cors.conf
Created April 21, 2016 12:07 — forked from sbuzonas/nginx-cors.conf
Nginx CORS maps
map $http_origin $allow_origin {
default "";
"~^https?://(?:[^/]*\.)?(stevebuzonas\.(?:com|local))(?::[0-9]+)?$" "$http_origin";
}
map $request_method $cors_method {
default "allowed";
"OPTIONS" "preflight";
}
@Finkregh
Finkregh / extend.sh
Created September 29, 2017 08:12 — forked from wvengen/extend.sh
Extend non-HiDPI external display above HiDPI internal display
#!/bin/sh
# extend non-HiDPI external display on DP* above HiDPI internal display eDP*
# see also https://wiki.archlinux.org/index.php/HiDPI
# you may run into https://bugs.freedesktop.org/show_bug.cgi?id=39949
# https://bugs.launchpad.net/ubuntu/+source/xorg-server/+bug/883319
EXT=`xrandr --current | sed 's/^\(.*\) connected.*$/\1/p;d' | grep -v ^eDP | head -n 1`
INT=`xrandr --current | sed 's/^\(.*\) connected.*$/\1/p;d' | grep -v ^DP | head -n 1`
ext_w=`xrandr | sed 's/^'"${EXT}"' [^0-9]* \([0-9]\+\)x.*$/\1/p;d'`
#!/bin/bash
# Make this executable and name it .git/hooks/pre-commit to have commits
# randomly rejected with a prompt to rethink it. The odds are higher for
# longer commits
set -eu
# How many lines a commit must have before it's considered long and should
# have the highest odds of getting an extra prompt
@Finkregh
Finkregh / rancher-zerotier.yml
Created March 26, 2018 21:33 — forked from elcritch/rancher-zerotier.yml
Run ZeroTier on RancherOS
#cloud-config
rancher:
services:
zerotier:
image: zerotier/zerotier-containerized:1.2.4
labels:
io.rancher.os.scope: system
volumes:
- /var/lib/zerotier-one:/var/lib/zerotier-one
restart: always