Compare commits
9 Commits
5feb513b38
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
8ec1d53ea4
|
|||
|
8ef34f8a1f
|
|||
|
1dbc97209e
|
|||
|
594107c252
|
|||
|
89238fa9eb
|
|||
|
57a1b027ed
|
|||
|
e1fee5d4c2
|
|||
| 2cff9f47ea | |||
| 0a41f6b65a |
7
Makefile
7
Makefile
@@ -4,6 +4,12 @@ EDITOR ?= vi
|
|||||||
FZF != command -v sk || command -v fzy || command -v fzf || \
|
FZF != command -v sk || command -v fzy || command -v fzf || \
|
||||||
{ echo install a fuzzy finder && exit 1 ;}
|
{ echo install a fuzzy finder && exit 1 ;}
|
||||||
|
|
||||||
|
ifeq "$(FZF)" "/usr/bin/fzy"
|
||||||
|
FZF += -i
|
||||||
|
else
|
||||||
|
FZF += --print-query | cat
|
||||||
|
endif
|
||||||
|
|
||||||
spill_contents = sed -e '1,/---/d'
|
spill_contents = sed -e '1,/---/d'
|
||||||
|
|
||||||
help: .git/info/exclude ## Print the help message
|
help: .git/info/exclude ## Print the help message
|
||||||
@@ -72,6 +78,7 @@ article: ## Write an article
|
|||||||
@path=$$(find $(categories) -type d | sort | uniq | $(FZF)) ;\
|
@path=$$(find $(categories) -type d | sort | uniq | $(FZF)) ;\
|
||||||
read -p "Title: " title ;\
|
read -p "Title: " title ;\
|
||||||
filename="$$(echo "$$title" | tr '[:upper:]' '[:lower:]' | tr ' ' '_')" ;\
|
filename="$$(echo "$$title" | tr '[:upper:]' '[:lower:]' | tr ' ' '_')" ;\
|
||||||
|
mkdir -p $$path ;\
|
||||||
printf '%s\n' '---' >> $$path/$$filename.md ;\
|
printf '%s\n' '---' >> $$path/$$filename.md ;\
|
||||||
printf 'title: "%s"\n' "$$title" >> $$path/$$filename.md ;\
|
printf 'title: "%s"\n' "$$title" >> $$path/$$filename.md ;\
|
||||||
printf 'tags: [ "%s" ]\n' "$$path" | tr '[:upper:]' '[:lower:]' | sed 's#\/#", "#g' >> $$path/$$filename.md ;\
|
printf 'tags: [ "%s" ]\n' "$$path" | tr '[:upper:]' '[:lower:]' | sed 's#\/#", "#g' >> $$path/$$filename.md ;\
|
||||||
|
|||||||
54
data/newsraft.md
Normal file
54
data/newsraft.md
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
---
|
||||||
|
title: "Newsraft"
|
||||||
|
tags: [ "data", "RSS" ]
|
||||||
|
requires: [ "Shell Scripts" ]
|
||||||
|
---
|
||||||
|
|
||||||
|
# Setup
|
||||||
|
|
||||||
|
Install newsraft, then:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
mkdir ~/.config/newsraft
|
||||||
|
echo 'https://codeberg.org/newsraft/newsraft.atom "Newsraft git"' >> ~/.config/newsraft/feeds
|
||||||
|
newsraft
|
||||||
|
```
|
||||||
|
|
||||||
|
# Commands
|
||||||
|
|
||||||
|
Copy the default config file:
|
||||||
|
|
||||||
|
```
|
||||||
|
cp /usr/share/doc/newsraft/example/config ~/.config/newsraft/config
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
Add a line to check the man page while inside the program:
|
||||||
|
|
||||||
|
```
|
||||||
|
bind M exec man newsraft
|
||||||
|
```
|
||||||
|
|
||||||
|
This will fail, because the letter 'M' is taken by `mpv`.
|
||||||
|
|
||||||
|
Add this line to take the default link, and place it in a list of videos.
|
||||||
|
|
||||||
|
```
|
||||||
|
bind V mark-read; exec echo "%l" >> ~/.cache/vidlist.txt
|
||||||
|
```
|
||||||
|
|
||||||
|
# Videos
|
||||||
|
|
||||||
|
You can get an RSS feed from any YouTube video with this script:
|
||||||
|
|
||||||
|
```
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
CHANNEL_ID="$(curl -s "$1" | tr ',' '\n' | grep -Po 'channelId":"\K[\w+-]+' | tail -1)"
|
||||||
|
FEED_URL="https://www.youtube.com/feeds/videos.xml?channel_id=$CHANNEL_ID"
|
||||||
|
CHANNEL_NAME="$(curl -s "$FEED_URL" | grep -m 1 -Po 'title\>\K[\w\s]+')"
|
||||||
|
|
||||||
|
printf '%s "%s"\n' "$FEED_URL" "$CHANNEL_NAME"
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
@@ -14,7 +14,6 @@ sudo systemctl edit getty@tty1
|
|||||||
The put in the following, changing `[ USER ]` to your username.
|
The put in the following, changing `[ USER ]` to your username.
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
ExecStart=
|
ExecStart=
|
||||||
ExecStart=-/usr/bin/agetty --autologin [ USER ] -s %I 115200,38400,9600 vt102
|
ExecStart=-/usr/bin/agetty --autologin [ USER ] -s %I 115200,38400,9600 vt102
|
||||||
@@ -25,9 +24,22 @@ ExecStart=-/usr/bin/agetty --autologin [ USER ] -s %I 115200,38400,9600 vt102
|
|||||||
|
|
||||||
In `.bashrc`.
|
In `.bashrc`.
|
||||||
|
|
||||||
```
|
```sh
|
||||||
if [ -z "$DISPLAY" ] && [ "$(fgconsole)" -eq 1 ]; then
|
if [ -z "$DISPLAY" ] && [ "$(fgconsole)" -eq 1 ]; then
|
||||||
exec startx
|
exec startx
|
||||||
fi
|
fi
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
# Faillock reset
|
||||||
|
|
||||||
|
After failing 3 times to enter the password, archlinux would ussualy lock entering the password for 10 minutes, not all apps and guis display this message, so sometimes it can be a bit confusing. To reset this lockdown, you can login as root and restart it manually with command
|
||||||
|
|
||||||
|
``` sh
|
||||||
|
failock --reset
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
title: "basic-install"
|
title: "Install Arch"
|
||||||
tags: [ "arch" ]
|
tags: [ "arch" ]
|
||||||
requires: [ "partitions", "time" ]
|
requires: [ "partitions", "time" ]
|
||||||
---
|
---
|
||||||
|
|||||||
27
distros/arch/install_yay.md
Normal file
27
distros/arch/install_yay.md
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
---
|
||||||
|
title: "Install yay"
|
||||||
|
tags: [ "distros", "arch" ]
|
||||||
|
requirements: [ "pacman" ]
|
||||||
|
---
|
||||||
|
|
||||||
|
```sh
|
||||||
|
pacman --sync --noconfirm --needed base-devel gcc git
|
||||||
|
git clone https://aur.archlinux.org/yay.git /tmp/yay
|
||||||
|
makepkg -C !$ -si
|
||||||
|
```
|
||||||
|
|
||||||
|
The flags are mostly the same as in `pacman`.
|
||||||
|
But running `yay` without flags will do the update like `yay -Syu` and with package name it will search packages in the AUR and `pacman` repos, and let you choose which to install.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
yay <search_term>
|
||||||
|
```
|
||||||
|
|
||||||
|
Building the package can usually take some time, and after the build it will ask for the `sudo` password.
|
||||||
|
If you leave, the installation will fail.
|
||||||
|
To avoid this, you can use the flag `--sudoloop` and enter the sudo password initially and it will loop it until the installation is finished.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
yay -S --noconfirm --sudoloop <package_name>
|
||||||
|
```
|
||||||
|
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
---
|
---
|
||||||
title: "Maintenance"
|
title: "Arch Maintenance"
|
||||||
tags: [ "arch" ]
|
tags: [ "arch" ]
|
||||||
|
requirements: [ "pacman" ]
|
||||||
---
|
---
|
||||||
|
|
||||||
# Package Cache
|
# Package Cache
|
||||||
@@ -12,15 +13,6 @@ ls /var/cache/pacman/pkg/ | wc -l
|
|||||||
sudo pacman -Sc
|
sudo pacman -Sc
|
||||||
ls /var/cache/pacman/pkg/ | wc -l
|
ls /var/cache/pacman/pkg/ | wc -l
|
||||||
```
|
```
|
||||||
And the same for `yay` (with `-Yc` to remove old dependencies):
|
|
||||||
|
|
||||||
```sh
|
|
||||||
ls ~/.cache/yay/ | wc -l
|
|
||||||
yay -Sc
|
|
||||||
yay -Yc
|
|
||||||
ls ~/.cache/yay/ | wc -l
|
|
||||||
```
|
|
||||||
|
|
||||||
# New Configs
|
# New Configs
|
||||||
|
|
||||||
If you chance a configuration file, such as `/etc/environment`, and `pacman` wants to update the file, it will place `/etc/environment.pacnew`.
|
If you chance a configuration file, such as `/etc/environment`, and `pacman` wants to update the file, it will place `/etc/environment.pacnew`.
|
||||||
@@ -41,10 +33,7 @@ sudo -e /etc/pacman.d/mirrorlist
|
|||||||
sudo rm /etc/pacman.d/mirrorlist.pacnew
|
sudo rm /etc/pacman.d/mirrorlist.pacnew
|
||||||
```
|
```
|
||||||
|
|
||||||
Or,
|
Or use a tool like `pacdiff` to view the changes next to each other, and select them with `vim`.
|
||||||
|
|
||||||
- use a tool like `pacdiff` to view the changes next to each other, and select them with `vim`.
|
|
||||||
|
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
sudo pacman -S pacman-contrib
|
sudo pacman -S pacman-contrib
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
---
|
---
|
||||||
title: "pacman"
|
title: "pacman"
|
||||||
tags: [ "distros" ]
|
tags: [ "distros" ]
|
||||||
|
requirements: [ "Install Arch" ]
|
||||||
---
|
---
|
||||||
|
|
||||||
Packages are kept in /var/cache/pacman/pkg.
|
Packages are kept in /var/cache/pacman/pkg.
|
||||||
@@ -19,7 +20,9 @@ sudo pacman-key --populate archlinux
|
|||||||
|
|
||||||
And refreshed with:
|
And refreshed with:
|
||||||
|
|
||||||
|
```sh
|
||||||
sudo pacman-key --refresh-keys
|
sudo pacman-key --refresh-keys
|
||||||
|
```
|
||||||
|
|
||||||
If you have usigned keys, you can refresh with:
|
If you have usigned keys, you can refresh with:
|
||||||
|
|
||||||
@@ -48,7 +51,13 @@ sudo pacman -S archlinux-keyring
|
|||||||
List all orphaned packages:
|
List all orphaned packages:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
sudo pacman -Qtdq
|
pacman -Qtdq
|
||||||
|
```
|
||||||
|
|
||||||
|
Removing a package:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
sudo pacman -Rn <package_name>
|
||||||
```
|
```
|
||||||
|
|
||||||
## Cleaning Config Files
|
## Cleaning Config Files
|
||||||
@@ -61,3 +70,4 @@ These changes must be merge manually.
|
|||||||
|
|
||||||
Install the `pacdiff` tool to make this easier, from the `pacman-contrib` package, then simply run `sudo pacdiff` to sort through the various mergers.
|
Install the `pacdiff` tool to make this easier, from the `pacman-contrib` package, then simply run `sudo pacdiff` to sort through the various mergers.
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
29
distros/arch/pacman_extras.md
Normal file
29
distros/arch/pacman_extras.md
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
---
|
||||||
|
title: "pacman - Extras"
|
||||||
|
tags: [ "distros" ]
|
||||||
|
requirements: [ "pacman" ]
|
||||||
|
---
|
||||||
|
|
||||||
|
## Unattended Actions
|
||||||
|
|
||||||
|
```sh
|
||||||
|
pacman -Syu --noconfirm
|
||||||
|
```
|
||||||
|
|
||||||
|
## `pacman` and `yay` Text Colouring
|
||||||
|
|
||||||
|
Getting the colors is done by editing the `/etc/pacman.conf` and uncommenting the line `Color`.
|
||||||
|
|
||||||
|
By adding the line `ILoveCandy` you will unlock some terminal animations, like pacman eating dots while installing some package.
|
||||||
|
|
||||||
|
## Timid Installations
|
||||||
|
|
||||||
|
Want to try out software, but not sure if you want to keep it?
|
||||||
|
You can tell `pacman` that this is a dependency for another package:
|
||||||
|
|
||||||
|
|
||||||
|
```sh
|
||||||
|
pacman -S --noconfirm --asdeps <weird music player>
|
||||||
|
```
|
||||||
|
|
||||||
|
When you [remove orphaned packages](pacman.md), the package will be automatically uninstalled.
|
||||||
22
distros/arch/yay_maintenance.md
Normal file
22
distros/arch/yay_maintenance.md
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
---
|
||||||
|
title: "Arch Maintenance with yay"
|
||||||
|
tags: [ "arch" ]
|
||||||
|
requirements: [ "Arch Maintenance" ]
|
||||||
|
---
|
||||||
|
|
||||||
|
# Package Cache
|
||||||
|
|
||||||
|
Just like `pacman`
|
||||||
|
|
||||||
|
```sh
|
||||||
|
ls ~/.cache/yay/ | wc -l
|
||||||
|
yay -Sc
|
||||||
|
```
|
||||||
|
|
||||||
|
Use `-Yc` to remove old dependencies:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
yay -Yc
|
||||||
|
ls ~/.cache/yay/ | wc -l
|
||||||
|
```
|
||||||
|
|
||||||
@@ -113,6 +113,25 @@ Events:
|
|||||||
|
|
||||||
Pod copies are called a 'replicaset'.
|
Pod copies are called a 'replicaset'.
|
||||||
|
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ kubectl exec $POD_NAME -- env
|
||||||
|
|
||||||
|
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
||||||
|
HOSTNAME=stupendously-verbose-podish-nomenclature-jvguenaqbz-punenpgref
|
||||||
|
KUBERNETES_PORT_443_TCP_PORT=443
|
||||||
|
KUBERNETES_PORT_443_TCP_ADDR=10.96.0.1
|
||||||
|
KUBERNETES_SERVICE_HOST=10.96.0.1
|
||||||
|
KUBERNETES_SERVICE_PORT=443
|
||||||
|
KUBERNETES_SERVICE_PORT_HTTPS=443
|
||||||
|
KUBERNETES_PORT=tcp://10.96.0.1:443
|
||||||
|
KUBERNETES_PORT_443_TCP=tcp://10.96.0.1:443
|
||||||
|
KUBERNETES_PORT_443_TCP_PROTO=tcp
|
||||||
|
NPM_CONFIG_LOGLEVEL=info
|
||||||
|
NODE_VERSION=6.3.1
|
||||||
|
HOME=/root
|
||||||
|
```
|
||||||
|
|
||||||
# Create
|
# Create
|
||||||
|
|
||||||
Create a 'deployment' of `nginx`.
|
Create a 'deployment' of `nginx`.
|
||||||
|
|||||||
@@ -51,7 +51,6 @@ Search packages:
|
|||||||
```sh
|
```sh
|
||||||
tlmgr search --global epstopdf
|
tlmgr search --global epstopdf
|
||||||
```
|
```
|
||||||
|
|
||||||
Can't find what you need?
|
Can't find what you need?
|
||||||
Search for a specific file instead:
|
Search for a specific file instead:
|
||||||
|
|
||||||
@@ -60,8 +59,16 @@ tlmgr search --global --file epstopdf-base.sty
|
|||||||
sudo tlmgr install epstopdf-pkg
|
sudo tlmgr install epstopdf-pkg
|
||||||
```
|
```
|
||||||
|
|
||||||
## Recommended Packages
|
Check how many unique licences LaTeX packages use:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
tlmgr info --list --json
|
||||||
|
jq -r '.[].cataloguedata.license' < tex.json | sort | uniq | wc -l
|
||||||
|
```
|
||||||
|
|
||||||
|
Please remember: the world does not need any more licences.
|
||||||
|
|
||||||
|
## Recommended Packages
|
||||||
|
|
||||||
```
|
```
|
||||||
latexmk
|
latexmk
|
||||||
|
|||||||
@@ -3,6 +3,13 @@ title: "vim basics"
|
|||||||
tags: [ "vim", "basic" ]
|
tags: [ "vim", "basic" ]
|
||||||
---
|
---
|
||||||
|
|
||||||
|
## Instant nano replacement
|
||||||
|
|
||||||
|
`vim -y` - will start vim but like other editors like nano, there will be syntax highlighting, etc
|
||||||
|
Keybind to exit this mode is `Ctrl+q`
|
||||||
|
|
||||||
|
## Steps
|
||||||
|
|
||||||
1. Insert text by pressing `a`.
|
1. Insert text by pressing `a`.
|
||||||
1. Stop inserting text by pressing `Ctrl+[`.
|
1. Stop inserting text by pressing `Ctrl+[`.
|
||||||
1. Exit with `ZZ`.
|
1. Exit with `ZZ`.
|
||||||
|
|||||||
Reference in New Issue
Block a user