Qemu/KVM Command Line Notes

The executable kvm is an alias for (symbolic link to) qemu-system-x86_64

KVM is the type 1 hypervisor which can be used by QEMU for speed

-accel kvm is the newer way of saying –enable-kvm

CPU host pass-through for speed

-cpu host

Select boot device (c for HDD, d for cd-rom)

-boot d

Attach IDE optical drive (only one allowed, more needs to me mapped with -drive)

-cdrom {iso file or device file}

SPICE (rdp-like protocol to control virtual machine through IP) recommends qxl video driver

-vga qxl

-spice port={default is 3001},password={cannot start with numbers or it’ll be treated as boolean as it’d be interpreted as numeric}

Base HDD/SSD drive: discard=unmap means TRIM for SSD, can add it as a virtio device for speed ONLY AFTER the guest virtio drivers are installed:

-drive file={VHD or drive image file},discard=unmap[,if=virtio]

Speedup by skipping precision clock catchup (HPET)


Use base=localtime to correct for Linux and Window’s difference in interpreting host RTC’s timezone (Linux assumes that hardware time is UTC+0 while Windows assumed it’s your local time)

-rtc base=localtime,clock=host

 13 total views

Ubuntu Cinnamon Remix notes

Fix annoying bash colors

Folders (di) color ($LS_COLOR) are dark blue by default which is hard to read on a default dark background (also default): edit ~/.bashrc and add this to the last line to change folder colors to change it to bold (1) light blue (94)

LS_COLORS=$LS_COLORS:'di=1;94:' ; export LS_COLORS

The default prompt ($PS1) also contains the directory (\w), which is also in dark blue (34) but bold (1) by default. Look for the line right below the $color_prompt flag section and change the color ([\033[<STYLE>;<COLOR>m]) modified before \w from bold dark blue (01;34) to bold light blue (01;94)

if [ "$color_prompt" = yes ]; then 
    PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;94m\]\w\[\033[00m\]\$ '

 13 total views

Cinnamon Desktop UI design WTFs (1)

Out of the box, Cinnamon decides to group the taskbar buttons like later Windows did. It’s often a huge annoyance to people who hates context switching in our head (I like huge workspaces that I can see everything at once so I don’t overlook clues from the relationship between things I’m working on. This is how I find difficult twists in research problems that other people give up solving).

In Windows, you right clock the taskbar, get to settings and there’s a pulldown menu for you to decide whether and how the buttons are grouped. Easy. But Cinnamon still have the Linux smell: organize things that are logical to programmers but not users (Tektronix, DD-WRT, etc. does that too), then surprise users with poorly thought out default behavior.

This time it’s a can of worms that requires some web searching to find people with the same exact specific problem (it’s a sign of poor UI design if the users cannot guess from the UI how to do what they want).

  1. Needing to change whether buttons are grouped is common. It should not take a lot of steps to change the behavior, preferably a right click context menu
  1. I would have thought it’s under Panel Settings, but hell no, things has to be organized the way the code was designed (sarcasm). It turns out that the windows button grouping is handled by an Applet called “Grouped Window List”
  1. Some user suggested removing the applet altogether (turns out it’s wrong and unnecessary as turning it off will disable the taskbar altogether and there’s an option to disable it within the applet’s setting: the applet itself is the windows list, not just the grouping feature), but fuck by default the applet was not activated the settings button is dead. I have to go to the bottom navigation bar in the window and hit the ‘+’ sign to get to the settings so now there’s a check mark next to it and the setting (gear) button is now activated.

    They also did not dim the settings button (two gears) when the ‘grouped window list’ is not activated (bug?), which made me think I can configure an Applet that’s not in use. Not to mention the previous settings got cleared (reset) if I disable the Applet and re-enable immediately afterwards (bug?)!
  1. Now I can finally get to turn this shit off
Chris Rock’s #HNTGYAKBTP Step #4 (1. OTL, 2. UCS, 3. SI, 4. TTSO, 5. BP, 6. STFU, 7. GAWF, 8. DRWAMW)
  1. This is where I think the UI design’s really fucked up. After you activate/deactivate the “Grouped windows list” applet, the buttons aligned right instead of left (default)! WTF!?! Do not do shit to surprise users! There’s absolutely no freaking logical reason why the taskbar button alignment should change the default (or the current state) for any reason!
  2. To fix this, you have to so something similar to unlocking the taskbar in Microsoft Windows to move the task button bar. It’s easy in MS Windows as you just right click context menu on the taskbar to unlock and just drag the starting separator (the || bar on the leftmost where the taskbar starts) to specific position you wanted. In Linux/Cinnamon, you have to enter the ‘Panel Edit Mode’ to unlock the taskbar so you can drag things around:
  1. I was confused while dragging the task button bar because there’s no clear position markers of where the task button starts and where it can ‘snap to grid’. It’s easy to drop it to the center to align center, but to align left, you have to watch for the buttons you want to insert before to move around to tell if it was a valid place to drop your new taskbar position What a pain in the butt!

This UI design suck, and I can totally understand why they would do something like this because of my programming background. It’s very logical for the programmer to modularize it as one applet, but first of all, generic suffixes like -let and -get does not help users get what the name means: it’s geeks’ way to name abstract concepts without getting the essence of the use case.

In MS Windows, the ‘Applets’ are organized roughly the same as ‘Toolbar’, except Windows is slightly more specialized that they have a ‘Toolbar’, ‘Start Menu’ and ‘Systray’ as distinct concepts instead of abstracting them into a higher level object as in ‘Applets’.

The biggest gripe I have about Cinnamon’s design choices is that detailed position adjustment needs to be easily accessible it’s likely that user preferences may vary a lot.

  • By not having a separate Toolbar concept, they forgot to add direct ‘unlock grouped windows list (aka tasklist toolbar in MS Windows)’ option (context menu item). You have to click through ‘Preference > Configure’ to get to get to configure the ‘Grouped window list’
  • Since the ‘Grouped window list’ is a (container) ‘bar’ within a bigger’ bar’ (Panel), the position of the window taskbar is logically organized under the platform (the bigger bar, hence the Panel), therefore the unlock window taskbar setting belongs to Panel, not Applet. This makes sense to programmers who knows that the feature is conceptually organized as container objects, but this is hell of confusing for users if they have to reason through this when they are trying to do one of the most common things!
  • Unlike MS Windows, you cannot use the task buttons while you are in Panel edit mode. Panel edit mode (you enter a special mode where you drag objects into positions you like, but cannot actually use them, then freeze it after you leave the mode) is the same concept used in Interactive Broker’s Trader Workstation (TWS), which is a pain in the ass but I understand the massive work saved for the people who designs the code/UI. Of course it comes at the expense of user frustration.
  • The solution article was written in 2018 and I’m surprised I still need that in 2022!

 16 total views

Extract installer package with secret command line switches

7-zip do not open the contents of every single self-extracting installer executable. Sometimes you’ll see garbage like this

Here’s a list of the ‘secret’ keys I know to get the core driver files out for slipstream

For a more generic way of capturing temporary files, redirect the temp folder to somewhere with a custom ACL permissions that do not allow deleting:

enter image description here

 15 total views

Thunderbird Quirks

Mail sorts from oldest to newest by default

This design choice escapes me and is highly annoying. Go go Preferences/Settings > Config Editor (the very bottom problem at the page)

It’s called Advanced Preferences tab. Look up mailnews.default_news_sort_order and change the value from 1 (ascending) to 2 (descending)

Thanks PolarSPARC for the clue.

 15 total views

Windows logs every single filename you visited (ShellBag) out of the box!

Basically Windows is making a diary of every single folder/filenames you’ve visited in chronological order. Just learned about something called ShellBag while using NTlite to slipstream Windows. WTF!

Parents can run a scan with ShellBag Analyzer in their family computer and see what their teenager has been up to!

Everybody should first disable this feature by running this registry settings (or manually creating the DWORD entry and set it to 1) which you can download and execute below:

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell]
"BagMRU Size"=dword:00000001

 17 total views

