Skip to content

Instantly share code, notes, and snippets.

View DavyLandman's full-sized avatar

Davy Landman DavyLandman

View GitHub Profile
@DavyLandman
DavyLandman / panic-20150414-215721.log
Created April 19, 2015 14:29
syncthing-panic-logs
[O67KX] 2015/04/14 21:56:53.779665 main.go:398: INFO: syncthing v0.10.30 (go1.4.2 linux-arm default) builduser@leming 2015-03-29 07:46:44 UTC
[O67KX] 2015/04/14 21:56:53.780569 main.go:399: INFO: My ID: ---
[O67KX] 2015/04/14 21:56:54.612056 progressemitter.go:90: DEBUG: progress emitter: updated interval 5s
[O67KX] 2015/04/14 21:56:54.613151 progressemitter.go:57: DEBUG: progress emitter: timer - looking after 0
[O67KX] 2015/04/14 21:56:54.613415 progressemitter.go:73: DEBUG: progress emitter: nothing new
[O67KX] 2015/04/14 21:57:08.220194 main.go:665: INFO: Starting web GUI on http://0.0.0.0:8384/
[O67KX] 2015/04/14 21:57:14.601994 model.go:414: DEBUG: IDX(in): --- "Davy-Documents": 0 files
[O67KX] 2015/04/14 21:57:14.612013 model.go:414: DEBUG: IDX(in): --- "Davy-Pictures": 0 files
[O67KX] 2015/04/14 21:57:14.627633 model.go:414: DEBUG: IDX(in): --- "davy-camera": 0 files
[O67KX] 2015/04/14 21:57:14.637224 main.go:916: INFO: Starting local discovery announcements
@DavyLandman
DavyLandman / keybase.md
Created February 25, 2015 08:35
keybase.md

Keybase proof

I hereby claim:

  • I am DavyLandman on github.
  • I am davylandman (https://keybase.io/davylandman) on keybase.
  • I have a public key whose fingerprint is 49D1 473B AAB8 8188 A2BA 8705 D40E 418E 10BE 143C

To claim this, I am signing this object:

@DavyLandman
DavyLandman / gist:c0dd99cdbee35d1a9a4e
Last active August 29, 2015 14:07
Rename pdf's based on metadata (requires pdfinfo from the poppler package)
# It uses the pdf meta data to rename the file to the title of the pdf
# on osx it requires poppler installed: brew install poppler
find . -type f -name "*.pdf" -exec sh -c 'mv "$0" "$(pdfinfo $0 | sed -n "/^Title/ s/Title:\(.*\)/\1.pdf/p" | sed "s/^[ \t]*//" | sed -e "s/[^A-Za-z0-9._-]/_/g")"' {} \;
@DavyLandman
DavyLandman / ssh-ssl-in-one.go
Last active January 31, 2016 14:13
The ssh-ssl-behind same port trick but now in go (previous version was in nodejs https://gist.github.com/DavyLandman/8314380 ) for more details on how it works, see the other issue. *why go?:* nodejs is not that nice for low-performance cpu's, and go nicely compiles to a native application :)
package main
import (
"net"
"log"
"time"
)
var noDeadline = time.Time{}
@DavyLandman
DavyLandman / ssh-ssl-in-one.js
Last active July 20, 2017 09:41
A recent nodejs trick, hide the ssh agent behind a https port. This means you can serve stuff via https, and almost always login into ssh (since the 443 port is hardly filtered/proxied).And if you have ssh, well all bets are off ;-)
var net = require('net');
net.createServer(httpsSshSwitch).listen(443);
// if the first byte is 22, it is a https handshake,
// so redirect it to the actual https server (running on port 8443)
// else redirect it to the ssh instance.
//
// some ssh clients wait for the server to send the first welcome message
// so if we have not seen any data for 2 seconds, assume it is a ssh connection
@DavyLandman
DavyLandman / Output.txt
Created September 23, 2012 15:41
URI encoding stuff in Java
project://name/path
auth: name host: name port: -1
project://name%20space/path
auth: name space host: null port: -1
project://name:200/path
auth: name:200 host: name port: 200
project://name%20space:200/path
@DavyLandman
DavyLandman / new_bashrc.sh
Created August 11, 2012 15:59 — forked from josephwecker/new_bashrc.sh
Replace .bashrc, .bash_profile, .profile, etc. with something much more clean, consistent, and meaningful.
#!/bin/bash
# License: Public Domain.
# Author: Joseph Wecker, 2012
#
# Are you tired of trying to remember what .bashrc does vs .bash_profile vs .profile?
# Are you tired of trying to remember how darwin/mac-osx treat them differently from linux?
# Are you tired of not having your ~/.bash* stuff work the way you expect?
#
# Symlink all of the following to this file:
# * ~/.bashrc
@DavyLandman
DavyLandman / gist:2634816
Created May 8, 2012 13:09
Turing L1 Bitflipper
J14
W1
J_5
W0
MF
J19
W1
J_10
W0
MF
@DavyLandman
DavyLandman / gist:2634811
Created May 8, 2012 13:08
Turing L2 Bitflipper
L Restart
REP 10 {
L Start
J1 Unset
W1
J_ Move
L Unset
W0
L Move
MF
// Add support for an alternative (second) dateFormat to the jQuery datepicker
(function () {
var oldMethod = $.datepicker.parseDate;
$.datepicker.parseDate = function () {
var dateValue = Date.parseExact(arguments[1], 'ddMMyyyy');
if (dateValue) {
return dateValue;
}
return oldMethod.apply(this, arguments);
};