Skip to content

Instantly share code, notes, and snippets.

View lotherk's full-sized avatar

Konrad Lother lotherk

View GitHub Profile
@lotherk
lotherk / del_cluster.sh
Last active December 8, 2021 23:46 — forked from ianchen06/del_cluster.sh
delete proxmox cluster
#/bin/sh
# source: https://forum.proxmox.com/threads/removing-deleting-a-created-cluster.18887/
set -x
# stop service
systemctl stop pvestatd.service
systemctl stop pvedaemon.service
systemctl stop pve-cluster.service
systemctl stop corosync
#!/bin/sh
set -e
DEST="/path/to/dest"
SRCS="/path1 /usr/path2"
INCLUDES=""
for s in $SRCS; do
#!/bin/sh
MIN=5
WARN=10
BAT_TIME=$(sysctl -a |grep battery.time |awk -F ' ' '{print $2}')
test -f /tmp/battery.lock && exit 1
touch /tmp/battery.lock
#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];
#!/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"
#!/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
#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
@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:
@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;
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
struct uri_param {
char *key;
char *value;
};
struct uri {