Skip to content

Instantly share code, notes, and snippets.

@diresi
diresi / mt_client.py
Last active October 8, 2015 12:02
celery multithreaded client
# start the worker with: `celery -A tasks worker`
import threading
import celery, celery.backends.rpc
from kombu.common import oid_from
broker = "amqp://guest:guest@172.17.0.3//"
backend = "tasks.RPC"
class RPC(celery.backends.rpc.RPCBackend):
# stolen from centos docker-storage-setup
VG=vg
POOL_LV_NAME="docker-pool"
DATA_LV_NAME=$POOL_LV_NAME
META_LV_NAME="${POOL_LV_NAME}meta"
CHUNK_SIZE=512K
CHUNK_SIZE_ARG="-c $CHUNK_SIZE"
VG_SIZE=$( vgs --noheadings --nosuffix --units s -o vg_size ${VG} )
META_SIZE=$(( $VG_SIZE / 1000 + 1 ))
DATA_SIZE=40%FREE
date -u -Iseconds | sed -e 's/\(+[[:digit:]]\{2\}:[[:digit:]]\{2\}\|UTC\)$//'
[core]
abbrev = 12
[user]
name = Christoph Rissner
email = resi@rissner.net
[push]
default = matching
[alias]
glog = !GIT_PAGER='less +/HEAD' git log --graph --all --decorate
log = log --decorate
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout some time, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see http://i3wm.org/docs/userguide.html for a complete reference!
#!/bin/bash
#flac --endian=big --channels=2 --bps=16 --sample-rate=44100 --sign=signed --force-raw-format data.bin -o data.flac
toc2cue audiocd.toc audiocd.cue
flac --endian=big --channels=2 --bps=16 --sample-rate=44100 --sign=signed --cuesheet=audiocd.cue -o data.flac data.bin
#metaflac --import-cuesheet-from=audiocd.cue data.flac
cat audiocd.toc | ~/tmp/toc2tag.pl > album.tags
metaflac --add-replay-gain --no-utf8-convert --import-tags-from=album.tags data.flac
--- dovecot/conf/dovecot.conf 2017-07-10 20:55:14.000000000 +0000
+++ PATCHES/dovecot.conf 2017-09-20 18:56:53.000000000 +0000
@@ -3,9 +3,9 @@
###############
log_path = /dev/stderr
protocols = imap pop3 lmtp sieve
-postmaster_address = {{ POSTMASTER }}@{{ DOMAIN }}
-hostname = {{ HOSTNAME }}
-mail_plugins = $mail_plugins quota
+postmaster_address = THE-ADMIN-GUY@MY-DOMAIN.TLD
@diresi
diresi / .gitconfig
Created January 18, 2019 09:19
git-mergetool-remerge
# see https://stackoverflow.com/questions/54233117/git-cherry-pick-manually-accept-our-or-their-hunks-in-conflicted-files)
# run with git mergetool --tool=remerge-{ours,theirs} -- <path/to/file>
[mergetool "remerge-ours"]
cmd = git merge-file --ours "$LOCAL" "$BASE" "$REMOTE" && mv -- "$LOCAL" "$MERGED"
trustExitCode = true
[mergetool "remerge-theirs"]
cmd = git merge-file --theirs "$LOCAL" "$BASE" "$REMOTE" && mv -- "$LOCAL" "$MERGED"
trustExitCode = true
@diresi
diresi / init.vim
Last active March 20, 2019 21:08
set termguicolors
set guicursor= "now that's a bad default value
" tab stuff
set tabstop=4
set softtabstop=4
set expandtab
set smarttab
set shiftwidth=4
set autoindent
@diresi
diresi / hello.csv
Last active May 24, 2019 11:02
hello?
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
2.550000000000000000e+02;2.540000000000000000e+02;3.200000000000000000e+01;0.000000000000000000e+00
9.500000000000000000e+01;0.000000000000000000e+00;9.500000000000000000e+01;0.000000000000000000e+00
9.500000000000000000e+01;0.000000000000000000e+00;9.500000000000000000e+01;0.000000000000000000e+00
9.500000000000000000e+01;0.000000000000000000e+00;9.500000000000000000e+01;0.000000000000000000e+00
9.500000000000000000e+01;0.000000000000000000e+00;9.500000000000000000e+01;0.000000000000000000e+00
9.500000000000000000e+01;0.000000000000000000e+00;9.500000000000000000e+01;0.000000000000000000e+00
9.500000000000000000e+01;0.000000000000000000e+00;9.500000000000000000e+01;0.000000000000000000e+00
9.500000000000000000e+01;0.000000000000000000e+00;9.500000000000000000e+01;0.000000000000000000e+00
9.500000000000000000e+01;0.000000000000000000e+00;1.000000000000000000e+01;0.000000000000000000e+00
6.000000000000000000e+01;0.000000000000000000e+00;3.200000000000000000e+01;0.000000000000000000e+00