Back up a directory
Here’s the one-liner for backing up a directory, named as the directory name plus the date and time when the backup is done. tar czf ~/backups/dir-backup-$(date +'%Y%m%d_%H%M%S').tar.gz ~/dir/*
Here’s the one-liner for backing up a directory, named as the directory name plus the date and time when the backup is done. tar czf ~/backups/dir-backup-$(date +'%Y%m%d_%H%M%S').tar.gz ~/dir/*
Oneline: mkdir -p {a..z}; for i in ./*; do export FILE=$(basename "$i"); export LTR=$(echo "${FILE:0:1}" | tr A-Z a-z); mv "$i" "$LTR/$FILE" ; done Process: mkdir -p {a..z} for i in ./* do export FILE=$(basename "$i") export LTR=$(echo "${FILE:0:1}" | tr A-Z a-z) mv "$i" "$LTR/$FILE" done
List installed packages All installed packages pacman -Q All explicitly installed packages pacman -Qe Explicitly installed packages not required by other installed packages pacman -Qet Only packages names pacman -Qet | awk '{print $1}' > my_installed_packages.txt List which package owns a file pacman -F filename
Here is a simple oneliner pommodoro timer: echo "aplay ring.wav" | at now + 25 min
Installing packages from the AUR Essentially: Acquire the build files, including the PKGBUILD and possibly other required files, like systemd units and patches: git clone https://aur.archlinux.org/aurutils.git ~/builds/aurutils Verify that the PKGBUILD and accompanying files are not malicious or untrustworthy. In the directory where the files are saved, run: makepkg -sri This will download the code, resolve the dependencies with pacman, compile it, package it, and install the package. AUR helpers As of the date when this is being written, yay is the most complete and easiest AUR helper I’ve found, for my taste of course. ...
To start lynx with a session file: lynx --session=path/to/session.html -book -scrollbar To download a website Source: https://kb.iu.edu/d/aczi To download from the web using Lynx from the Unix command line prompt, enter: lynx -source URL > filename Replace URL with the URL of the page or image that you want to download. Replace filename with a filename that you want to give to what you are downloading. For example, if you are trying to download a web page at the address http://empire.gov/dvader.html, and you’d like to name the page on your account myhero.html, then you’d enter: ...
Create an image: qemu-img create -f raw win10.raw 50G Open image: /usr/bin/qemu-system-i386 -boot c -m 1024 \ -hda '$HOME/win10.raw' \ -cdrom '$HOME/cdrom.iso' -net nic,vlan=0 -net user,vlan=0 -localtime & Share a directory between host (linux) and guest (windows) At boot, we indicate qemu we want access to e.g. `$HOME/qemu_share: qemu -smb $HOME/qemu_share -m 384 -localtime windows.img Then allow access a real user (in principle, a user in the host): sudo smbpasswd -a username ...
To download a video list in webm format, extract audio and keep the original video file: youtube-dl -f 43 --extract-audio -k "https://www.youtube.com/playlist?list=AlphanUmerIcCodeofTheList" Download a video list in preferably free format, otherwise non-free, extracting audio and keeping original video file: youtube-dl --prefer-free-formats --extract-audio -k Download a video list in preferably free format, otherwise non-free, extracting audio and keeping original video file, restricting the files names to alphanumeric characters and dashes: youtube-dl --prefer-free-formats --extract-audio -k --restrict-filenames http://www.youtube.com/playlist?list=LIstCode -o ~/outputDir/%\(title\)s-%\(id\)s.%\(ext\)s ...
Markdown files for a blog/website First start a hugo server from the location where the website/blog/markdown files are: cd /path/to/website/files; hugo server and then access localhost:1313 in a browser. Preview of a single mardown file lynx and pandoc can be used like: pandoc file.md | lynx -stdin or pandoc -t plain file.md | less
This is a collection of appropriate software to deal with disks. smartmontools (smartctl) badblocks nmon iotop