Skip to content

Instantly share code, notes, and snippets.

View luandro's full-sized avatar

luandro luandro

View GitHub Profile
@luandro
luandro / cpe_borda.md
Last active October 19, 2022 12:18
CPE 210 na borda

/etc/config/network:

config interface 'loopback'
	option ifname 'lo'
	option proto 'static'
	option ipaddr '127.0.0.1'
	option netmask '255.0.0.0'

config globals 'globals'
@luandro
luandro / computer_gateway.sh
Created August 7, 2023 23:42
This bash script is used to set up and tear down a simple internet gateway. It uses the ip, iptables, ufw, and dnsmasq utilities to configure network interfaces, set up NAT (Network Address Translation), configure a firewall, and set up a DHCP server.
#!/bin/bash
# Check if script is run as root
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
# Check if required utilities are installed
for util in ip iptables ufw dnsmasq; do
@luandro
luandro / generate-defaults.sh
Last active August 8, 2023 00:19
Generates a Mapeo config defaults.json based on the items within the presets folder and their geometry fields. Execute from the Mapeo configuration project's folder root.
#!/bin/bash
# Path to the presets folder
presetsFolder="./presets"
# Path to defaults.json
defaultsPath="./defaults.json"
# Temp file for jq output
tempFile=$(mktemp)
@luandro
luandro / download_files_from_email_eml_file.sh
Last active August 31, 2023 15:20
Downloads Google Drive attachments from a EML file.
#!/bin/bash
# Check if an argument has been provided
if [ $# -eq 0 ]; then
echo "No argument provided. Please enter the .eml file path:"
read file_path
else
file_path=$1
fi