Skip to content

Instantly share code, notes, and snippets.

@sa7dse
sa7dse / 99-rodecaster-pro.conf
Last active March 27, 2024 09:33
rename rodecaster pro 2 in pipewire, in the SPA-JSON format
# Renames the outputs and inputs of the RODE RODECaster Pro II.
# Based on the lua version: https://gist.github.com/ngandrass/c81cda4903b8429262fe80dc69d8252f
#
# Place this file inside ~/.config/wireplumber/wireplumber.conf.d/
#
# Tips on using the RODE RODECaster Pro II on Linux:
# - Use PipeWire together with WirePlumber. I'm using the following packages on
# Arch Linux: pipewire pipewire-alsa pipewire-pulse pipewire-jack wireplumber.
# Optional packages: qpwgraph
# - Configure the RODE RODECaster Pro II to use the 'Pro Audio' profile
printf 'network={\n ssid="%sC3"\n key_mgmt=WPA-EAP\n eap=TTLS\n identity="%s"\n password="%s"\n ca_cert="/etc/ssl/certs/DST_Root_CA_X3.pem"\n altsubject_match="DNS:radius.c3noc.net"\n
phase2="auth=PAP"\n}\n' `date +'%Y'| awk '{print $1-1983}'` `openssl rand -base64 32` `openssl rand -base64 32`
@sa7dse
sa7dse / sysctl-net.service
Last active August 31, 2015 09:32
systemd unit to run sysctls after network comes online
[Unit]
Description=Apply Kernel Variables after network
DefaultDependencies=no
Conflicts=shutdown.target
After=network-online.target
ConditionPathIsReadWrite=/proc/sys/
Wants=network-online.target
[Service]
Type=oneshot
@sa7dse
sa7dse / aur4 pre-commit hook
Last active June 24, 2016 15:41
Pre commit hook to sync changes from the PKGBUILD to the .SRCINFO file. For aur4.
#!/bin/sh
# Pre commit hook to sync changes from the PKGBUILD to the .SRCINFO file.
# Depends on: pkgbuild-introspection
if git diff --cached --stat --name-only | grep PKGBUILD 2>&1
then
mksrcinfo
git add .SRCINFO
fi
### Keybase proof
I hereby claim:
* I am slaveriq on github.
* I am slaveriq (https://keybase.io/slaveriq) on keybase.
* I have a public key whose fingerprint is 8E96 F6BB D6B7 8C1C E3B1 0DC1 1F4E 13A3 4D0C E5D7
To claim this, I am signing this object:
[Unit]
Description=OpenVPN connection to %i
After=network.target
Requires=systemd-ask-password-wall.service
[Service]
Type=forking
ExecStart=/usr/bin/openvpn --cd /etc/openvpn/%i --config /etc/openvpn/%i/openvpn.conf --daemon openvpn@%i
[Install]
WantedBy=multi-user.target
#!/usr/bin/python
import random
import time
def secret_gen():
random.seed()
while(1):
num = int(random.randint(1,100))
yield num
def leave(secret):
@sa7dse
sa7dse / imapfilter@.service
Last active July 11, 2017 10:22
systemd unit file for imapfilter
[Unit]
Description=Imapfilter
After=network.target
[Service]
Type=simple
ExecStart=/usr/local/bin/imapfilter -dc /home/%I/.imapfilter/config.lua
ExecReload=/bin/kill -HUP $MAINPID
KillMode=process
Restart=always
#include <iostream>
#include <string>
#include <sstream>
using namespace std;
int ask()
{
int number;