Skip to content

Instantly share code, notes, and snippets.

View defel's full-sized avatar
🐧
I use arch btw

defel

🐧
I use arch btw
View GitHub Profile
@defel
defel / keebwerk-nano-pulseaudio-v1.js
Last active January 31, 2020 10:00
Keebwerk Nano Bento Pulseaudio Volumecontrol
const midi = require('midi');
const debounce = require('debounce');
const {execSync} = require('child_process')
// Set up a new input.
const input = new midi.Input();
// Count the available input ports.
// console.log('COUNT:', input.getPortCount());
// console.log('P1:', input.getPortName(0));
@defel
defel / qr-scan.sh
Created August 22, 2019 09:21
Scan QR-Code from CLI by combining zbar, grim and slurp
#!/usr/bin/env bash
grim -g "$(slurp)" - | zbarimg PNG:-
@defel
defel / PicardTips.md
Created May 10, 2019 19:33
Picard Tips as fortune file

Get picard tips as your fortune file ✨

  1. install fortune on arch: sudo pacman -S fortune-mod

  2. create dat-file: strfile PicardTips.txt

  3. test fortune: fortune PicardTips.txt

  4. add to your .zshrc or bashrc

#!/bin/bash
# see http://www.linux.org/threads/resetting-the-usb-subsystem.6256/
cd /sys/bus/pci/drivers/xhci_hcd/
echo "0000:00:14.0" > unbind
echo "0000:00:14.0" > bind
@defel
defel / z-schema_issue69.js
Created November 27, 2014 15:22
z-schema floating point issue script
var
ZSchema = require('z-schema'),
options = {},
validator = new ZSchema(options),
fs = require('fs'),
schema,
schemaValid;
schema = {
"type": "object",
@defel
defel / sources.list
Created October 31, 2014 17:19
sources.list
## CRUNCHBANG
## Compatible with Debian Wheezy, but use at your own risk.
deb http://packages.crunchbang.org/waldorf waldorf main
deb http://ftp.de.debian.org/debian jessie main contrib non-free
deb http://ftp.debian.org/debian/ jessie-updates main contrib non-free
deb http://security.debian.org/ jessie/updates main contrib non-free

Keybase proof

I hereby claim:

  • I am defel on github.
  • I am defel (https://keybase.io/defel) on keybase.
  • I have a public key whose fingerprint is 3FD1 BAF2 45C3 9826 0092 ADF5 B3A3 3132 E586 72AE

To claim this, I am signing this object:

@defel
defel / create_cert.sh
Last active August 29, 2015 14:03
SmartOS/nginx: install CaCert Class-3 SSL Certificate
# get root.crt and class3 cert from cacert
curl http://www.cacert.org/certs/root.crt > cacert.root.class3.crt
curl http://www.cacert.org/certs/root.crt > cacert.root.class3.crt
# chain page certificate and cacert class3
cat www.example.com.crt cacert.root.class3.crt > www.example.com.chained.crt
# copy cert and key to nginx config-dir
cp www.example.com.chained.crt /opt/local/etc/nginx/ssl/.
cp www.example.com.pem /opt/local/etc/nginx/
@defel
defel / start_fpm_on_boot.sh
Last active August 29, 2015 14:03
smartos: start nginx and php-fpm on boot
# install php-fpm
pkgin in php55-fpm-5.5.10
# enable the service
/usr/sbin/svcadm enable svc:/pkgsrc/php-fpm:default
# after reboot php-fpm should be started per default
@defel
defel / github_search_cli.sh
Created February 3, 2014 08:30
Search Github for Projects which README file contains "antigen bundle"
curl https://api.github.com/search/repositories\?q\=antigen bundle+in:readme | json -a items| json -a id name full_name html_url