Skip to content

Instantly share code, notes, and snippets.

@troeger
troeger / rook_osd_zap.txt
Created August 21, 2020 19:52
Deleting an OSD in Rook
Lets assume you want to get rid of OSD.2, and none of the "nice" ways worked.
- Determine the node where the OSD daemon is running (`kubectl -n rook-ceph get pods -o wide|grep osd.2`)
- Enter the toolbox pod, run `ceph osd out 2`
- Wait for the cluster to migrate the data away (`ceph status -w`)
- Delete the Rook deployment for OSD 2.
- Enter the toolbox pod, run:
- ceph osd crush remove osd.2
- ceph auth del osd.2
- ceph osd rm 2
@troeger
troeger / script.js
Created May 11, 2020 12:54
Incoming WebHook script for parsing Grafana notifications in Rocket.Chat
class Script {
process_incoming_request({ request }) {
console.log(request.content);
return {
content:{
"text": request.content.message,
"attachments": [{
"author_name": "Grafana",
"image_url": request.content.imageUrl,
"title": request.content.title
root@datexis-master2:/data/brick1# gluster volume get fast all
Option Value
------ -----
cluster.lookup-unhashed on
cluster.lookup-optimize on
cluster.min-free-disk 10%
cluster.min-free-inodes 5%
cluster.rebalance-stats off
cluster.subvols-per-directory (null)
cluster.readdir-optimize off
@troeger
troeger / checkqueue.py
Created December 9, 2017 14:20
Find hacked mail account used for spam sending (Postfix)
'''
This script checks the current Postfix mail queue for mails that
where delivered through SMTP authentication. It then shows both
the authentication user name and the sender mail adress.
Since spammers normally don't use a valid sender adress in your
administrative domain, you quickly see the problem.
Run with "python3 checkqueue.py"
'''

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@troeger
troeger / zot5exp2bbt.py
Last active August 7, 2017 06:15
Script for emulating the Zotero BetterBibtex stable citation key feature
#!/usr/bin/env python
'''
Script for emulating the BetterBibtex stable citation key feature.
(see https://github.com/retorquere/zotero-better-bibtex)
input.bib: A BibLatex export from a Zotero 5 library that has "Extra" field
entries for stable BibTex keys ("bibtex: <my_key>"). They end up in the
note field of the standard Zotero 5 export.
output.bib: A BibTex file where the citation keys from the Extra/note field are
@troeger
troeger / domain_list.py
Created March 8, 2017 23:14
Using the SchlundTech XML interface from Python
import schlundtech
auth={"user":"xxxxxx", "password":"yyyyy", "context":"zzz"}
all_domains=schlundtech.domain_info(auth)
for domain in all_domains:
print("\n{name} (last update: {updated})".format(**domain))
info=schlundtech.zone_info(auth, domain['name'])
for rr in info:
print("{name}\t\t{type}\t{value}".format(**rr))
@troeger
troeger / minecraft-server
Last active April 5, 2023 17:22
Running a Minecraft server as daemon on Amazon Linux
#!/bin/bash
#
# chkconfig: 2345 95 05
#
### BEGIN INIT INFO
# Provides: minecraft-server
# Required-Start: $network $local_fs $remote_fs
# Required-Stop: $network $local_fs $remote_fs
# Should-Start: $syslog
# Should-Stop: $syslog
@troeger
troeger / latexmkrc
Created October 13, 2016 09:32
Let "latexmk" consider extra files from another directory
$ENV{'TEXINPUTS'}='.:../../../Common//:../Include/:' . $ENV{'TEXINPUTS'};
$pdflatex="pdflatex -shell-escape -file-line-error --synctex=1 %O %S";
$pdf_mode=1;
@troeger
troeger / raidcheck.py
Last active September 6, 2016 18:29
Draft for a Python script that checks an Adaptec HW RAID controller through the arcconf utility
#!/usr/bin/python
'''
Check status of an Adaptec HW RAID controller and sends an email
if something looks bad.
Intended for being used as cron job, so no screen output is generated.
'''
# Configuration section
notify_email="root"