Skip to content

Instantly share code, notes, and snippets.

View Gunni's full-sized avatar

Gunnar Guðvarðarson Gunni

View GitHub Profile

Keybase proof

I hereby claim:

  • I am Gunni on github.
  • I am gunni (https://keybase.io/gunni) on keybase.
  • I have a public key whose fingerprint is 7F4B 48AC F283 1B71 AE3D 2D10 A540 617A 282B DF22

To claim this, I am signing this object:

http
{
# ...
ssl_ciphers "EECDH+ECDSA+AESGCM EECDH+aRSA+AESGCM EECDH+ECDSA+SHA384 EECDH+ECDSA+SHA256 ECDHE-RSA-AES256-SHA384 EECDH+aRSA+SHA384 EECDH+aRSA+SHA256 EECDH !EDH+aRSA !RC4 !aNULL !eNULL !LOW !3DES !MD5 !EXP !PSK !SRP !DSS";
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:64m;
ssl_session_tickets on;
ssl_session_timeout 1h;
@Gunni
Gunni / keybase.md
Last active November 5, 2017 12:49
Keybase proof of account ownership

Keybase proof

I hereby claim:

  • I am Gunni on github.
  • I am gunni (https://keybase.io/gunni) on keybase.
  • I have a public key whose fingerprint is 9E10 82AD 43F2 AF43 36D7 8A71 FF8D F079 9F3E 74FD

To claim this, I am signing this object:

@Gunni
Gunni / client-cert.inc.php
Created March 2, 2017 23:05
html/includes/authentication/client-cert.inc.php
<?php
/**
* Observium
*
* This file is part of Observium.
*
* @package observium
* @subpackage authentication
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2016 Observium Limited
<?php
define(LDAP_OPT_DIAGNOSTIC_MESSAGE, 0x0032);
$handle = ldap_connect('ldap://9.0.0.1');
$bind = ldap_bind($handle, 'observium-xxxxx@domain.local', 'super good password');
if ( ! $bind)
{
if (ldap_get_option($handle, LDAP_OPT_DIAGNOSTIC_MESSAGE, $extended_error))
@Gunni
Gunni / wgp.py
Last active June 28, 2019 00:14
Wireguard prettifier
#!/usr/bin/python3
'''
The script looks for a line similar to:
PublicKey=eP5bTA845m1hTnp0bjgFnw4efn+NHQ7WrXVwVmffwhY=
Then it goes back one line and uses that if it is a comment
# Example comment
Example file content
@Gunni
Gunni / .py
Created July 19, 2019 18:43
python sha512 using mmap
# Switch sha512 out for any other if you want
# Use hexdigest if you want a "normal" hex version of the digest
def hashFile(path):
with open(path, 'r') as fh, mmap.mmap(fh.fileno(), 0, prot=mmap.PROT_READ) as map:
return hashlib.sha512(map).digest()
@Gunni
Gunni / ipv6allocations.py
Last active August 25, 2019 07:14
Just to show how huge IPv6 is
from collections import defaultdict
import requests
import csv
import ipaddress
import datetime
print(f'# {datetime.datetime.utcnow()}')
assignmentsFile = requests.get('https://www.iana.org/assignments/ipv6-unicast-address-assignments/ipv6-unicast-address-assignments.csv')
assignmentsFile.raise_for_status()
@Gunni
Gunni / nftables.conf
Created February 26, 2020 23:12
Example nftables.conf for a wireguard "server"
table inet filter {
chain inbound {
type filter hook input priority 0
policy drop
ct state invalid counter drop
ct state { established, related } counter accept
ip protocol icmp counter accept
ip6 nexthdr ipv6-icmp counter accept
@Gunni
Gunni / output.txt
Last active April 21, 2020 15:01
RPKI Results, Iceland
Not found:
2603 192.36.171.0/24
2603 194.68.13.0/24
6677 31.209.144.0/20
6677 31.209.192.0/18
6677 85.220.0.0/17
6677 157.157.0.0/16
6677 192.147.34.0/24
6677 194.105.224.0/19