aboutsummaryrefslogtreecommitdiff
path: root/content
diff options
context:
space:
mode:
Diffstat (limited to 'content')
-rw-r--r--content/notes/catv-weechat-config.md19
-rw-r--r--content/notes/convert-mkv.md20
-rw-r--r--content/notes/download-youtube-videos.md23
-rw-r--r--content/notes/fix-plan9-bootloader.md18
-rw-r--r--content/notes/git-push-multiple-origins.md16
-rw-r--r--content/notes/install-plan9port-linux.md18
-rw-r--r--content/notes/mass-set-permission.md14
-rw-r--r--content/notes/mount-plan9-over-network.md21
-rw-r--r--content/notes/plan9-screenshot.md16
-rw-r--r--content/notes/preview-troff-man-pages.md18
-rw-r--r--content/notes/run-9front-in-qemu.md26
-rw-r--r--content/notes/write-iso-usb.md13
-rw-r--r--content/pages/pastebin.md135
13 files changed, 222 insertions, 135 deletions
diff --git a/content/notes/catv-weechat-config.md b/content/notes/catv-weechat-config.md
new file mode 100644
index 0000000..8d85d22
--- /dev/null
+++ b/content/notes/catv-weechat-config.md
@@ -0,0 +1,19 @@
1---
2title: "#cat-v on weechat configuration"
3url: catv-weechat-config.html
4date: 2023-05-09
5type: notes
6draft: false
7---
8
9Set up weechat to connect to #cat-v on oftc. This applies to [weechat](https://weechat.org/)
10but should be similar for other irc clients.
11
12```sh
13# Install weechat and launch it and execute the following commands.
14
15/server add oftc irc.oftc.net -tls
16/set irc.server.oftc.autoconnect on
17/set irc.server.oftc.autojoin "#cat-v"
18/set irc.server.oftc.nicks "nick1,nick2,nick3"
19```
diff --git a/content/notes/convert-mkv.md b/content/notes/convert-mkv.md
new file mode 100644
index 0000000..cca08d7
--- /dev/null
+++ b/content/notes/convert-mkv.md
@@ -0,0 +1,20 @@
1---
2title: Convert all MKV files into other formats
3url: convert-mkv.html
4date: 2023-05-14
5type: notes
6draft: false
7---
8
9You will need `ffmpeg` installed on your system. This will convert all MKV files
10into WebM format.
11
12```sh
13# Convert all MKV files into WebM format.
14find ./ -name '*.mkv' -exec bash -c 'ffmpeg -i "$0" -vcodec libvpx -acodec libvorbis -cpu-used 5 -threads 8 "${0%%.mp4}.webm"' {} \;
15```
16
17```sh
18# Convert all MKV files into MP4 format.
19find ./ -name '*.mkv' -exec bash -c 'ffmpeg -i "$0" c:a copy -c:v copy -cpu-used 5 -threads 8 "${0%%.mp4}.mp4"' {} \;
20```
diff --git a/content/notes/download-youtube-videos.md b/content/notes/download-youtube-videos.md
new file mode 100644
index 0000000..dd3363d
--- /dev/null
+++ b/content/notes/download-youtube-videos.md
@@ -0,0 +1,23 @@
1---
2title: Download list of YouTube files
3url: download-youtube-videos.html
4date: 2023-05-13
5type: notes
6draft: false
7---
8
9If you need to download a list of YouTube videos and don't want to download the
10actual YouTube list (which `yt-dlp` supports), you can use the following method.
11
12```js
13// Used to get list of raw URL's from YouTube's video tab'.
14// Copy them into videos.txt.
15document.querySelectorAll('#contents a.ytd-thumbnail.style-scope.ytd-thumbnail').forEach(el => console.log(el.href))
16```
17
18Download and install https://github.com/yt-dlp/yt-dlp.
19
20```sh
21# This will download all videos in videos.txt.
22yt-dlp --batch-file videos.txt -N `nproc` -f webm
23```
diff --git a/content/notes/fix-plan9-bootloader.md b/content/notes/fix-plan9-bootloader.md
new file mode 100644
index 0000000..f37ff0e
--- /dev/null
+++ b/content/notes/fix-plan9-bootloader.md
@@ -0,0 +1,18 @@
1---
2title: Fix bootloader not being written in Plan9
3url: fix-plan9-bootloader.html
4date: 2023-05-11
5type: notes
6draft: false
7---
8
9If the bootloader is not being written to a disk when installing 9front on real
10harware try clearing first sector of the disk with the following command.
11
12```sh
13dd if=/dev/zero of=/dev/sdX bs=512 count=1
14
15# If command above doesn't work try this one, wait couple of seconds and
16# press delete key to stop the command.
17cat </dev/zero >/dev/sd*/data
18```
diff --git a/content/notes/git-push-multiple-origins.md b/content/notes/git-push-multiple-origins.md
new file mode 100644
index 0000000..7b12148
--- /dev/null
+++ b/content/notes/git-push-multiple-origins.md
@@ -0,0 +1,16 @@
1---
2title: Push to multiple origins at once in Git
3url: git-push-multiple-origins.html
4date: 2023-05-06
5type: notes
6draft: false
7---
8
9Sometimes you want to push to multiple origins at once. This is useful if you
10have a mirror of your repository on another server. You can do this by adding
11multiple push urls to your git config. After this you can push to all origins
12at once by using `git push --all`. This is a shorthand for command above.
13
14```sh
15git config --global alias.pushall '!sh -c "git remote | xargs -L1 git push --all"'
16```
diff --git a/content/notes/install-plan9port-linux.md b/content/notes/install-plan9port-linux.md
new file mode 100644
index 0000000..6355287
--- /dev/null
+++ b/content/notes/install-plan9port-linux.md
@@ -0,0 +1,18 @@
1---
2title: Install Plan9port on Linux
3url: install-plan9port-linux.html
4date: 2023-05-12
5type: notes
6draft: false
7---
8
9Install Plan9port on Linux. This applies to [Plan9port](https://9fans.github.io/plan9port/).
10This is a port of many Plan 9 programs to Unix-like operating systems. Useful for
11programs like `9term` and `rc`.
12
13```sh
14sudo apt-get install gcc libx11-dev libxt-dev libxext-dev libfontconfig1-dev
15git clone https://github.com/9fans/plan9port $HOME/plan9
16cd $HOME/plan9/plan9port
17./INSTALL -r $HOME/plan9
18```
diff --git a/content/notes/mass-set-permission.md b/content/notes/mass-set-permission.md
new file mode 100644
index 0000000..20a4fab
--- /dev/null
+++ b/content/notes/mass-set-permission.md
@@ -0,0 +1,14 @@
1---
2title: Change permissions of matching files recursively
3url: mass-set-permission.html
4date: 2023-05-16
5type: notes
6draft: false
7---
8
9Replace `*.xml` with your pattern. This will remove executable bit from all
10files matching the pattern. Change `+` to `-` to add executable bit.
11
12```sh
13find . -type f -name "*.xml" -exec chmod -x {} +
14```
diff --git a/content/notes/mount-plan9-over-network.md b/content/notes/mount-plan9-over-network.md
new file mode 100644
index 0000000..3572b99
--- /dev/null
+++ b/content/notes/mount-plan9-over-network.md
@@ -0,0 +1,21 @@
1---
2title: Mount Plan9 over network
3url: mount-plan9-over-network.html
4date: 2023-05-07
5type: notes
6draft: false
7---
8
9- First install libfuse with sudo apt install libfuse-dev.
10- Then clone https://github.com/ftrvxmtrx/9pfs and compile it with make.
11- Copy 9pfs to your path.
12
13```sh
14# On Plan9 side
15ip/ipconfig # enables network
16aux/listen1 -tv tcp!*!9999 /bin/exportfs -r tmp # export tmp folder
17
18# On Linux side
199pfs 172.18.0.1 -p 9999 local_folder # mount
20umount local_folder # unmount
21```
diff --git a/content/notes/plan9-screenshot.md b/content/notes/plan9-screenshot.md
new file mode 100644
index 0000000..88b7bd9
--- /dev/null
+++ b/content/notes/plan9-screenshot.md
@@ -0,0 +1,16 @@
1---
2title: Take a screenshot in Plan9
3url: plan9-screenshot.html
4date: 2023-05-10
5type: notes
6draft: false
7---
8
9Take a screenshot in Plan9. This applies to [Plan9](https://9p.io/plan9/) and
10[9front](https://9front.org/). This will take a screenshot of the screen and
11output it to `/dev/screen`. You can then use `topng` to convert it to a png
12image.
13
14```sh
15cat /dev/screen | topng > screen.png
16```
diff --git a/content/notes/preview-troff-man-pages.md b/content/notes/preview-troff-man-pages.md
new file mode 100644
index 0000000..6ff1124
--- /dev/null
+++ b/content/notes/preview-troff-man-pages.md
@@ -0,0 +1,18 @@
1---
2title: Previews how man page written in Troff will look like
3url: preview-troff-man-pages.html
4date: 2023-05-15
5type: notes
6draft: false
7---
8
9Troff is used to write man pages and it is difficult to read it so this will
10preview how it will look like when it is rendered.
11
12```sh
13# On Linux system.
14groff -man -Tascii filename
15
16# On Plan9 system.
17man 1 filename
18```
diff --git a/content/notes/run-9front-in-qemu.md b/content/notes/run-9front-in-qemu.md
new file mode 100644
index 0000000..1e6820d
--- /dev/null
+++ b/content/notes/run-9front-in-qemu.md
@@ -0,0 +1,26 @@
1---
2title: Run 9front in Qemu
3url: run-9front-in-qemu.html
4date: 2023-05-05
5type: notes
6draft: false
7---
8
9Run 9front in Qemu. This applies to [Plan9](https://9p.io/plan9/) and
10[9front](https://9front.org/).
11
12Download from here http://9front.org/iso/.
13
14```sh
15# Create a qcow2 image.
16qemu-img create -f qcow2 $HOME/VM/9front.qcow2.img 30G
17
18# Run the VM.
19qemu-system-x86_64 -cpu host -enable-kvm -m 1024 \
20 -net nic,model=virtio,macaddr=52:54:00:00:EE:03 -net user \
21 -device virtio-scsi-pci,id=scsi \
22 -drive if=none,id=vd0,file=$HOME/VM/9front.qcow2.img \
23 -device scsi-hd,drive=vd0 \
24 -drive if=none,id=vd1,file=$HOME/VM/ISO/9front.386.iso \
25 -device scsi-cd,drive=vd1,bootindex=0
26```
diff --git a/content/notes/write-iso-usb.md b/content/notes/write-iso-usb.md
new file mode 100644
index 0000000..04b0c81
--- /dev/null
+++ b/content/notes/write-iso-usb.md
@@ -0,0 +1,13 @@
1---
2title: Write ISO to USB Key
3url: write-iso-usb.html
4date: 2023-05-08
5type: notes
6draft: false
7---
8
9Write ISO to USB key. Nothing fancy here.
10
11```sh
12sudo dd if=iso_file.iso of=/dev/sdX bs=4M status=progress conv=fdatasync
13```
diff --git a/content/pages/pastebin.md b/content/pages/pastebin.md
deleted file mode 100644
index 422b417..0000000
--- a/content/pages/pastebin.md
+++ /dev/null
@@ -1,135 +0,0 @@
1---
2title: Pastebin
3date: 2023-05-19
4url: pastebin.html
5draft: false
6---
7
8*No additional explanation provided here. Use blog for more detailed stuff.*
9
10**▒ Change permissions of all files matching a pattern recursively**
11
12```sh
13find . -type f -name "*.xml" -exec chmod -x {} +
14```
15
16**▒ Previews how man page written in Troff will look like**
17
18```sh
19# On Linux system.
20groff -man -Tascii filename
21
22# On Plan9 system.
23man 1 filename
24```
25
26**▒ Convert all MKV files into WebM format**
27
28```sh
29find ./ -name '*.mkv' -exec bash -c 'ffmpeg -i "$0" -vcodec libvpx -acodec libvorbis -cpu-used 5 -threads 8 "${0%%.mp4}.webm"' {} \;
30```
31
32**▒ Convert all MKV files into MP4 format**
33
34```sh
35find ./ -name '*.mkv' -exec bash -c 'ffmpeg -i "$0" c:a copy -c:v copy -cpu-used 5 -threads 8 "${0%%.mp4}.mp4"' {} \;
36```
37
38**▒ Download list of YouTube files**
39
40```js
41// Used to get list of raw URL's from YouTube's video tab'.
42// Copy them into videos.txt.
43document.querySelectorAll('#contents a.ytd-thumbnail.style-scope.ytd-thumbnail').forEach(el => console.log(el.href))
44```
45
46Download and install https://github.com/yt-dlp/yt-dlp.
47
48```sh
49yt-dlp --batch-file videos.txt -N `nproc` -f webm
50```
51
52**▒ Install Plan9port on Linux**
53
54```sh
55sudo apt-get install gcc libx11-dev libxt-dev libxext-dev libfontconfig1-dev
56git clone https://github.com/9fans/plan9port $HOME/plan9
57cd $HOME/plan9/plan9port
58./INSTALL -r $HOME/plan9
59```
60
61**▒ Fix bootloader not being written in Plan9**
62
63If the bootloader is not being written to a disk when installing 9front on
64real harware try clearing first sector of the disk with the following command.
65
66```sh
67dd if=/dev/zero of=/dev/sdX bs=512 count=1
68
69# If command above doesn't work try this one, wait couple of seconds and
70# press delete key to stop the command.
71cat </dev/zero >/dev/sd*/data
72```
73
74**▒ Take a screenshot in Plan9**
75
76```sh
77cat /dev/screen | topng > screen.png
78```
79
80**▒ #cat-v on weechat configuration**
81
82```sh
83# Install weechat and launch it and execute the following commands.
84
85/server add oftc irc.oftc.net -tls
86/set irc.server.oftc.autoconnect on
87/set irc.server.oftc.autojoin "#cat-v"
88/set irc.server.oftc.nicks "nick1,nick2,nick3"
89```
90
91**▒ Write ISO to USB Key**
92
93```sh
94sudo dd if=iso_file.iso of=/dev/sdX bs=4M status=progress conv=fdatasync
95```
96
97**▒ Mount Plan9 over network**
98
99- First install `libfuse` with `sudo apt install libfuse-dev`.
100- Then clone https://github.com/ftrvxmtrx/9pfs and compile it with `make`.
101- Copy `9pfs` to your path.
102
103```sh
104# On Plan9 side
105ip/ipconfig # enables network
106aux/listen1 -tv tcp!*!9999 /bin/exportfs -r tmp # export tmp folder
107
108# On Linux side
1099pfs 172.18.0.1 -p 9999 local_folder # mount
110umount local_folder # unmount
111```
112
113**▒ Push to multiple origins at once in Git**
114
115```sh
116git config --global alias.pushall '!sh -c "git remote | xargs -L1 git push --all"'
117```
118
119**▒ Run 9front in Qemu**
120
121Download from here http://9front.org/iso/.
122
123```sh
124# Create a qcow2 image.
125qemu-img create -f qcow2 $HOME/VM/9front.qcow2.img 30G
126
127# Run the VM.
128qemu-system-x86_64 -cpu host -enable-kvm -m 1024 \
129 -net nic,model=virtio,macaddr=52:54:00:00:EE:03 -net user \
130 -device virtio-scsi-pci,id=scsi \
131 -drive if=none,id=vd0,file=$HOME/VM/9front.qcow2.img \
132 -device scsi-hd,drive=vd0 \
133 -drive if=none,id=vd1,file=$HOME/VM/ISO/9front.386.iso \
134 -device scsi-cd,drive=vd1,bootindex=0
135```