Skip to content

Instantly share code, notes, and snippets.

View casantos's full-sized avatar

Carlos Santos casantos

  • Red Hat
  • Porto Alegre, RS, Brasil
View GitHub Profile
@casantos
casantos / esxi-hostname-setup.txt
Created August 17, 2025 13:06
VMware ESXi host name setup
mv .ssh/authorized_keys /etc/ssh/keys-root/
esxcli system hostname set --host=esxi-8-0
esxcli system hostname set --fqdn=esxi-8-0.example.com
esxcli system hostname set --domain=example.com
esxcli network ip dns search add -d example.com
esxcli network ip dns search remove -d Home
esxcli network ip dns search list
cat /etc/resolv.conf
vi /etc/rc.local.d/local.sh
vim-cmd hostsvc/enable_ssh
@casantos
casantos / passwd-gui.sh
Created May 19, 2025 12:21
Shell script with GUI to change user password
#!/bin/sh
# Use an ASCII 07 character (BEL) as separator, so the user can type any
# visible character in the password.
sep=$(printf '\a')
while :; do
# Read the old and new passwords.
input=$(zenity --forms \
--title="Change Password" \
@casantos
casantos / ip-addr@.service
Last active August 12, 2024 19:49
systemd unit to configure a network interface with static IP address
[Unit]
Description=Configure a static IP address on interface %i
Documentation=man:ip(8)
Wants=network.target
BindsTo=sys-subsystem-net-devices-%i.device
After=sys-subsystem-net-devices-%i.device
Before=network.target network.service
[Service]
Type=exec
@casantos
casantos / dhclient@.service
Last active August 2, 2024 19:54
systemd unit to configure a network interface via DHCP
[Unit]
Description=Configure interface %i via DHCP
Documentation=man:dhclient(8)
Wants=network.target
BindsTo=sys-subsystem-net-devices-%i.device
After=sys-subsystem-net-devices-%i.device
Before=network.target network.service
[Service]
Type=forking