Skip to content

Instantly share code, notes, and snippets.

View rhizoome's full-sized avatar
💭
Gluing elephants to the ceiling

Jean-Louis Fuchs rhizoome

💭
Gluing elephants to the ceiling
View GitHub Profile
@rhizoome
rhizoome / color-mark.kak
Last active March 17, 2021 09:03
color-marks for kakoune
provide-module color-mark %{
declare-option int color_mark_index 0
set-face global ColorMark0 rgb:FF7F00+rb
set-face global ColorMark1 rgb:0095FF+rb
set-face global ColorMark2 rgb:FF00AA+rb
set-face global ColorMark3 rgb:6AFF00+rb
set-face global ColorMark4 rgb:00EAFF+rb
set-face global ColorMark5 rgb:AA00FF+rb
set-face global ColorMark6 rgb:8F2323+rb
set-face global ColorMark7 rgb:23628F+rb
@rhizoome
rhizoome / setsound.sh
Last active July 31, 2020 21:03
Symmetric dmix and dnsoop for applications that process input/output synchronous (WebRTC, Chromium)
#!/bin/sh
if [ -z "$1" ]; then
aplay -L | grep -v "^ " | cut -d ':' -f 2 | uniq | sort | uniq
exit 1
fi
cat <<EOF > "$HOME/.asoundrc"
pcm.!default {
type asym
$> cat run-server.sh
#!/bin/sh
# Copyright (c) 2012-2015 Kaarle Ritvanen
# See LICENSE file for license details
export AUGEAS_LENS_LIB=augeas
if [ $(basename $0) = run-server.sh ]; then
export LUA_PATH="./?.lua;./?/init.lua;;"
$> cat run-server.sh
#!/bin/sh
# Copyright (c) 2012-2015 Kaarle Ritvanen
# See LICENSE file for license details
export AUGEAS_LENS_LIB=augeas
if [ $(basename $0) = run-server.sh ]; then
export LUA_PATH="./?.lua;./?/init.lua;;"
qemu-system-x86_64
-m 512M
-serial stdio
-monitor null
-kernel {S.kernel}
-initrd {S.initramfs}
-drive file=root.squashfs,if=virtio,format=raw
--append "root=/dev/vda console=ttyS0"
@rhizoome
rhizoome / builder-error-to-mail.py
Last active March 10, 2020 12:14
Alpine Builder Error to Email
import json
import smtplib
import subprocess
import sys
import time
from email.message import EmailMessage
import toml
TO = "[email protected]"
#!/bin/dash
exec python -m pip install \
pdbpp \
black \
vmprof \
isort \
python-language-server \
pydocstyle \
pycodestyle \
pyls-isort \
@rhizoome
rhizoome / cost.py
Created October 30, 2019 22:40
azure subscription cost
import datetime
import json
from subprocess import check_output
end = datetime.datetime.now() + datetime.timedelta(days=1)
start = end - datetime.timedelta(days=31)
end_fmt = end.strftime("%Y-%m-%d")
start_fmt = start.strftime("%Y-%m-%d")
cmd = (
@rhizoome
rhizoome / doms.txt
Last active September 21, 2019 20:22
doms
'aax-eu.amazon-adsystem.com',
'abs-0.twimg.com',
'abs.twimg.com',
'acdn.adnxs.com',
'ad.doubleclick.net',
'ade.googlesyndication.com',
'adservice.google.com',
'ads.pubmatic.com',
'ad.turn.com',
'ad.yieldlab.net',
@rhizoome
rhizoome / git-brase.py
Last active August 15, 2019 10:23
Bisect get merge/rebase (seems safe, but use at your own risk)
#!/usr/bin/env python3
import bisect
import functools
import shlex
import subprocess as s
import sys
devel = False