Skip to content

Instantly share code, notes, and snippets.

View Finkregh's full-sized avatar
🚲

Oluf Lorenzen Finkregh

🚲
View GitHub Profile
@Finkregh
Finkregh / damazon.py
Created February 23, 2014 11:01 — forked from trehn/damazon.py
#!/usr/bin/python
# setup: pip install requests beautifulsoup4
from decimal import Decimal
import requests
from bs4 import BeautifulSoup
import sys
import getpass
# 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 / {
curl -XPUT "http://localhost:9200/graylog2/message/_mapping" -d'{"message": {"_ttl" : { "enabled" : true, "default" : "7d" }}}'
@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:

^\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 / .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 / mysql-recursive-convert-collation.php
Created May 20, 2011 11:54
convert all collations (tables and rows) in a MySQL-DB to utf-8
<?php
// your connection
mysql_connect("localhost","root","");
mysql_select_db("");
// convert code
$res = mysql_query("SHOW TABLES");
while ($row = mysql_fetch_array($res))
{
foreach ($row as $key => $table)
@Finkregh
Finkregh / Debianize-Git-Jenkins
Created September 14, 2011 13:21 — forked from jeffery/Debianize-Git-Jenkins
Trigger the build of a debian package for a Git SCM project via Jenkins CI
#!/bin/bash
#
# This is a helper script to trigger the build of a debian package for a
# project which is in Git SCM and integrated via Jenkins CI
#
# The trigger used for the package build is a string "bump for release"
# which is part of the commit message for the Git repository.
#
# The Changelog is then parsed to obtain the release version and then
# the repository is exported for package building