Pages

Sunday, February 28, 2016

Ubuntu VMware guest stuck/hangs on boot

Apparently there is a bug in one of the recent Linux kernel update on Ubuntu running as a guest OS on VMware. To be exact, the affected kernels are versions 4.2.0-30.35, 3.19.0-51.57, and 3.16.0-62.82 (mine was Ubuntu 14.10 on Linux kernel v3.19.0-51.57). The bug report is here, and in this blog I am going to show the way to solve it (credits to the answer on this askubuntu Q&A forum).

First, you need to get into the Advanced boot options, which you can access from the GNU GRUB menu.
  1. Start the problematic Ubuntu VM. Hold the shift key on your keyboard until you are redirected to the GNU GRUB menu. If you see the command-prompt-like log that you usually see when you boot your VM up, you missed the point where you should get redirected to the GNU GRUB menu. Restart and try again. Note that when you restart the VM sometimes the VM redirect your keyboard inputs to the host OS instead. Click the VM screen repeatedly to ensure that your keyboard inputs is sent to the guest OS.
  2. Choose Advanced options for Ubuntu
  3. You will be brought to a screen where there are a list of Ubuntu you can boot into with different kernels and boot mode. Choose any that uses the Linux kernel that is not buggy (refer to the list of buggy kernels I show at the start of this post). You can just choose the default boot mode (no upstart/recovery mode).
  4. Congratulations! Now you have managed to boot up to your OS!
  5. There should be an update to the Linux kernel if you check your software updater (I was notified without needing to check manually). Just update and the problem should not occur anymore. If there isn’t any update, you can try Googling to make your VM to boot using the old Linux kernel by default for the time being.
That is all. Note that not all Ubuntu is affected; seems like only Ubuntu on VMware is affected, and only if you happened to update your Ubuntu with the buggy kernel.
Hopefully it helps!

Saturday, February 27, 2016

Integration or Isolation? That's the question

I happened to stumble upon this blog post written by a friend of mine who is also my group mate for the FBOA module I am taking in NUS this semester. The background of the post is actually that he deactivated his Facebook account sometime last year because he feels that Facebook is rather pointless and not the best choice out there as a platform to find information, share his thoughts, or to keep in touch with friends.

I agree with him that Facebook is one of the worst options out there to find information and share your thought. I mean, it is filled with people from all walks of life, and not everyone is as educated as you are, and not everyone is as thoughtful as you are by not sharing pictures of every cat or corgi they saw on the Internet, borderline explicit videos, and those "X things that only YYY understand; number N will make you shocked!" kind of posts. It can be toxic too, seeing the highlights of your friends' lives going for exchange, going on dates, outings, getaway to some exotic place etc etc, while you were there in front of your laptop in your room, living a boring life.

But those are not the main reason I am writing this post (maybe we can discuss about it another day). The post I am talking about is the first one I hyperlinked (or alternatively, here). It was about how one service is tightly integrated to another such that if one service for some reason, God forbid, is down, it will trigger a chain reaction and render us unable to access many of other services. The personal example he mentioned in the post was that he was then unable to use his Spotify because he used Facebook to sign up for his Spotify account.

That brings the question: should different services be isolated from one another? Or should they be integrated with as many others as possible? An argument for isolation is already mentioned above. An argument for integration is that it frees user from filling in the registration/sign-up form and verification hassle that is just way too common. Also, users do not need to remember yet another login ID, nickname, password, or PIN for the new platform he/she is signing up for.

There is no right or wrong answer to this question just yet. This friend of mine seems to be more inclined towards the isolation side, judging from that post. Me, I actually more inclined isolation too, but there are benefits of integration that I do not want to lose (such as no need to remember yet another password).

