Saturday, January 5, 2019

Upgrading to Fedora 29

Once again it is time to upgrade Fedora.  Not trouble at all with the upgrade and it went pretty fast.  Simply followed the instruction from Fedora Magazine.

Saturday, October 27, 2018

2B coming to to Soul Calibur VI

Looks like 2B from Nier: Automata is alive and well!  It's just been announced that 2B will be a playable character in the Soul Calibur VI!

Saturday, September 22, 2018

A Night of Bad Shows: Jurassic World: Fallen Kingdom and Elementary Season 6 Finale

I watched Jurassic World: Fallen Kingdom and the season 6 finale of Elementary on the same night.  I've generally liked the Jurassic movie franchise even though it deviated from the novel and I've been a fan of Elementary since it first aired.

Jurassic World: Fallen Kingdom

Jurassic World is terrible.  Every character from the villains to the kids were just different degrees evil or narcissists.  Ironically, in the movie the "bad" guy asks the protagonists how are they different and in this movie it is actually very easy to feel that they aren't different from each other.  In this movie there are no real protagonist/hero.  I don't know whether it is because this is a bridge episode to the final installment of the trilogy, but the characters show little empathy to each other and just focus on their own individual views.

It's hard to cheer for characters who care so little for others and can so easily throw away their moral values.  From the "nerd" who can just suddenly decide it's okay to kill another person to a vet who find it cool to be rude and a bully everyone it is really hard to find a likable character in this movie. The writers seem to only have two views: either you're with the dinosaurs or you're with people.

The irony continues since the movie actually starts with Jeff Goldblum's Ian Malcolm character explaining that it's not so black-and-white, but the movie and every character in it immediately ignores him.  The movie makes zero attempt to show that it's not black-and-white.  It completely ignores it and just moves forward with everyone making decisions for their own benefit.

Ultimately, the movie tries to distract you with action and tries to get audiences to develop emotional attachment through nostagia and sadness by killing the likable dinosaurs from the original Jurassic Park.  This alone says a lot about the movie... it is terrible.

Elementary Season 6 Finale

Similar to Fallen Kingdom, Elementary went out of its way to completely alienate one of its main characters in the season 6 finale, "Whatever Remains, However Improbable".  Elementary always pointed out the moral ambiguity of the decisions its character has to make, but it also dedicated time to show that such decisions were not taken lightly.  The show also emphasize loyalty and dedication to one another where family doesn't just mean related by blood.

In the season finale, some of the main characters from the show completely violates the tenants of the show.  From Watson's decision that would break apart her and Sherlock's partnership and then throwing it in Sherlock's face that if they were partners he should support her decision to Captain Grayson blaming Sherlock for all the bad things then throwing them under the bus, both took the easy path.

Only Sherlock and Marcus stayed true to their beliefs and recognized that the more difficult path was the right one and wasn't deterred from walking that path.  In their decisions, they came out being more noble in their characters which only made the contrast with Watson and Capt. Gregson's action more difficult to bear and accept.

The show seems like it'll be make numerous changes in season 7 especially as season 6 didn't end with any type of cliff hanger to tie the seasons together.  I hope, though, that it doesn't just abandon the fractured relationship from season 6 as fans have invested 6 years into these characters' relationship.  Although Elementary is a crime drama, the show is ultimately a show about relationship between people and the impact that one person can have on another.  It would be a shame if they just threw this all away so easily.

Nomatic Travel Pack First Trip

I previously wrote about my first impressions of the Nomatic Travel Pack and now I've had a chance to use it on a trip so here are my thoughts.

What I Like

In its non-expanded form, the Travel Pack external dimensions doesn't feel that much bigger then my everyday carry backpack.  It held everything that I normally bring along when traveling with little effect on the shape of the backpack.  It easily can fit under the seat on an airplane and it stayed upright without problems.

Access to the main compartments were good and accommodating since it provide access from either side and the top.

There are plenty of organizational pockets, pouches and compartments so everything had a place and stayed in place.

