December 19, 2021

[Note] HEIC

Environment: Ubuntu 20

Issue:

Photos from iPhone->Google Photo->Download saves as .HEIC, can't view on Linux.

Solution:

$ sudo apt install heif-gdk-pixbuf

$ sudo apt install libheif-examples

$ heif-convert -q 90 [HEIC file] [filename.jpg]

December 12, 2021

[Note] Ubuntu VirtualBox + VirtualBox Extension Pack

Environment:

Ubuntu 20.04, VirtualBox 6.1.30 r148432

VBox was updated multiple times.

 

Problem:

sudo apt install fails to install VBox Extension Pack 

 

$ sudo apt install virtualbox-ext-pack

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  virtualbox-ext-pack
0 upgraded, 1 newly installed, 0 to remove and 3 not upgraded.
Need to get 10.6 kB of archives.
After this operation, 142 kB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu focal-updates/multiverse amd64 virtualbox-ext-pack all 6.1.26-2~ubuntu1.20.04.1 [10.6 kB]
 

...omit....

Progress state: NS_ERROR_FAILURE
VBoxManage: error: Failed to install "/usr/share/virtualbox-ext-pack/Oracle_VM_VirtualBox_Extension_Pack-6.1.26.vbox-extpack"
VBoxManage: error: VBoxExtPackRegister returned VERR_VERSION_MISMATCH, pReg=0000000000000000 ErrInfo='Helper version mismatch - expected 0x3 got 0x30000'
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component ExtPackManagerWrap, interface IExtPackManager
VBoxManage: error: Context: "RTEXITCODE handleExtPack(Ha
ndlerArg*)" at line 1424 of file VBoxManageMisc.cpp
Installation error: License key incorrect or unknown problem during installation.
dpkg: error processing package virtualbox-ext-pack (--configure):
 installed virtualbox-ext-pack package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 virtualbox-ext-pack
E: Sub-process /usr/bin/dpkg returned an error code (1)


Fix:

  1. Make sure all VMs are closed.
  2. Open http://download.virtualbox.org/virtualbox/6.1.30/
  3. (firefox was used) Click on Oracle_VM_VirtualBox_Extension_Pack-6.1.30.vbox-extpack
  4. It'll ask to open with Oracle VM VirtualBox - click Ok.
  5. Check: open VBox Manager -> File -> Preferences -> Extensions





[Note] HWP 1.51 file conversion

Converting HWP 1.51 file to UTF8

1. Save as new (@V), select ASCII - KS

2. From Linux,  

$ iconv -f uhc -t utf8 KS2.TXT > /tmp/out.txt

