Skip to content

Instantly share code, notes, and snippets.

View arunk-s's full-sized avatar

Arun Sori arunk-s

View GitHub Profile

Keybase proof

I hereby claim:

  • I am arunk-s on github.
  • I am arunks (https://keybase.io/arunks) on keybase.
  • I have a public key ASAKI2NEXOIHew05064rAWsjoUnuNLe1K4es7FR9UEfD7wo

To claim this, I am signing this object:

@arunk-s
arunk-s / risc.tavor
Created March 20, 2015 10:41
Simple tavor format to generate RISC-V Assembly instructions
START = ".global _start" "\n" "_start:" "\n" +(line "\n")
/*register_zero = "x0"*/
register_name = "x"[0-31]
instruction_r_type = inst_r " " register_name "," register_name "," register_name
instruction_i_type = (inst_i | inst_l | inst_s) " " register_name "," register_name "," +([\d]) //12 bit immediate
@arunk-s
arunk-s / instruction.tavor
Last active August 29, 2015 14:17
Simple tavor format to generate assembly code statement
START = line |
register_name = "eax" | "ebx" | "ecx" | "edx"
label = +([\w]) ":"
inst_mov = "mov " register_name "," register_name,
| "mov " register_name "," +([\d])
inst_add = "add " register_name "," register_name,
| "add " register_name "," +([\d])
inst_jmp = "jmp " +([\w])
@arunk-s
arunk-s / libaudit.go
Created January 29, 2015 19:30
AuditIsEnabled in Blocking Mode
package netlinkAudit
import (
"bytes"
"encoding/binary"
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"log"
@arunk-s
arunk-s / main.go
Created January 28, 2015 20:15
Update main.go to print the errors
package main
import (
"./netlinkAudit"
"log"
"os"
"syscall"
"time"
)
@arunk-s
arunk-s / c_go.go
Last active August 29, 2015 14:07
strace
package main
/*
#cgo CFLAGS: -Wall
#cgo LDFLAGS: -L . -laudit
#include <libaudit.h>
*/
import "C"
@arunk-s
arunk-s / list_features.go
Last active August 29, 2015 14:06
Netlink.go
package main
import (
// "encoding/binary"
"fmt"
"syscall"
"unsafe"
)
const (
@arunk-s
arunk-s / gostrace
Created September 5, 2014 13:23
strace go run netlink.go
execve("/usr/bin/go", ["go", "run", "netlink.go"], [/* 39 vars */]) = 0
brk(0) = 0x227c000
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7feea8392000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=124620, ...}) = 0
mmap(NULL, 124620, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7feea8373000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
@arunk-s
arunk-s / integration.cpp
Created July 18, 2014 08:49
Integration with the prototype
#include <tuple>
#include <boost/chrono/date/algorithms/weekday_from_days.hpp>
#include <boost/chrono/date/algorithms/days_from_civil.hpp>
#include <boost/chrono/date/algorithms/civil_from_days.hpp>
days_date::days_date(chrono::year y, chrono::month m, chrono::day d) BOOST_NOEXCEPT
{
x_ = days_from_civil(y,m,d) //Passing opaque has better performance results