Windows recovery mode repair option disappeared?

Sometimes Windows recovery mode do not have the ‘Startup Repair’ option like this below

I don’t know under what condition it won’t show up (sometimes I plug the system drive to be repaired in a computer, it shows up, at least for Windows 2008 R2), but you can selection Command Prompt (always available) and go to X:\sources\recovery and run startrep.exe to launch the repairing tool.

 15 total views

Are powered USB hub bus-powered?

I’ve bought many powered USB hubs, even the expensive industrial version like Startech, but they never work reliably when I connect multiple devices that draws quite a bit of power. The behavior is the same (erratic when too many power drawing devices are active within one hub) whether I supply the hub with external power or not.

I suspected the USB hubs wasn’t wired in a way that the USB hub controller understands that I want to have the hub self-powered (powered from an external source like a wall wart instead of drawing the 5V from the USB upstream cable). So I opened up my StarTech and it looked like this:

Love that it’s made in Taiwan and they cut no corners in power management.
10 ports means 3 x 4-port hub chained and they do not share power converters.

On the top left corner, there’s a jumper to set the USB hub to use self-powered instead of bus-powered (default out of the box). I switched the jumpers and the board no longer takes power from the upstream bus and the lights won’t light up until I have the local power connected, which confirms it’s working as a self-powered hub.

 14 total views

Patten: Leadership in Beijing they may be thuggish dictators he (Percy Cradock) would say, but they are men of their word, now we know that at least one of the things is correct

Chris Patten, “My main critic when I was the last colonial oppressor (the MPs chuckled) … Percy Cradock, who used to say, …, the leadership in Beijing they may be thuggish dictators he would say, but they are men of their word, now we know that at least one of the things is correct.

 15 total views