Note

  • hwp2txt v3 produces zero byte file
  • hwp2txt v1.2 converts to some unknown encoding (chardet couldn't detect)
  • enca can't detect
  • used chardet to detect the encoding uhc (EUC-KR).

 

To-do

send key events from Linux to DOSBox to automate saving in KS-ASCII encoding, or find correct hwp2txt version.


 

December 11, 2021

[Bookmark] SDR air traffic signal (video in Korean)

[NOTE] log4j security issue


Issue

https://nvd.nist.gov/vuln/detail/CVE-2021-44228

Apache Log4j2 <=2.14.1 JNDI features used in configuration, log messages, and parameters do not protect against attacker controlled LDAP and other JNDI related endpoints. An attacker who can control log messages or log message parameters can execute arbitrary code loaded from LDAP servers when message lookup substitution is enabled. From log4j 2.15.0, this behavior has been disabled by default. In previous releases (>2.10) this behavior can be mitigated by setting system property "log4j2.formatMsgNoLookups" to “true” or by removing the JndiLookup class from the classpath (example: zip -q -d log4j-core-*.jar org/apache/logging/log4j/core/lookup/JndiLookup.class). Java 8u121 (see https://www.oracle.com/java/technologies/javase/8u121-relnotes.html) protects against remote code execution by defaulting "com.sun.jndi.rmi.object.trustURLCodebase" and "com.sun.jndi.cosnaming.object.trustURLCodebase" to "false".

Remedy - for now, see https://www.darkreading.com/dr-tech/what-to-do-while-waiting-for-the-log4ju-updates


News


Reference



October 17, 2021

[Note] New Keyboard and mouse - Linux middle mouse button emulation

This is a note on new keyboard and mouse I bought recently for my Linux desktop due to aging keyboard and mouse.

I've been using MS keyboard/mouse for many years (https://www.amazon.com/gp/product/B00CYX54C0/):



Pros:

  • Most of key layout is great
  • Ergonomic
  • Perfect keyboard height and feeling of typing, quiet.

Cons: 

  • Small function keys
  • Strange layout of Insert/Del/Pg up-dn/Home/End keys.

I never got used to the mentioned keys as cons, and due to that, I always have to look at the keyboard for them.

Mouse is great, however, I like trackball for my wrist and shoulder over mouse, giving less stress on them.

 

I prefer keyboard with: 

  • normal size keys and layout for the mentioned keys.
  • non-bluetooth, wireless
  • no number keypad

These are what I bought:


Pros: It's the old standard style keyboard - I can do touch type for function keys and insert/del/home/pg up-dn keys easily.  

Cons: The key height is little too tall -- I like laptop like keyboard height and feeling better.

These days, many OS/apps use much less of function keys, but it's great for IDEs and customize them to do whatever the user needs are.


 
Everything is great, except that the location of buttons are a bit awkward, especially for the 2nd button.  It's too light, and can be pushed when clicking on buttons.  No 3rd button (middle button).

 
* * * * *
 

Note: emulating 3rd button

 

# Find device number
xinput list
# Inspect device properties
xinput list-props 9
# Turn on the emulator for middle button
sudo xinput set-prop 9 "libinput Middle Emulation Enabled" 1

This setting can be in ~/.xstartup.  
 
Here are other ways that I haven't tried:

[1] Modify xorg.conf
Section "InputDevice"
        Identifier      "Configured Mouse"
        Driver          "mouse"
        Option          "CorePointer"
        Option          "Device"                "/dev/input/mice"
        Option          "Protocol"              "ImPS/2"
        Option          "Emulate3Buttons"       "true"
EndSection

[2] add in xorg.conf.d directory
Section "InputClass"
   Identifier "middle button"
   MatchIsPointer "on"
   MatchDriver "libinput"
   Option "MiddleEmulation" "on"
EndSection


xorg.conf file doesn't exist and xorg.conf.d is at /usr/share/X11/xorg.conf.d/ for my Ubuntu 20.01.





 

June 29, 2021

[Note] Converting Audible books to MP3 (legally)

GOAL

Audible runs on most of devices and via web browser.  Still some odd devices only support MP3.  This note is to convert Audible files you *own* to mp3 to listen to them on those odd devices.

 

REQUIRED S/W

Linux (Ubuntu 20), console, Chrome browser, Chrome driver

Optional: bash, ffmpeg, mid3v2


OVERVIEW

  1. Download Audible files from Audible site using your ID, PW.  The files are .aax format.
  2. Using an open source project, get "activation code" with your ID/PW.
  3. Using another open source project, convert AAX to MP3 with the activation code.

NOTE

  • When .aax is converted to mp3, the converter split them to multiple mp3 files, cover.jpg, and play list (.m3u).
  •  Optional S/W and steps are needed to do: merge all the mp3 into one mp3 file with cover image embedded.

STEPS

[1] Log onto Audible.com, click on 'Library' at the top.  Click on Download button.

[2] Get activation code

  1. $ git clone https://github.com/inAudible-NG/audible-activator.git
  2. Check your Chrome browser version
  3. Download an appropriate chrome driver version, https://chromedriver.storage.googleapis.com/index.html
  4. Unzip the download file.  Find and copy chromedriver executable into directory audible-activator
  5. cd audible-activator
  6. ./audible-activator.py -l us
    This will ask Amazon ID/PW.  Then it will give Player ID and activation_bytes:

$ ./audible-activator.py -l us
Username: [email protected]
Password:
[*] Player ID is SOME_PLAYER_ID

ATTENTION: Now you may have to enter a one-time password manually. Once you are done, press enter to continue...
activation_bytes: SOME_CODE

SOME_CODE is what you need for the next step, converting to MP3.

[3] Convert AAX to MP3

$ git clone https://github.com/KrumpetPirate/AAXtoMP3.git
$ cd AAXtoMP3
$ ./AAXtoMP3 --authcode SOME_CODE AUDIO_BOOK.AAX

It will create directory Audiobook/[AUTHOR]/[BOOK TITLE]/, and place .mp3, cover.jpg, play list file - .m3u files.

OPTIONAL STEPS

As mentioned, above step will create multiple mp3 files.  For some odd devices, you'd want to have only 1 mp3 file per book, and cover image embedded.

  • To merge mp3 files into one, use ffmpeg.
  • To add conver.jpg to the mp3, use mid3v2.  To obtain the s/w, do
    $ sudo apt install python3-mutagen

Sample Usage

Create a text file mp3list.lst, containing:

file '/path/to/file1.mp3'
file '/path/to/file2.mp3'
file '/path/to/file3.mp3'

$ ffmpeg -f concat -safe 0 -i mp3list.lst -metadata artist="$author" -metadata title="$book" -c copy $path/merged.mp3

Adding cover image:

$ mid3v2 -p cover.jpg merged.mp3

With a lot of AAX files, merging and adding cover image steps are tedious.  Here is a script I wrote to automate it (https://gist.github.com/keithkim/7c9ac8b7cd291bbcdb1a61ad29691048).  Save in Audiobook directory and run it from there:


 

REFERENCE