Skip to content

Instantly share code, notes, and snippets.

@sahal
sahal / wiki_js_podman_compose.md
Created June 26, 2024 03:07
Get Wiki JS running locally with podman
@sahal
sahal / record_audio_from_pulse_audio_monitor_device.md
Last active June 9, 2024 00:57
Record Audio from Pulse Audio Monitor Device

Find your default sink monitor

giggles: sink monitor is a funny name for this concept

  • The audio outputs that PulseAudio creates are called "sinks."
  • "Monitors" are virtual devices that you can use to listen to the audio that will be sent to these devices (i.e. it turns a sink into a source)
# get default monitor name - you do not need to be root for this. yay!
$ pactl list sinks | grep $(pactl get-default-sink).monitor | cut -d : -f 2

Ensure that your monitor volume is at 100%

@sahal
sahal / REMAP_KEYBOARD_KEYS.md
Last active March 7, 2024 21:30
Now that Wayland is default in KDE6, I have to find an alternative way to remap keys
@sahal
sahal / 00_redact_and_rasterize.md
Created March 2, 2024 17:14
Split PDF using Okular, pdfimages, ImageMagick, pdfchain to resize, grayscale, and combine pdfs

Okular

Multi-platform, fast and packed with features, Okular allows you to read PDF documents, comics and EPub books, browse images, visualize Markdown documents, and much more.

Okular

Redact

Use Okular (or similar) to add annotations that cover up the parts of the PDF that you want to redact (i.e. passwords, socials, etc)

@sahal
sahal / Generate Anki Decks for CLEP Biology Essentials Exambusters Flash Cards.md
Last active December 30, 2023 03:02
Generate Anki Decks for CLEP Biology Essentials Exambusters Flash Cards

Note

I'm not including the original epub or the resultant Anki deck as I'm sure its still copyrighted. I'm sure you can find what you need elsewhere.

1. Use Calibre to convert the epub to pdf

See https://manual.calibre-ebook.com/en/conversion.html

2. Rename the file to make it easier to work with on the CLI

@sahal
sahal / netctl wifi restart script.md
Last active December 30, 2023 03:02
netctl wifi restart script

restart-wifi.sh

I use this script because netctl is kinda annoying to use otherwise.

Change Wifi Device state

I've been turning off my wifi device using ip as follows:

@sahal
sahal / youtube-dl-options.md
Last active July 17, 2023 21:27
youtube dl options

youtube-dl options

How to use an external downloader aria2c rather than internal http client. See also: ytdl-org/youtube-dl#6923

This seemed to work at the following commit hash. YMMV.

$ git remote show origin
* remote origin
 Fetch URL: git@github.com:ytdl-org/youtube-dl.git
@sahal
sahal / mycolorscheme.vim
Created July 27, 2022 19:02
mycolorscheme.vim
" ~/.vim/colors/mycolorscheme.vim
" https://stackoverflow.com/questions/2019281/load-different-colorscheme-when-using-vimdiff
highlight DiffAdd cterm=bold ctermfg=10 ctermbg=17 gui=none guifg=bg guibg=Red
highlight DiffDelete cterm=bold ctermfg=10 ctermbg=17 gui=none guifg=bg guibg=Red
highlight DiffChange cterm=bold ctermfg=10 ctermbg=17 gui=none guifg=bg guibg=Red
highlight DiffText cterm=bold ctermfg=10 ctermbg=88 gui=none guifg=bg guibg=Red
@sahal
sahal / update-branch-name.sh
Created July 27, 2022 18:59
Github suggestion when you rename a branch
git branch -m master main
git fetch origin
git branch -u origin/main main
git remote set-head origin -a
@sahal
sahal / README.md
Created July 14, 2022 23:16
concatonate (merge) mp4s using ffmpeg

Get a list of files

  • Assuming the files have some sort of number indicating their order in their filename.
find $(pwd) -maxdepth 1 -type f -name "*.mp4" | xargs -I "{}" echo file \'"{}"\' | sort | tee output.txt

FFmpeg