Cheat sheet
Checksusm
Section titled “Checksusm”Generate and validate checksums in Linux, assuming the exe file is named
VxlPro.exe
:
# generate:md5sum VxlPro.exe > VxlPro.md5# validate:md5sum -c VxlPro.md5
Generate checksums in Windows 10 (to compare with that in VxlPro.md5)
certutil -hashfile VxlPro.exe MD5
Cross-compile
Section titled “Cross-compile”Cross-compile C++ apps for Arm Linux ref:
sudo apt install qemu-user qemu-user-static gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu build-essentialpodman run --rm --arch aarch64 -it alpine# ...
Linux configuration
Section titled “Linux configuration”Passwordless login
Section titled “Passwordless login”Password-less login to a Linux server
# If no ~/.ssh/id_ed25519* file, create one:ls ~/.ssh/id_ed25519 >/dev/null 2>&1 || ssh-keygen -t ed25519
# copy public key to serverssh UNAME@HOST 'mkdir ~/.ssh && chmod 700 ~/.ssh'cat ~/.ssh/id_ed25519.pub | ssh UNAME@HOST 'cat >> .ssh/authorized_keys'
Debug networking issues
Section titled “Debug networking issues”Inspect open ports:
ss -tulpn | grep LISTEN # list open ports and processes using themlsof -i -P -n | grep LISTEN # list open ports and processes using themnetstat -tulpn # list open ports and processes using them
nmap -sS <target_IP> # scan remote ports
Other commands: traceroute
Request/see pods/bashrc
file for frequently used shortcuts!
Geany Lightweight IDE
Section titled “Geany Lightweight IDE”- Build from forked source; see the Dockerfile for instructions
Debian package search
Section titled “Debian package search”# search in package repository (Note: not apt-get):apt search <package># More cumbersome approach, as root/sudo:apt-get install apt-fileapt-file updateapt-file find filename.h/libname # | grep -F .so
Debian server setup
Section titled “Debian server setup”-
Edit
/etc/default/console-setup
and change font size to16x32
, and reboot! -
Run
sudo dpkg-reconfigure keyboard-configuration
and follow the interactive visual terminal, leave the first page at its defaults. -
Edit
/etc/netplan/50-cloud-init.yaml
and set password, and then runsudo netplan apply
-
If not using cloudinit, use wpa_supplicant… and e.g. dhclient -v wlan0 instead.
-
Get the ip address,
ip addr show
, and see below for ssh setup -
To use faster 5GHz wifi:
Terminal window sudo iw reg set USsudo systemctl restart netplan-wpa-wlan0.service
Fix the terminals blue colour bug:
printf %b '\e]4;4;#6495ed\a'
For more info request/see Ansible #Raspberry-pi configs!
Debian packaging
Section titled “Debian packaging”- notes from: Paul Dreik presentation , youtube
#apt-get install dh-make build-essential dscriptscd path/to/source/repo# create debian folderdh_make --packagename mypackage_0.0.1-2 --native --single --yestree debian | less# Modify debian/[control,copyright,changelog,rules]dhci -i # manage the package versiondpkg-buildpackage -b -ucdpkg -i mypackage_0.0.1-2_all.debapt-get remove mypackage_0
Fix Gnome regressions
Section titled “Fix Gnome regressions”-
Extensions for Gnome-3/4: hide-title-bar
-
Fix Linux Nautilus file browser regressions:
# Install meld and integrate:mkdir -p ~/.local/share/nautilus/scripts/echo '#!/bin/sh' > ~/.local/share/nautilus/scripts/meld.shecho 'meld $@' >> ~/.local/share/nautilus/scripts/meld.shchmod +x ~/.local/share/nautilus/scripts/meld.sh
# Restore ability to create text files!:echo > ~/Templates/NewFile.md
git vs https vs ssh protocols:
git remote add gitea ssh://git@SERVER:PORT/USERNAME/REPO.git# vsgit clone https://github/aliraeini/porescale.git# vsgit clone git@github.com:aliraeini/porescale.git
OCR / image to text conversion, put all png images in a folder and run: Warning: renames and rewrites your files
rename 's/\ /_/g' *.png# add `-channel RGB -negate` if needed:for cas in `ls *.png`; do convert $cas ${cas%.png}.tif; donefor cas in `ls *.tif`; do tesseract $cas ${cas%.tif}; done