Skip to content

Instantly share code, notes, and snippets.

@wbonis
wbonis / nfs-audit.sh
Created October 7, 2025 10:59
ESXi NFS Audit – Read-only checks + recommendations (ESXi 7/8/9)
#!/bin/sh
# ESXi NFS Audit – Read-only checks + recommendations (ESXi 7/8/9)
# No changes are made.
export PATH=/bin:/sbin:/usr/bin:/usr/sbin
ESXCLI="${ESXCLI:-$(command -v esxcli 2>/dev/null || echo /usr/bin/esxcli)}"
ADVCFG="${ADVCFG:-$(command -v esxcfg-advcfg 2>/dev/null || echo /usr/sbin/esxcfg-advcfg)}"
[ -x "$ESXCLI" ] || { echo "esxcli not found at $ESXCLI"; exit 1; }
[ -x "$ADVCFG" ] || { echo "esxcfg-advcfg not found at $ADVCFG"; exit 1; }
@wbonis
wbonis / resize.sh
Last active March 14, 2025 11:42
Resize a linux Filesystem when the Disk size was extended (for example in a VM)
#!/bin/bash
set -e
# Default settings
DRY_RUN=false
VERBOSE=false
# Print usage information
usage() {
================================================================================================
================================================================================================
Without Patch
================================================================================================
lego git:(master) rm -rf .lego ; ./dist/lego -m wb@stylite.de --dns digitalocean -d '*.test.stylite-live.net' -d test.stylite-live.net -s https://acme-staging-v02.api.letsencrypt.org/directory -a --dns.resolvers='8.8.8.8:53' run
2019/05/10 20:55:01 No key found for account wb@stylite.de. Generating a P384 key.
2019/05/10 20:55:01 Saved key to /Users/bonis/go/src/github.com/go-acme/lego/.lego/accounts/acme-staging-v02.api.letsencrypt.org/wb@stylite.de/keys/wb@stylite.de.key
2019/05/10 20:55:01 [INFO] acme: Registering account for wb@stylite.de
!!!! HEADS UP !!!!
===========================================================================================================================================================
The CNAME ist Setup like this:
lego git:(pr-885) dig _acme-challenge.bonis.de
;; ANSWER SECTION:
_acme-challenge.bonis.de. 12291 IN CNAME acme.do.stylite-live.de.
acme.do.stylite-live.de. 3599 IN A 127.0.0.1
===========================================================================================================================================================
===========================================================================================================================================================
954 git clone https://github.com/jcadduono/nethunter_kernel_klte.git -b cm-13.0
955 cd nethunter_kernel_klte/
956 ls
957 vim build.sh # add path to toolchain
958 ./build.sh
root@KaliLinux:/opt/src/nethunter_kernel_klte# ./scripts/dtbTool/dtbTool -o build/arch/arm/boot/dtb.img build/arch/arm/boot/ -s 2048
DTB combiner:
Input directory: 'build/arch/arm/boot/'
Output file: 'build/arch/arm/boot/dtb.img'
Found file: msm8974pro-ac-sec-k-r08.dtb ...
Version:1
... skip, incorrect 'qcom,msm-id = <' format
skip, failed to scan for 'qcom,msm-id = <' tag
......
#!/system/bin/sh
# Fix the WLAN if wlan0 is not the build in wlan
# Ths happens if you have a USB WLAN chip on the USB port
swap_if(){
echo "XXX: Swapping $1 with $0"
IF0=$1
IF1=$2
ip link set $IF0 down
# Kali NetHunter init
on init
export TERMINFO /system/etc/terminfo
export TERM linux
# Execute files in /system/etc/init.d before booting
service run-parts /sbin/busybox_nh run-parts /system/etc/init.d
class main
oneshot
units:
- name: etcd.service
command: start
content: |
Description=etcd 2.0
After=docker.service
[Service]
Restart=always
EnvironmentFile=/etc/environment
TimeoutStartSec=0
@wbonis
wbonis / a.rb
Last active August 29, 2015 14:16
#cloud-config
#
hostname: node01
users:
- name: sysop
coreos-ssh-import-github: ZimboBoyd
groups:
- sudo
- docker