Wine tips


To play Windows games on Linux, Wine is necessary. Even Steam Proton is also based on Wine.

To play most modern Windows games, I will suggest NVidia graphic card as the hardware requirement. Without good graphic card, a lot of 3D games are not able to render properly. Moreover, some pixelated games perform better with NVidia graphic card.

Winetricks

In my opinion, to configure Wine to the best compatibility, we need to install several libraries (DLLs) using winetricks.

  • dxvk
  • d9vk

Then it is able to use Vulkan for DirectX 9, 10, and 11. For more details about dxvk and Vulkan installation, can read here and here.

Media Foundation

Recently, I found that some games require Media Foundation for playing movie. Though winetricks can install Media Foundation, it doesn’t work. A more promising solution is mf-install.

Heat and laptop fan issue

I also experienced that, quite a lot of games cause my laptop to produce loud fan, due to the heat. I prefer performance rather than good graphics. At the end, I found that, libstrangle is able to solve the problem. I use 25 FPS for most of the games.

CJK support

Just in case you need to render some CJK fonts, can try to import this registry file using regedit, then run the wine with LANG environment variable. However, this solution only works on the Window user interface like menu items.

For some games that render CJK fonts, may need to install the font and also fontconfig.

Emulate virtual desktop

I experienced that, Alt-Tab causes the game not functioning. To solve this issue, emulate virtual desktop is the best solution. This can be done by using winecfg. Alternatively, we can run

wine explorer /desktop=wine,1024x768 explorer

“explorer /desktop=wine,1024×768” will run the application with the emulated virtual desktop. By this, we need not to use winecfg to configure the virtual desktop.

Use different Wine prefix for different usage

To understand Wine prefix, read here. I personally uses this script to manage Wine prefix. Because some installations require to run Wine as Windows XP, but the game can only run with Wine as Windows 7 and above. Keep changing the version with winecfg is inconvenient.

Besides that, some games may require dotnet4x installed. Yet dotnet may break other games in the same prefix.

Use Proton as an alternative

Some of the games may have poor performance on Wine. In that case, can try on Proton. I have wrote a script to make the Proton invocation easier.

But my personal experience is that, Proton doesn’t have good support on joystick/gamepad as Wine.

Note: Proton version 5.x has an issue that I have reported here.

Other libraries

Not only Wine libraries affect the games, Linux libraries are also important to make the games work, for instance, Vulkan. This wiki page suggested several libraries as well.

Compatibility databases

I found that ProtonDB is a good place to find whether a game is compatible to Proton. And some users also shared the solutions on how to make the games work.

Alternatively, Wine official application database also provides some details on game configuration.

Offline mode

Just in case we prefer to run certain apps without Internet connection, we can use firejail. Eg, firejail --noprofile --net=none wine explorer.

Solution on Evernote login issue


I faced the login issue with Evernote since around two weeks ago. It leads me to a blank page, with the HTTP status code 418. There is similar issue reported here. I made the bug report, but the issue not yet solved. Looks like it happened in Malaysia and Vietnam according to the forum. Suggested solution in the forum was to use VPN.

This is how I solved the issue as a temporary solution to login.

Requirement:

  • Google account
  • Tor browser or any VPN related connection

Try to login successfully from the web, by luck or by Tor browser or any VPN related connection.

After login, go to Settings > Connected Services, and enable “Sign in with Google (Sign in to Evernote with 1 click)”.

By enabling the above, I can just sign in with my Google account, which skips the status code 418 issue.

Med (Linux memory editor) version 3.6.1


I released version 3.6.1 for my hobby project, Med (Linux Memory Editor). There are several great changes in UI (since 3.5), especially the larger window, due to more components in the UI.

Named scans

Now it supports named scans (the bottom part of the window).

New UI

I create this named scans feature because sometimes I need to scan for several values of interested. For example, a game character A’s experience point and character B’s experience point. By using named scans, I can scan these two values without destroying the scan result of each others. This makes my (game cheating) life become much easy.

Improved memory editing

Memory edit

Memory editing is now improved with preview the values in int32, float32, and float64 (double as in C/C++). This is useful for me to discover the pattern surrounding the game character status. For example, there is a game I played, the character has non-rounded float32. This causes me failed to search the values for various trial. Lastly I found the address by scan unknown. By using these three values preview, I can discover the values easier without doing actual scanning.

Furthermore, memory editing now supports “entering” the value according to the scan type (the Enter button). In the versions prior to 3.6, memory editing can only directly edit the hexadecimal. This is troublesome to edit the float values. Previously, I have to create a new memory address in the stored list, then edit the value. But now, I can update the values directly.

