Developer's Note

// shall I write some keywords here to boost search engine ranking?

Monday, August 26, 2019

Offload your SSD (on Windows) and SD Card (on Linux)

As many of us aware, both SSD and SD Card wearing out upon write operation. So to extend life span of the storage, we may look into reduce the write operation.

(With wear leveling, most modern SSD have lifespan that is long enough where you might want to skip this post. But no harm to know something new, right ?)

For SSD, you may consider putting the Windows's TEMP folder into a RAM disk. RAM disk, as the name implies, it is a virtual drive that reserve and utilise the space on your RAM. There are many RAM disk software out there, and I'm using ImDisk's RamDisk Configuration.

You can define the space of the RAM disk, and set the TEMP folders to the RAM Disk with this tool:

(ImDisk RamDisk Configuration)

For SD Card that store your OS (i.e. Raspberry Pi), we will put the `/var/log` on RAM with log2ram. This will make the logs stay in RAM and only flush to storage once a day by default (configurable).

After done installation and reboot your Raspberry Pi, you shall see the screen below:

(log2ram: new mounting point after installation and restart)
This shall extend the lifespan of your SD Card.

Thanks for reading.

Friday, August 16, 2019

Get 30GB of Samba Storage on Cloud

OK, it is less than 30GB to be exact, as the OS took some space too.

The whole idea started from the offer from Google Cloud with an "always free" plan which include 1 f1-micro instance with 30GB standard persistent storage. (Anyway, you might still get charge for egress too)

So if you already have some running VPS or cloud instance, you may just use that too.

However, as you might experienced, most cloud provider have strong focus on network security. And the steps to define firewall rules, etc are different among providers.

Fortunately, ZeroTier come into rescue. We can use ZeroTier to link our home PC with the cloud instance just like there are in the same LAN (or Global Area Network, as advertise by ZeroTier).

So here go the list of guide that I had followed, hope you enjoy it:

Additional Ideas:

  • If you are have Windows 10 Pro at home, you may also consider to use NFS too.
  • You may experiment on mount object storage to the VM via FUSE for additional storage. (Do share with me the result and experience)

Wednesday, April 29, 2015

Chrome unable to load Google sites

Recently I had been facing problem loading Google sites such as its search engine, Gmail, Youtube, etc.

It is either take extra ordinary long time to load, or just failed with `ERR_QUIC_PROTOCOL_ERROR`.

I did a search and found I am not alone, and below are the solution [1]:

  1. Open a new tab in Chrome, and type `chrome://flags/` into address bar, then press Enter.
  2. Search for `Experimental QUIC protocol`
  3. Disable it.
  4. Restart Chrome. Done.
It had been about a week, and the error never happen again.


Saturday, October 05, 2013

Set Transfer Encoding of Attachment for Axis2

When sending SOAP request with attachment, Axis2 handle the attachment via Axiom, and the default transfer encoding for binary file are binary.

In order to change the transfer encoding to something else, we will utilize the org.apache.axiom.attachments.ConfigurableDataHandler instead of the usual javax.activation.DataHandler.

Below is the sample code:

Wednesday, June 13, 2012

Axis2 + Rampart: Generate Nonce and Created when Plain Text Password was Used

Axis2 support WS-Security via Apache Rampart module. I had develop the SOAP client based on tutorial : UsernameToken Authentication with Rampart

However, the default implementation of Apache Rampart will not generate Nonce when plain text password was used.

After some google, I found this page talk about a configuration called "addUTElements".

So below are the modified configuration fragment: