Skip to content

Instantly share code, notes, and snippets.

@topikachu
topikachu / lego.c
Created September 18, 2013 12:34
dump stuct size of lego ev3 devices gcc lego.c -o lego -fpack-struct
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
typedef unsigned char UBYTE; //!< Basic Type used to symbolise 8 bit unsigned values
typedef unsigned short UWORD; //!< Basic Type used to symbolise 16 bit unsigned values
typedef unsigned int ULONG; //!< Basic Type used to symbolise 32 bit unsigned values
typedef signed char SBYTE; //!< Basic Type used to symbolise 8 bit signed values
typedef signed short SWORD; //!< Basic Type used to symbolise 16 bit signed values
typedef signed int SLONG; //!< Basic Type used to symbolise 32 bit signed values
@topikachu
topikachu / iic.c
Last active December 27, 2015 11:29
ev3 iic poc
#include <fcntl.h>
#include <stdio.h>
#include <string.h>
#include <sys/mman.h>
#include <sys/ioctl.h>
#include "lms2012.h"
//The ports are designated as PORT_NUMBER-1
const char PORT = 0x0;
const int MAX_SAMPLES = 100;
int main()
@topikachu
topikachu / lejos_ev3_kernel_patch
Created November 24, 2013 07:24
lejos ev3 kernel patch to work with new udev
diff --git a/kernel/setup.sh b/kernel/setup.sh
index bbb0e84..a43d757 100755
--- a/kernel/setup.sh
+++ b/kernel/setup.sh
@@ -8,6 +8,7 @@
tar xfa linux*.tgz
cd linux*
patch -p1 < ../lx.patch
+patch -p1 <../sys_accept4.patch
cd ..

Arquillian Mockito

The Arquillian Mockito provides a simple way to bring Mockito into the Arquillian framework.

Getting Started

The following example illustrates how Arquillian Mockito can be used:

@topikachu
topikachu / client.yaml
Last active September 14, 2017 17:54
kubernetes stateful elasticsearch cluster
---
apiVersion: v1
kind: Service
metadata:
name: es-client
labels:
app: es-client
spec:
ports:
- port: 9200
@topikachu
topikachu / screen-stuff.md
Created February 4, 2018 03:14 — forked from gesellix/screen-stuff.md
screen and Docker for Mac
screen ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/tty



screen -AmdS docker ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/tty
screen -r docker
# enter, then disconnect with Ctrl-a d
screen -S docker -p 0 -X stuff $(printf root\\r\\n)
screen -r docker