Skip to content

Instantly share code, notes, and snippets.

View KennethEhmsen's full-sized avatar

Kenneth KennethEhmsen

  • Orange Design One
  • Denmark
  • X @Ehmsig
View GitHub Profile
@KennethEhmsen
KennethEhmsen / iptables-ddos-protection.txt
Created February 14, 2022 20:22 — forked from peerapach/iptables-ddos-protection.txt
Build Your Own DDoS Protection With Linux & IPtables
DEV=eth0
PORT=80
### Use SYNPROXY ###
/sbin/iptables -t raw -A PREROUTING -i $DEV -p tcp -m tcp --syn --dport $PORT -j CT --notrack
/sbin/iptables -t mangle -A INPUT -i $DEV -p tcp -m conntrack --ctstate INVALID,UNTRACKED --dport $PORT -j SYNPROXY \
--sack-perm --timestamp --wscale 7 --mss 1460
/sbin/iptables -t mangle -A INPUT -i $DEV -p tcp -m conntrack --ctstate INVALID --dport $PORT -j DROP
@KennethEhmsen
KennethEhmsen / .. MediaCreationTool.bat ..md
Created October 1, 2021 09:45 — forked from AveYo/.. MediaCreationTool.bat ..md
Universal MediaCreationTool wrapper for all MCT Windows 10 versions from 1507 to 21H1 with business (Enterprise) edition support

Not just an Universal MediaCreationTool wrapper script with ingenious support for business editions,
Preview
A powerful yet simple windows 1X deployment automation tool as well!

awesome gui dialogs to pick windows version and preset action
Auto Setup choice for upgrade directly without prompts, with edition change / intelligent fallback
Create ISO choice for authoring iso file directly via DIR2ISO snippet, including any 'oem' customizations
Create USB choice for authoring usb via native MCT, including any 'oem' customizations (prompts once)
Select in MCT choice for vanilla MCT processing without 'oem' modifications, script quits straightway
control via set script vars, commandline parameters or rename script like iso 21H2 Pro MediaCreationTool.bat

#
# ChangePwd
#
# Author: Shawn Masterson
# Created: June 2013
# Version: 1
#
# Purpose: Change local Windows account passwords on remote systems located in a vSphere folder
#
#
<#
.SYNOPSIS
Deploy Multiple VMs to vCenter
.DESCRIPTION
VMs are deployed asynchronously based on a pre-configured csv file (DeployVM.csv)
.PARAMETER csvfile
Path to DeployVM.csv file with new VM info
#requires -Version 3.0
<#
.SYNOPSIS
My Veeam Report is a flexible reporting script for Veeam Backup and
Replication.
.DESCRIPTION
My Veeam Report is a flexible reporting script for Veeam Backup and
Replication. This report can be customized to report on Backup, Replication,
rm -r /etc/vmware/license.cfg
cp /etc/vmware/.#license.cfg /etc/vmware/license.cfg
/etc/init.d/vpxa restart
vim-cmd vimsvc/license --show | grep expirationDate
# see https://calvin.me/reset-esxi-evaluation-license/
@KennethEhmsen
KennethEhmsen / psCompress.ps1
Created July 8, 2020 08:51 — forked from marcgeld/psCompress.ps1
Powershell: Compress and decompress byte array
# Compress and decompress byte array
function Get-CompressedByteArray {
[CmdletBinding()]
Param (
[Parameter(Mandatory,ValueFromPipeline,ValueFromPipelineByPropertyName)]
[byte[]] $byteArray = $(Throw("-byteArray is required"))
)
Process {
@KennethEhmsen
KennethEhmsen / Use-Impersonation.ps1
Created June 25, 2020 12:06 — forked from idavis/Use-Impersonation.ps1
Impersonate a user and execute a script block as that user
param( [ScriptBlock] $scriptBlock )
<#
.SYNOPSIS
Impersonates a user and executes a script block as that user. This is an interactive script
and a window will open in order to securely capture credentials.
.EXAMPLE
Use-Impersonation.ps1 {Get-ChildItem 'C:\' | Foreach { Write-Host $_.Name }}
This writes the contents of 'C:\' impersonating the user that is entered.
#>
#!/bin/vbash
# CONFIG
wan=dhcp
lan=10.10.10.1
lan_segment=10.10.10.0
lan_workstationip1=10.10.10.10
lan_workstationmac1=04-92-26-DA-58-A9
vpn_segment=10.10.15.0
domain=home.local
Title : "Vyos basic configuration"
Date : "25/07/2018"
Author : "Musha"
Reference : "http://soucy.org/vyos/UsingVyOSasaFirewall.pdf"
1) Configure network Interface eth0 (internet)
set interfaces ethernet eth0 address dhcp
set interfaces ethernet eth0 description 'OUTSIDE'
2) Configure network interface eth1 (dmz)