Skip to content

Instantly share code, notes, and snippets.

DROP TABLE IF EXISTS agency;
DROP TABLE IF EXISTS calendar_dates;
DROP TABLE IF EXISTS routes;
DROP TABLE IF EXISTS shapes;
DROP TABLE IF EXISTS stops;
DROP TABLE IF EXISTS stop_times;
DROP TABLE IF EXISTS trips;
CREATE TABLE agency
(
@skreuzer
skreuzer / day1.py
Last active December 10, 2020 03:11
Advent of Code 2020
#!/usr/local/bin/python
from itertools import combinations
from functools import reduce
n = []
with open('input.txt') as f:
for l in f.readlines():
n.append(int(l.rstrip()))
@skreuzer
skreuzer / pandemic.nki
Last active December 2, 2020 20:05
robotfindskitten: Global Pandemic Edition
Counterfeit N95 mask
Empty bottle of hand sanitizer
Toilet paper
12 pack of Corona
Empty bottle of Chloroquine
Half empty bottle of Hydroxychloroquine
Latex gloves
Bleach filled syringe
Ultraviolet light bulb
Fake news
@skreuzer
skreuzer / patch-src-robotfindskitten.c
Created June 13, 2020 01:56
MegaHyperDeath patch for robotfindskitten 2.8284271.702
--- src/robotfindskitten.c.orig 2020-03-01 17:25:06 UTC
+++ src/robotfindskitten.c
@@ -119,6 +119,10 @@
#define KITTEN 1
#define BOGUS 2
+/* Finish him! */
+#define FATALITIES (sizeof fatalities / sizeof (char*))
+
+
Some useful G-Codes
* G0 - Rapid Motion
* G1 - Coordinated Motion
* G2 - Arc - Clockwise
* G3 - Arc - Counter Clockwise
* G4 - Dwell
* G10 - Create Coordinate System Offset from the Absolute one
* G17 - Select XY plane (default)
* G18 - Select XZ plane (not implemented)
* G19 - Select YX plane (not implemented)
@skreuzer
skreuzer / stats.md
Last active July 22, 2019 00:39
XFS Stats
extent_alloc 44 3145360 36 1238158
abt 0 0 0 0
blk_map 29405 1058 16 24 16 30580 0
bmbt 0 0 0 0
dir 10001 1398 1398 62
trans 0 11540 0
ig 1405 62 0 1343 0 1340 1397
log 39 1732 2 20 8
push_ail 22541 0 3615 16 0 219 0 0 0 10
@skreuzer
skreuzer / prometheus.yml
Last active February 7, 2019 18:45
smokeping style metrics in prometheus
global:
evaluation_interval: 15s
rule_files:
- smokeping.rules
scrape_configs:
- job_name: 'blackbox_icmp'
metrics_path: /probe
params:
module: [icmp]
scrape_interval: 1s
diff --git a/cf-agent/nfs.c b/cf-agent/nfs.c
index 1d0bc66..3ca3568 100644
--- a/cf-agent/nfs.c
+++ b/cf-agent/nfs.c
@@ -667,13 +667,23 @@ PromiseResult VerifyUnmount(EvalContext *ctx, char *name, Attributes a, const Pr
static int MatchFSInFstab(char *match)
{
Item *ip;
+ char delimit[]=" \t\r\n\v\f";
+ char *fstab_line, *token;
@skreuzer
skreuzer / npa.py
Last active April 26, 2017 13:49
nato phonetic alphabet
#!/usr/local/bin/python3
import sys
pa = {
'a': 'alpha',
'b': 'bravo',
'c': 'charlie',
'd': 'delta',
'e': 'echo',
R: linux_4_4_35_33_55_amzn1_x86_64
R: Hr14_Q3
R: messages_high_dev1
R: compiled_on_linux_gnu
R: _stdlib_has_path_tar
R: _stdlib_has_path_logger
R: ipv4_172
R: GMT_Day20
R: diskfree_high
R: smtp_in_high