Skip to content

Instantly share code, notes, and snippets.

View unixdj's full-sized avatar

Vadim Vygonets unixdj

  • Friedrichshain, EU
View GitHub Profile
@unixdj
unixdj / time.go
Created December 9, 2023 00:31
Go #63844 absDate and Date using uint64
// Copyright 2009 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.
package main
import (
"fmt"
"time"
)
package main
/*
[...] angles [...] are specified as
up to three numbers representing degrees, minutes and seconds. The
last number may be fractional. The numbers are either separated by
<,> (commas) or suffixed, in order:
degrees by <°> (degree sign),
minutes by <′> (prime) or <'> (apostrophe),
@unixdj
unixdj / :etc:config:network
Last active January 31, 2018 11:05
OpenWRT: STA+AP on TP-Link TL-WR703N. Network configuration for OpenWRT that enables two VAPs, one as a client (STA) for uplink (wan interface) and another as an access point bridged with eth0 (lan bridge). NAT is already provided. TL-WR703N has Atheros AR9331 wireless with one antenna and no network switch.
config interface 'loopback'
option ifname 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
config globals 'globals'
option ula_prefix 'fdxx:xxxx:xxxx::/48'
config interface 'lan'
@unixdj
unixdj / dbthrash.go
Created December 1, 2012 20:19
Go database/sql thrasher
/*
This program writes to a database concurrently from 16 goroutines.
To see the results sorted (GNU sort can't sort by two numeric fields):
sqlite3 the.db 'select * from tbl' \
| awk -F\| '{printf "%3d %5d\n", $1, $2}' | sort | less
Here's a little script that interprets the results: