VirtualBox Start

In KDE, when a Virtualbox virtual machine is turned on, sometimes, both the guest OS and the host OS would capture the Super key at the same time. In order to avoid that, use the following steps:

1. Right-click the VirtualBox title bar

2. Choose:

More Actions
\to Special Window Settings
\to Ignore Global Shortcuts (in Appearance and Fixes)
\to Force \to Yes

— Me@2023-05-17 07:52:55 PM

.

.

2023.05.19 Friday (c) All rights reserved by ACHK

MangoHud

A Vulkan and OpenGL overlay for monitoring FPS, temperatures, CPU/GPU load and more.

.

.

vram
ram
swap
gpu_temp
cpu_temp
gpu_power
cpu_power

.

.

— Me@2023-03-07 09:14:51 AM

.

.

2023.03.07 Tuesday (c) All rights reserved by ACHK

Zsh, 2

To install the Z shell (Zsh):


1. Read my blog post “Zsh” to follow the instructions point 1 and point 2.


2. In the Bash terminal, run

zsh 

once, in order to get the config file generated.


3. Return to my blog post “Zsh” to follow the remaining steps.


— Me@2023-01-19 12:41:56 PM

— Me@2023-02-24 05:19:38 PM

.

.

2023.02.24 Friday (c) All rights reserved by ACHK

G40-70

If you are using SSD, you should turn off the swap file:

1. In command line, run

swapoff --all

2. Backup the file

/etc/fstab

3. Then, in that file, comment out any lines that contain the word “swap”.

— Me@2023-02-14 05:00:26 PM

.

.

2023.02.15 Wednesday (c) All rights reserved by ACHK

KDE Chinese, 2

After installing Chinese Input in KDE, I found that in Emacs, I did not have the font regular script (楷書).

To install and activate the font, in the Bash terminal, run this command:

sudo apt-get install fonts-arphic-ukai

— Me@2023.01.22 05:42:57 PM

.

.

2023.01.31 Tuesday (c) All rights reserved by ACHK

FF7R

Crucial MX500 1TB 3D NAND SATA SSD

.

Final Fantasy 7 Remake Steam version testing result:

1. With GTX 1050 Ti as the GPU, the bottleneck is the GPU, not the CPU, even though my CPU itself was weak.

2. However, once the GPU got upgraded, the CPU became the bottleneck.

The following settings can make the game smoother:

3. Set the Texture to Low. However, I do not recommend that.

4. Set the Shadow to Low.

5. Set the number of background people to be zero.

6. Set the resolution to 720p.

.

The following are the less obvious steps to release some CPU pressure:

7. Turn Steam into offline mode.

8. Turn off as many as other programs as possible.

9. In the controller setting, change the controller from the default “XInput” to “XBox 360“. However, I do not recommend that because that would disable the game’s rumble function.

.

After these settings, the game should be able to load Cloud’s headache memory cinematic scenes.

— Me@2023-01-11 12:39:59 AM

.

10. If not, start to repeat pressing the pause button every one second when a scene starts to load.

— Me@2023.01.23 05:17:38 PM

.

.

2023.01.24 Tuesday (c) All rights reserved by ACHK

KDE Chinese

This post is about how to enable Traditional Chinese keyboard in KDE Plasma desktop in Ubuntu 22.10.

1. In the Bash terminal, get the Cangjie input method (倉頡輸入法) by the following command:

sudo apt-get install ibus-cangjie

2. Then, get also the the following packages

sudo apt-get install \
ibus-data \
ibus-gtk \
ibus-gtk3 \
ibus-gtk4 \
ibus-table-cangjie3 \
ibus-table-cangjie5 \
ibus-table-cantonese \
ibus-table-quick-classic \
python3-ibus-1.0

3. Log out KDE and then log in again.

4. In KDE, open the application IBus Preferences. Add the language Chinese.

5. Select Cangjie3.

6. Change the language switch hotkey from Super-Space to Ctrl-Space.

7. Then in any text editor, press Ctrl-Space to switch input language.

— Me@2023-01-01 11:52:09 AM

.

.

2023.01.07 Saturday (c) All rights reserved by ACHK

Zsh

To install Z shell (Zsh):

1. In the Bash terminal, get zsh by the following command:

sudo apt-get install zsh