Besides that, in the memory editing, it supports “string” scan type, for entering the string directly.
WARNING: Longer string may cause the memory overflow.
NOTE: Entering string is not null-terminated. Add the null (0) value at the end if necessary.

Lastly, I fixed the cursor in the memory editing (hexadecimal area).

Med: Experimental feature


I just tested with my new experimental feature for Med (Linux Memory Editor) on Sea Dogs, i.e. Custom Scan.

Sea Dogs is very difficult to do memory editing, as the values are stored in string. Luckily someone wrote a superb guide on how to do memory editing, which can be found here.

But the problem is that, the guide is written for CE (Cheat Engine). Unfortunately, CE is for either Windows or Mac. And to cheat in Sea Dogs, need to use “Group Search” feature of CE. WTF is Group Search?

After some studies from here, finally I wrote similar feature on Med. The related source code can be found here (not yet merge into master branch). I use similar syntax as CE’s Group Search.

s:'6', w:87, s:'5', w:31, s:'5', w:151, s:'6', w:31, s:'7', w:159, s:'7', w:199, s:'6'

The current code in Med uses block alignment 8, which cannot be changed, since I am doing experiment. Different from CE, I use comma separation instead of space separation. The s is string, follows by single quotes, w is wildcard. So far I only wrote the code for s and w. Nothing else.

Yeah! Now I can play the protagonist as superman.

Brave and Chromium


I have switched my primary web browser to Brave. But also found that Chromium (or any alternative web browser) is necessary. Since I am a software developer, sometimes need to implement ads related feature. Brave will block ads by default. That’s why I need an alternative web browser that I can freely to turn off the adblock. Though I can turn off the adblock in Brave, it will affect my browsing experience. As a result, using an alternative web browser for development on ads related feature is necessary.

Brave or Chromium


I am in dilemma of choosing Brave or Chromium as my default browser.

The following is my comparison,

ChromiumBrave
Arch Linux official repoYes, in ExtraAUR
SyncSync a lot of things, including tabs, history, compatible to Google ChromeSync bookmark only
AdBlockRequire extension, such as uBlock OriginBuilt-in adblock, but leads to difficulty to customize blocking certain HTML elements.
Adblock also breaks some anti-adblock sites.
But adblock works on mobile version on both Android and iPhone
StartFast startSlower than Chromium, because it runs pacman (Arch Linux package manager) to check pepper-flash.
PrivacyNothing specialBuilt-in Tor feature for private browsing with Tor

I am still continue using Brave, because I prefer Brave over Firefox on Android. In order to conform with Brave on Android, I choose Brave on desktop.

Besides that, Brave has built-in Tor. Alternatively, we can use Tor Browser (based on Firefox), which means I need to use two browsers: Firefox and Tor Browser.

Microsoft To Do


In my previous post, I mentioned I migrated Wunderlist to Microsoft To Do.

However, there are two annoying things. Firstly, do not expect there will be Chrome App version of Microsoft To Do similar to Wunderlist and Google Keep, because Chrome Apps is going to be discontinued.

Secondly, I frequently experienced To Do web page doesn’t load properly, either stuck at the loading page, or the tasks not showing or showing partially.

In order to resolve the second issue, I need to test the page with incognito mode, to make sure the page works fine. Then in normal browsing, I need to remove the HTTP cookies for to-do.live.com, live.com, microsoft.com, and any cookies used by the page. Lastly, re-login to To Do.

Brave browser


I wrote a post about Brave recently, and found that Brave browser is interesting. So, I am switching to Brave from Chromium for a trial.

A brief introduction about Brave: Brave is developed by Brave Software, which is founded by Brendan Eich, creator of JavaScript and former CEO of Mozilla Corporation. Firefox is the product of Mozilla Corporation. However, Brave is built on Chromium, the open source project for Google Chrome. So, I personally perceive Brave as the Chromium with the soul of Firefox. That is why, it makes Brave different from Chromium and Firefox.

Why not Firefox?

Actually I was trying to switch from Chromium to Firefox before. However, Firefox doesn’t fit my needs. Since I am doing web development, sometimes the web browser will be crashed. Firefox crashes more frequent than Chromium. The worst is, Firefox crashing will cause systemd core dump and the computer slow down, until I do hard reboot on the computer. That is very bad development experience.

Besides that, Firefox rendering engine is different from Chromium. Most of the web developers I know are using Chrome. If I am using different web browser, the CSS styling may be varied. It will be difficult to do testing and review.

Bookmark sync

