Skip to content

Instantly share code, notes, and snippets.

View mback2k's full-sized avatar
👨‍👩‍👧‍👦
I may be slow to respond. Family life and day job keep me busy.

Marc Hörsken mback2k

👨‍👩‍👧‍👦
I may be slow to respond. Family life and day job keep me busy.
View GitHub Profile
@mback2k
mback2k / nfs.yaml
Last active February 11, 2021 18:57
rook-ceph-nfs
---
apiVersion: ceph.rook.io/v1
kind: CephBlockPool
metadata:
name: ceph-nfs-pool
namespace: rook-ceph
spec:
failureDomain: host
replicated:
size: 3
@mback2k
mback2k / logstash-ruby-fix-timestamp.conf
Created July 23, 2020 10:35
Make sure a syslog timestap is in the past, eg. while ingesting archived logs
filter {
ruby {
code => 'ts=event.get("@timestamp"); if ts.time > Time.now then ts=ts.time.to_a; ts[5]-=1; ts=Time.mktime(*ts); event.set("@timestamp", LogStash::Timestamp.new(ts)) end'
}
}
@mback2k
mback2k / keybase.md
Created January 1, 2017 17:26
Keybase proof

Keybase proof

I hereby claim:

  • I am mback2k on github.
  • I am mback2k (https://keybase.io/mback2k) on keybase.
  • I have a public key ASAo5x9qPUp7vKH67yo54IK8gQGgZd7euqgybo6bbzBnbAo

To claim this, I am signing this object:

@mback2k
mback2k / git-mapfile-tags.py
Created November 19, 2013 14:10
Convert hg commit hashes to git tags after using hg-git
import sys, os, os.path
def main(args):
if len(args) == 2:
return tags(os.path.abspath(args[1]))
else:
print 'Usage: <hg-repository-path>'
def tags(repo):
if not os.path.exists(repo):
@mback2k
mback2k / select_ws.bat
Last active July 31, 2017 12:03
select_ws example program
mingw32-gcc select_ws.c -Wl,-lws2_32 -g -pedantic -Wall -W -Wpointer-arith -Wwrite-strings -Wunused -Wshadow -Winline -Wnested-externs -Wmissing-declarations -Wmissing-prototypes -Wno-long-long -Wfloat-equal -Wno-multichar -Wsign-compare -Wundef -Wno-format-nonliteral -Wendif-labels -Wstrict-prototypes -Wdeclaration-after-statement -Wstrict-aliasing=3 -Wcast-align -Wtype-limits -Wold-style-declaration -Wmissing-parameter-type -Wempty-body -Wclobbered -Wignored-qualifiers -Wconversion -Wno-sign-conversion -Wvla -Wno-pedantic-ms-format -Wno-system-headers -o select_ws.exe
@mback2k
mback2k / regex_transform_case.py
Created December 23, 2012 12:16
Transform case using RegExp
import unittest
import re
class RegexTransformCase(unittest.TestCase):
def setUp(self):
self.pattern = r'(?<!\\)\\(U|L)(.*?)(?<!\\)\\[ELU]'
self.upper_strings = [
(r'\Uhello\E', r'HELLO'),
(r'\\Uhello\E', r'\\Uhello\E'),
@mback2k
mback2k / pbcompile.py
Last active October 5, 2015 17:37
Compile debug release of PureBasic project
#!/usr/bin/python
from xml.etree import ElementTree
import sys, subprocess
NAMESPACE = r'{' + r'http://www.purebasic.com/namespace' + r'}' + r'%s'
COMPILER = {
'x64': r'C:\Program Files\PureBasic\Compilers\pbcompiler.exe',
'x86': r'C:\Program Files (x86)\PureBasic\Compilers\pbcompiler.exe',
}