Using Apple File System (APFS) with your virtualized Mac

Apple has just released the macOS High Sierra with new features, one of them is the brand-new Apple File System (APFS) that is optimized for flash storage which newer Macs enjoy. If you happen to be using macOS in a virtualized way, e.g. with VMware, you may have trouble getting the new OS to work as the upgrade forces conversion of the boot partition to APFS which the VMware UEFI does not support.

To solve the problem, we need to let the VMware UEFI know APFS and luckily the APFS driver can be extracted from the High Sierra installer as a UEFI driver executable. We can then slip the driver to the UEFI BIOS that bundles with VMware Player itself and everything should work.

Getting Started

We’ll need 3 things before modifying the VMware UEFI BIOS. They are listed below:

To simplify things, you can download my modified UEFI BIOS (tested on VMware Workstation Pro 14, may work for other versions too). If that ROM doesn’t work for you, go after these steps to get a modified BIOS with APFS support.

Use UEFITool to open EFI64.rom located at [VMware Installation Folder]/x64/, select File > Search and choose GUID tab. Type in 961578FE-B6B7-44C3-AF35-6BC705CD2B1F and double click the result inside Message section. Leave this screen for now.

Extract the FFS tool to the same directory as the APFS driver file. Open your command prompt, change directory to that place and run this command: GenMod apfs.efi .

 

Go back to UEFITool, right-click the selected item and choose Insert After, then select apfs.ffs from the FFS directory. The screen should look like this.

 

Save the modified ROM with the name efi64_apfs.rom to your VM directory.

Applying the new UEFI BIOS

To get the modified UEFI BIOS to work, use a text editor to open the VMX file. Ensure the file contains the following lines.

firmware = "efi"
efi64.filename = "efi64_apfs.rom"

Save the VMX file and start your VM, your macOS High Sierra will now boot as expected with an APFS volume. Voila!

[Tony Yip] libSSE-php Version 2

On 7 June, the libSSE-php released version 2.1.0 and providing well interface available to integrate with popular framework. And I release the laravel-sse for the Laravel. The libSSE-php has changed so much comparing from version 1. In this post, I hope to share about the libSSE-php version 2.

Change in libSSE-php

Namespace and packagist

First, the most important change is adding namespaces and available on packagist. To make it simple and easy to remember, I picked the prefix SSE and the packagist package name as tonyhhyip/sse. Most of the classes had the prefix SSE and not being autoload. Therefore, the prefix was changed into namespace SSE. Also, the method name is using the snake case which is not the common practice in PSR-2, as a result, all of them is then changed into lower camelcase.

Data Mechanism and Core Heart

Moreover, In the most common issue of the libSSE-php is people complain about was they are not able to change session data. To solve this issue, Data Mechanism is added for people, which is using apc, mysql and file in version 1. In version 2.0, memcache, redis and PDO mechanism is added to provide more choice for users. Furthermore, in version 2.1,  I added a Session Mechanism by making use of Symfony session interface. I make a change on the core heart – class SSE in the version 2.1, it makes use of the Symfony StreamedResponse. As a result, it is more easy to integrate the libSSE-php into the popular PHP framework like Symfony 2 and Laravel.

Release of laravel-sse

Last but not least, I release the laravel-sse, so that the library can be easily used in the most popular PHP framework nowadays.

Find out more

Hope you will love and make use the libSSE-php. Come and give it a star on Github and Packagist.
Creative Commons Licence
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

[Tony Yip] Some thought about SITCON x HK

Recently, some of my friends including those in Taiwan asking me about when will be the next SITCON x HK. I am here to thanks all of your support. And I am here to talk some more about SITCON x HK.

Hardness

However, I need to take the Hong Kong DSE in this year. The Hong Kong DSE would finish on the late April. In May, I am going to have my speech day and ready for the coming up Hong Kong Open Source Conference 2016 in June. And then in July, I have to face the hardness of the release of result of HKDSE and JUPAS. Also, I am going to join the COSCUP in August. It is a hard job for me to organize the SITCON x HK before the Autumn. If you are hoping to go to SITCON x HK, you may expect it in Autumn or Winter.

Organizing a conference is not a simple task like a school project study. It involves call for proposals, promotion, budget planning, ticket selling (even in free), looking for venue and sponsorship, technical (thanks @licson) and many more basic decision.

SITCON x HK 2015

In the last year, SITCON x HK held in the HKOSCon because of luck of time, so most of the problem is solved by the other committees of the HKOSCon. However, SITCON x HK have to become a standalone conference. I have to face these problem by myself which bring me, a F6 student, so much pressure.

It is a very sad news for me every time when I look at the posts on SITCON x HK Facebook Page. The number of people reached is also in a low level. I did ask myself whether I am not doing in the right way or anything I have missed ?

The last SITCON x HK also make me very upset. The number of participant is in a low rate, specially the main target audience, students . I am not meaning there is any problem on the speaker. The main reason of this I think is because of my promotion is not enough and success. After the conference, I am a bit losing the way on SITCON x HK. Specially after the University IT Exploration Conference 2015 (UnitExCon 2015) , I saw much more students joining the conference comparing to the SITCON x HK. I started to ask myself whether I should stop SITCON x HK and let the organizer of UnitExCon, Joint Universities Computer Association (JUCA) to held the conference instead.

