Skip to content

Instantly share code, notes, and snippets.

@tvi
tvi / cp1250.go
Created July 13, 2017 09:14
golang windows cp1250 to utf8 conversion
import "golang.org/x/text/encoding/charmap"
func DecodeWindows1250(enc []byte) string {
dec := charmap.Windows1250.NewDecoder()
out, _ := dec.Bytes(ba)
return string(out)
}
func EncodeWindows1250(inp string) []byte {
enc := charmap.Windows1250.NewEncoder()
@tvi
tvi / upc_keys.c
Created January 5, 2016 18:46
upc_keys.c
/*
* upc_keys.c -- WPA2 passphrase recovery tool for UPC%07d devices
* ===============================================================
* You'd think vendors would stop using weak algorithms that allow
* people to recover the credentials for a WiFi network based on
* purely the ESSID. Sadly, these days aren't over yet. We've seen
* some excellent recent research by Novella/Meijer/Verdult [1][2]
* lately which illustrates that these issues still exist in recent
* devices/firmwares. I set out to dig up one of these algorithms
* and came up with this little tool.
@tvi
tvi / designer.html
Created August 19, 2014 01:15
designer
<link rel="import" href="../core-scaffold/core-scaffold.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-menu/core-menu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-menu/core-submenu.html">
<polymer-element name="my-element">
@tvi
tvi / emacs-vimium.map
Last active August 29, 2015 13:57
Emacs key mapping for vimium.
unmapAll
map <c-n> scrollDown
map <c-p> scrollUp
map <c-b> scrollLeft
map <c-f> scrollRight
map <c-v> scrollFullPageDown
map <a-v> scrollFullPageUp
map <c-w> copyCurrentUrl
map <a-w> copyCurrentUrl
map <c-k> copyCurrentUrl
@tvi
tvi / keybase.md
Last active January 26, 2017 16:35

Keybase proof

I hereby claim:

  • I am tvi on github.
  • I am tomas (https://keybase.io/tomas) on keybase.
  • I have a public key whose fingerprint is FCDB D510 548B F95E 26C0 6842 3651 8CFB E6D6 DD60

To claim this, I am signing this object: