Skip to content

Instantly share code, notes, and snippets.

View oornnery's full-sized avatar

Fabio Souza oornnery

View GitHub Profile
@wainejr
wainejr / .config_qtile_autostart.sh
Last active November 15, 2024 15:54
Linux setup files
#!/bin/bash
# From root in repo, run
# chmod +x .config/qtile/autostart.sh
# ln -s $(pwd)/.config/qtile/autostart.sh ~/.config/qtile/autostart.sh
# to link autostart with this
# Function to check if a process is already running and run it if not
function run {
if ! pgrep -x $(basename $1 | head -c 15) 1>/dev/null;
#!/usr/bin/env python
# todo: WWW-Authorizationのuriを変更しない
import sys
import os
import selectors
import socket
import re
proxy_address = "proxy_address_local"
@ityonemo
ityonemo / test.md
Last active April 29, 2025 08:28
Zig in 30 minutes

A half-hour to learn Zig

This is inspired by https://fasterthanli.me/blog/2020/a-half-hour-to-learn-rust/

Basics

the command zig run my_code.zig will compile and immediately run your Zig program. Each of these cells contains a zig program that you can try to run (some of them contain compile-time errors that you can comment out to play with)

@swuecho
swuecho / proxmox-import-disk-image.txt
Created August 12, 2020 00:56
Add import existing disk image into Proxmox
#
# The official PVE docs on how to prepare cloud-init templates:
# https://pve.proxmox.com/wiki/Cloud-Init_Support#_preparing_cloud_init_templates
#
# Additional guides and resources:
# https://dae.me/blog/2340/how-to-add-an-existing-virtual-disk-to-proxmox/
# https://pve.proxmox.com/pve-docs/qm.1.html
# use the Qemu/KVM Virtual Machine Manager to import the disk
qm importdisk 107 Univention-App-kopano-core-KVM.qcow2 local-lvm
@tdcosta100
tdcosta100 / WSL2GUIXvnc-pt_br.md
Last active February 24, 2025 04:14
Tutorial para utilizar interface gráfica no WSL2, substituindo XServer pelo Xvnc, permitindo ao WSL trabalhar como se fosse Linux nativo, incluindo tela de login

WSL2 com interface gráfica utilizando Xvnc

Note

Caso você queira utilizar o WSLg puro, você pode tentar o novo tutorial com o WSLg (Xwayland) ou o tutorial com o WSLg (Wayland).

Nesse tutorial, iremos configurar a interface gráfica no WSL2, e acessá-la utilizando o VNC. Nenhum software adicional fora do WSL é necessário (como o VcXsrv), exceto, claro um VNC Viewer (RealVNC, TightVNC, TigerVNC, UVNC, etc, todos devem funcionar perfeitamente).

Os componentes-chave que precisamos instalar são o metapackage do desktop que você desejar (GNOME, KDE, Xfce, Budgie, etc) e o tigervnc-standalone-server.

Para essa configuração irei utilizar Ubuntu (20.04, 22.04 e 24.04 funcionam), e irei instalar o GNOME Desktop. Uma vez que os comp

@fjpalacios
fjpalacios / arch-i3gaps-install.md
Last active April 18, 2025 09:44
Arch + i3-gaps Install Guide

Arch + i3-gaps Install Guide

First set up your keyboard layout. For example, in Spanish:

   # loadkeys es

For a list of all acceptable keymaps:

   # localectl list-keymaps
@hartred
hartred / sip_example.py
Created March 23, 2018 11:10
Twisted SIP protocol example
from twisted.internet import reactor
from twisted.protocols import sip
from twisted.internet.protocol import ServerFactory
class SipProxy(sip.Proxy):
def __init__(self):
sip.Proxy.__init__(self,host='192.168.1.3',port=5060)
self.tries=0
def handle_request(self,message,addr):
@samuelcolvin
samuelcolvin / SIP_call_watcher.py
Created March 13, 2018 17:40
watch a sip server and print the number of incoming calls using python 3.6 and asyncio
import asyncio
import hashlib
import os
import re
import secrets
from time import time
from multidict import CIMultiDict
from devtools import debug
@jart
jart / sip.rl
Created March 12, 2018 08:18
gossip sip parser definition
%%{# -*-ragel-*-
#
## SIP Message Parser Definition
#
# The parser should be a linearly complex FSM. It should be able to parse a
# real-world SIP INVITE in less than 30μs. This parser only trades speed in
# favor of friendly data structures, which are big structs linked together.
#
## Implementation Notes
#
Session Initiation Protocol (INVITE)
Request-Line: INVITE sip:[email protected] SIP/2.0
Method: INVITE
Request-URI: sip:[email protected]
Request-URI User Part: 18556909191
Request-URI Host Part: laxsip.incontact.com
[Resent Packet: False]
Message Header
Via: SIP/2.0/TCP 192.168.0.128:49468;branch=z9hG4bK-524287-1---9d65765a0e5dd225;rport
Max-Forwards: 70