Skip to content

Instantly share code, notes, and snippets.

View arunk-s's full-sized avatar

Arun Sori arunk-s

View GitHub Profile
@arunk-s
arunk-s / backup.sh
Created April 13, 2014 06:36
Shell Script for taking Incremental Backup and store it at a remote place
# backup.sh
# The contents of this file are released under the GNU General Public License. Feel free to reuse the contents of this work, as long as the resultant works give proper attribution and are made publicly available under the GNU General Public License.
# By Arun Sori <arunsori94@gmail.com>
#For taking backup of the desired directory and store it at a remote place
#timestamp
time_stamp=`date`
#backup file name
@arunk-s
arunk-s / nginx.toml
Created July 9, 2014 16:13
Hekad configuration file for anamoly detection from nginx logs
[hekad]
maxprocs = 4
# Nginx access log reader
[Nginxserver]
type = "LogstreamerInput"
log_directory = "/var/log/nginx"
file_match = 'access\.log'
decoder = "CombinedNginxDecoder"
@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
@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 / 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 / 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 / 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 / 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 / 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])