Skip to content

Instantly share code, notes, and snippets.

Work in progress

Denis Sedchenko x1unix

Work in progress
View GitHub Profile
x1unix / parsefloat.go
Created Aug 10, 2020
Go: precise float parse
View parsefloat.go
package main
import (
// ParseFloatPrecisely parses floating point from string as strconv.ParseFloat
// but avoids float point precision issue (ex: "0.21" parsed as 0.209999)
func ParseFloatPrecisely(str string, bitSize int) (num float64, err error) {
if str == "" || str == "0" {
x1unix /
Last active May 29, 2020
The VIM Cheatsheet
x1unix / cidr.go
Last active Apr 16, 2020
Go - CIDR to IPs
View cidr.go
package main
func IPsFromCIDR(cidr string) ([]net.IP, error) {
_, ipNet, err := net.ParseCIDR(cidr)
if err != nil {
return nil, err
ones, bits := ipNet.Mask.Size()
addrCount := 1 << (bits - ones)
View Xiaomi

Xiaomi Yi camera

General info

  • OS: Buildroot
  • CPU: ARMv6-compatible processor rev 5 (v6l)
  • BogoMIPS: 524.28
  • Memory: 37MB

The root filesystem is rootfs, which is stored in memory and therefore wiped on reboot. The Micro SD card is mounted at /tmp/fuse_d/. Something is also mounted at /tmp/fuse_a and /tmp/fuse_z.

x1unix / site.conf
Created Jan 22, 2020
ProxyPass LetsEncrypt Apache
View site.conf
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
x1unix / batch_iterator.go
Created Jan 10, 2020
Go - Batch Iterator
View batch_iterator.go
package util
type IteratorCallback = func(start int, v []interface{}) error
type BatchIterator struct {
batchSize int
func NewBatchIterator(batchSize uint) BatchIterator {
return BatchIterator{
View yet another radare2


load without any analysis (file header at offset 0x0): r2 -n /path/to/file

  • analyze all: aa
  • show sections: iS
  • list functions: afl
  • list imports: ii
  • list entrypoints: ie
  • seek to function: s sym.main
View bootloader.s
; Infinite loop (e9 fd ff)
jmp start
message db 'Hello yoba' ; 10 bytes
mov ah, 0x0e ; tty mode
mov cx, 0
mov bx, message
x1unix / main.go
Created Sep 13, 2019
Go - RegNotifyChangeKeyValue
View main.go
package main
import (
View main.go
package main
import (
func main() {
var mem [16*32]byte
You can’t perform that action at this time.