Skip to content

Instantly share code, notes, and snippets.

@missdeer
missdeer / gist:e22631912ddc858f4894
Created Nov 5, 2015 — forked from msmuenchen/gist:9318327
KeePass v2.x (KDBX v3.x) file format
View gist:e22631912ddc858f4894
Convention: Byte array notation as it would appear in a hexeditor.
= Layout=
KDBX files, the keepass database files, are layout as follows:
1) Bytes 0-3: Primary identifier, common across all kdbx versions:
private static $sigByte1=[0x03,0xD9,0xA2,0x9A];
2) Bytes 4-7: Secondary identifier. Byte 4 can be used to identify the file version (0x67 is latest, 0x66 is the KeePass 2 pre-release format and 0x55 is KeePass 1)
View SwipeArea.qml
/* This code was written by Sergejs Kovrovs and has been placed in the public domain. */
import QtQuick 2.0
MouseArea {
property point origin
property bool ready: false
signal move(int x, int y)
signal swipe(string direction)
View crosscompilego.bat
set GOARCH=amd64
set GOOS=darwin
call make.bat --no-clean
set GOOS=linux
call make.bat --no-clean
set GOOS=windows
call make.bat --no-clean
set GOOS=freebsd
call make.bat --no-clean
set GOOS=openbsd
@missdeer
missdeer / crosscompilego.sh
Created Nov 19, 2014
cross copmile go toolchain
View crosscompilego.sh
#!/bin/bash
# Copyright 2012 The Go Authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
# support functions for go cross compilation
type setopt >/dev/null 2>&1 && setopt shwordsplit
PLATFORMS="darwin/386 darwin/amd64 openbsd/386 openbsd/amd64 netbsd/386 netbsd/amd64 dragonfly/386 dragonfly/amd64 freebsd/386 freebsd/amd64 freebsd/arm linux/386 linux/amd64 linux/arm windows/386 windows/amd64"
View gist:54570737b21a11e124c6
import "code.google.com/p/go.net/html/charset"
ad := &models.ArticleDocument{}
d := xml.NewDecoder(bytes.NewReader([]byte(xmldoc)))
d.CharsetReader = func(s string, r io.Reader) (io.Reader, error) {
return charset.NewReader(r, s)
}
d.Decode(ad)
View gist:d9f8ba521faf5b74dc92
func main() {
python_readability := &controllers.PythonReadabilityController{}
beego.Router("/*", python_readability, "get:Get")
........
}
func (u *PythonReadabilityController) Get() {
url = u.GetString(":splat")
if len(url) != 0 {
url = strings.Replace(url, "http:/", "http://", 1)
View gist:5d28cb6cb44f6f7ce6c0
{
"recipients": [
0x01,
0x02
],
"body": "hello",
"type": 1
}
View ssl_smtp_example.go
package main
import (
"fmt"
"log"
"net"
"net/mail"
"net/smtp"
"crypto/tls"
)
View gist:a2ab151b734d2ecf8510
183.60.243.233 - 199.91.73.17 - - [17/Jun/2014:22:36:43 +0800] "GET / HTTP/1.1" 200 13888 "-" "-""-"
183.60.243.233, 10.1.1.1 - 199.91.73.17 - - [17/Jun/2014:22:37:16 +0800] "GET /robots.txt HTTP/1.1" 200 425 "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; SV1; QQDownload 732; .NET4.0C; .NET4.0E; 360SE)""-"
183.60.243.233, 10.1.1.1 - 199.91.73.17 - - [17/Jun/2014:22:37:44 +0800] "GET / HTTP/1.1" 200 13888 "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; SV1; QQDownload 732; .NET4.0C; .NET4.0E; 360SE)""-"
183.60.243.233, 10.1.1.1 - 199.91.73.17 - - [17/Jun/2014:22:38:15 +0800] "GET / HTTP/1.1" 200 13888 "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; SV1; QQDownload 732; .NET4.0C; .NET4.0E; 360SE)""-"
183.60.243.233, 10.1.1.1 - 199.91.73.17 - - [17/Jun/2014:22:38:46 +0800] "GET /login HTTP/1.1" 200 9953 "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; SV1; QQDownload 732; .NET4.0C; .NET4.0E; 360SE)""-"
183.60.243.233, 10.1.1.1 -
You can’t perform that action at this time.