Wednesday, June 3, 2026

Run macOS in linux docker container

To be able to run macOS in linux docker container to access macOS applications without switch back and forth makes life easy. This project allow you to do that. The instruction given is very tricky, so I have written a step by step how to begin.


0. This is the main project which we will work on. Essentially we need to build an image where the image is not found in dockerhub at the moment.

```

$ git clone  https://github.com/sickcodes/Docker-OSX

$ cd Docker-OSX

$ docker build -t docker-osx:naked -f Dockerfile.naked .

```


1. Start the macOS installer, this will take some times. If clone repository OpenCorePkg is slow , add this `-v "<USERNAME>/macos/OpenCorePkg:/home/arch/OSX-KVM/OpenCorePkg"` to the command below. But make sure you have clone the repository before https://github.com/acidanthera/opencorepkg

```

$ docker run -it \

    --device /dev/kvm \

    -p 50922:10022 \

    -v /tmp/.X11-unix:/tmp/.X11-unix \

    -e "DISPLAY=${DISPLAY:-:0.0}" \

    -e GENERATE_UNIQUE=true \

    -e MASTER_PLIST_URL='https://raw.githubusercontent.com/sickcodes/osx-serial-generator/master/config-custom.plist' \

    -e SHORTNAME=monterey \

    sickcodes/docker-osx:latest    

```


2. In the mean time, get the container id and note the container id

```

$ docker ps

```


3. A qemu screen will appear, click on `macOS Base System`. wait the messages loading is complete.




4. Once at the installer screen is up, then to erase the biggest disk. You can name the disk any name because it is not important. Example `my_macos_vd`.




5. Then reinstall the macOS. Pick the disk that you erase in step 4. This installation will take a long time. Approximately 1hour in my host machine.

6. Inspect the container and get the directory where we will copy out the disk. 
```
$ docker inspect 0a0fdebac3ac | grep Upper
                "UpperDir": "/var/lib/docker/overlay2/11043fba8b6ed2e4ffeaeb8a439d791f03081cd785a9a14e60024dc3e6c4f461/diff",
```

7. Once installation is done, power down the container. 

8. Based on the step 6, the value of `UpperDir`, now copy the `mac_hdd_ng.img` to another directory in your host. Any directory will do. I pick `~/macos/`
```
$ sudo su -
# cd /var/lib/docker/overlay2/11043fba8b6ed2e4ffeaeb8a439d791f03081cd785a9a14e60024dc3e6c4f461/diff
# ls -lh ./home/arch/OSX-KVM/mac_hdd_ng.img
-rw-r--r-- 1 jason jason 37G Jun  2 20:43 ./home/arch/OSX-KVM/mac_hdd_ng.img
# cp ./home/arch/OSX-KVM/mac_hdd_ng.img </home/USERNAME/>/macos/
```

9. Update the file permission to your username correctly. 
```
$ cd ~/macos/
$ sudo chown jason:jason mac_hdd_ng.img
$ chmod 664 mac_hdd_ng.img
```

10. Now start the container using the virtual disk, the local built naked image to finish the OS setup/configuration. It will takes more than 30 minutes to complete at least.

```
docker run -it \
    --device /dev/kvm \
    -p 50922:10022 \
    -v "/home/jason/macos/mac_hdd_ng.img:/image" \
    -v /tmp/.X11-unix:/tmp/.X11-unix \
    -e "DISPLAY=${DISPLAY:-:0.0}" \
    -e MASTER_PLIST_URL=https://raw.githubusercontent.com/sickcodes/Docker-OSX/master/custom/config-nopicker-custom.plist \
    -e SHORTNAME=monterey \
    docker-osx:naked
```  
to speed up the container, add the below parameters to the command above if your host hardware support it.
```
    -m 10g \
    --cpus="8.0" \
    --gpus all \
    --device /dev/nvidia0 \
    --device /dev/nvidia-uvm \
    --device /dev/nvidia-uvm-tools \
    --device /dev/nvidiactl \
```

11. Once started, get the container id again. After the mac os setup/configuration is finish, then stop the container. Note that during this step, OS reboot is expected.

```
$ docker ps
```




12. Now every time to start the container
```
$ docker start <container id from step 11>
```




It is a pity that the macOS after Monterey does not work. If you managed to make it work, I would like to know and please contact me!

Saturday, March 28, 2026

