Skip to content

Instantly share code, notes, and snippets.

View goffinet's full-sized avatar

goffinet

View GitHub Profile
@goffinet
goffinet / ubuntu-minimal-configuration.sh
Last active May 14, 2017 21:08
Ubuntu minimal audit configuration
systemctl disable apparmor
systemctl disable ufw
apt-get update && apt-get -y upgrade
apt-get install snmp ntpdate bind9utils wget curl nmap python-scapy thc-ipv6 yersinia hydra tftpd-hpa tftp-hpa tshark quagga vim john freeradius freeradius-utils scrypt easy-rsa cdpr lldpd ladvd radvd hping3 arp-scan snimpy yasat snmp-mibs-downloader stunnel4 telnet openvpn htop dsniff mc
for x in quagga ladvd radvd openvpn freeradius ; do
systemctl stop $x
#systemctl disable $x
#systemctl status $x
done
@goffinet
goffinet / create_vm1.ps1
Last active December 13, 2016 07:13
posh create vm windows 2016 14393
#
#Set VM Name, Switch Name, and Installation Media Path.
$VMname = 'TESTVM'
#$Switch = 'NatSwitch'
$Switch = 'VmNAT'
$ISO = 'C:\Users\Administrator\Downloads\14393.0.160715-1616.RS1_RELEASE_SERVER_EVAL_X64FRE_EN-US.ISO'
$VHD = 'C:\Users\Administrator\Documents\'
$VHDSize = 40 GB
$RAM = 4 GB
@goffinet
goffinet / remove_vm1.ps1
Created December 12, 2016 22:40
Remove vm by name with disk**s**
#
$VMname = 'TESTVM'
GET-VM –Name $VMname | GET-VMHardDiskDrive | Foreach { STOP-VM –Name $_.VMname; Remove-item –path $_.Path; REMOVE-VM –Name $_.VMname -Force }
@goffinet
goffinet / net.sh
Last active May 3, 2025 04:17
Centos7 router config firewalld/networkmanager
#!/bin/bash
connection="System eth0"
ip4="192.168.168"
ip6="fd00:168:168"
1_interfaces () {
hostnamectl set-hostname router
nmcli c mod "$connection" ipv4.addresses $ip4.1/24
nmcli c mod "$connection" ipv4.method manual
nmcli c mod "$connection" ipv6.addresses $ip6::1/64
nmcli c mod "$connection" ipv6.method manual
@goffinet
goffinet / wheezy.preseed
Created December 28, 2016 10:05 — forked from sturadnidge/wheezy.preseed
Debian 7.x preseed file for a simple, minimal install.
#### Contents of the preconfiguration file (for wheezy)
### Localization
d-i debian-installer/locale string en_US.UTF-8
d-i debian-installer/keymap select us
d-i keymap select us
### Network configuration
d-i netcfg/choose_interface select auto
### Mirror settings
@goffinet
goffinet / debian8-preseed.cfg
Created December 28, 2016 15:01
debian8-preseed.cfg
#### Contents of the preconfiguration file (for jessie)
### Localization
# Preseeding only locale sets language, country and locale.
d-i debian-installer/locale string en_US
# The values can also be preseeded individually for greater flexibility.
#d-i debian-installer/language string en
#d-i debian-installer/country string NL
#d-i debian-installer/locale string en_GB.UTF-8
# Optionally specify additional locales to be generated.
@goffinet
goffinet / virt
Created January 18, 2017 10:42 — forked from tomassedovic/virt
Simple script for detecting IP address of running virtual machine
#!/bin/bash
if [[ $# == 0 ]]; then
echo Usage:
echo "virt <command> <vm> args"
echo Command is: ip, ssh, scp, sshfs
exit 1
fi
cmd="$1"; shift
@goffinet
goffinet / le-renew.sh
Created January 19, 2017 16:15 — forked from erikaheidi/le-renew.sh
Auto renewal for Let's Encrypt Apache
#!/bin/bash
#================================================================
# Let's Encrypt renewal script for Apache on Ubuntu/Debian
# @author Erika Heidi<erika@do.co>
# Usage: ./le-renew.sh [base-domain-name]
# More info: http://do.co/1mbVihI
#================================================================
domain=$1
le_path='/opt/letsencrypt'
le_conf='/etc/letsencrypt'
#!/bin/bash
#================================================================
# Let's Encrypt renewal script for Apache on CentOS
# @author Erika Heidi<erika@do.co>
# Usage: ./le-renew.sh [base-domain-name]
# More info: http://do.co/1SHe4eL
#================================================================
domain=$1
le_path='/opt/letsencrypt'
le_conf='/etc/letsencrypt'
@goffinet
goffinet / vm-add-storage.sh
Last active January 30, 2017 16:38
kvm libvirt add storage
#!/bin/bash
# Variables
guest=$1
disk=/var/lib/libvirt/images/$2.img
# Create 4G Spare Disk with dd
dd if=/dev/zero of=$disk bs=1M seek=4096 count=0
# Or create a qcow2 disk
qemu-img create -f qcow2 -o preallocation=metadata $disk 4G