Bookmark sync is one of my main requirement to choose a web browser. Chromium and Firefox both support bookmark sync, with the requirement to create user account.

Brave is a little different, it doesn’t require any account created, but it can sync between desktop version and mobile version.

Please take note that, Brave desktop disabled the Sync feature by default. This can be enabled by going to brave://flags, then enable “Enable Brave Sync”.

Besides that, we can doing copy-paste for the bookmark folders from Chromium to Brave easily. Need not to export and import.

Side note: Workspace (personal method)

Since I am migrating from Chromium to Brave, I also discover a method to manage my workspace.

Most of my works require Slack as the communication channel, so does other communication applications like Skype, GMail, Google Calendar, etc. These web apps need to open during working hours.

I was using All-in-One Messenger long time ago. However it focuses on messengers only.

Then one of my project managers mentioned Shift. It has similar interface like Slack App. But I didn’t try any of them. I used alternative app, namely Franz. After some time of using Franz, the app limits to three services only, meaning I can maximum run three services at the same time, such as one GMail, one Slack, one Google Calendar, no extra.

After Franz, I found the other alternative, that’s Rambox. It is very good solution so far.

The rationale that I use different app for the communications is to decentralize the usage of single web browser for all tasks. Let’s say the web browser crashes, the communication app can still work.

However, I plan to centralize every task in Brave, in order to try out the potentiality. In order to make a working environment similar to Rambox or Franz, this is what I am doing:

  1. Create a bookmark folder, eg: Workspace
  2. Create all the bookmarks for my working web app in the folder
  3. Whenever I work, just right-click and open all bookmarks in the folder in New Window
  4. Practise that the New Window is for communication only, don’t open new tab for browsing or development.

By doing the above, Rambox will be unnecessary.

Lenovo Legion Y7000


In my previous blog, I mentioned I changed a new laptop. My older faulty laptop is Dell Vostro 5459, which was four years old. My current laptop is Lenovo Legion Y7000 2019 PG0 model 81T0, which as higher spec than the old one. Besides that, I added another 1T HDD, just in case I may doing machine learning study, or my work requires large disk space.

Note: All the instructions should follow official Arch Linux Wiki. The followings are only based on my experience of this installation.

Installation preparation

Since I have an extra HDD and plan for dual boot, I preserve the Windows in the SSD. Therefore in Windows, firstly disable Fast Boot, and secondly allow UTC time.

After this, I disable the Secure Boot through BIOS.

Since my primary OS is Arch Linux, I usually prepare two Live USBs, Arch Linux and SystemRescueCD. I just found that the recent SystemRescueCD is built based on Arch Linux.

SystemRescueCD is useful especially doing partitioning, shrinking/growing partition, and moving partitions, using GUI. Command-line like cfdisk and cgdisk can do partitioning, but moving partitions will be less intuitive comparing to GUI.

However, I failed to run SystemRescueCD with Xorg (running startx) due to graphic driver issue. (Though later, I found that it can be solved by going to BIOS, and change the Graphic Mode to “Switchable”, where the default is “Discrete”.)

As a result, I continued with Arch Linux Live USB. Due to the graphic driver issue, the TTY is not rendered properly. This can be solved by adding nomodeset parameter to the Kernel, by editing the GRUB menu during the boot.

Network

After boot into the Arch Linux installation Live USB, the first thing must solve is the networking. In this modern day, a laptop that cannot connect internet with WiFi is useless. However, the WiFi of Lenovo Legion Y7000 was blocked (plane mode) by default when running in Live USB. This can be solved by rfkill unblock all. Then, I started the network service with netctl.

Partitioning and boot loader

I believe most modern laptop and HDD support GPT. Since I am using command-line interface, cgdisk is sufficient for the partitioning. I created three partitions, for / (root), swap, and /home.

After partitioning and mounting, I installed the Arch through network.

Boot loader is a little troublesome. I chose GRUB. I believe most modern laptop supports EFI. So, I booted into Windows and used Disk Management to find the partition that is used for boot. One of the partitions is EFI.

Then in Arch Linux live media, I installed grub, os-probe, and efibootmgr.

Note: I installed the grub after I have run pacstrap. pacstrap will create /boot directory. So, I renamed it to /boot to /boot~, and create another /boot for GRUB installation.

I mounted the partition to /boot (in arch-chroot environment), then follow the instructions here.

os-probe is useful to allow dual boot to Windows, as it will generate the GRUB menu entry for Windows automatically.

After this, reboot to make sure we can boot into the new installation.

Note: Add nomodeset to the Kernel in the /etc/default/grub if rendering fails.

Network again