๐Ÿ‡ฒ๐Ÿ‡พ A Simple, Fast EPF Calculator for Malaysians — Built for Everyday Use

 

๐Ÿ‡ฒ๐Ÿ‡พ A Simple, Fast EPF Calculator for Malaysians — Built for Everyday Use

Managing your finances in Malaysia often means keeping track of your EPF (Employees Provident Fund) contributions — whether you’re an employee, employer, or freelancer planning ahead.

That’s exactly why I built this lightweight, no-frills web app:

๐Ÿ‘‰ https://weetech-software.github.io/epf/


๐Ÿ’ก Why This EPF Calculator Exists

Most EPF calculators online tend to be:

  • Overly complex

  • Slow to load

  • Filled with ads or unnecessary steps

I wanted something different:

  • Fast

  • ๐Ÿงผ Clean UI

  • ๐ŸŽฏ Straight to the point

This tool is designed to help you quickly answer questions like:

  • How much EPF will I contribute this month?

  • What is my employer contributing?

  • What’s the total deduction from my salary?


๐Ÿงฎ What the Calculator Does

The calculator lets you:

  • Input your monthly salary

  • Instantly see:

    • Employee EPF contribution

    • Employer EPF contribution

    • Total EPF contribution

It reflects standard EPF contribution structures used in Malaysia, making it practical for:

  • Employees checking payslips

  • HR or payroll quick checks

  • Anyone planning savings projections


๐Ÿš€ Key Features

⚡ Instant Calculation

No loading screens, no waiting — results update immediately as you type.

๐Ÿง  Simple & Intuitive

No financial jargon. Just enter your salary and get your numbers.

๐Ÿ“ฑ Works Everywhere

Fully web-based, so you can use it on:

  • Desktop

  • Mobile

  • Tablet

No installation needed.

๐Ÿ”’ Privacy-Friendly

  • No login

  • No tracking

  • No data stored

Everything runs directly in your browser.


๐Ÿ› ️ Built for Practical Use

This isn’t meant to replace official tools — it’s meant to make your daily life easier.

Whether you’re:

  • Checking your take-home salary

  • Estimating job offers

  • Planning monthly finances

This tool gives you quick, reliable answers without friction.


๐Ÿ“Œ Example Use Case

Let’s say you’re offered a salary of RM5,000.

Instead of manually calculating percentages or digging through EPF tables, you can:

  1. Open the calculator

  2. Enter 5000

  3. Instantly see:

    • Your contribution

    • Employer contribution

    • Total EPF savings

Done in seconds.


๐ŸŒฑ Future Improvements

Some ideas I’m considering:

  • Support for different EPF contribution rates (e.g. reduced rates)

  • Yearly projection / savings growth

  • Printable summary

  • More financial tools in one place


๐Ÿ™Œ Try It Out

If you’re in Malaysia and want a quick way to calculate EPF:

๐Ÿ‘‰ https://weetech-software.github.io/epf/


๐Ÿ’ฌ Feedback Welcome

If you find it useful or have ideas to improve it, feel free to share feedback. The goal is to keep it simple, fast, and genuinely helpful.


Built with simplicity in mind — because financial tools shouldn’t be complicated.

Saturday, March 14, 2026

Integrate alert_threshold into Jenkins

To run this application periodically and ensure system admins/support receive timely alerts, a Jenkins installation is required.

  1. Make sure you have already run this app as described in the How to run this app section.
  2. Download and install Jenkins. While Jenkins setup is outside the scope of this document, more information can be found here.
  3. Create a Freestyle Project in Jenkins and apply the appropriate settings. The minimum required settings are:
    • Build periodically
    • Execute Shell
  4. That’s it! Check the console output for any errors. A YouTube video has also been created to briefly demonstrate this integration:


Sunday, October 12, 2025

How to draw arrow in GIMP using plugin

GIMP is a great image editing program that allows us to alter images and better convey our intentions. I like using GIMP for tasks such as resizing, changing formats, or cropping images. In this article, I will explain how to draw an arrow in GIMP.

First, download the arrow.zip which contains two Scheme script files. There should be 3 files in total. Below is a summary of the files:

  • ArrowScriptNotes.pdf : description of the arrow.
  • arrow.scm            : Scheme script file for gimp version 2.x
  • arrow_V3.scm         : Scheme script file for gimp version 3.x
Depending on your GIMP installation, copy the appropriate file to the GIMP script directory and then make it executable. For example , I'm using GIMP version 3.0.4-3 so I would do the following:

