Skip to content

Instantly share code, notes, and snippets.

View niamtokik's full-sized avatar

Niamtokik niamtokik

View GitHub Profile
@niamtokik
niamtokik / ports.mtree
Created October 29, 2017 14:36
OpenBSD mtree structure
######################################################################
# mtree ports structure
# cd /usr/ports
# mtree ports.mtree
######################################################################
/set type=dir uname=root gname=wheel mode=0755
.
distfiles uname=_pfetch gname=_pfetch
..
@niamtokik
niamtokik / dualblink_arduino.c
Created July 9, 2017 14:26
simple beat parser for arduino (based on string) for dual blinking led.
@niamtokik
niamtokik / Makefile
Last active March 1, 2022 12:56
Meetup BSD Rennes - Jail Makefile
######################################################################
# BSD Meetup Rennes - FreeBSD Jails Workshop
#
# TEA-WARE LICENSE:
# Mathieu Kerjouan <contact@steepath.eu> wrote this file. As long as
# you retain this notice you can do whatever you want with this
# stuff. If we meet some day, and you think this stuff is worth it,
# you can buy me a tea in return. Mathieu Kerjouan
#
######################################################################
%
% extract namespace information from linux procfs.
%
-module(namespace).
-compile(export_all).
-include_lib("eunit/include/eunit.hrl").
-record(pid, { id :: integer(),
cgroup = 0 :: integer(),
@niamtokik
niamtokik / connection.go
Created February 17, 2017 14:39
simple concurrent wrapper with channels support around go net module
package main
import "fmt"
import "sync"
import "net"
import "bufio"
type Controller struct {
fifo chan string
status chan string
@niamtokik
niamtokik / pyramid.go
Created February 17, 2017 13:18
way to define triangle and pyramid in go (work on pointers)
package main
import "fmt"
// import "crypto/sha1"
// import "path/filepath"
// import "os"
type triangle struct {
connect [3]*triangle
}
// feistel network test
// currently doesn't work as expected.
// the idea is to use variable return
// function to make branchment instead
// of traditional datastructure.
package main
import "fmt"
@niamtokik
niamtokik / Makefile
Created February 8, 2017 18:06
xbps template generator for erlang via erlang.mk database. This is a poc and currently doesn't work as expected.
# Copyright (c) 2013-2016, Loïc Hoguin <essen@ninenines.eu>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
@niamtokik
niamtokik / xtemplate.go
Created February 7, 2017 14:57
xbps-src templating in go
package main
import "fmt"
import "os"
import "flag"
import "strconv"
import "strings"
import "text/template"
import "crypto/sha256"
import "encoding/hex"
@niamtokik
niamtokik / update.sh
Created January 24, 2017 11:29
simple, quick and dirty netbsd standard cvs update wrapper with mail alert
#!/bin/sh
######################################################################
# simple cvs update wrapper for netbsd #
######################################################################
ALERT_MAIL="yes"
ALERT_USER="root"
CVS_OPTS="-qz3"
CVS="cvs ${CVS_OPTS}"