Skip to content

Instantly share code, notes, and snippets.

View vicentedeandrade's full-sized avatar

Vicente de Andrade vicentedeandrade

  • Advance Soluções em TI
  • Blumenau/SC
View GitHub Profile
@vicentedeandrade
vicentedeandrade / forticlientsslvpn-expect.sh
Created October 29, 2024 17:13 — forked from mgeeky/forticlientsslvpn-expect.sh
Simple script intended to automate Fortinet SSL VPN Client connection on Linux using expect scripting.
#!/bin/bash
# Forticlient SSL VPN Client launching script utilizing expect.
# --------------------------------------------
# CONFIGURATION
# If empty - script will take some simple logic to locate appropriate binary.
FORTICLIENT_PATH=""
@vicentedeandrade
vicentedeandrade / docker-dhcpd.md
Created July 29, 2024 19:49 — forked from mikejoh/docker-dhcpd.md
Short guide on how to set up a Docker container as a DHCP server

Setting up a Docker container as a DHCP server

In this guide I’ve tested a number of different commands and configurations using Docker to run a container with dhcpd (+macvlan driver) to serve my clients in my home network. In the end i’ll migrate from my Windows 2012 R2 Server running DHCP to a much more lightweight Docker container (7.42 MB in total). Wow.

My home environment:

  • Firewall (Juniper)
    • I’m running IP helper for bootp which in this case means that i relay DHCP requests from various VLANs into one where i've placed my Windows 2012 R2 server. This is also where my container will live. See the FW configuration below:
@vicentedeandrade
vicentedeandrade / threatboard.sh
Created July 25, 2024 11:18 — forked from jrsouth/threatboard.sh
SQL `watch` commands
watch -t -n 5 'echo -e "THREAT BOARD\n`date`\n\n TOP\n---------------------";top -b -n 1 | head -12 | tail -6; echo -e " \n df -h\n---------------------"; df -h | sort -g -k5; echo -e " \n free -m\n---------------------"; free -m; echo -e " \n MySQL\n---------------------"; mysql -e "SELECT COUNT(ID) AS \`NUMBER OF THREADS\` FROM INFORMATION_SCHEMA.PROCESSLIST;" | sed "$!{:a;N;s/\n/: /;ta}"; mysql -t -e "SELECT ID, USER, HOST, DB, STATE, COMMAND, TIME, SUBSTRING(INFO, 0, 20) AS QUERY FROM INFORMATION_SCHEMA.PROCESSLIST ORDER BY TIME DESC;";'
@vicentedeandrade
vicentedeandrade / fix-wordpress-permissions.sh
Created November 20, 2023 20:51 — forked from Adirael/fix-wordpress-permissions.sh
Fix wordpress file permissions
#!/bin/bash
#
# This script configures WordPress file permissions based on recommendations
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions
#
# Author: Michael Conigliaro <mike [at] conigliaro [dot] org>
#
WP_OWNER=www-data # <-- wordpress owner
WP_GROUP=www-data # <-- wordpress group
WP_ROOT=$1 # <-- wordpress root directory
@vicentedeandrade
vicentedeandrade / dockerfile
Created February 28, 2023 13:28 — forked from AntonMiles/dockerfile
Creating A .NET Windows Docker Container With Internal IIS SSL (From PFX File) and HTTPS Support
# The following won't work as-is, I use '<>' to denote variables you need to replace, including a name so you can keep them straight!
# A list of all of them, for searching follows.
# app_directory
# app_name
# ssl_password
# ssl_name
#base machine is meant to contain IIS as well as asp/.net requirements
FROM microsoft/aspnet
#Expose port 443 to allow incoming traffic over the default HTTPS port