$ cp arrow_V3.scm $HOME/.config/GIMP/3.0/scripts
$ chmod 770 $HOME/.config/GIMP/3.0/scripts/arrow_V3.scm
$ # for GIMP version 2.x
$ # cp arrow_V3.scm $HOME/.config/GIMP/2.10/scripts

Restart GIMP if it is already running. I also created a YouTube video demonstrating how to draw an arrow using this plugin.




Monday, November 11, 2024

APC UPS 1200VA connected to linux debian

On 1st November 2023 was one of the worst ever day in my working life. One super strongest ever lightning strike completely shut off the the whole house electric supply! I have UPS connected to my laptop which the laptop also shut off abruptly. I would say "lucky" ? that that the laptop managed to boot up unfortunately the USBs are all broken, it does not function anymore. Never in my life would think that even with a laptop protected by an APC UPS, the device would be damage, well partially. Closer inspection show that laptop power adapter socket, the live connector got burned mark. It is just how strong was the lightning strike! So lesson learn, this time I bought a new APC UPS which connected in serial fashion and behind a surge protector (Targus) and hoping that with 2x protections, I will survive in the incoming lightning storm. hopefully. ๐Ÿคž๐Ÿ™

Let's see the APC UPS






and when it is connected and running



This unit come with monitoring system. It can be connected to the pc device via USB cable which is awesome! Best part is, if you are using linux, it comes detected automagically. At the time of this writing, I'm using Debian 12.7. 

what you need to do is just installed package apcupsd

$ sudo apt install apcupsd
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
  hunspell-gl-es hunspell-sv-se libnvidia-compiler libu2f-udev libwpe-1.0-1 libwpebackend-fdo-1.0-1 linux-headers-6.1.0-17-common
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  apcupsd-doc libusb-0.1-4
Suggested packages:
  apcupsd-cgi
The following NEW packages will be installed:
  apcupsd apcupsd-doc libusb-0.1-4
0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 670 kB of archives.
After this operation, 1,779 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://deb.debian.org/debian bookworm/main amd64 libusb-0.1-4 amd64 2:0.1.12-32 [23.4 kB]
Get:2 http://deb.debian.org/debian bookworm/main amd64 apcupsd amd64 3.14.14-3.1+b1 [256 kB]
Get:3 http://deb.debian.org/debian bookworm/main amd64 apcupsd-doc all 3.14.14-3.1 [390 kB]
Fetched 670 kB in 0s (3,160 kB/s)    
Selecting previously unselected package libusb-0.1-4:amd64.
(Reading database ... 438864 files and directories currently installed.)
Preparing to unpack .../libusb-0.1-4_2%3a0.1.12-32_amd64.deb ...
Unpacking libusb-0.1-4:amd64 (2:0.1.12-32) ...
Selecting previously unselected package apcupsd.
Preparing to unpack .../apcupsd_3.14.14-3.1+b1_amd64.deb ...
Unpacking apcupsd (3.14.14-3.1+b1) ...
Selecting previously unselected package apcupsd-doc.
Preparing to unpack .../apcupsd-doc_3.14.14-3.1_all.deb ...
Unpacking apcupsd-doc (3.14.14-3.1) ...
Setting up libusb-0.1-4:amd64 (2:0.1.12-32) ...
Setting up apcupsd-doc (3.14.14-3.1) ...
Setting up apcupsd (3.14.14-3.1+b1) ...
Created symlink /etc/systemd/system/multi-user.target.wants/apcupsd.service → /lib/systemd/system/apcupsd.service.
Processing triggers for man-db (2.11.2-2) ...
Processing triggers for libc-bin (2.36-9+deb12u7) ...
Scanning processes...                                                                                                                                                                         
Scanning processor microcode...                                                                                                                                                               
Scanning linux images...                                                                                                                                                                      

Running kernel seems to be up-to-date.

The processor microcode seems to be up-to-date.

No services need to be restarted.

No containers need to be restarted.

No user sessions are running outdated binaries.

No VM guests are running outdated hypervisor (qemu) binaries on this host.

and then start it.

