Skip to content

Instantly share code, notes, and snippets.

View lotherk's full-sized avatar

Konrad Lother lotherk

View GitHub Profile
[ActiveShadows]
Color=75,75,75
ColorType=5
HOffset=10
Size=29
VOffset=20
[KWin]
BorderSize=3
CustomShadows=true
#include <stdio.h>
#include <stdlib.h>
typedef struct array {
void *array;
size_t used;
size_t size;
} array_t;
// initializes an array.
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC1Wg4Xpvw4HZo62Hy6uxgiNLtOikRh1f0BvLUSSTFM/pts84OUBXFvoQFJ+Npo+ak5AO5t40td031QnlDnmjqWGra2hTYQAaxyne7+xA5jWvlcsmeMY08rRFUo7GPpjE9zRFHYVA4Sr6R4TDckq+nUcKLf126Ze6TeX5NiQEj4I2KpNPLHBwxykcf7QxOn09PFiOHERq9ODe8iSqt880jJZnBtjzWN+LA5Jc4+f6ljDAqP7nof8vNSDqIL/FwkBOFm9ztw/bDMs6aJ7H5mriOkPFgsVrZNLHAf5P6afY4A7oEtiuEnBTbSkCKweLQ+6dOKh5WnWvd6ubidfYlCWFQT Konrad Lother
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
struct uri_param {
char *key;
char *value;
};
struct uri {
@lotherk
lotherk / sb_bs.c
Created April 10, 2017 10:42
Struct to Bytes and Bytes to Struct
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int pack(void *strct, unsigned char buf[], size_t size) {
int i = 0;
unsigned char *byte;
for (byte = (unsigned char *)strct; size--; ++byte)
buf[i++] = *byte;
@lotherk
lotherk / diablo3.py
Created April 14, 2017 12:14
diablo 3 mighty macro
if starting:
ticks = 0
def update():
global ticks
ticks += 1
diagnostics.watch(ticks)
if (ticks >= 100):
ticks = 0
if keyboard.getKeyDown(Key.LeftShift) and mouse.leftButton:
#cloud-config
hostname: dor
coreos:
etcd2:
advertise-client-urls: "http://$public_ipv4:2379"
listen-client-urls: "http://0.0.0.0:2379"
units:
- name: etcd2.service
#!/bin/sh
#
# reindex elastic search indizies
#
# might destroy everything, don't use.
RES=$(curl -s 'localhost:9200/_cat/indices' |awk -F ' ' '{print $3}')
echo $RES
for r in $RES; do
#!/bin/sh
init_mirror="/dev/da3 /dev/da4"
mirrors="da5:da6 da7:da8 da9:da11 da12:da13 da14:da15"
zils="da2:da10"
zil_size="8g"
zfs_pool="tank"
out_file="/root/bonnie.csv"
bonnie_dir="/tank/bonnie"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define MEM_SIZE_KBYTES 32
#define MEM_SIZE (1024 * MEM_SIZE_KBYTES)
struct vehicle {
char serial[32];
char name[32];