Skip to content

Instantly share code, notes, and snippets.

View aka-mj's full-sized avatar

Michael John aka-mj

  • Henny Penny
  • Ohio, USA
  • 04:23 (UTC -05:00)
View GitHub Profile
@aka-mj
aka-mj / console_1.sh
Created June 26, 2025 13:15
Serial in Go, no external dependencies
❯ socat -d -d pty,raw,echo=0 pty,raw,echo=0
2020/10/24 10:44:43 socat[786] N PTY is /dev/pts/16
2020/10/24 10:44:43 socat[786] N PTY is /dev/pts/17
2020/10/24 10:44:43 socat[786] N starting data transfer loop with FDs [5,5] and [7,7]
@aka-mj
aka-mj / main.zig
Created June 26, 2025 12:52
CAN Socket in Zig
const std = @import("std");
const c = @cImport({
@cInclude("linux/can.h");
});
const page_allocator = std.heap.page_allocator;
const Allocator = std.mem.Allocator;
const can_frame = extern struct {
can_id: u32,
@aka-mj
aka-mj / git-commit-log-stats.md
Created August 5, 2022 15:23 — forked from eyecatchup/git-commit-log-stats.md
Some commands to get git commit log statistics for a repository on the command line.

git commit stats

Commands to get commit statistics for a Git repository from the command line -
using git log, git shortlog and friends.




@aka-mj
aka-mj / renew-gpgkey.md
Created August 4, 2022 13:56 — forked from krisleech/renew-gpgkey.md
Renew Expired GPG key

Renew GPG key

Given that your key has expired.

$ gpg --list-keys
$ gpg --edit-key KEYID

Use the expire command to set a new expire date:

@aka-mj
aka-mj / main.c
Last active August 2, 2021 00:59
Mangos program unable to send request
// An NNG version which does work
// What's different between this and the Go version?
#include <unistd.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <nng/nng.h>
#include <nng/protocol/reqrep0/rep.h>
@aka-mj
aka-mj / reverse.fs
Last active November 22, 2019 18:43
Reverse a list in F#
let reverse lst' =
let rec rev acc = function
| [] -> acc
| head::tail -> rev (head::acc) tail
rev [] lst'
@aka-mj
aka-mj / tcpsock_ex.go
Created February 23, 2017 21:02
TCP Socket Example in Go
// go run main.go
package main
import (
"bytes"
"fmt"
"net"
"os"
"time"
@aka-mj
aka-mj / unixsock_ex.go
Created February 9, 2017 19:32
Unix Socket Example in Go
package main
import (
"fmt"
"net"
"os"
"time"
)
func listen(end chan<- bool) {