In Linux when a console session is closed most background jobs (^Z and bg %n) will stop running when the parent ( the ssh session ) is closed because the parent sends a SIGHUP to all its children when closing (properly). Some programs can catch and ignore the SIGHUP or not handle it at all…
Category: Howtos
DHCP debugging with tcpdump
tcpdump filter to match DHCP packets including a specific Client MAC Address: tcpdump -i br0 -vvv -s 1500 ‘((port 67 or port 68) and (udp[38:4] = 0x3e0ccf08))’ tcpdump filter to capture packets sent by the client (DISCOVER, REQUEST, INFORM): tcpdump -i br0 -vvv -s 1500 ‘((port 67 or port 68) and (udp[8:1] = 0x1))’ Sample…
Get ssh key fingerprint for comparing safely
SSh keys can be long and unwieldy to compare. Many platforms digest them to md5 formats for non disclosure such as github. This command will give you the digested fingerprint of an ssh key in linux / Mac. nJoy 😉
Get Days in a month from a bash script
Useful listing of days in a month to populate directories or run scripts for backing up getting the correct dates of days in a month and year. YEAR=2020 MONTH=2 for DAY in $(DAYS=`cal $MONTH $YEAR | awk ‘NF {DAYS = $NF}; END {print DAYS}’` && seq -f ‘%02G’ $DAYS) ;do DATE=”$YEAR-$MONTH-$DAY” echo $DATE…
Simple amazing tool to understand what file access is happening to trouble shoot heavy disk usage Linux
fatrace reports file access events from all running processes. $ sudo apt-get install fatrace nJoy 😉
Automatically passing ssh password in scripts especially to ESX where passwordless ssh is hard
First you need to install sshpass. Ubuntu/Debian: apt-get install sshpass Fedora/CentOS: yum install sshpass Arch: pacman -S sshpass Example: sshpass -p “YOUR_PASSWORD” ssh -o StrictHostKeyChecking=no YOUR_USERNAME@SOME_SITE.COM Custom port example: sshpass -p “YOUR_PASSWORD” ssh -o StrictHostKeyChecking=no YOUR_USERNAME@SOME_SITE.COM:2400 from : https://stackoverflow.com/questions/12202587/automatically-enter-ssh-password-with-script This works better for me though for sshfs: echo $mypassword | sshfs -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no user@host mountpoint -o workaround=rename…
fail to mount ntfs in BSD
[root@ftp /mnt/test]# ntfs-3g /dev/da10s1 /mnt/test fuse: failed to open fuse device: No such file or directory kldload fuse That’s a missing module needs loading. nJoy 😉
lsblk in freenas bsd
geom disk list nJoy 😉
Resizing a disk once the volume has grown on host in a VM (Ubuntu)
The disk will not automatically resize on many platforms once more disk space was made available. Particularly in Ubuntu 16.04 Rescanning the device for size maps : echo 1 > /sys/class/scsi_device/2\:0\:0\:0/device/rescan Then standard procedures to grow the fs apply. nJoy 😉
Nginx setting to allow wss sockets to connect
General idea of the config https + proxy pass + virtual host Nginx as a proxy causes a failure of wss:// connections to the backend server. add these parameters to the proxy section : proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection “upgrade”; proxy_set_header Host $host; Voila’ !!! 😉 nJoy