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
@mikejoh
mikejoh / docker-dhcpd.md
Last active November 10, 2024 09:08
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:
@AntonMiles
AntonMiles / dockerfile
Created July 15, 2017 15:04
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
@mgeeky
mgeeky / forticlientsslvpn-expect.sh
Last active October 29, 2024 17:14
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=""
@jrsouth
jrsouth / threatboard.sh
Created October 23, 2013 13:20
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;";'
@Adirael
Adirael / fix-wordpress-permissions.sh
Created August 17, 2012 23:16
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