This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Rnx2crx creates a copy of the file that is Hatanaka-compressed (compact RINEX). | |
// see http://terras.gsi.go.jp/ja/crx2rnx.html | |
func Rnx2crx(obsFil string) (string, error) { | |
tool, err := exec.LookPath("RNX2CRX") | |
if err != nil { | |
return "", err | |
} | |
if !strings.HasSuffix(obsFil, ".rnx") { | |
return "", fmt.Errorf("file %s with invalid extension", obsFil) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import "bufio" | |
import "bytes" | |
func main() { | |
// Get a new writer | |
var b bytes.Buffer | |
w := bufio.NewWriter(&b) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Convert array to object | |
var rnxSearch = formDataArray.reduce(function (o, val) { o[val.name] = val.value; return o; }, {}); | |
// Round float | |
return Number(myfloat).toFixed(2); | |
/************************************************** | |
Forms | |
***************************************************/ | |
// Check a radio |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# who swaps? | |
for file in /proc/*/status ; do awk '/VmSwap|Name/{printf $2 " " $3}END{ print ""}' $file; done | sort -k 2 -n -r | less |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Check availability and response time for a website | |
# Output is in InfluxDB line protocol | |
measurement="http.stat" | |
function dorequest () { | |
local url=$1 | |
local chkstr=$2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://go.dev/blog/strings | |
// https://henvic.dev/posts/go-utf8/ | |
// https://pkg.go.dev/github.com/saintfish/chardet | |
f, err := os.Open("testdata/tor300est_20230726.log") | |
if err != nil { | |
return err | |
} | |
defer f.Close() |