Skip to content

Instantly share code, notes, and snippets.

"data": {
"logitech_z906": {
"toggle": "JgBQAAABHJAREhE2ERMREhETERQREhETERIRExETERIRExE2ERIRNhETERISExETERIRExESETYRNhE2ETYRNxE2ETYRNhESEQAFsgABHUgSAA0F",
"input": "JgBQAAABHY8RExE3ERIRExESEhIRExESERMREhETERMREhE3ERMRNhESERMRExE1ERMRExESERMSNhE2ETURExE2ETYRNhI1EQAFswABHEkRAA0F",
"vol_plus": "JgBQAAABHJAREhE2ERMREhETERMSEhETERIRExETERIRExE2ERIRNhETETcREhE2ERMRNhESETYRNhETETYSEhE2ERMRNhESEQAFsgABHUgRAA0F",
"vol_minus": "JgBQAAABHJARExE2ERIRExETERIRExESEhMRExESERMREhE2ERMRNhESETYSExE2ERIRNhE2ERMRNhESETcRExE2ERIRExE1EgAFsgABHUgRAA0F",
"mute": "JgBQAAABHZAREhE3ERMREhETERIRExETERIRExESERMRExE3ERIRNhETETYREhE2ERMRNxE1EjURNhETETYREhE2ERQREhETEQAFswABHUgRAA0F"
}
}
@theonlydoo
theonlydoo / restic_backup.md
Created December 8, 2023 14:23
restic backup with auto restic, autorestic and an nfs server as a remote storage

restic.sh

#!/bin/bash
timeout 30 mount /home/backup/ && time autorestic --config /home/changeme/.autorestic.yml backup -a ; umount /home/backup

restic.service

@theonlydoo
theonlydoo / logfinder.py
Created December 8, 2016 14:02
flume log finder and config generator
#!/usr/bin/env python
import os, time, re, socket, getopt, sys
from jinja2 import Template
logfile=re.compile(ur'.*\.log$', re.IGNORECASE)
def finder(path, brokers):
paths={}
here=os.getcwd()
for dpath, dnames, fnames in os.walk(path):
@theonlydoo
theonlydoo / keybase.md
Last active July 7, 2016 12:50
keybase.md

Keybase proof

I hereby claim:

  • I am Theonlydoo on github.
  • I am arnaudb (https://keybase.io/arnaudb) on keybase.
  • I have a public key whose fingerprint is C7DA 3E9F E141 ADE9 36CC 5BE7 FD9E D04E 67B0 E775

To claim this, I am signing this object:

@theonlydoo
theonlydoo / cgroups.conf.j2
Created March 29, 2016 15:23 — forked from DazWorrall/cgroups.conf.j2
Collecting cgroup memory stats using collectd and ansible
LoadPlugin "table"
<Plugin table>
{% for vm in running_vms.list_vms %}
<Table "/sys/fs/cgroup/memory/libvirt/lxc/{{ vm }}/memory.stat">
Instance "{{ vm }}-memory"
Separator " \\t"
<Result>
Type gauge
InstancesFrom 0
ValuesFrom 1
@theonlydoo
theonlydoo / include_vars_merged
Created December 1, 2015 15:33 — forked from udondan/include_vars_merged
Ansible action plugin "include_vars_merged". Same as "include_vars" but merges hashes instead of overriding

#Why? Current version of Ansible (1.7.1) does not merge hashes in the include_vars task even if told so via hash_behaviour = merge in your ansible.cfg. ansible/ansible#9116

This action plugin will merge hashes no matter how you have configured your hash_behaviour.

#How to setup: Save include_vars_merged.py to library/plugins/action/include_vars_merged.py

Save include_vars_merged to library/custom/include_vars_merged

@theonlydoo
theonlydoo / haproxy.cfg
Created November 27, 2015 14:53
haproxy config for docker registry v2
global
log /dev/log local0
log /dev/log local1 notice
chroot /var/lib/haproxy
stats socket /run/haproxy/admin.sock mode 660 level admin
stats timeout 30s
user haproxy
group haproxy
daemon
ssl-server-verify none
#!/bin/bash
# This script require to have html2text on your computer
# doo@dooby.fr
###############################################################
vars(){
ipfile="/home/ip"
ip=$(curl -s monip.org|html2text |grep -i "ip :"|awk '{ print $3 }')
login="mondomaine.eu-mamachine"
pass="monsuperpass"
domain="mondomaine.eu"
@theonlydoo
theonlydoo / chrootgen.sh
Last active August 29, 2015 13:57
Simple chrootgen script
#!/bin/bash
#
# exit 0 : OK
# exit 1 : KO
# TODO : intégrer le script en mode read avec p-e une interface curl
# : proposer du password random
# : proposer un mail d'avertissement
# : mode debug
# author doo@dooby.fr
# Fork of : http://root-lab.fr/2012/01/25/creer-chroot-ssh-limite-simplement/