Skip to content

Instantly share code, notes, and snippets.

View Fef0's full-sized avatar
:octocat:
Studying

Federico Lombardo Fef0

:octocat:
Studying
View GitHub Profile
@Fef0
Fef0 / wordnet3_infused_kindle_mobi_to_stardict.md
Created September 10, 2022 13:57
Convert a .mobi dictionary (Wordnet3 Infused in this example) to a StarDict .dict file (with it's .ifo)

After a whole day of struggles, I finally managed to convert a wordnet3 infused dictionary (that you can get here: http://eb.lv/) from .mobi format to .dict format (suitable for KOReader).

I tested this process on Arch Linux, so your process might be different from mine.

Step 1

  • Download the KindleUnpack program from here: https://github.com/kevinhendricks/KindleUnpack
  • Extract the .zip
  • Start the GUI with python 2 (IMPORTANT: python3 doesn't work!): python2 KindleUnpack.pyw
  • Select the .mobi file as input and choose your output directory
  • (optional) I don't know if it is necessary, but select ePub Output type: Auto-Detect
@Fef0
Fef0 / gist:c200ada187141753aa6fe5ec89612b4e
Last active September 7, 2020 10:57
Enable all threads when compiling with makepkg
Open /etc/makepkg.conf
Search for "MAKEFLAGS=-jx" and change it to "MAKEFLAGS=-j$(($(nproc)+1))"
@Fef0
Fef0 / fixthinkpaddocked
Created January 9, 2020 16:31
Fix Thinkpad going to sleep when docked and lid is closed using Arch Linux and Systemd
Open /etc/systemd/logind.conf, then uncomment and edit these fields:
```
HandleLidSwitch=ignore
HandleLidSwitchExternalPower=ignore
HandleLidSwitchDocked=ignore
```
@Fef0
Fef0 / gist:abd858b33d6694f33bf343cdab4dc188
Created June 20, 2019 22:54
Linux command for bit depth, bit rate and channel numbers ifno of an audio stream to a specific device
- Get infos about a supported stream of your audio equipment (X is your equipment, Y is the stream number)
cat /proc/asound/X/streamY
- Get infos about the actual stream your audio equipment is using, especially the bit depth, bit rate and channels number (X is your equipment)
cat /proc/asound/X/pcm0p/sub0/hw_params