Setup JBoss with Eclipse

I have been doing this for a while, mostly for my new work (back to dev). My goal is being able to debug a Java web application, just like what I did for my previous work (Spring STS + Tomcat). The new work requires Eclipse + JBoss (some coworkers uses the not free Intelli-J).

Download / install Eclipse
link here, need to unzip, and install the Eclipse for JEE

Add a new server
I picked Wirefly 11. Read this post regarding JBoss EAP vs Wirefly. This has been helpful.

After that I was able to import a “maven project” (that runs on STS with vFabric server), and start the app in debugging mode. This seems like baby steps, but for me it’s a long time “not doing” :-)

Paradigm shift

(07-08-2018) Came across this multi-cloud article form Glenn.

(Original) Good old Oracle is shifting Java SE from perpetual license model to subscription based. Link here.

Note John Chen (CEO of blackberry) mentioned the subscription model makes more revenue more predicable for the business (video here, noticed he mentioned new accounting rules here).

Btw, heart broken to see the Blackberry phones go away.

Docker – second take

(Update 02-13-2018) So I found out today I have AWS bill of $2.62 (mostly due to EC2 instances) today. This is due to the fact that I did fire up the VM as well as the docker swarm instances (total 9? maybe due to I ran the deploy script multiple times?) Anyway I fired up the instance last night, this evening I looked at the “instances” and looked at the bill, I know what happened. I still did not make the connection from outside to ec2 working though. For the time being, I “terminated” the docker swarm, and stopped AWS VM.

(Update 02-12-2018) I am also following the tutorial at Docker’s official website. I am at step 6 here. And right now, I am stuck in connecting to the AWS vm (was following this Docker guide): step 6 “docker node ls”. I did follow the steps to create docker credentials for AWS.

error during connect: Get https://192.168.99.102:32768/v1.35/nodes: http: server gave HTTP response to HTTPS client

Note this IP address looks like the local default machine: one thing I am not quite sure is how the local connects AWS

(Original 01-31-2018) I installed docker on my mac a while ago and did a simple tutorial. But I never had much chance to play with it until recently. After the training, esp. after I saw use docker container to host Tomcat, and then use Jenkins to trigger Tomcat, this whole thing got me interested in docker again. Note I have been learning about docker contain and they seem to be the future deployment model for scalable mobile apps backend: e.g., I know the Robinhood app (the free stock trading app) is container based in the back.

Some resources I used to get started:
1) Youtube docker tutorials;
2) Install docker or docker.io on Ubuntu (I have a digitalocean droplet / VM, and its OS is Utuntu);
3) Overcome the error message:
FATA[0000] Get http:///var/run/docker.sock/v1.17/version: dial unix /var/run/docker.sock

The answer is this:

The problem is that your user has not been added to the docker group.

Try:

sudo usermod -a -G docker
If you don’t want to log in/out from your current shell, run:

newgrp docker

Last but not least, install Jenkins on Ubuntu 14.04.

Other error messages (note I am on a Mac)
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? (when I tried to run some docker command)

It seems the solution is
eval “$(docker-machine env default)”

Alipay wechat Pay

IMG_8760

I was travelling in China for 9, 10 days recently, and I can see those two payments method everywhere. From the small food stall to KFC, one of those two methods are widely accepted, and in many cases cash transactions are very rare. I noticed this trend about 1.5 years ago during my China trip too, at that time I saw some promotions around those new payment methods. This time I saw many promotions too, such as discount to points (reward) system.

Just use my own shopping experience as an example. I purposefully did not get a local mobile phone number this time, which in other words, this disqualified me from using those new payment methods. I did not want the hassle of getting a new mobile phone number, with or without data plan, and then have to give up the number later. Because my trip is really a 9 day trip. I noticed in most “free” or public wifi hotspots, the setup is such that they send a validation code to the mobile phone. For me I can live without because my phone has international data roaming, in other words, I still get to wechat on the go. But I cannot get to those free public wifi hotspots, at a bookstore when I tried to sign up to be their member via wechat, I realized my lack of local phone number is preventing me from doing that, or getting the discount. Same thing in KFC. I did noticed some China Unionpay (flash pay, or its own contactless payment methods, like masterpass or visa checkout, if you will) promotion along with Apple Pay and Samsung Pay, but it’s very obvious they are not in the same magnitude as Alipay or wechat pay. There is news saying that China central bank is regulating Alipay and wechat pay, such as limit the amount of transaction. It will be interesting to observe though, we know Unionpay is very much state owned, while the other 2 are in theory private owned. But all in all, this is a very difficult market for Mastercard and Visa to crack.

Fully disclosure: as of this writing, yours truly works for Mastercard. And this article is just my personal opinion, not my employer’s.

PS, in order to get a local mobile phone number, one usually needs a local identification card. I am not sure how foreigners can get one, via their passport. I assume there is a legal/legit way to get that.

Last but not least, my friend in Ningbo, used Alipay app to rent a car (I assume it’s similar to Uber), to pick me up at Ningbo railway station. He said he even sold his car recently, due to the convenience of car-rent app, public transportation, and the desire to walk/cycle (again bike sharing here, needs a phone and app) more instead of trying to finding a parking spot for his car (and the cost of maintain a car). When we got off the car, the payment is automatic just like Uber.

Change of job: what to do with the savings in the 401k plan