After boot into newly installed Arch Linux, I was not able to connect internet, because required packages were not installed. So, I needed to boot to the live media again, with the network connection, install wpa_supplicant, netctl, and dhcpcd. Then at least I can connect to internet with the newly installed Arch Linux.

NVIDIA

After the network, the second big problem is NVIDIA. I choose NVIDIA, because it supports CUDA, as it is important for machine learning, especially deep learning.

I used nvidia-dkms, which I have good experience with this package.

But I faced two main problems. One is the brightness not able to be controlled when running Xorg. The documentation mentioned that this can be solved by adding

option "RegistryDwords" "EnableBrightnessControl=1"

in /etc/X11/xorg.conf or relevant file, under “Device” section “nvidia” driver.

The above solution doesn’t work perfectly. When I boot into LightDM (display manager), sometimes the brightness is 100%, which I cannot reduce the brightness. But sometimes it works fine.

When the brightness is 100%, I need to restart the LightDM, or login and logout (I am using Openbox). Then the brightness is controllable.

The second problem is hibernation. I failed to resume from hibernation. It was a nightmare, as one of my testings failed to boot properly.

I have tried several solution, such as this, and this, and this. None of them work.

I also tried to use linux-lts. But it doesn’t solve the brightness problem, and the WiFi failed to work. So, I give up linux-lts.

And I give up the hibernation as well. It is useful, but I still can work without hibernation.

Note: After successful installation of NVIDIA, we can remove nomodeset from the GRUB entry.

Touchpad

I was using Synaptics. But it is no longer actively updated, and the official documentation suggest to use libinput.

So, I am using libinput now, but it sadly doesn’t support circular scrolling.

f.lux

I was using f.lux for health purpose. However, f.lux package doesn’t work on new laptop with NVIDIA. So, I switch to Redshift. The drawback is that, unlike f.lux GUI, Redshift is not able to change the colour temperature on the fly.

Leftover tasks

After these, I have to migrate a lot of data from my previous computer.

Danshari is necessary, so that not all data need to be migrated.

Family and personal photos (and some videos) are important, as they tell me who I was.

Personal data are important, as they tell me who I am.

Working data are important, as they allow me to continue what I am working with.

Configuration files are important, as I need not to waste my time to setup everything again. Especially Openbox, tint2, Mendeley Desktop, Postman, DBeaver, Emacs, VIM, bash, zsh, SSH, fcitx, fonts (and fontconfig), etc.

Other data files like movies, pictures, music are less important, but valuable. As I need not to collect them again.

Chinese New Year and new laptop


This was a disastrous week. Firstly, internet network cable broken. Secondly, my laptop went wild. Internet network cable broken, I still can online through mobile hotspot. But my laptop, it was catastrophic problem. Because I have a lot of valuable data, and I have to work.

Chinese proverb, 旧的不去,新的不来, but it was damn pressure. Because the old laptop had unpredictable behaviour. The problem was that, the keyboard will trigger some keys unintentionally, especially Alt key. I thought it was software problem, but until I reboot, and saw the GRUB menu cursor moving by itself. Damn! This means, (i) I am not able to work, (ii) I have to spend money to buy new laptop, and (iii) I need to get my data out.

First problem means that, I may not able to earn money during the period, as I am a freelance software engineer. Second problem means that, I need to spend money, with the possibility that I am not able to generate income, and the new laptop may not be Linux compatible. Linux compatibility is important to me, due to the familiarity and the working environment. Third problem means that, I may have possibility loss the data. I have done backup, but not frequent and not all data were backup. Though those data which I didn’t backup were less important, they are still valuable as I spent time on them.

Surely most important data are family photos, personal data, and those work related things. Though we use “git” and commit our source code, setup everything again spends time. Your employer doesn’t pay you to setup, but pay you to work. That is why I felt very pressure.

I prayed, I prayed, and prayed. Luckily keyboard problem was partially solved with USB keyboard, and Linux command “xinput float” can disconnect the built-in keyboard. And the new laptop can be used to work now (since yesterday). Though new laptop has higher hardware specifications than the old one, it is not perfect, as I failed to make it able to hibernate. NVIDIA and Linux combination is sh*t. But I still need NVIDIA, just in case I have to do machine learning with CUDA. So, for the moment, I have to sacrifice hibernation. Also, during the testing when resume from hibernation, it showed a freaking behaviour, I cannot type in the LightDM login. Damn, I cannot bear it if new laptop also broken.

Hopefully this is the end of the accident. I pray that this year will be new as this new powerful laptop.

祸不单行昨夜行,福无双至今日至。祝大家新年快乐。