Sunday, August 6, 2017

Backward slash where are you?

I got a new bluetooth keyboard yesterday, and it is nice.  However, one thing I didn't notice at the time of purchase is it does NOT have a backward slash key.  I only found it out when I try to type an UNC path.

As always, Google came to rescue.  It turns out you can type a backward slash using the ALT GR + # key combo (at least in Windows 10 where I have tried so far!).

Edited 2018-03-17: On Linux, it is ALT GR + - key

Sunday, July 30, 2017

Linux and its schedulers


Personally I don't like the default CFQ scheduler as a heavy IO process can make the whole system sluggish.  For instance, you will find everything non-responsive while copying a large file.

Luckily, there are alternatives.  You can use either NOOP or Deadline instead.

I use Deadline for my system as it is based on fixed length time-slicing.  With this scheduler, IO tasks are queued up for processing.  When it is its turn, it will be run for a fixed duration.  If the task cannot be completed within the time, it will get suspended and put back to the queue for its next run.  As the execution time is fixed, it means no IO task can hog the IO, i.e. the system can apparently be felt like more responsive.

To permanently change the scheduler, you need to modify your /etc/default/grub file by modifying the line below:

GRUB_CMDLINE_LINUX="elevator=noop"
And then run the update-grub2 to apply the change (see https://blog.codeship.com/linux-io-scheduler-tuning/)

You may also change the scheduler if you are running Linux as a virtualized instance.  It seems NOOP scheduler is more suitable, i.e. letting the host IO to worry about IO scheduling.

Friday, April 21, 2017

Mint Linux and HDMI

Recently I have set up a Linux Computer (Mint Linux XFCE 18.1) for playing media contents. The system is connected to my TV using HDMI, and initially everything seems working fine. Then I found it is having sound issue after I had turned my TV off and on again. The system keeps falling back to analog output. After a bit of research on Google, this seems to be a known issue. I took the suggestions from this guide at

https://wiki.archlinux.org/index.php/PulseAudio/Troubleshooting#No_HDMI_sound_output_after_some_time_with_the_monitor_turned_off

I commented out the "load-module module-switch-on-port-available" option in /etc/pulse/default.pa as advised, and this seems fixed my issue.

 ...
### Should be after module-*-restore but before module-*-detect
#load-module module-switch-on-port-available

Tuesday, January 10, 2017

Convert text file encoding with NotepadQQ

I use EAC to extract audio CD into CUE+WAV combo.  EAC uses my system default language for its encoding, and this causes issues when I try to convert tracks on LInux using Flacon.

Most tutorials I have seen are based on command line using iconv, and this isn't something I prefer.  Today I found an GUI alternative.

On Windows, I uses Notepad++ for convert the default encoding to UTF-8 and this works great.  On Linux I uses its equivalence, NotepadQQ.

To convert the encoding, you open the file with NotepadQQ.  Unlike Notepad++, it may have a bit of problem on guessing the encoding.  Fear not, you can pick the encoding manually using the option under

Encoding -> Interpret as ...

Once you can see the file as it should be, you can use the whatever encoding you like using the "Convert to" option under the same menu, e.g.

Encoding -> Convert to UTF8

I found this option more interactive, i.e. I can see if my guessed encoding is correct.  However, if you have  a set of files need to get converted, you may want to take a look at iconv.  However for odd files every now and then, NotepadQQ gets my vote.

Hope this helps.