Skip to content

Instantly share code, notes, and snippets.

255 local
254 main
253 default
0 unspec
250 myvpn
# A simple Tobii 4C -> vJoy adapter script for FreePIE
# By default, sets a gaze (X,Y) differences from the center
# to be joystick (X,Y) axis deviating from the center
#
# You may have to ajust which vJoy device to use (if you have multiple)
# and smoothing factor to your liking
# Pressing toggleButton would stop gazetracking
# Pressing rsetButton would set joystic axis to (0,0)
vJoyDeviceIndex = 0
#define EXPORT __attribute__((used)) __attribute__ ((visibility ("default")))
#define NULL ((void*)0)
extern void _console_log(void *ptr, int length);
EXPORT int foo(int tag, ...) {
_console_log(NULL, (int)&tag);
return tag+1;
}
typedef struct {
int a;
} foo;
int main(int argc, char **argv) {
foo foo = {1};
return foo.a;
}
typedef struct {
int x;
int y;
} mystruct;
int foo(mystruct v) {
return v.x + v.y;
}
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include <stdint.h>
#include <sys/time.h>
#include <unistd.h>
#ifndef SIZE
#define SIZE 10000
#endif
#!/bin/sh
rm -f *_gen.go
curl -s https://www.keycloak.org/docs-api/4.2/rest-api/index.html |
tidy -asxml -q -n --show-warnings no |
xsltproc --html sheet.xml - 2>/dev/null |
awk '{if (index($0,"file:") == 1) { name=substr($1,6); printf "" > name; } else { print $0 >> name; }}' &&
go fmt .
@iamtakingiteasy
iamtakingiteasy / nginx.conf
Last active August 7, 2018 13:38
Example nginx reverse-proxy configuration to work-around GitLab hostility to go get utility in case of private groups/projects.
location @proxy-gitlab {
allow all;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
# fdisk -l /dev/data/winx-data
Disk /dev/data/winx-data: 1.7 TiB, 1892763566080 bytes, 3696803840 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 524288 bytes / 1048576 bytes
Disklabel type: gpt
Disk identifier: 8075E650-A7F4-4EB7-A940-4F754B4D5C33
Device Start End Sectors Size Type
/dev/data/winx-data1 2048 34815 32768 16M Microsoft reserved
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 1.8T 0 disk
└─sda1 8:1 0 1.8T 0 part
└─md0 9:0 0 1.8T 0 raid5
├─data-winx--root 253:0 0 100G 0 lvm
└─data-winx--data 253:1 0 1.7T 0 lvm
├─data-winx--data1 253:2 0 16M 0 part
└─data-winx--data2 253:3 0 1.7T 0 part
sdb 8:16 0 931.5G 0 disk
└─sdb1 8:17 0 931.5G 0 part