2. Then, apt-get also the following 3 packages:

sudo apt-get install zsh-syntax-highlighting

sudo apt-get install zsh-autosuggestions

sudo apt-get install zsh-theme-powerlevel9k

.

3. Read my blog post “Haskell mode“.

Follow the instructions point 0 and point 1 to install the Nix package manager.

.

4. Then, use the Nix package manager to install the Powerlevel10k theme.

nix-env -iA nixpkgs.zsh-powerlevel10k

5. Also, install the Meslo Nerd Font.

nix-env -iA nixpkgs.meslo-lgs-nf

The font would be located at

~/.nix-profile/share/fonts/truetype/

6. Use, for example, the KDE Plasma Font Management program to install the font.

.

7. Open the text file

~/.zshrc

Add the following 3 lines onto it:

source /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh

source /usr/share/zsh-autosuggestions/zsh-autosuggestions.zsh

source ~/.nix-profile/share/zsh-powerlevel10k/powerlevel10k.zsh-theme

8. Run the command

chsh --shell /usr/bin/zsh

9. Reboot the computer.

.

— Me@2022-12-21 01:29:17 PM

— Me@2023-01-05 10:43:10 PM

.

.

2023.01.06 Friday (c) All rights reserved by ACHK

Haskell mode

The goal of this blog post is to install an advanced Haskell mode, called LSP mode, for Emacs.

0. In this tutorial, you will need to go to the official website of NixOS and that of MELPA (Milkypostman’s Emacs Lisp Package Archive). Make sure that both websites are the real official ones. Any instructions from an imposter website can get your machine infected with malware.

1. Assuming your computer OS is Ubuntu 20.04 or above, go to the NixOS official website. Follow the instructions to install the Nix package manager (not the NixOS) onto your OS. Choose the “single-user installation” method.

2. On the NixOS official website, click the magnifying glass at the top right corner to reach the package search engine.

3. Search “haskell language server” and then copy its installation command.

nix-env -iA nixpkgs.haskell-language-server

4. Run the command in the bash terminal to install the Haskell Language Server.

.

5. Search “stack” on the package search engine.

6. Run its installation command

nix-env -iA nixpkgs.stack

to install the Haskell Tool Stack.

7. Search “ghc” on the package search engine.

8. Run its installation command

nix-env -iA nixpkgs.ghc

to install the Glasgow Haskell Compiler.

.

9. Reboot your computer.

This step is needed for triggering the OS to recognize the Nix package manager setup.

.

10. Go to MELPA package manager’s official website. Follow the instructions to install “Melpa”, not “Melpa Stable”.

11. Open the Emacs editor. Click "Options" and then "Manage Emacs Packages".

Install the following packages. For each of them, make sure that you have chosen the source archive as “melpa“. Versions from other sources would not work.

company Modular text completion framework
flycheck On-the-fly syntax checking
lsp-haskell Haskell support for lsp-mode
lsp-mode LSP mode
lsp-ui UI modules for lsp-mode

12. Open Emacs’ initialization file, which has the filename

.emacs

Its location should be

~/.emacs

13. Add the following code to the file.

;;;;;;;;;;;;;;;;;;;;;;;;;;

(require 'company)

(require 'flycheck)

(require 'lsp-ui) 

;;;;;;;;;;;;;;;;;;;;;;;;;;

(require 'lsp)

(add-hook 'haskell-mode-hook #'lsp)

(add-hook 'haskell-literate-mode-hook #'lsp)

(save-place-mode 1)

;;;;;;;;;;;;;;;;;;;;;;;;;;

(defun haskell-and-go-back ()

  (interactive)
  
  (haskell-process-load-file)
  
  (windmove-up))

(global-set-key 
            (kbd "C-n") 
            'haskell-and-go-back)

;;;;;;;;;;;;;;;;;;;;;;;;;;

14. Close the Emacs program.

.

15. Create a dummy Haskell source code file named “test.hs”.

16. Use Emacs to open it.

17. You should see this message:

18. Select one of the first 3 answers. Then you can start to do the Haskell source code editing.

19. To compile your code, hold the Ctrl key and press n.

Ctrl+n

— Me@2022-08-18 05:22:02 PM

.

.

2022.08.20 Saturday (c) All rights reserved by ACHK