Systemd - Periodically run a command, script, process, or service
2021-08-31
To set up a periodic script, follow these steps. Note vim is used as the example text editor, and a $ denotes a command for the terminal as opposed to text in a file. In this example the path to the script is /path/to/script_name.sh; replace this with the path of your script. Make executable the script which you want to periodically ran. $ chmod +x /path/to/script_name.sh Create a .…
PKGBUILD, AUR - Making a PKGBUILD (for the AUR)
2021-06-28
In this guide, I will use an example package called notepac (see the git repository here) to explain the contents of a fairly basic PKGBUILD file. A PKGBUILD file is all that is required to build a package using the makepkg command, and is required to upload a package to the Arch User Repository (AUR). You can learn more about PKGBUILD by using the command man pkgbuild. Example PKGBUILD file for a program:…
Chromium - PDF viewer keyboard shortcuts
2021-06-21
Zoom in: CTRL++ Zoom out: CTRL+- Toggle between Fit Width and Fit Page: CTRL+\ Rotate clockwise: CTRL+] Rotate counter-clockwise: CTRL+[ Download PDF: CTRL+S Print PDF: CTRL+P Scroll one page up: PgUp Scroll one page down: PgDn Search Document: CTRL+F
pacman - Clean the package cache
2021-06-19
remove ( r ) packages from the cache, but keep ( k ) one ( 1 ) cached version of each package. paccache -rk 1
pacman - Remove orphaned packages
2021-06-19
Query ( Q ) the database for neither required nor optionally required ( t ) packages, nor dependencies for builds ( d ), and output less information ( q ). Pass this list ( | ) to be as an argument ( - ). This list is to be searched ( s ) for locally installed packages, and remove ( R ) these packages which are native ( n ) to the system.…
Vim - Commands
2021-06-18
Notation Notation Meaning Key 1 + Key 2 Hold Key 1 and press Key 2 Key 1 , Key 2 Press Key 1, then press Key 2 Modes are shown by their keybindings. Binding Meaning - Applies to all modes (Do not enter -) Esc Normal mode Esc , : Command mode Esc , i Insert mode Esc , v Visual mode Shortcuts Operation Mode Command Move to between tabs - Ctrl + Pg Up or Ctrl + Pg Dn Copy a line Esc yy Cut a line Esc dd Paste at the cursor Esc P Paste after the cursor Esc p Go to file (the path is under the cursor) Esc gf Go to the previous cursor location (may be in a different file) Esc Ctrl + o Go to the next cursor location (may be in a different file) Esc Ctrl + i Replace a character Esc r Open a file in a new tab Esc , : tabnew /path/to/file Move to the end of a line Esc , i Ctrl + o , $ Select word Esc, v iw Turn off highlighting for the last searched word Esc , : noh Replace the start the selected line(s) with # (Useful for commenting lines out in bash) Esc , v s/^/# / Paste into the buffer Esc , : Ctrl + r , + Undo Esc u Redo Esc Ctrl + r Count words Esc , v g , Ctrl + g Enclose line in parentheses/brackets (()) Esc bcw() , Esc , P Record a macro (.…
ClamAV - Speed up slow scans
2021-06-17
Your ClamAV scans may be slow because they are being performed as single-thread operations. Try using multi-threading to speed up your scans, which can be achieved with or without the daemon running. To perform a multi-thread scan on the file with the path /path/to/file, try the following. If the daemon is active, use the following command: $ clamdscan --multiscan --fdpass "/path/to/file" If the daemon either is or is not active, use the following command:…