There are cable pass-throughs  between the main compartment, easy access pocket and the front compartment.  This allowed me to have my main battery in the inner side pockets of the main compartment then run a charging cable to the easy access pocket to charge my phone and to anything in the front compartment without having the cable getting exposed on the outside.  There is no pass-through to the laptop compartment unfortunately so I can't charge the tablet without running the cable along the outside.

It was comfortable to carry even when full.  For this trip, I didn't use the waist straps.

What Is So-So

The ability to open up the laptop compartment is meant for the convenience of going through TSA checkpoints faster without having to take out the laptop, but that only works because TSA wants to see the laptop unobstructed.  Having the tablet pocket on the side as the laptop meant that TSA will likely ask you to take one of them out so it kind of defeats the purpose.  If it is on the opposite side of the compartment like how the Atlas Everki has it then it will be more convenient.

The quick access pocket at the top is not very big and I found it to be a tight fit for my phone.  I really can't put much in there if I want the phone to be there.  Normally I'd like to stick my phone there when I go through airport security rather then leaving it in the bin where I might forget or make it easier for someone to snatch.

The water bottle holders were a tight squeeze especially if there are bulky items in the inner side pockets.  It does stretch so it does fit a typical water bottle but it's not easy to drop-in.  For me it was a two-handed operation.  I definitely missed the Everki in this area.

The hidden security pocket along the back of the backpack was also very tight.  It's good for paper money and other thin items but when I put in my wallet, I found it slightly cumbersome to fetch it back out.

The Travel Pack can hook onto your rolling luggage but it goes on sideways.  I'm not used to accessing items from the side but for the main compartment  it's fine.  For the quick access pocket and front compartment, it feels more awkward and I worried that something might fall out when I open the zipper.

The outside material feels more plastic-like then what I'm used to.

What is Silly

The main compartment has 4 zippers.  The two middle zippers can be locked together to prevent it from being opened.  The two outside zippers doesn't lock to anything so even if you locked the two middle zipper together, you can still get access to the main compartment with the two outer zippers.

Initial Thoughts

Overall, the Travel Pack performed as advertised.  When I first packed it and when through the security checkout, I wasn't as happy with it but it grew on me as I traveled.  I had to adjust a bit with how I organize and access items.  I would probably sacrifice a bit of form for function such as the bottle holder pocket from the Everki (see comparison between the Everki and TLS here), a bigger quick access pocket and being able to hook to luggage up-right instead of sideways.

I'm not a 1-bag traveler where I would just use one bag to store everything so I don't expect to use it in expanded form much, but even in its normal form there was plenty of space for additional stuff in the main compartment that I didn't use on this trip.

Sunday, August 12, 2018

My Essential Travel Gear for Family Vacation

As the tech dad, I'm responsible for making sure that the family has all the tech gear needed while on vacation.  In this post, I describe the essential items I bring to meet the demands of the family and minimize my work cause this is the blog of a lazy hacker...

Nomatic Travel Pack First Impressions

Nomatic Travel Pack

This is my first impression of the Travel Pack.  Nomatic has 3 bags that have very similar names:  Nomatic Backpack (smaller everyday carry backpack), the Travel Pack (designed for 3-4 days of travelel) and the Travel Bag (large suitcase bag).  I find that my needs for a daily use backpack is different then what I need for travel.  I carry a lot more stuff when traveling (especially when it is with my family).  I carry different things depending on whether I'm going to the office versus when I'm traveling so I can understand why Nomatic has different bags for daily use and short term travel.

Tuesday, July 3, 2018

Windows As a Developer Machine with Windows Subsystem for Linux (WSL)

Windows Subsystem for Linux allows running Linux binaries on Windows 10.   To overly simplify it, this means that Windows 10 can run a Linux shell based on a number of Linux distributions.  

Although Linux is my primary OS, I also have a Macbook Pro to address the rare occasions where I need to use an app that isn't available to Linux (e.g. Sketchup) and when I need a portable UNIX machine (OSX is based on Darwin, a BSD variant).  It used to be that to have an UNIX-like environment on Windows meant having to run something like Cygwin which I always felt to be somewhat clunky.  Getting Linux software to work was never as smooth or simple as using Linux itself (obviously) or OSX.  

