sudo pro config set apt_news=false
lsblk --nodeps -o name,serial
netstat -tulpn | grep LISTEN
or
ss -tulpn | grep LISTEN
sudo systemctl daemon-reload
apt list --installed
apt-cache search <keyword>
sudo update-alternatives --config editor
If visudo complains about a missing defaults.vim file, it can be fixed thusly:
sudo touch ~root/.exrc
Settings -> Privacy -> Screen Lock
Settings -> Power -> Blank Screen
sudo smbpasswd -a <username>
sudo pdbedit -L
tune2fs -l /dev/vda2 | grep ‘Filesystem created:’ (replace vda2 with device where root filesystem is located)
sudo rsync -aAXv --info=progress2 --exclude='/lost+found' /disk2/ /newdisk/
du -a /dir/ | sort -n -r | head -n 20 (replace 20 with the # of lines you wish to have returned)
find . -type f -printf '%T+ %p\n' | sort | head -n 1
find . -iname <filename to search for>
Create (or edit, if it exists) ~/.vimrc; into this file add the command syntax off, and save the file.
mkdir /tmp/rootbind mount --bind / /tmp/rootbind du -d 1 -h /tmp/rootbind
apt install wsdd
xrandr -q
OTA DVR recordings are saved as .ts files, which are not compatible with DaVinci Resolve (my video editor of choice). For this reason, we must convert the files into a format that “DR” can comprehend. We can do this on linux using the ffmpeg package:
ffmpeg -i <inputfile.ts> -vcodec copy -acodec copy <outputfile.mp4>
Overwrite/blast the boot block on the hard drive (ONLY when you want to re-install the operating system!)
dd if=/dev/zero of=/dev/sda count=1 bs=512
mkpasswd --method=sha-512
openssl rand -base64 48
ansible-playbook playbook.yml --vault-password-file ~/.ansible_vault_pass
.zip files that have been encrypted with AES-256 cannot be extracted via the default 'unzip' program that the distro installs. Instead, one must install 7zip. Perform the following steps:
apt update apt install 7zip
Once installed, use the 7zz command to extract the file (you will be prompted for the password used to initially encrypt the archive if one was used):
7zz x <filename>
Ensure that websockets support is enabled
Create /etc/apache2/conf-available/remoteip.conf with the following contents:
RemoteIPHeader X-Forwarded-For RemoteIPTrustedProxy x.x.x.x (replace w/ IP address of trusted proxy)
Execute the commands:
ln /etc/apache2/conf-available/remoteip.conf /etc/apache2/conf-enabled/remoteip.conf ln /etc/apache2/mods-available/remoteip.load /etc/apache2/mods-enabled/remoteip.load
Edit /etc/apache2/apache2.conf and find the LogFormat lines. Change each occurrence of %h to %a.
Restart apache.
sudo into an elevated shell and then perform the following:
parted /dev/sdX (where X is the letter of the drive to be manipulated) mklabel gpt Acknowledge the warning if one is given unit TB mkpart primary 0.00TB 2.00TB (or 3.00TB, 4.00TB, etc. depending on the size to be created) print (to view the new partition) quit (to exit parted)
Then proceed to format the new drive, i.e. mkfs -t ext4 /dev/sdb1
sudo vi /etc/netplan/00-installer-config.yaml find the existing IP and change it to the desired IP; 'wq' out of the file sudo netplan apply
hostnamectl set-hostname [new host name]
Edit the /etc/netplan/50-cloud-init.yaml file appropriately (file name may vary)
Apply the changes with the sudo netplan apply command
This becomes necessary if a DNS server is deployed on the local system, since it will conflict with the local resolver unless it is first disabled.
Edit /etc/systemd/resolved.conf and change DNSStubListener to “no”:
DNSStubListener=no
Update the resolv.conf symlink:
sudo ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf
Restart systemd-resolved:
sudo systemctl restart systemd-resolved
Validate that the system is no longer listening on port 53:
ss -tulpn | grep 53
To create an ed25519 key -
ssh-keygen -t ed25519 -C "<comment>" -f ~/.ssh/<keyname>