Skip to content

Instantly share code, notes, and snippets.

View Finkregh's full-sized avatar
🚲

Oluf Lorenzen Finkregh

🚲
View GitHub Profile
@Finkregh
Finkregh / ldif-to-dokuwiki-table.sh
Last active January 21, 2016 13:48 — 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, dsimmons@squiz.co.uk
# 2016-01-21, finkregh@mafia-server.net
# rewrite to output dokuwiki-data
#
@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 / .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 / 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 / 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:
^\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 / keybase.md
Created October 9, 2014 18:44
keybase.md

Keybase proof

I hereby claim:

  • I am finkregh on github.
  • I am finkregh (https://keybase.io/finkregh) on keybase.
  • I have a public key whose fingerprint is 327E 822C 5533 8A8A 51AF 2CC4 FFC0 1051 DEE0 B735

To claim this, I am signing this object:

curl -XPUT "http://localhost:9200/graylog2/message/_mapping" -d'{"message": {"_ttl" : { "enabled" : true, "default" : "7d" }}}'
# The blog post that started it all: https://neocities.org/blog/the-fcc-is-now-rate-limited
#
# Current known FCC address ranges:
# https://news.ycombinator.com/item?id=7716915
#
# Confirm/locate FCC IP ranges with this: http://whois.arin.net/rest/net/NET-165-135-0-0-1/pft
#
# In your nginx.conf:
location / {