Skip to content

Instantly share code, notes, and snippets.

@houaq
houaq / ifparser.lua
Last active October 18, 2018 08:33
Linux networking config file (/etc/network/interfaces) parser by Lua
local function rtrim(s)
local x = string.find(s, '%s+$')
if x then
return string.sub(s, 1, x - 1)
else
return s
end
end
local function parseIfs()
@houaq
houaq / idcard.go
Last active December 21, 2023 09:20
Call dll functions from golang
package main
import (
"fmt"
"log"
"syscall"
)
type IDCRDriver struct {
handle syscall.Handle
@houaq
houaq / MACOSX-TINC.md
Last active May 27, 2024 11:01 — forked from kost/MACOSX-TINC.md
tinc on Mac OS X example configuration using utun

MAC OS X, tinc and utun

tinc on Mac OS X example configuration using utun

IP allocations explained

My machine: 192.168.152.10

Remote machine: 192.168.152.5 (8.8.8.8)

@houaq
houaq / ubuntu-xenial-armfh-qemu.md
Last active June 27, 2025 10:42 — forked from takeshixx/ubuntu-xenial-armfh-qemu.md
Running Ubuntu 16.04.1 armhf on Qemu

Running Ubuntu 16.04.1 armhf on Qemu 10.x under macOS

This is a writeup about how to install Ubuntu 16.04.1 Xenial Xerus for the 32-bit hard-float ARMv7 (armhf) architecture on a Qemu VM via Ubuntu netboot.

The setup will create a Ubuntu VM with LPAE extensions (generic-lpae) enabled. However, this writeup should also work for non-LPAE (generic) kernels.

The performance of the resulting VM is quite good, and it allows VMs with >1G ram (compared to 256M on versatilepb and 1G on versatile-a9/versatile-a15). It also supports virtio disks whereas versatile-a9/versatile-a15 only support SD cards via the -sd argument.

Get netboot files