WSL changes that completely and I've been using it for a couple of months writing Go programs with VIM in a Ubuntu shell running through WSL.  So far it has worked very well!  Things does run slower on WSL such as when I'm compiling and writing to the file system, but as my secondary machine that isn't as big a deal.  It's really nice that WSL mounts the Windows file system as a mount point that can easily be accessed.

The ever declining quality of Apple's laptops and OSX and its rising cost gives even more weight to Windows being a better buy for developers needing a portable Linux solution or needing both Windows and Linux.

Sunday, June 24, 2018

Upgrading to Fedora 28

It's time to do another Fedora upgrade. 

I generally use the command line tool to upgrade from Fedora 27 to Fedora 28.  The first upgrade went without a hitch.  On a second machine, I ran into a dependency problem requiring that I install the Fedora 28 version of the nss-pem package before starting the upgrade
# dnf install nss-pem-1.0.3-9.fc28 --releasever=28
Fedora 28 has the latest version of Go (version 1.10) which is very nice.  I haven't paid attention to what the previous versions of Go Fedora comes with since I also install the latest version that is released on

Sunday, June 10, 2018

Go with WebAssembly Early Examples

WebAssembly (WASM) is the most exciting technology in web development in a long time from my perspective.  It represents the first true steps in breaking the monopoly of Javascript as the language for the browser even though the WASM folks emphasize that isn't the intention.  In my previous post, I mention that Go will support compiling to WebAssembly in version 1.11.  This post shares some of my experimentation with Go's WASM support and to see what might be possible.  Let me emphasize that the code is very hacky.  I wrote them quickly mainly so I can try out WASM. 

There are multiple ways to use WASM for web applications:

  1. Optimization for JavaScript-driven applications - This is the scenario most emphasized for the current level functionality provided by the initial (MVP) release of WASM.  Instead of writing everything in pre-compiled Javascript, optimized WASM modules are called by JavaScript.  These modules can be written in JavaScript or other languages that can compile to WASM.
  2. Porting existing code bases over to the browser - This is most often demonstrated with porting existing C/C++ code bases over to WASM through Emscripten and running what might previously been an exclusively desktop/native app (e.g. Autocad, games, etc.).
  3. Writing an web app completely in a non-Javascript language - This is what I'm most excited about!  Instead of having Javascript be the primary language, the application is completely written in another language such as Go.  At the time of this writing, this isn't completely possible since WASM doesn't support WASM modules from directly calling the browser APIs (e.g. DOM APIs, XHR, etc.).  This will be coming and is currently covered under the Host Binding proposal for WASM.  Until then, the Javascript can be abstracted away in a language-specific binding.
The current state of Go WASM doesn't fit the first scenario very well.  There doesn't seem to be a way to expose methods individually for Javascript to call directly.  The Javascript code can execute each Go program's main function and when main() is done the module is done running.  Given that each WASM module has the complete Go runtime including garbage collection, I'm not sure how practical it is to have a bunch of Go programs that are essentially meant to be single methods to the Javascript code.

Go WASM does provide the ability to define callback methods and attach callbacks to browser events.  This requires that the module is running because once it exists it's not longer available to the browser call call.  Because of this, Go WASM is currently most appropriate for scenarios 2 & 3.

The browser executes Javascript and WASM in a single threaded manner.  When the WASM module is running, the browser's front end will block until it is completed.  This will appear to the end user as if the browser is frozen: no way to type input, click button, etc.  With Go WASM, control is given back to the browser when using time.Sleep or when the Go code is blocked.  This has to be done manually by the developer so it's important to keep it in mind.  Unless the apps expect to have completely control of everything in the browser while it is running developers need to remember to periodically sleep itself to give some control back to the browser.   I hope this gets improved in the future because it makes the code ugly, error prone and honestly isn't something developers should need to do in a multi-tasking environment.

Example 1

Complete source is here. See it running here.  