I remember the hope of friends of SITCON in Taiwan. I hope they would not be disappointed on this. Therefore, I have decided to let the Hong Kong students to make this decision. I am going to organize SITCON x HK in October or November 2016 and open for the call for staff, proposal and sponsorship since this artical has published until August. I will decide whether I should continue organizing SITCON x HK or not depending on the response from the public in SITCON x HK.

[Tony Yip] First Taste on GNOME Ubuntu

As the task of Google Code-In required and the needs of improvement of control users, I installed GNOME Ubuntu in the school library computer as the OPAC. The original version is Ubuntu Desktop 14.04.3 LTS and I installed the GNOME Ubuntu 14.04 LTS which means I can use the same kernel and commands in the computer.

Advantage compare with Ubuntu

After doing tests on the GNOME Ubuntu, I figure out some advantage of GNOME Ubuntu than Ubuntu Desktop. The starting up time of GNOME Ubuntu is much shorter than the Ubuntu Desktop. It took 2 to 3 minutes to start up the OPAC with the Ubuntu Desktop in the old days but now it just takes less than 2 minutes to bootstrap the OPAC.

Moreover, GUI supporting is much better. Since many GUI application is written with GTK+ and GNOME, GNOME Ubuntu has a better support than Unity and provides a better user experience.

Furthermore, GNOME Ubuntu provides a more natural UI for users than Ubuntu Desktop. The button are placed on the top right corner instead of top left corner which is more easy to use for Windows users. Also, the menu bar is place at the top of the application instead of the top of the whole window.

Disadvantage compared with Ubuntu

However, no pay no gain. There is cost in taking the advantage of GNOME Ubuntu.

The layout of GNOME Ubuntu is a bit boring for those using the colourful Unity. The colour using in GNOME Ubuntu make users feeling repeating and easily being upset in using. This would be a bad news as the computer is providing service for students search books.

What is more, GNOME Ubuntu does not have as much support as Ubuntu Desktop. For the field of desktop, Canonical Ltd. is still putting the focus on Ubuntu Desktop instead of GNOME Ubuntu. This is a unfavourable factor for putting GNOME Ubuntu in production.

Next, GNOME Ubuntu is much harder to download. As I am living in Hong Kong, I can easily get the Ubuntu install image from the mirror of CUHK. However, I need to get the GNOME Ubuntu installation image from cdimage.ubuntu.com which is far away from my home and takes me a long time to download.

Conclusion

Finally, installing GNOME Ubuntu on the school library computer as OPAC seems not a bad idea for now. I would observe whether the users prefer which Ubuntu.

Creative Commons Licence
This work is licensed under a Creative Commons Attribution 4.0 International License.

Installing NVENC SDK and CUDA SDK on Ubuntu 14.04

After I set up my streaming server, there are some problems brought by the design. Using CPU to process the streams will consume lots of CPU cycles and if the streaming server have lots of connections, resource to handle them will run low if the machine itself does not have strong CPUs. NVIDIA’s NVENC is a way of offload the transcoding to GPUs that is dedicated to such processing and leaves much more CPU cycles for other purposes. However, installing NVIDIA’s driver is a nightmare, which is why I decided to write it down for future reference.

# Fetch system updates (if it is a fresh install)
apt-get install update && apt-get install upgrade

# Install required packages for NVIDIA driver installation
apt-get install build-essential linux-source linux-headers-3.13.0-68-generic linux linux-image-extra-virtual -y

# Get NVIDIA CUDA SDK (this is v7.5, for the latest version please visit NVIDIA's site)
wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1404/x86_64/cuda-repo-ubuntu1404_7.5-18_amd64.deb
dpkg -i cuda-repo-ubuntu1404_7.5-18_amd64.deb

# Install CUDA SDK (which includes the NVIDIA graphics driver)
apt-get update
apt-get install cuda -y

# Check whether NVIDIA kernel module is loaded
modprobe nvidia

# If the above fails, try installing NVIDIA graphics drive seperately (this is drier version 352.63, for the latest one go check NVIDIA's website)
wget http://us.download.nvidia.com/XFree86/Linux-x86_64/352.63/NVIDIA-Linux-x86_64-352.63.run
chmod +x NVIDIA-Linux-x86_64-352.63.run

# Run the installer. Accept the EULA and it will ask you whether to overwrite the previously installed driver, choose continue. The installation here should complete.
./NVIDIA-Linux-x86_64-352.63.run

# Check whether NVIDIA kernel module is loaded
modprobe nvidia

# If all things go well here, this command will show detailed information about your GPU
nvidia-smi

Then the below installs NVENC SDK’s header into your system.

# Fetch NVENC SDK
wget http://developer.download.nvidia.com/compute/nvenc/v5.0/nvenc_5.0.1_sdk.zip

# Uncompress the zip and copy the headers to /usr/local/include/
unzip -q nvenc_5.0.1_sdk.zip
mv nvenc_5.0.1_sdk/Samples/common/inc/*.h /usr/local/include/

You can then now compile programs that uses NVIDIA’s NVENC to speed up video processing, including ffmpeg.