Skip to content

Instantly share code, notes, and snippets.

View crazybolillo's full-sized avatar
🐛
Bugs

Antonio crazybolillo

🐛
Bugs
View GitHub Profile
@crazybolillo
crazybolillo / main.rs
Created October 2, 2024 01:12
ARI external media to WAV
use hound;
use std::net::UdpSocket;
// Obtained from: https://github.com/zaf/g711
const ULAW2PCM: [i16; 256] = [
-32124, -31100, -30076, -29052, -28028, -27004, -25980, -24956, -23932, -22908, -21884, -20860,
-19836, -18812, -17788, -16764, -15996, -15484, -14972, -14460, -13948, -13436, -12924, -12412,
-11900, -11388, -10876, -10364, -9852, -9340, -8828, -8316, -7932, -7676, -7420, -7164, -6908,
-6652, -6396, -6140, -5884, -5628, -5372, -5116, -4860, -4604, -4348, -4092, -3900, -3772,
-3644, -3516, -3388, -3260, -3132, -3004, -2876, -2748, -2620, -2492, -2364, -2236, -2108,
@crazybolillo
crazybolillo / twilioAttributes.js
Created September 16, 2024 22:35
Twilio Flex Attributes with Zitadel
const logger = require('zitadel/log')
function twilioAttributes(ctx, api) {
logger.info('Setting up Twilio Attributes')
const user = ctx.v1.getUser()
api.v1.attributes.setCustomAttribute('full_name', '', user.human.displayName)
api.v1.attributes.setCustomAttribute('email', '', user.human.email)
@crazybolillo
crazybolillo / iptables.sh
Created June 19, 2024 15:28
Enable internet access for Vagrant VMs
#!/bin/sh
iptables -A FORWARD -i virbr1 -o wlp4s0 -j ACCEPT
iptables -A FORWARD -i wlp4s0 -o virbr1 -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -t nat -A POSTROUTING -o virbr1 -j MASQUERADE
@crazybolillo
crazybolillo / qemu.sh
Created September 5, 2022 01:28
Windows with QEMU
# Run a Windows Guest in a Linux host with Qemu
kvm -hda win11.qcow2 -m 4096 -cpu host -smp 4 -vga qxl \
-machine vmport=off -daemonize \
-spice port=3001,disable-ticketing=on \
-device virtio-serial \
-chardev spicevmc,id=vdagent,debug=0,name=vdagent \
-device virtserialport,chardev=vdagent,name=com.redhat.spice.0 \