Skip to content

Instantly share code, notes, and snippets.

$ ~/bin/packer build redis.json
docker output will be in this color.
==> docker: Creating a temporary directory for sharing data...
==> docker: Pulling Docker image: debian:jessie-slim
docker: Trying to pull repository registry.fedoraproject.org/debian ...
docker: Trying to pull repository registry.access.redhat.com/debian ...
docker: Trying to pull repository docker.io/library/debian ...
docker: sh
@dzeban
dzeban / execute.c
Last active September 5, 2023 02:26
jprobes for execve and execveat
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
int main(int argc, char *argv[])
{
char *newargv[] = { NULL, "-l", NULL };
char *newenviron[] = { NULL };
newargv[0] = argv[1];
@dzeban
dzeban / jprobe_etn_io.c
Last active November 5, 2018 23:43
jprobes example
/*
* Here's a sample kernel module showing the use of jprobes to dump
* the arguments of third-party network driver for Bercut ETN.
*
* For more information on theory of operation of jprobes, see
* Documentation/kprobes.txt
*
* Build and insert the kernel module as done in the kprobe example.
* You will see the trace data in /var/log/messages and on the
* console whenever do_fork() is invoked to create a new process.
@dzeban
dzeban / Makefile
Last active August 29, 2015 14:00
keynotifier
CFLAGS_keynotifier.o := -I$(src)
obj-m := keynotifier.o
KDIR := /lib/modules/$(shell uname -r)/build
module:
$(MAKE) -C $(KDIR) M=$(PWD) modules
@dzeban
dzeban / jhash.c
Created February 4, 2014 13:57
Jenkins hash
/*
* jhash.c - Simple Jenkins hash.
*
* Copyright (C) 2006. Bob Jenkins (bob_jenkins@burtleburtle.net)
* http://burtleburtle.net/bob/hash/
*
* Sources taken from Linux kernel implementation.
* Copyright (C) 2009-2010 Jozsef Kadlecsik (kadlec@blackhole.kfki.hu)
*
* Turned into userspace program by avd