This is a very basic example of writing a Go WASM module that defines a method that gets attached to a HTML button's click event, change some attributes of the document's elements, waits a few seconds then executes a Go routine that draws to the canvas in the browser.  The keepalive() function prevents the module from quitting until it gets a quit signal that happens when the Quit button is clicked and the cbQuit method is invoked because the button click event is triggered.  Also note that when the browser's Alert dialog is triggered, it blocks everything until it is dismissed whether it's called by JavaScript or by the Go code.

The keepalive() can also simply be
select {}
if the intention is just not let the module exit.

--- ---
The basics of having Go drive the web page (rather then it being Javascript) is all there.

Example 2

Complete source here.  Running example here.

This example was inspired by what was presented at GopherCon by Hana Kim when gomobile was first announced.

Instead of re-writing Rob Pike's Ivy Interpreter for Android/iOS/command-line the example showed that the existing Go library was reused.  Just like her example, this example shows that existing Go libraries can be used in WASM.

--- ---

The resulting WASM module is about 4MB but when compressed, the whole web app was only about 1 MB.

This example really doesn't show anything that the previous example didn't already show. I wanted to try against a larger code base and didn't want to write it myself.  It mainly just demonstrates an existing Go library being used with no changes needed to make it work.

The Ivy code is easy to port but if something is expecting to access a file system or make HTTP calls then the browser environment doesn't match.  There isn't any standard file system and outbound calls uses XHRHttpRequest rather then the current HTTP package.


It is possible to use Go to write web applications even though it currently still needs to rely on JavaScript to access the brower's APIs.  Things like Go routines work but developers have to handle sleeping themselves in order to not block the UI.  However, the possibility of ending JavaScript's monopoly for being the browser's language is definitely there!

Browsers themselves still need to do some optimizations.  Each WASM module's byte code still has to be compiled so there's always a delay before the module starts running.  It still starts faster then JavaScript but it'd be much better if the browsers caches the compiled WASM the first time.  My understanding that it'll likely come in the near future but not there yet.

I'm very excited to see this land in Go 1.11 and look forward to see what other developers use it for!

Monday, May 28, 2018

Backup and Restore Your Linux System and Home Directory

It's a good idea to regularly back up the files on your computer in case there is ever a hard drive failure.  OSX and Windows comes with basic backup software that is very easy to use.  Simply connect and external USB drive to your computer and enable the backup software.  Google even offers the ability to back up to your Google drive so your data is stored at a different physical location.

Linux system can be backed up very simply through the use of a command line tool called rsync and with a little scripting the backup process can be automated just like it is on OSX and Windows.

Encrypting the Backup Drive

Before backing up your files, it is a good idea to encrypt the external drive where you'll be storing your backups.  This is to prevent someone from taking the external drive and accessing your files.  Use the Disks utilities and select the drive and change it to encrypt the partition.  Note that this means that in the future only a Linux system (along with the password) can access the external drive.

Backing Up the Home Directory

I create two separate backups:  system and home.  The system is to backup my system configuration while the home directory contains the users data.  There are a lot of files and directories in the home directory that doesn't need to be backed up that might be consuming a lot of disk space.  These include cached files, trash files, etc.  It's best to exclude these files and directories. 

I found this file as a good starting point for things to exclude from the home directory.  With this files (modified to your liking), use rsync to back up the home directory (this example is to back up just your own home directory):

rsync -aP --exclude-from=[exclusion file] /home/$USER [path to backup location]
Make sure that you've mounted the external drive and have the path correct.  Use the 'n' option (e.g. rsync -naP ...) to do a dryrun where it it doesn't actually copy any files so you can test first.

If it all works correctly, a crontab to automatically repeat the process can be made although you still need to mount the drive with the encryption passphrase unless you set it up where the cron job has access to the passphrase.  I just create a bash script that I run manually.

Backing Up the System

Backing up the system is very similar except there are some additional directories to exclude and the starting point is "/" instead of the home directory.  

1.  Create a file similar to the one for excluding home directories (see above).  This file is more simple since it only contains directories:
Then you'd run (again, use -n first to do a dry run):

sudo rsync -aAXv / --exclude-from=[file of excluded directories] [path to backup location]
Note that this time it uses the "sudo" command since some systems files requires SUDO privileges.