Skip to content

Instantly share code, notes, and snippets.

gdm85 gdm85

Block or report user

Report or block gdm85

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@gdm85
gdm85 / round.go
Created Nov 22, 2017
Round function for Go < 1.10
View round.go
package main
import (
"math"
)
// some constants copied from https://github.com/golang/go/blob/master/src/math/bits.go
const (
shift = 64 - 11 - 1
bias = 1023
@gdm85
gdm85 / iftopsvc.log
Last active Feb 10, 2018
Example of log output of iftop -S 8080
View iftopsvc.log
interface: eth0
IP address is: 192.168.1.10
MAC address is: c7:35:ce:fd:8e:a1
[Fri Feb 2 22:03:10 2018] REST webservice starting on port 8080
[Fri Feb 2 22:03:10 2018] "GET /iftop/history" 200 35
[Fri Feb 2 22:03:12 2018] "GET /iftop/history" 200 145
[Fri Feb 2 22:03:15 2018] "GET /iftop/history" 200 145
[Fri Feb 2 22:03:17 2018] "GET /iftop/history" 200 145
[Fri Feb 2 22:03:19 2018] "GET /iftop/history" 200 145
[Fri Feb 2 22:03:21 2018] "GET /iftop/history" 200 145
@gdm85
gdm85 / iftopsvc.json
Last active Feb 10, 2018
Example output of /iftop/history
View iftopsvc.json
{
"version": "1.0pre4",
"history": [{
"source": "192.168.1.10:55340",
"destination": "172.207.13.3:443",
"received": 4758,
"sent": 1118,
"protocol": 6
},
{
View adtxt.cfg
label expert
menu label ^Expert install
kernel linux
append priority=low vga=0x340 initrd=initrd.gz ---
label cli-expert
menu label Command-^line expert install
kernel linux
append tasks=standard pkgsel/language-pack-patterns= pkgsel/install-language-support=false priority=low vga=0x340 initrd=initrd.gz ---
include rqtxt.cfg
@gdm85
gdm85 / socat-add-verify-hash.patch
Created Dec 25, 2017
Socat patch to add hash verification to openSSL connections
View socat-add-verify-hash.patch
commit 49d13df85993eda521002b9c197d68914c0c86e6
Author: gdm85 <gdm85@users.noreply.github.com>
Date: Tue Nov 14 23:21:23 2017 +0100
[PATCH] Add support for openssl-verify-hash
A new option is added, openssl-verify-hash with alias verify-hash; this option
specifies a SHA256 hash in hexadecimal format that will be required to match
the X509 hash of the OpenSSL peer certificate.
Documentation is updated to mention MiTM for the pre-existing 'verify' option
@gdm85
gdm85 / nodejs-express-cookies-example.js
Created Jun 19, 2014
How to create session cookies with Node.js + Express
View nodejs-express-cookies-example.js
var express = require('express'),
app = express(),
https = require('https'),
fs = require('fs'),
keys = require( "keygrip" )(['secret1', 'secret2']),
cookies = require( "cookies" );
// This line is from the Node.js HTTPS documentation
var options = {
key: fs.readFileSync('private_key_cert.pem'),
@gdm85
gdm85 / keymap.cson
Last active Nov 13, 2016
D-Lang IDE with Atom: keymap.cson
View keymap.cson
## main article: https://medium.com/@gdm85/atom-editor-building-with-f5-edc228034ec0
'atom-workspace':
'f5' : 'atom-shell-commands:run-project'
'f6' : 'atom-shell-commands:make-project'
'atom-text-editor':
'f5' : 'dlang:save-run'
'f6' : 'dlang:save-build'
@gdm85
gdm85 / init.coffee
Last active Nov 13, 2016
D-Lang IDE with Atom: init.coffee
View init.coffee
## main article: https://medium.com/@gdm85/atom-editor-building-with-f5-edc228034ec0
atom.commands.add 'atom-text-editor', 'dlang:save-run', ->
editor = atom.workspace.getActiveTextEditor()
editor.save()
atom.commands.dispatch(atom.views.getView(editor), 'atom-shell-commands:dfmt-run')
atom.commands.add 'atom-text-editor', 'dlang:save-build', ->
editor = atom.workspace.getActiveTextEditor()
editor.save()
atom.commands.dispatch(atom.views.getView(editor), 'atom-shell-commands:dfmt-build')
@gdm85
gdm85 / config.cson
Last active Nov 13, 2016
D-Lang IDE with Atom: config.cson
View config.cson
## main article: https://medium.com/@gdm85/atom-editor-building-with-f5-edc228034ec0
"*":
"atom-shell-commands":
commands: [
{
name: "make-project"
command: "make"
options:
cwd: "{ProjectDir}"
matchs: [
@gdm85
gdm85 / wolfengo.log
Created Feb 12, 2016
Texture coordinates debug output (Linux/working)
View wolfengo.log
WolfenGo v0.1.1, Copyright (C) 2016 gdm85
https://github.com/gdm85/wolfengo
WolfenGo comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under GNU/GPLv2 license.
3.0 Mesa 10.1.3
addVertices( [-0.14736843 0 0 -1 1 0 0 0 -0.14736843 0.25 0 -1 -0 0 0 0 0.14736843 0.25 0 -0 -0 0 0 0 0.14736843 0 0 -0 1 0 0 0] , [0 1 2 0 2 3] )
addVertices( [-0.18125 0 0 -1 1 0 0 0 -0.18125 0.7 0 -1 -0 0 0 0 0.18125 0.7 0 -0 -0 0 0 0 0.18125 0 0 -0 1 0 0 0] , [0 1 2 0 2 3] )
addVertices( [0 0 0 0.5 1 0 0 0 0 1 0 0.5 0.75 0 0 0 1 1 0 0.75 0.75 0 0 0 1 0 0 0.75 1 0 0 0 0 0 0 0.73 1 0 0 0 0 1 0 0.73 0.75 0 0 0 0 1 0.125 0.75 0.75 0 0 0 0 0 0.125 0.75 1 0 0 0 0 0 0.125 0.5 1 0 0 0 0 1 0.125 0.5 0.75 0 0 0 1 1 0.125 0.75 0.75 0 0 0 1 0 0.125 0.75 1 0 0 0 1 0 0 0.73 1 0 0 0 1 1 0 0.73 0.75 0 0 0 1 1 0.125 0.75 0.75 0 0 0 1 0 0.125 0.75 1 0 0 0] , [0 1 2 0 2 3 6 5 4 7 6 4 10 9 8 11 10 8 12 13 14 12 14 15] )
addVertices( [-0.030106707 0 0 -1 1 0 0 0 -0.030106707 0.0625 0 -1 -0 0 0 0 0.030106707
You can’t perform that action at this time.