Skip to content

Instantly share code, notes, and snippets.

View fabiojmendes's full-sized avatar

Fabio Mendes fabiojmendes

  • Toronto, Canada
View GitHub Profile
@fabiojmendes
fabiojmendes / main.c
Created December 4, 2021 05:46
Playing around with interrupt driver uarts in Zephyr
#include <string.h>
#include <zephyr.h>
#include <console/console.h>
#include <drivers/uart.h>
/* size of stack area used by each thread */
#define STACKSIZE 1024
#define UART_1 "UART_1"
#define TTY_BUF_SZ 512
@fabiojmendes
fabiojmendes / nftables.conf
Last active September 3, 2024 03:21
Wireguard vpn nat proxy
#!/usr/sbin/nft -f
flush ruleset
define pub_iface = "enp1s0"
define wg_iface = "wg0"
define wg_port = 51820
table inet filter {
chain input {
type filter hook input priority 0; policy drop;
@fabiojmendes
fabiojmendes / update.sh
Last active August 27, 2024 19:59
Update headless raspberry pi using a script
#!/bin/bash
# Update script for headless pi
# Add these options to the end of cmdline.txt file
# systemd.run=/boot/firmware/update.sh systemd.run_success_action=reboot systemd.unit=kernel-command-line.target
set -euo pipefail
# Remove options from cmdline for normal reboot
cleanup() {
exit_code=$?
@fabiojmendes
fabiojmendes / main.nft
Last active September 6, 2024 14:02
Nftables configuration that plays nice with podman
# This config is based on the original nftables
# config that ships with fedora/rocky/rhel
# Added podman_allowed so it works with podman
# Sample configuration for nftables service.
# Load this by calling 'nft -f /etc/nftables/main.nft'.
# Note about base chain priorities:
# The priority values used in these sample configs are
# offset by 20 in order to avoid ambiguity when firewalld