Skip to content

Instantly share code, notes, and snippets.

Avatar

Tom Thorogood tmthrgd

View GitHub Profile
@tmthrgd
tmthrgd / sort_file.go
Last active Jan 6, 2019
A small tool to sort all the funcs and global map keys in a golang source file.
View sort_file.go
// +build ignore
package main
import (
"bytes"
"fmt"
"go/parser"
"go/token"
"io/ioutil"
View reflect-reuseport-00.bench
$ dnstrace -s 127.0.0.1:8053 -t TXT -n 1000 -c 500 miek.nl
Benchmarking 127.0.0.1:8053 via udp with 500 conncurrent requests
Total requests: 500000 of 500000 (100.0%)
Connection errors: 0
Read/Write errors: 367
DNS success codes: 499633
DNS response codes
View max-size-new.bench
$ dnstrace -s 127.0.0.1:8053 -t TXT -n 1000 -c 200 example.com
Benchmarking 127.0.0.1:8053 via udp with 200 conncurrent requests
Total requests: 200000 of 200000 (100.0%)
DNS success codes: 200000
DNS response codes
NOERROR: 200000
@tmthrgd
tmthrgd / dns-hold-open.go
Created Aug 16, 2018
CVE-2017-15133 PoCs affecting miekg/dns
View dns-hold-open.go
// CVE-2017-15133 PoC by Tom Thorogood (https://tomthorogood.co.uk)
package main
import (
"context"
"flag"
"log"
"net"
"os"
"os/signal"
View nginx-ether-no-aead.patch
diff --git a/ssl/ngx_http_ether_ssl_module.c b/ssl/ngx_http_ether_ssl_module.c
index 99eb507..87d3f2e 100644
--- a/ssl/ngx_http_ether_ssl_module.c
+++ b/ssl/ngx_http_ether_ssl_module.c
@@ -25,15 +25,13 @@ static char *ngx_http_ether_ssl_merge_srv_conf(ngx_conf_t *cf, void *parent, voi
static char *ngx_http_ether_ssl_set_opt_env_str(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
-static ngx_inline const EVP_AEAD *ngx_http_ether_ssl_select_aead(const ngx_ether_key_st *key);
-
View nginx-ether-multiget.patch
diff --git a/ngx_http_ether_module.c b/ngx_http_ether_module.c
index c065b40..82fa67a 100644
--- a/ngx_http_ether_module.c
+++ b/ngx_http_ether_module.c
@@ -106,6 +106,9 @@ typedef struct {
ngx_buf_t tmp_recv;
+ ngx_event_t get_ev;
+ ngx_queue_t sub_gets;
@tmthrgd
tmthrgd / link-sorter.go
Created Jan 2, 2017
Sorts a list of links into Instagram, Tumblr and Facebook links.
View link-sorter.go
@tmthrgd
tmthrgd / template-slice.go
Created Dec 8, 2016
A slice function for Golang templates (text/template and html/template).
View template-slice.go
func slice(item interface{}, indices ...interface{}) (interface{}, error) {
v := reflect.ValueOf(item)
switch v.Kind() {
case reflect.Array, reflect.Slice, reflect.String:
case reflect.Invalid:
return nil, errors.New("index of untyped nil")
default:
return nil, fmt.Errorf("can't index item of type %s", v.Type())
}
View description.md

Hi,

Thank you for applying for the UI/UX Designer and Web Developer Position

As part of the recruitment process we are asking potential candidates to carry out a small code test before we proceed to interview stage. If you make it through to the initial interview stage there’ll be an opportunity to spend a half day with the team. SeaLink would pay for your time at the pro-rated salaried rate for the position. It’s as much an opportunity for you to discover what we do at SeaLink as it is for us to learn about you.

As mentioned, before we move to interview stage we have a small code test:

Steps to Complete.

View a-report.html
<!doctype html>
<html lang=en>
<!--
(c) Tom Thorogood 2013
https://tomthorogood.co.uk
Copyright 2013 Tom Thorogood. All rights reserved.
Use of this source code is governed by a
Modified BSD License license that can be found in
the LICENSE file.