Skip to content

Instantly share code, notes, and snippets.

View csamsel's full-sized avatar

Christian Samsel csamsel

View GitHub Profile
@csamsel
csamsel / esxi-snmp.sh
Created June 14, 2018 20:11
activate snmpd on esxi vmhost
# set community name, change for maximum security
[root@oxygen-vmhost:~] esxcli system snmp set --communities public
# activate snmp
[root@oxygen-vmhost:~] esxcli system snmp set --enable true
# firewall policy defaults to deny
[root@oxygen-vmhost:~] esxcli network firewall ruleset set --ruleset-id snmp --allowed-all false
# allow specific ip range
[root@oxygen-vmhost:~] esxcli network firewall ruleset allowedip add --ruleset-id snmp --ip-address 192.168.2.0/24
# activate firewall rule set
[root@oxygen-vmhost:~] esxcli network firewall ruleset set --ruleset-id snmp --enabled true
@csamsel
csamsel / gist:a6bd13b0963bcdf2eaf34eea27632a4a
Created June 14, 2018 19:57
resize ext4 root partition in ubuntu under ESXi
# parted /dev/sda
GNU Parted 3.2
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) rm 3
(parted) p
Model: VMware Virtual disk (scsi)
Disk /dev/sda: 32.2GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
@csamsel
csamsel / dnscrypt-proxy.toml
Last active April 3, 2018 10:03
dnscrypt-proxy configuration for use with dnsmasq and cloudflare
listen_addresses = ['127.0.0.1:5300']
...
dnscrypt_servers = false
doh_servers = true
...
cache = false
...
server_names = ['cloudflare', 'cloudflare-ipv6']
@csamsel
csamsel / dnsmasq.conf
Created April 3, 2018 10:01
dnsmasq.conf for local dnscrypt-proxy using port 5300
server=127.0.0.1#5300
no-resolv
no-poll
dnssec
dnssec-check-unsigned
conf-file=/usr/share/dnsmasq/trust-anchors.conf
domain-needed
expand-hosts
no-negcache
local-ttl=600

Keybase proof

I hereby claim:

  • I am csamsel on github.
  • I am csamsel (https://keybase.io/csamsel) on keybase.
  • I have a public key ASDHrm4CEkXQuramKWPKoiKtLQ3uQwSVlMwUW54NSAGNCwo

To claim this, I am signing this object:

@csamsel
csamsel / raid-settings.sh
Created March 22, 2018 11:03
script to activate TLER and disable NCQ on raid member HDDs
for i in sdb sdc sdd sde
do
# activate TLER
smartctl -q errorsonly -l scterc,70,70 /dev/$i
# disable NCQ
echo 1 > /sys/block/$i/device/queue_depth
done
@csamsel
csamsel / btrfs-raid10-notes.txt
Last active March 23, 2018 09:45
notes on switching from Linux md RAID5 to btrfs RAID10
assumptions:
/dev/sd[bcde]1 in Linux md (/dev/md0) RAID5/RAID6 mounted as /storage.
Less space used then capacity of one drive.
1.
stop all services accessing the array first.
Remounting the array ro might be a good idea (mount /dev/md0 -o remount,ro).
2.
remove one disk from array
@csamsel
csamsel / convert-ssl.sh
Last active April 18, 2024 07:25
convert ssl certificates from pem to crt/key
openssl rsa -outform der -in privkey.pem -out privkey.key
openssl x509 -outform der -in fullchain.pem -out fullchain.crt
openssl x509 -outform der -in cert.pem -out cert.crt
@csamsel
csamsel / wildcard.sh
Last active March 14, 2018 12:43
certbot command to request wildcard certificate, requires certbot => 0.22.0
certbot certonly --manual --preferred-challenges dns-01 --server https://acme-v02.api.letsencrypt.org/directory -d *.domain.tld
@csamsel
csamsel / gist:d004b0242a98529353642d89b001bd55
Created February 22, 2018 11:02
delete broken symlinks in runlevel scripts
find -L /etc/runlevels -type l -delete