$ sudo systemctl start apcupsd
$ sudo systemctl status apcupsd
● apcupsd.service - UPS power management daemon
     Loaded: loaded (/lib/systemd/system/apcupsd.service; enabled; preset: enabled)
     Active: active (running) since Mon 2024-11-11 21:32:23 +08; 2s ago
       Docs: man:apcupsd(8)
    Process: 212186 ExecStartPre=/lib/apcupsd/prestart (code=exited, status=0/SUCCESS)
    Process: 212190 ExecStart=/sbin/apcupsd (code=exited, status=0/SUCCESS)
   Main PID: 212191 (apcupsd)
      Tasks: 3 (limit: 37451)
     Memory: 584.0K
        CPU: 8ms
     CGroup: /system.slice/apcupsd.service
             └─212191 /sbin/apcupsd

Nov 11 21:32:23 debby systemd[1]: Starting apcupsd.service - UPS power management daemon...
Nov 11 21:32:23 debby systemd[1]: apcupsd.service: Can't open PID file /run/apcupsd.pid (yet?) after start: No such file or directory
Nov 11 21:32:23 debby apcupsd[212191]: apcupsd 3.14.14 (31 May 2016) debian startup succeeded
Nov 11 21:32:23 debby apcupsd[212191]: NIS server startup succeeded
Nov 11 21:32:23 debby systemd[1]: Started apcupsd.service - UPS power management daemon.

and even better, gnome automatically detect it. I was really impress how little effort require to make things work.



one thing it does not work out of the box is communication with UPS also lost... but not sure how gnome able to detect the battery percentage..anyway, guess this is the work require.

$ sudo apcaccess

APC      : 001,018,0437

DATE     : 2024-11-11 21:33:20 +0800  

HOSTNAME : debby

VERSION  : 3.14.14 (31 May 2016) debian

UPSNAME  : debby

CABLE    : USB Cable

DRIVER   : USB UPS Driver

UPSMODE  : Stand Alone

STARTTIME: 2024-11-11 21:32:23 +0800  

STATUS   : COMMLOST 

MBATTCHG : 5 Percent

MINTIMEL : 3 Minutes

MAXTIME  : 0 Seconds

NUMXFERS : 0

TONBATT  : 0 Seconds

CUMONBATT: 0 Seconds

XOFFBATT : N/A

STATFLAG : 0x05000100

END APC  : 2024-11-11 21:33:20 +0800  

In any case, I really like this unit come with monitoring system. I guess just need to find out how to fix the communication problem and it would be a blast!


Reference:

https://opensource.com/article/21/12/linux-apcupsd

https://wiki.debian.org/apcupsd

 

Sunday, June 2, 2024

my code is your code

 If tomorrow is debug day (Type "function")

And I'm standin' with the front-end design

And the lead asks me what I did with my code

I will say I coded with you


If I wake up in Code War III (Code War III)

I see bugs and vulnerabilities

And I feel like I want to go home

It's okay if you're debugging with me


(

Cuz your code is my code

My code is your code

It would take an infinity loop to break us

And the chains of GitHub couldn't fork us

) x2


If I lose my fame and followers (Really don't matter)

And my server crashes down (Really don't matter)

As long as I got your commits (Really don't matter)

It really don't matter (Really don't matter)


As the versions they pass us by (the versions, the versions, the versions, the versions, the versions)

We stay updated through each other's code (each other's code)

And no matter how many updates we make

It's okay as long as I got your merge



(

Cuz your code is my code

My code is your code

It would take an infinity loop to break us

And the chains of GitHub couldn't fork us

) x2


If my code should break today (Break today)

Don't worry, 'cause in code we iterate anyway (Oh no)

"No matter the chatter from others (truly inconsequential)

I'll stand by, awaiting you beyond the reckoning's sway"


(

Cuz your code is my code

My code is your code

It would take an infinity loop to break us

And the chains of GitHub couldn't fork us

) x2

Saturday, May 20, 2023

Now I know why zoom feature is available in operating system for.

I use to think why would an O/S feature is created as it sudden zoom ridiculous 10-100x of the current resolution. 

But as one age, it FINALLY make sense, all comes around! Let's give an example. Given the current view at current resolution of the following picture

Given the following webshot, what's the difference can you identify?



Sure, some with very good eye can spot but it would also take sometime to identify. But if you can zoom in, wouldn't that be nice?! In linux , try super + alt + 8, yes the 8 is not on the numpad. Now it should be clearly shown what is the difference.


The display might be too small, try open the image in a new window tab. It should be clearly seen that the vertical line is dashed whilst the horizontal line is dotted. Well that's the difference!

It is like the zoom feature allow one to inspect the DNA.. well, computer DNA.. :)