So what about you? You can just take my (and my friend's) post as fruit for thought, or alternatively you can express your opinion on the comment section! But then again this is just a personal blog that happens to be maintained as I am currently using it for one of my course in university, so don't expect too much discussion except perhaps with me :p.

Wednesday, February 24, 2016

SQL Server Management Studio installation error: "wait on the database engine recovery handle failed"

When I was installing SQL Server Management Studio 2014 a few days ago, I was shown a pop-up at the end of the installation: "wait on the database engine recovery handle failed", and followed by some of the SQL Server MS features failed to be installed.

To be exact, here are the screenshot of the error notifications (not on my computer, credits to the blog who provided me with the solution)

"wait on the database engine recovery handle failed"

Features failed to be installed
To solve this, the TL;DR version is to just uninstall it and install it again but when you are shown the Server Configuration page, change the Account Name of SQL Server Database Engine service to "NT AUTHORITY\NETWORK SERVICE". After that just click next and everything should be installed correctly.

For me, the above paragraph was sufficient to fix my installation. However, if somehow it does not solve your issue (something about validation error pops up, or anything else), go to the blog where I found this solution and try to follow the complete steps provided.

Hopefully it helps!

Tuesday, February 16, 2016

FBOA Module: Technical Expertise - Git workflow

As part of the CS3281/2 module requirement I am currently taking in NUS, I have to establish myself as an expert in a topic/field/technology of my choice. Because version control systems are going to stay, and Git is currently (arguably) the most popular version control systems out there, and I have had some experience in it, and I have friends who are good at it (I have one too many and's), it is just natural that I choose Git to fulfil that requirement. This is going to be the first of the series of Git tips and tricks that I will post in this blog, so stay tuned!

Officially, my tech expertise is "Git workflow" because if I declare as just "Git", apparently I am expected to know Git inside out or something. Nevertheless, my Git-related blogposts will not be limited to just Git workflow, but also Git tips and tricks in general.

Some topics that I plan to write about in the next 1-2 months (which is basically the rest of the semester):

1. Git workflow best practices
2. Git rebase + push --force safely
3. Git rebase vs merge, and what is happening in the background

To get the ball rolling, here's a neat trick I got from @rauchg's Retweet on Facebook if you need to find the first commit where a given string first appeared in the source code.

git log --source --all -S <string>
What it returns is basically a list of all commits that contains the string you input as changes (both as addition and deletion). The first  commit where it appears is of course, the one at the bottom of the list. If you only need the commit's hash, you can shorten the output by adding the --one-line option to the command. Also, if you want a string longer than one word, you can put the string within quotation marks.

If you want to know what each option actually does, you can refer to git-log documentation page.

That is all for now. Stay tuned for more Git workflow goodness! Happy coding!

Wednesday, February 10, 2016

ENOSPC error when running zuul locally

Today I encountered an error when I tried to running zuul locally. It throws an error on a function call to watch a file with error code ENOSPC.

After a quick Google search, I found out that ENOSPC just means that there is insufficient space (probably it stands for Error NO SPaCe). Apparently it happens when you are opening a large number of programs/files. However, at the time I received the error, I only got File Explorer, Terminal, and Sublime Text opened, which is not a large number of programs at all. Further research told me that Sublime is actually implicitly opening a large number of programs if you are using its Open Folder feature so what I did to solve the problem was to close Sublime whenever I wanted to run a zuul test locally.

Hope it helps someone out there who can't figure out what's wrong with their zuul!

Sunday, January 31, 2016

Migrating from Browserify to Webpack

As you might have read from my previous post, I am currently enrolled in FBOA and is working on Socket.IO. One of the tasks he gave us was to migrate bundling from using Browserify to using Webpack, and I wrote in my last post that I was not even sure if I was doing it correctly. Well, as it turned out, I was not, because I have not put any bundling options yet.

Anyway, so I start looking for solutions by Googling "webpack equivalent of browserify options" and got this useful link. However, it was not quite enough, because in the repo I was working on, there are some options that are not listed in that link such as browserify's insertGlobalVars option. After some digging, finally I found out that its equivalent in webpack is externals.

Hopefully it is useful to anyone out there doing something similar. Also, if anyone has any other useful webpack equivalent of any other browserify's options, feel free to comment so I can just add it in to the main post! Happy coding!

Disclaimer: It is not my intention in any way to encourage migration from browserify to webpack. I am just helping those who already made the decision. I am no web dev expert in any way.

Saturday, January 23, 2016

The Long Overdue Update: FBOA and Webpack

Hi everyone! Seems like I have only been updating this blog for once a year, huh? Sorry about that; nothing much happened in my life that can be written in this blog anyway. Just to get you all up to speed, I went for an exchange to Tsinghua University in China, which explains why I did not update the blog. I know, using VPN to access blogspot is like just a few clicks difference but then again, as I wrote earlier, nothing particularly significant from what I have been learning that can be put in this blog. During my semester there, I tried to redo an Android Development tutorial, this time from udacity. I also took a module in computer networks though if anything, what I learn is how to make a really fast (but not necessarily scalable) C++ programme instead of anything about computer networks itself.

This coming semester would be totally different. I am enrolled in the Facebook Open Academy (FBOA) programme via NUS under the module code CS3281/2, Thematic Systems Project. If you are curious, I will be working on the open source project Socket.IO. One of the grading aspects of the module is to write a blog post about my progress in the open source project I am working on. Because I am too lazy to create a new one, so I decided to just use this blog. Who knows, this might get the ball rolling for more frequent updates to come!

... And this post is going to be the first of those more frequent updates. My team is assigned to do migration from the tools currently being used by the project to (supposedly, debatable-y) better tools. For example, I am assigned to migrate from using browserify to webpack as the bundling tool. I thought it should not be too difficult (after all, it is our first task given by @rauchg (one of the guys behind socket.io) (I am using too many brackets here)). I guess it is not difficult if you are familiar with web development, but I am not (I should have, but no) so it took me one whole day to figure out how to do it, and I am not even sure if I am doing it correctly.

Learning new tools is never easy. The initial learning curve is almost always very steep, though fortunately it will only get easier over time. Webpack is no exception. I tried reading the Getting Started tutorial the devs provided but I still have no idea how it will fit into the project I am working on. Apparently previously socket.io uses browserify's node.js API and I did not know there is such a thing so I have been trying to integrate the webpack into socket.io's Makefile to no avail.... I thought the 2 tools are very different in terms of how it is being set up. But as it turned out, webpack also has its own node.js API, which I finally found somewhere in the docs. I tried to tweak the test initialization js files and finally managed to make the test runs and passes (yay!). I will probably push and send a pull request tomorrow to let my teammates check it first. After all, I should not be embarrassing NUS by sending some crappy PR, should I?

Sorry if this post is rather confusing or hard to read. It is 3 am in the morning and I just managed to integrate webpack into the project like literally 20 minutes after one whole day of googling so I do not want to have anything to do with it again for the next few hours and wrote this just for my own reference. Anyway, here's to more frequent and higher quality updates in the future!