Merge branch 'dev' into vhs

This commit is contained in:
2025-02-12 17:06:33 +01:00
52 changed files with 343 additions and 328 deletions

View File

@@ -6,7 +6,20 @@ tags: [ "fun" ]
- `asciiquarium`
- `cbonsai -lim "$(fortune)"`
```bash
```sh
cow=$(cowsay -l | sort -R | head -1)
fortune -s | figlet | cowsay -nf $cow | lolcat
```
Watch the [Collatz Conjecture](https://en.wikipedia.org/wiki/Collatz_conjecture) collapse:
```sh
x="$(du -sc ~/.cache | tr -d '[:alpha:]' | tail -1)"
until [ "$x" -eq "1" ]; do
test "$(( x % 2 ))" -eq 0 && x=$(( x / 2 )) || \
x=$(( x * 3 + 1 ))
clear -x
figlet "$x" | lolcat
sleep 1
done
```

View File

@@ -1,6 +1,6 @@
---
title: "at"
tags: [ "Basics" ]
tags: [ "Basics", "time" ]
---
Install with:

View File

@@ -342,11 +342,12 @@ apt install $PROGRAM
Remove `lolcat`, because it's useless:
```bash
```sh
sudo apt remove lolcat
```
... and that's pretty much it. You can move, create, destroy, install things, and look things up.
...and that's pretty much it.
You can move, create, destroy, install things, and look things up.
# Review

View File

@@ -1,6 +1,6 @@
---
title: "clock"
tags: [ "Basics" ]
tags: [ "Basics", "time" ]
---
Show system time:

View File

@@ -1,6 +1,6 @@
---
title: "cron"
tags: [ "Basics" ]
tags: [ "Basics", "time" ]
---
# Cronie

View File

@@ -1,6 +1,6 @@
---
title: "locale"
tags: [ "Basics" ]
tags: [ "Basics", "time" ]
---
Your locale tells the computer your location, preferred time-and-date format, standard language, papersize, et c.

View File

@@ -6,59 +6,30 @@ tags: [ "Basics" ]
`type` shows what kind of thing you're running, be it an alias, function, or binary program.
```bash
type cmus
```sh
type cd
type ls
type -P ls
type -a cat
```
![where is cmus?](/tapes/which.gif)
# Whereis the Program
Ask where the `angband` program is, along with all its configuration files:
Where is `grep` and all its configuration files?
`whereis angband`
Also `which` shows where a binary file (the program) is,
```bash
which cmus
```sh
whereis grep
```
# Search Instantly with `plocate`
Which one of these is the binary file which you actually use?
You can search every file on the computer instantly by installing `plocate`.
Once installed, run `sudo updatedb` to create the database of (nearly) every file on the computer.
Check how big the database is:
```bash
du -h /var/lib/plocate/plocate.db
```sh
which grep
```
Once you have the database, you can find nearly any file instantly.
# More
- Search for gifs: `locate .gif`
- Search for gifs in the `/usr/` directory: `locate /usr/ .gif`
- Search for jpg images with 'dog' or 'Dog' in the name: `locate -i dog jpg`
- Search for videos: `plocate --regex '.mp4$|.mkv$|.wmv$|.webm$|.mov$|.avi$'`
For best results, run `updatedb` regularly, perhaps in [crontab](../system/cron.md).
## Search More Places
`plocate` will not search `/tmp/`, because nobody cares about those files, and won't search inside `/mnt/`, because that's where USB sticks get mounted, so the files keep changing as USB sticks come and go.
Change where `plocate` searches by editing the configuration file at `/etc/updatedb.conf`.
By default, the `/mnt` directory is 'pruned' from the database.
So if you want to search `/mnt` for videos, remove the word `/mnt` from the configuration file.
```bash
cat /etc/updatedb.conf
sudo sed 's#/mnt/##' /etc/updatedb.conf
sudo updatedb
plocate --regex '.mp4$|.mkv$|.wmv$|.webm$|.mov$|.avi$'
```
- [Search instantly with `plocate`](data/search_system.md)

View File

@@ -1,6 +1,6 @@
---
title: "time"
tags: [ "Basics" ]
tags: [ "Basics", "time" ]
---
# systemd