I talked a bit on this topic in the past (see a post here). The one thing I may add is: I didn’t do very well in most the IRA (self management, mostly buy / sell stocks in the small scottrade IRA account). The value mostly bounced back since I bought the Huntsman (NYSE:HUN) in last couple years, but I lost quite a bit trading the coal stocks (and Palm stock) back in those days. So I decided to put money into Vanguard funds (and IRA account) in 2014 when the old 401 plan asked me to move my money (I worked on a contractor job in part of 2013, for 7 months).

Today I received a letter from my old employer Arch Coal, the director of benefits about change of the asset manager for the 401k plan. Note Arch Coal went through a bankruptcy in last few years, also note bankruptcy alone has no effect on employee’s 401k plan (the money is separate). But I did compare arch coal’s 401k plan performance vs the Mercy plan (managed by Fidelity, the No. 1 or 2 asset manager), and Arch’s performance is not as good. So this is something I will think about: 1) roll it over to my current employer; 2) roll it over to Vanguard; 3) leave it as is (the new manager is transamerica).

I have not decided it yet. Still thinking…

Stay away from work over weekend

My older daughter just finish 1st grade. One thing I learned is first graders do have some homework, at the same time they usually don’t have homework over the weekend (Friday, Saturday and Sunday). In other words, homework usually won’t be assigned out on Friday and due to Monday. This is something I like to talk about it today. Over the years I worked professionally, mostly for employers, I did encounter tight deadlines or last minute assignment which means I have to work or “hinted to work” over weekend and holidays. I recall in some scenarios we need to come into office and work. There is the line I want to draw: don’t commit to it if all at possible. In fact this is mostly a sign of bad management or planning when at Friday afternoon, the boss (project manager, someone who manages our work) came in, and say something needs to be done that urgently, and we need to work non-stop over Friday evening or Saturday, or even Sunday. This is both non-sense and counter productive.

We as knowledge workers usually don’t completely stop working even after normal work hours, sometimes we will (I know I do) think about the technical issues on the way from work to home, and sometimes we recall something like “ah, I may have done something wrong there, I will go back and fix it”. In fact I did something like that in my early career. Some other times, we monitor a long run job at home, or we test out new ideas coding on a company laptop. But we need break as human beings. Force us to work over weekend basically took away that, not to mention people who have families.

The downside of mandatory “overtime” in weekend (esp. coming to office) is that the workers never get rest in a normal weekend, thus hurting the productivity in the following week. In the example I gave earlier (the supervisor asked us to show up for work), looking back I think even him did not believe by coming in work on Saturday we will complete the project on time. This is mostly a show from management side, to let the upper management know that we are working hard. One of the dumbest thing I saw in my 17 years professional life.

On the positive side, I do have a few successful stories where I worked or thinking hard on a problem, and was able to solve a critical problems, all on a voluntary bases (nobody told me to come to office, I understand the urgency of the issue).

Apple TV 4th gen – initial impression

I finally decided to upgrade to the 4th gen Apple TV, which I had it as a developer kit about 2 years ago. I had not used it as the gen 2 Apple TV worked out fine mostly of the time, until recently it appears “play on Apple TV” feature did not work well on my old iPad mini (it could be caused by the old router too, oh well, I will replace it one at a time). I recall last time (a year ago) when I tried to use it, the TV comes as dev kit was locked, so I went ahead and did the “restore” in iTunes first. After that the setup was fairly smooth, it seems the main improvement over gen 2 was the voice recognition (Siri) and touch control (the touch control is not as precise as the four way control in the old remote in one case though).

Installed PBS kids app, and the screen saver looks new! Over the weekend I bought some TV from iTunes store (peppa pig, for younger daughter). It showed up fairly quickly on Apple TV.

Now the next step is for me to find the box for the old gen 2 and post it on eBay.

Some thoughts on United Airlines and the industry in general

Over the years I have rode quite a few United Air on my trips from US to China. Amid the most recent incident on the UA (warning: the video may not be suitable for little kids), I am thinking of a few UA trips I took, such as this one on March 2007, which worked out ok. Another trip (Summer 2002), which is also my first UA flight, was also eventful. The UA857 (from SFO to PVG) was spotted some fire (presumably under the wing, per some passenger) during the take-off. The plane had to drop most of the fuel above the sea, and turn back to SFO. And we had to reboard another plan to PVG. Here are some of the pictures of the plane releasing the fuel. I recall one flight attendant specially mentioned how much weight was the fuel, and the unit price of fuel, I calculated it was about $350,000 worth of the fuel.

UA867_July2002_4

UA867_July2002_1

plane2

Fast forward, the industry had another meltdown during the financial crisis, and has since come back. The regional carriers, such as the one had the incident on Sunday night, was never the money maker. In fact, I recall in year 2009 (Colgan 3407) there was an fatal accident on a flight from NYC to Buffalo NY. And I learned from that accident that those regional carrier’s pilots are not really well paid or trained. This combined with my observations of over the years, when the airlines tries to charge the baggage fees, and on those regional flights, people would just check in the baggages at the gate (to save the money). Then at the destination, esp. when during winter time, you will see a long line of people picking up the luggages. It just feels America is a 3rd world country at that time.

Last but not the least, my friend Wang Jianshuo wrote on similar topic almost 10 years ago.