Skip to content

Instantly share code, notes, and snippets.

@troeger
troeger / cpython2pypy_minimal.py
Last active February 24, 2016 21:36
A minimal example for calling the PyPy interpreter from CPython.
#!/usr/bin/env python
'''
A minimal example for calling the PyPy interpreter from CPython.
Derived from pyinteractive.py.
This only intended to understand what is going on when.
PyPy triggers arbitary C compiler runs in between ...
'''
source="print 'Hello World'"
@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"
@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 / 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 / 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

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:

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 / rpipypy.md
Last active August 29, 2019 14:56
Cross-compilation of PyPy for RaspberryPi
@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
@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