Skip to content

Instantly share code, notes, and snippets.

@riblo
riblo / Packer-Windows.json
Created October 3, 2022 09:34 — forked from janegilring/Packer-Windows.json
Packer file for building Windows base images
{
"builders": [
{
"type": "hyperv-iso",
"output_directory": "./output-{{ user `os_name` }}-base-hyperv/",
"temp_path": "C:\\ClusterStorage\\HYPData01\\PackerTemplates\\temp",
"vm_name": "{{ user `os_name` }}-base",
"iso_url": "{{ user `iso_url` }}",
"iso_checksum": "{{ user `iso_checksum` }}",
"iso_checksum_type": "sha1",
@riblo
riblo / resize_lvm.sh
Last active January 13, 2023 19:53
resize fedora root (/) LVM
lsblk
fdisk /dev/sdb
lsblk
pvcreate /dev/sdb1
vgextend fedora /dev/sdb1
lvextend -l +100%FREE /dev/fedora/root
#lvextend -l +100%FREE /dev/rhel/root
resize2fs /dev/fedora/root
#xfs_growfs /dev/rhel/root
lsblk
@riblo
riblo / vmx2ovf.bat
Last active November 27, 2019 10:12
Windows 10 - vmx2ovf oneline converter
ovftool.exe "C:\Your\Path\metasploitable-linux-2.0.0\Metasploitable2-Linux\Metasploitable.vmx" "C:\Your\Path\metasploitable\metasploitable.ovf"
@riblo
riblo / rm_history.sh
Created November 27, 2019 09:58
Remove history oneline
rm -f $HISTFILE && unset HISTFILE && exit
@riblo
riblo / ovf2kvm.sh
Last active March 15, 2024 18:47
Import VMware images (ovf based) to Proxmox VE
#!/bin/bash
# Script that import VMware images (ovf based) to Proxmox VE
# Your VM_NAME needs to be the same for: VM_NAME (directory) and VM_NAME.ovf
PROXMOX_USER=root
PROXMOX_PASS=ch4ng3m3!
PROXMOX_HOST=1.2.3.4
PROXMOX_PORT=22
PROXMOX_STORAGE=local-lvm
VM_PATH=/mnt/hgfs/shared/VM-Backup/
@riblo
riblo / dellemc_change_power_state.yml
Last active December 9, 2019 15:16
Ansible task to configure the Power State on the PowerEdge Servers
---
- hosts: hosts
connection: local
name: Configure Server Power Setting
gather_facts: False
tasks:
- name: Configure Server Power Setting
dellemc_change_power_state:
idrac_ip: "{{ idrac_ip }}"
# power server off
racadm serveraction powerdown
# power server on
racadm serveraction powerup
# perform server power cycle
racadm serveraction powercycle
# force hard server power reset
lsblk
fdisk /dev/sde
fdisk /dev/sdf
mkfs.ext4 /dev/sde1
mkfs.ext4 /dev/sdf1
reboot
lsblk
vgdisplay
pvcreate /dev/sde1
vgextend pve /dev/sde1
@riblo
riblo / xvnc_account_gen.sh
Created October 4, 2019 16:10
VNC multi-user/multiple access generator
#!/bin/bash
# VNC multi-user/multiple access generator
# CentOS-7 tested
# account: user-1:user-1, user-2_user-2, etc
#useradd/passwd loop
for i in {1..5}; do useradd user-$i; done;
for i in {1..5}; do echo user-$i | passwd user-$i --stdin; done;
# xvnc configurations
@riblo
riblo / firewall_stop.sh
Created October 4, 2019 15:57
Disable linux firewall: Disable firewalld and iptables rules and chains
#!/bin/bash
# stop and disable fwd 4 systemd linux host
systemctl stop firewalld
systemctl disable firewalld
# accept, flush and delete all iptables rules and chains
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT