Skip to content

Instantly share code, notes, and snippets.

@cuberri
cuberri / gist:9335863
Last active August 29, 2015 13:56
Sample mercurial workflow : changelog generation strategy in feature branching
#
# repository initialization
#
hg init helloworld && cd helloworld
echo 'hello!' > helloworld.txt
hg add
hg ci -m 'added a dumb file to init the repo of this example'
# necessary tricky tag for the first changelog generation :(
hg tag 0.0.0
@cuberri
cuberri / postgresql-drop-create.sh
Last active May 21, 2017 16:39
Reminder script used to automate postgresql related stuff
#!/bin/bash
#-------------------------------------------------------------------------------
# RECREATE DATABASE FROM DDL AND DML SCRIPTS
#-------------------------------------------------------------------------------
BASEDIR="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
SQLDIR="${BASEDIR}/sql"
PSQL_BIN="/usr/bin/psql"
PG_USER="<enter_pg_user_to_connect_with>"
@cuberri
cuberri / gist:5995686
Created July 14, 2013 20:02
root@rok4:/vagrant_rok4-workspace# awk '/^\t0x*/{print substr($0,11,39)}' getversion.req | tr -d ' ','\n' | awk '{print substr($0,length($0)+1-576,576)}' | awk '{print gensub("(..)","\\\\x\\1","g",$0)}'
\x45\x52\x5f\x50\x52\x4f\x54\x4f\x43\x4f\x4c\x48\x54\x54\x50\x2f\x31\x2e\x31\x11\x07\x47\x41\x54\x45\x57\x41\x59\x5f\x49\x4e\x54\x45\x52\x46\x41\x43\x45\x43\x47\x49\x2f\x31\x2e\x31\x0f\x0b\x53\x45\x52\x56\x45\x52\x5f\x53\x4f\x46\x54\x57\x41\x52\x45\x6e\x67\x69\x6e\x78\x2f\x31\x2e\x32\x2e\x31\x0b\x09\x52\x45\x4d\x4f\x54\x45\x5f\x41\x44\x44\x52\x31\x32\x37\x2e\x30\x2e\x30\x2e\x31\x0b\x05\x52\x45\x4d\x4f\x54\x45\x5f\x50\x4f\x52\x54\x34\x30\x31\x34\x34\x0b\x09\x53\x45\x52\x56\x45\x52\x5f\x41\x44\x44\x52\x31\x32\x37\x2e\x30\x2e\x30\x2e\x31\x0b\x04\x53\x45\x52\x56\x45\x52\x5f\x50\x4f\x52\x54\x38\x30\x38\x30\x0b\x09\x53\x45\x52\x56\x45\x52\x5f\x4e\x41\x4d\x45\x6c\x6f\x63\x61\x6c\x68\x6f\x73\x74\x05\x00\x48\x54\x54\x50\x53\x0f\x03\x52\x45\x44\x49\x52\x45\x43\x54\x5f\x53\x54\x41\x54\x55\x53\x32\x30\x30\x0f\x0b\x48\x54\x54\x50\x5f\x55\x53\x45\x52\x5f\x41\x47\x45\x4e\x54\x63\x75\x72\x6c\x2f\x37\x2e\x32\x36\x2e\x30\x09\x0e\x48\x54\x54\x50\x5f\x48\x4f\x53\x54\x6c\x6f\x63\x61\x6c\x68\x6f\x73\x74\x3a\x38\x30\x38\x30\x0b\x03
@cuberri
cuberri / gist:5995297
Last active December 19, 2015 17:59
# tcpdump -r getversion.pcap -X -n | grep -B6 -A34 "ERY_STRINGreques" | tee getversion.req
20:58:05.110369 IP 127.0.0.1.40076 > 127.0.0.1.9000: Flags [P.], seq 1:577, ack 1, win 8198, options [nop,nop,TS val 3575215 ecr 3575215], length 576
0x0000: 4500 0274 0993 4000 4006 30ef 7f00 0001 E..t..@[email protected].....
0x0010: 7f00 0001 9c8c 2328 3f56 843f 948e 9276 ......#(?V.?...v
0x0020: 8018 2006 0069 0000 0101 080a 0036 8daf .....i.......6..
0x0030: 0036 8daf 0101 0001 0008 0000 0001 0000 .6..............
0x0040: 0000 0000 0104 0001 0216 0200 0c1f 5155 ..............QU
0x0050: 4552 595f 5354 5249 4e47 7265 7175 6573 ERY_STRINGreques
0x0060: 743d 4765 7456 6572 7369 6f6e 2673 6572 t=GetVersion&ser
0x0070: 7669 6365 3d57 4d54 530e 0352 4551 5545 vice=WMTS..REQUE
0x0080: 5354 5f4d 4554 484f 4447 4554 0c00 434f ST_METHODGET..CO
@cuberri
cuberri / getversion.pcap
Created July 14, 2013 18:25
# tcpdump -r getversion.pcap -X -n
reading from file getversion.pcap, link-type LINUX_SLL (Linux cooked)
20:58:05.110305 IP 127.0.0.1.40076 > 127.0.0.1.9000: Flags [S], seq 1062634558, win 32792, options [mss 16396,sackOK,TS val 3575215 ecr 0,nop,wscale 2], length 0
0x0000: 4500 003c 0991 4000 4006 3329 7f00 0001 E..<..@[email protected])....
0x0010: 7f00 0001 9c8c 2328 3f56 843e 0000 0000 ......#(?V.>....
0x0020: a002 8018 fe30 0000 0204 400c 0402 080a .....0....@.....
0x0030: 0036 8daf 0000 0000 0103 0302 .6..........
20:58:05.110317 IP 127.0.0.1.9000 > 127.0.0.1.40076: Flags [S.], seq 2492371573, ack 1062634559, win 32768, options [mss 16396,sackOK,TS val 3575215 ecr 3575215,nop,wscale 2], length 0
0x0000: 4500 003c 0000 4000 4006 3cba 7f00 0001 E..<..@.@.<.....
0x0010: 7f00 0001 2328 9c8c 948e 9275 3f56 843f ....#(.....u?V.?
0x0020: a012 8000 fe30 0000 0204 400c 0402 080a .....0....@.....
@cuberri
cuberri / Rok4GetVersion.xml
Created July 14, 2013 18:23
# curl "http://localhost:8080/wmts?request=GetVersion&service=WMTS"
<ExceptionReport xmlns="http://www.opengis.net/ows/1.1">
<Exception exceptionCode="OperationNotSupported" >
L'operation getversion n'est pas prise en charge par ce serveur.ROK4-0.13.1
</Exception>
</ExceptionReport>