Skip to content

Instantly share code, notes, and snippets.

View fbraz3's full-sized avatar

Felipe Braz fbraz3

View GitHub Profile
@fbraz3
fbraz3 / cleanup-vm.sh
Created May 27, 2025 20:43 — forked from lucasmaurice/cleanup-vm.sh
This one clean up an Ubuntu installation before creating a template.
#!/usr/bin/bash
echo '> Begin Cleanup script'
echo '> Cleaning all audit logs ...'
sudo service rsyslog stop
if [ -f /var/log/audit/audit.log ]; then
cat /dev/null > /var/log/audit/audit.log
fi
@fbraz3
fbraz3 / openwrt_add_guest.sh
Last active July 7, 2025 17:39
[OpenWRT] Shell Script to Create a Fully Isolated Guest Network with Bandwidth Control
#!/bin/sh
#
# FOR USE IN OPENWRT
# This script creates a guest network fully isolated from the main one.
# Tested on a Xiaomi AX3000T router; should work on any OpenWRT-powered router.
#
# - Ensure the Wi-Fi interfaces retain their default names (radio0 and radio1).
# - For enable download/upload limits, you MUST install the sqm-scripts package on your OpenWRT router.
# - For enable roaming (aka wifi mesh):
@fbraz3
fbraz3 / mssql_helper.php
Created July 2, 2018 20:29 — forked from displague/mssql_helper.php
PDO_SQLSRV wrapper for legacy MSSQL PHP database functions
<?php
if (! extension_loaded('mssql') && extension_loaded('pdo_sqlsrv')) {
//Return an associative array. Used on mssql_fetch_array()'s result_type parameter.
define('MSSQL_ASSOC', '1');
//Return an array with numeric keys. Used on mssql_fetch_array()'s result_type parameter.
define('MSSQL_NUM', '2');
//Return an array with both numeric keys and keys with their field name. This is the default value for mssql_fetch_array()'s result_type parameter.