Skip to content

Instantly share code, notes, and snippets.

@ducky-hong
ducky-hong / Dockerfile
Created November 7, 2016 04:56
ubuntu for kens with gtest
FROM ubuntu:16.04
RUN sed -i 's/archive.ubuntu.com/ftp.kaist.ac.kr/g' /etc/apt/sources.list
RUN apt-get update && apt-get install -y build-essential cmake git \
&& git clone --depth 1 https://github.com/google/googletest.git \
&& cd /googletest/googletest && mkdir build && cd build \
&& cmake .. && make && cp libgtest*.a /usr/local/lib \
&& apt-get clean && cd / && rm -rf /googletest
@ducky-hong
ducky-hong / sample.lua
Created January 16, 2017 09:37
pktgen lua sample
package.path = package.path ..";?.lua;test/?.lua;app/?.lua;"
pktgen.screen("off");
-- size 200 causes seg fault
sizes = {64, 256, 576, 1500};
rates = {1, 5, 10, 20, 40, 50, 100};
interval = 5000;
for s = 1, 4 do
@ducky-hong
ducky-hong / timerfd.py
Created September 28, 2017 07:39
detecting system time changes via timerfd
# detecting system time changes via timerfd
# https://github.com/tsavola/pytimerfd
#
# Usage:
# $ python3 timerfd.py
# $ date -s "2 OCT 2006 18:00:00"
import ctypes
import ctypes.util
import selectors
import os
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BOARD)
GPIO.setup(12, GPIO.OUT)
p = GPIO.PWM(12, 50)
p.start(7.5)