Update README.md

This commit is contained in:
proledatarian 2022-04-08 11:38:56 +00:00
parent 5f7a24bc76
commit f0b825b8d9
1 changed files with 16 additions and 9 deletions

View File

@ -8,7 +8,7 @@ It's mostly distro-agnostic but sometimes specific for [pacman-based distros](ht
- Requires: *Do you need any particular software (provide a link)?* - Requires: *Do you need any particular software (provide a link)?*
- How-to: *Straight forward description and maybe a code example.* - How-to: *Straight forward description and maybe a code example.*
- *Detailled description if necessary.* - *Detailled description if necessary.*
- `# this is the actual code lol` - `$ this is the actual code lol`
- Aditionally: *Anything else that might be important like additional ressources.* - Aditionally: *Anything else that might be important like additional ressources.*
### 1. Automatic clear cache. ### 1. Automatic clear cache.
@ -37,14 +37,14 @@ It's mostly distro-agnostic but sometimes specific for [pacman-based distros](ht
- Description: Repeat and watch a command in a custom interval. - Description: Repeat and watch a command in a custom interval.
- Requires: The [procfs](https://gitlab.com/procps-ng/procps) package. - Requires: The [procfs](https://gitlab.com/procps-ng/procps) package.
- How-to: Use `watch` followed by your command. - How-to: Use `watch` followed by your command.
- Example: `# watch -n 1.0 "du -h -s ./$folder` - Example: `$ watch -n 1.0 "du -h -s ./$folder`
- This prints the summarized size of $folder in human-readable format every second. - This prints the summarized size of $folder in human-readable format every second.
- Additionally: --- - Additionally: ---
### 5. Repeat last command as su. ### 5. Repeat last command as su.
- Description: Repeat the last command using sudo. - Description: Repeat the last command using sudo.
- Requires: The [sudo](https://www.sudo.ws/) package. - Requires: The [sudo](https://www.sudo.ws/) package.
- How-to: Just type `sudo !!` and the last command will be repeated using `sudo`. - How-to: Just type `$ sudo !!` and the last command will be repeated using `sudo`.
- Additionally: --- - Additionally: ---
### 6. Prevent overwriting files. ### 6. Prevent overwriting files.
@ -58,17 +58,17 @@ It's mostly distro-agnostic but sometimes specific for [pacman-based distros](ht
- Description: Automatically clean the pacman package cache using paccache. - Description: Automatically clean the pacman package cache using paccache.
- Requires: A [pacman-based distro](https://en.wikipedia.org/wiki/List_of_Linux_distributions#Pacman-based) and the [pacman-contrib](https://github.com/archlinux/pacman-contrib) package. - Requires: A [pacman-based distro](https://en.wikipedia.org/wiki/List_of_Linux_distributions#Pacman-based) and the [pacman-contrib](https://github.com/archlinux/pacman-contrib) package.
- How-to: Enable the paccache.timer. - How-to: Enable the paccache.timer.
- `# systemctl enable paccache.time` - `$ systemctl enable paccache.time`
- Additionally: Edit the paccache.service in /usr/lib/systemd/system/ and change the command to e.g. keep the latest installed version and no uninstalled version of all packages: `ExecStart=/usr/bin/paccache -rk1 && /usr/bin/paccache -ruk0` - Additionally: Edit the paccache.service in /usr/lib/systemd/system/ and change the command to e.g. keep the latest installed version and no uninstalled version of all packages: `ExecStart=/usr/bin/paccache -rk1 && /usr/bin/paccache -ruk0`
### 8. Passwordless SSH. ### 8. Passwordless SSH.
- Description: Connect to a remote maschine using SSH without a password. - Description: Connect to a remote maschine using SSH without a password.
- Requires: A SSH implementation like [TinySSH](https://tinyssh.org/). - Requires: A SSH implementation like [TinySSH](https://tinyssh.org/).
- How-to: Generate a keypair and send the public key to the remote maschine's authorized keys. - How-to: Generate a keypair and send the public key to the remote maschine's authorized keys.
- Generate a keypair: `ssh-keygen -t rsa` - Generate a keypair: `$ ssh-keygen -t rsa`
- Send the key: `ssh-copy-id $remote-username@$remote-ip-address` - Send the key: `$ ssh-copy-id $remote-username@$remote-ip-address`
- Fill in the username and IP address of your remote maschine. - Fill in the username and IP address of your remote maschine.
- For example: `ssh-copy-id foo@192.168.178.123` - For example: `$ ssh-copy-id foo@192.168.178.123`
- Additionally: Here's a more detailed [tutorial](https://www.hostinger.com/tutorials/how-to-setup-passwordless-ssh/). - Additionally: Here's a more detailed [tutorial](https://www.hostinger.com/tutorials/how-to-setup-passwordless-ssh/).
### 9. Automatic clean orphaned packages. ### 9. Automatic clean orphaned packages.
@ -82,17 +82,24 @@ It's mostly distro-agnostic but sometimes specific for [pacman-based distros](ht
- Description: Automatically retrieve the latest Arch Linux mirrors and write them to the mirrorlist. - Description: Automatically retrieve the latest Arch Linux mirrors and write them to the mirrorlist.
- Requires: An Arch-based distro and [reflector](https://xyne.dev/projects/reflector/). - Requires: An Arch-based distro and [reflector](https://xyne.dev/projects/reflector/).
- How-to: Install reflector and enable the reflector.timer. - How-to: Install reflector and enable the reflector.timer.
- `# systemctl enable reflector.timer` - `$ systemctl enable reflector.timer`
- Additionally: [ArchWiki: Reflector](https://wiki.archlinux.org/title/Reflector#systemd_timer). - Additionally: [ArchWiki: Reflector](https://wiki.archlinux.org/title/Reflector#systemd_timer).
### 11. Extract text containing keywords from any file. ### 11. Extract text containing keywords from any file.
- Description: This command will filter and sort text based on keyword from any file(s). - Description: This command will filter and sort text based on keyword from any file(s).
- Requires: [GNU Coreutils](https://www.gnu.org/software/coreutils/), [GNU grep](https://www.gnu.org/software/grep/) - Requires: [GNU Coreutils](https://www.gnu.org/software/coreutils/), [GNU grep](https://www.gnu.org/software/grep/)
- How-to: - How-to:
- `cat ./*/files* | grep -e keyword1 -e keyword2 | sort -u | nl > file` - `$ cat ./*/files* | grep -e keyword1 -e keyword2 | sort -u | nl > file`
- `cat` will take any file(s), multiple files in multiple subdirectories can be specified. - `cat` will take any file(s), multiple files in multiple subdirectories can be specified.
- `grep -e` will look for any and/or all specified keywords. - `grep -e` will look for any and/or all specified keywords.
- `sort -u` will sort the results alphabetically and remove duplicates. - `sort -u` will sort the results alphabetically and remove duplicates.
- `nl` will add a number in front of every result (optionally). - `nl` will add a number in front of every result (optionally).
- `>` will write everything in a specified file. - `>` will write everything in a specified file.
- Additionally: This is simply an example of how useful the coreutils can be, especially when used together. - Additionally: This is simply an example of how useful the coreutils can be, especially when used together.
### 12. Enable parallel downloads for pacman.
- Description: Enable parallel downloads for faster updates with pacman.
- Requires: A [pacman-based distro](https://en.wikipedia.org/wiki/List_of_Linux_distributions#Pacman-based).
- How-to: Edit pacman's config-file at `/etc/pacman.conf` and uncomment `ParallelDownloads` and add a number of parallel downloads like 5 or 10.
- `# nano /etc/pacman.conf`
- Additionally: [ArchWiki: Pacman](https://wiki.archlinux.org/title/Pacman#Enabling_parallel_downloads).