From b3dfbe8b70b870399dc335b8dcf028bb9a3955de Mon Sep 17 00:00:00 2001 From: Mitja Felicijan Date: Wed, 24 May 2023 05:57:50 +0200 Subject: Added notes as a separate type of content and moved the content --- content/notes/catv-weechat-config.md | 19 +++++++++++++++++++ content/notes/convert-mkv.md | 20 ++++++++++++++++++++ content/notes/download-youtube-videos.md | 23 +++++++++++++++++++++++ content/notes/fix-plan9-bootloader.md | 18 ++++++++++++++++++ content/notes/git-push-multiple-origins.md | 16 ++++++++++++++++ content/notes/install-plan9port-linux.md | 18 ++++++++++++++++++ content/notes/mass-set-permission.md | 14 ++++++++++++++ content/notes/mount-plan9-over-network.md | 21 +++++++++++++++++++++ content/notes/plan9-screenshot.md | 16 ++++++++++++++++ content/notes/preview-troff-man-pages.md | 18 ++++++++++++++++++ content/notes/run-9front-in-qemu.md | 26 ++++++++++++++++++++++++++ content/notes/write-iso-usb.md | 13 +++++++++++++ 12 files changed, 222 insertions(+) create mode 100644 content/notes/catv-weechat-config.md create mode 100644 content/notes/convert-mkv.md create mode 100644 content/notes/download-youtube-videos.md create mode 100644 content/notes/fix-plan9-bootloader.md create mode 100644 content/notes/git-push-multiple-origins.md create mode 100644 content/notes/install-plan9port-linux.md create mode 100644 content/notes/mass-set-permission.md create mode 100644 content/notes/mount-plan9-over-network.md create mode 100644 content/notes/plan9-screenshot.md create mode 100644 content/notes/preview-troff-man-pages.md create mode 100644 content/notes/run-9front-in-qemu.md create mode 100644 content/notes/write-iso-usb.md (limited to 'content/notes') 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 @@ +--- +title: "#cat-v on weechat configuration" +url: catv-weechat-config.html +date: 2023-05-09 +type: notes +draft: false +--- + +Set up weechat to connect to #cat-v on oftc. This applies to [weechat](https://weechat.org/) +but should be similar for other irc clients. + +```sh +# Install weechat and launch it and execute the following commands. + +/server add oftc irc.oftc.net -tls +/set irc.server.oftc.autoconnect on +/set irc.server.oftc.autojoin "#cat-v" +/set irc.server.oftc.nicks "nick1,nick2,nick3" +``` 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 @@ +--- +title: Convert all MKV files into other formats +url: convert-mkv.html +date: 2023-05-14 +type: notes +draft: false +--- + +You will need `ffmpeg` installed on your system. This will convert all MKV files +into WebM format. + +```sh +# Convert all MKV files into WebM format. +find ./ -name '*.mkv' -exec bash -c 'ffmpeg -i "$0" -vcodec libvpx -acodec libvorbis -cpu-used 5 -threads 8 "${0%%.mp4}.webm"' {} \; +``` + +```sh +# Convert all MKV files into MP4 format. +find ./ -name '*.mkv' -exec bash -c 'ffmpeg -i "$0" c:a copy -c:v copy -cpu-used 5 -threads 8 "${0%%.mp4}.mp4"' {} \; +``` 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 @@ +--- +title: Download list of YouTube files +url: download-youtube-videos.html +date: 2023-05-13 +type: notes +draft: false +--- + +If you need to download a list of YouTube videos and don't want to download the +actual YouTube list (which `yt-dlp` supports), you can use the following method. + +```js +// Used to get list of raw URL's from YouTube's video tab'. +// Copy them into videos.txt. +document.querySelectorAll('#contents a.ytd-thumbnail.style-scope.ytd-thumbnail').forEach(el => console.log(el.href)) +``` + +Download and install https://github.com/yt-dlp/yt-dlp. + +```sh +# This will download all videos in videos.txt. +yt-dlp --batch-file videos.txt -N `nproc` -f webm +``` 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 @@ +--- +title: Fix bootloader not being written in Plan9 +url: fix-plan9-bootloader.html +date: 2023-05-11 +type: notes +draft: false +--- + +If the bootloader is not being written to a disk when installing 9front on real +harware try clearing first sector of the disk with the following command. + +```sh +dd if=/dev/zero of=/dev/sdX bs=512 count=1 + +# If command above doesn't work try this one, wait couple of seconds and +# press delete key to stop the command. +cat /dev/sd*/data +``` 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 @@ +--- +title: Push to multiple origins at once in Git +url: git-push-multiple-origins.html +date: 2023-05-06 +type: notes +draft: false +--- + +Sometimes you want to push to multiple origins at once. This is useful if you +have a mirror of your repository on another server. You can do this by adding +multiple push urls to your git config. After this you can push to all origins +at once by using `git push --all`. This is a shorthand for command above. + +```sh +git config --global alias.pushall '!sh -c "git remote | xargs -L1 git push --all"' +``` 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 @@ +--- +title: Install Plan9port on Linux +url: install-plan9port-linux.html +date: 2023-05-12 +type: notes +draft: false +--- + +Install Plan9port on Linux. This applies to [Plan9port](https://9fans.github.io/plan9port/). +This is a port of many Plan 9 programs to Unix-like operating systems. Useful for +programs like `9term` and `rc`. + +```sh +sudo apt-get install gcc libx11-dev libxt-dev libxext-dev libfontconfig1-dev +git clone https://github.com/9fans/plan9port $HOME/plan9 +cd $HOME/plan9/plan9port +./INSTALL -r $HOME/plan9 +``` 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 @@ +--- +title: Change permissions of matching files recursively +url: mass-set-permission.html +date: 2023-05-16 +type: notes +draft: false +--- + +Replace `*.xml` with your pattern. This will remove executable bit from all +files matching the pattern. Change `+` to `-` to add executable bit. + +```sh +find . -type f -name "*.xml" -exec chmod -x {} + +``` 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 @@ +--- +title: Mount Plan9 over network +url: mount-plan9-over-network.html +date: 2023-05-07 +type: notes +draft: false +--- + +- First install libfuse with sudo apt install libfuse-dev. +- Then clone https://github.com/ftrvxmtrx/9pfs and compile it with make. +- Copy 9pfs to your path. + +```sh +# On Plan9 side +ip/ipconfig # enables network +aux/listen1 -tv tcp!*!9999 /bin/exportfs -r tmp # export tmp folder + +# On Linux side +9pfs 172.18.0.1 -p 9999 local_folder # mount +umount local_folder # unmount +``` 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 @@ +--- +title: Take a screenshot in Plan9 +url: plan9-screenshot.html +date: 2023-05-10 +type: notes +draft: false +--- + +Take a screenshot in Plan9. This applies to [Plan9](https://9p.io/plan9/) and +[9front](https://9front.org/). This will take a screenshot of the screen and +output it to `/dev/screen`. You can then use `topng` to convert it to a png +image. + +```sh +cat /dev/screen | topng > screen.png +``` 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 @@ +--- +title: Previews how man page written in Troff will look like +url: preview-troff-man-pages.html +date: 2023-05-15 +type: notes +draft: false +--- + +Troff is used to write man pages and it is difficult to read it so this will +preview how it will look like when it is rendered. + +```sh +# On Linux system. +groff -man -Tascii filename + +# On Plan9 system. +man 1 filename +``` 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 @@ +--- +title: Run 9front in Qemu +url: run-9front-in-qemu.html +date: 2023-05-05 +type: notes +draft: false +--- + +Run 9front in Qemu. This applies to [Plan9](https://9p.io/plan9/) and +[9front](https://9front.org/). + +Download from here http://9front.org/iso/. + +```sh +# Create a qcow2 image. +qemu-img create -f qcow2 $HOME/VM/9front.qcow2.img 30G + +# Run the VM. +qemu-system-x86_64 -cpu host -enable-kvm -m 1024 \ + -net nic,model=virtio,macaddr=52:54:00:00:EE:03 -net user \ + -device virtio-scsi-pci,id=scsi \ + -drive if=none,id=vd0,file=$HOME/VM/9front.qcow2.img \ + -device scsi-hd,drive=vd0 \ + -drive if=none,id=vd1,file=$HOME/VM/ISO/9front.386.iso \ + -device scsi-cd,drive=vd1,bootindex=0 +``` 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 @@ +--- +title: Write ISO to USB Key +url: write-iso-usb.html +date: 2023-05-08 +type: notes +draft: false +--- + +Write ISO to USB key. Nothing fancy here. + +```sh +sudo dd if=iso_file.iso of=/dev/sdX bs=4M status=progress conv=fdatasync +``` -- cgit v1.2.3