Skip to content

Instantly share code, notes, and snippets.

@bofhbug
bofhbug / ansible-node-report-output.json
Created November 19, 2020 14:24 — forked from garyellis/ansible-node-report-output.json
ansible linux report development
[
{
"command": "uptime -s",
"name": "uptime_since",
"result": [
"2018-04-16 02:40:37"
]
},
{
"command": "hostname",
@bofhbug
bofhbug / test
Last active November 13, 2019 19:22
foo
gist bofhbug
@bofhbug
bofhbug / packer_template_autounattended_file_few_scripts.sh
Created April 30, 2019 13:21 — forked from ruzickap/packer_template_autounattended_file_few_scripts.sh
Create Packer template and Autounattended file for Windows Server 2016 Eval + download few helper scrips
# Prepare directory structure
mkdir -p /var/tmp/packer_windows-server-2016-eval/{scripts/win-common,http/windows-server-2016,ansible}
cd /var/tmp/packer_windows-server-2016-eval
# Download Autounattended file for Windows Server 2016 Evaluation
wget -c -P http/windows-server-2016 https://raw.githubusercontent.com/ruzickap/packer-templates/master/http/windows-server-2016/Autounattend.xml
# Create some basic Ansible playbook for Windows provisioning
cat > ansible/win.yml << EOF
---
@bofhbug
bofhbug / virtio-win_packer.sh
Created April 30, 2019 13:20 — forked from ruzickap/virtio-win_packer.sh
Mount the virtio-win iso and run Packer
export VIRTIO_WIN_ISO_DIR=$(mktemp -d --suffix=_virtio-win-iso)
export NAME=windows-server-2016-standard-x64-eval
export WINDOWS_VERSION=2016
export WINDOWS_TYPE=server
export TMPDIR="/var/tmp/"
cd /var/tmp/packer_windows-server-2016-eval
# Download and mount virtio-win to provide basic virtio Windows drivers
wget -c https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/latest-virtio/virtio-win.iso
@bofhbug
bofhbug / packer_qemu_windows_ansible_winrm.sh
Created April 30, 2019 13:19 — forked from ruzickap/packer_qemu_windows_ansible_winrm.sh
Quick and Dirty script building Windows using Packer + Ansible + WinRM on QEMU (libvirt)
#!/bin/bash -x
mkdir test
cd test
curl https://raw.githubusercontent.com/ruzickap/packer-templates/master/http/windows-server-2016/Autounattend.xml | sed '/.*Microsoft-Windows-PnpCustomizationsWinPE.*/,/component>/d' > Autounattend.xml
wget -c https://raw.githubusercontent.com/ruzickap/packer-templates/master/scripts/win-common/fixnetwork.ps1
test -f packer || ( wget https://releases.hashicorp.com/packer/1.2.0/packer_1.2.0_linux_amd64.zip && unzip packer_1.2.0_linux_amd64.zip && rm packer_1.2.0_linux_amd64.zip )
@bofhbug
bofhbug / RequiresPowerShell.bat
Created April 28, 2019 16:07 — forked from deejay7/RequiresPowerShell.bat
Batch file to automatically detect, download and install PowerShell 2 on to an XP SP3 machine
@echo off
REM If PowerShell 2 is not installed, this script will automatically download and install it.
REM Only works on XP SP3 with .NET 3.5. Only for dev boxes, not designed for servers.
REM Based on http://blog.codeassassin.com/2009/12/10/no-web-browser-need-powershell/
ver | find "XP" > nul
if %ERRORLEVEL% neq 0 goto not_xp
ver | find "5.1.2600" > nul
@bofhbug
bofhbug / microsoft.txt
Created April 27, 2019 21:25 — forked from CHEF-KOCH/microsoft.txt
Microsoft Products + file check
Nr. + product name + .exe/.iso/dvd + file integrety check
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 MS-DOS 6.0 (English) EN_MSDOS60.exe 2000-10-12 877B0B8E391ED07CB83214CB09E8F3B10C4B206F
2 SQL Server 2008 Enterprise (x86, x64, ia64) - DVD (Chinese-Simplified) zh-hans_sql_server_2008_enterprise_x86_x64_ia64_dvd_x14-89199.iso 2008-8-13 D23B103331AB0B3CCC82769B99CA1C2F16BEBBF4
3 Windows XP Professional with Service Pack 2- VL (Simplified Chinese) sc_win_xp_pro_with_sp2_vl.iso 2005-5-18 C0ADDD927B5D1F93DCE9C455FD6B26EAC7391BE9
4 MS-DOS 6.22 (English) EN_MSDOS622.exe 2000-10-12 D01AA47A5D85908185F8987E972AFC66DC92A735
@bofhbug
bofhbug / zerofree.sh
Created January 18, 2017 16:40 — forked from x1a0/zerofree.sh
Zero out space on a virtual machine
init 1
for i in `mount | grep sda | grep ext | cut -b 9` ; do mount -o remount,ro /dev/sda$i && zerofree -v /dev/sda$i && mount -o remount,rw /dev/sda$i ; done ;