Categories
iPhone app

Database deployment automation

Reading Time: < 1 minute

DB deployment (schema or DDL, package)
Continuous integration and deployment of database is a main issue for many legacy monolithic web app. I came across this article recently, and I think it touched some good points.

On a related matter, Jeff Atwood (cofounder of stack overflow), has a good piece on database version control.

I understand the world is going microservice, and the monolithic relational database is not used as frequently as it’s being used in those legacy web apps. But nonetheless, it helps the dev team to be agile if version control / CI / CD can be applied to database update as well as the application update.

Tracking data changes in DB
This also reminds me of an app I worked in 2010/11, in which we have an DB audit log for many (if not most) database changes: add, update, delete. It’s usually achieved via trigger in Oracle, or interceptor in Java. I read an article from a startup engineering blog (credit karma? Or something like this), they detailed how this is implemented.

Categories
iPhone app

Working from home friendly companies

Reading Time: < 1 minute

Or companies that allows or encourages remoting.

Zapier (Emily Irish) The Remote Work Survival Guide: 9 Do’s & Don’ts Every Remote Worker Needs to Know

stackoverflow remote dev jobs:
e.g., MobyMax: this is very interesting because I learned about Mobymax because my daughter’s school has the subscription.

Top 30 Companies for Work-from-Anywhere Remote Jobs in the U.S.

Work From Home 2018: The Top 100 Companies For Remote Jobs

Last but not least, LinkedIn has the top startup list for 2017 and 2018. Note many startup like people to work onsite for more communication but there are some exceptions (InVision for one).

Categories
Fun kids

GregTang Math

Reading Time: < 1 minute

A brain teaser kind of question at GregTang math (I just heard bout GregTang and the problem recently at a school event): use 6, 7, 8 and 9, plus any addition, subtraction, multiplication and division to make the result of calculation as 10 (only use each number once, can use any kind of parenthesis as needed).

I saw a few kids come up with answers (but it seems to me some answers are from the parents 🙂 I tried but could not come up with answer as 10 at the spot. Note we, my wife and I, when we were kids in China did similar exercise / games using the poker (draw 4 kids, instead of 10, we need to make 24). On my way home, or at home (this is how things work for me, just like how I come up with the solutions to coding at work), I have this: (7+8)x6/9=10

Note: there should be many ways / combinations to this, the one I heard at the gathering is 8x(9-7)-6=10

After that I followed GregTang on twitter, and I worked on some of the puzzles there from time to time: those are not “too hard” problems, but nonetheless interesting / educational for the kids (I think).

Categories
iPhone app

Webhooks

Reading Time: < 1 minute

(Update 2 09-30-2020) Webhooks — The Definitive Guide [2019]

Other Useful Tools For Debugging/Testing Webhooks

A modern request bin to inspect any event

(Update 03-21-2019) Add the Power of Webhooks to Your App with Okta’s System Log (Joël Franusic at Okta).

(Original 12-28-2018)
Webhooks
I heard webhooks from Zapier the first. Below is an good article written by the folks at Zapier.
What are the webhooks? (Zapier)

Was trying to follow the tutorial from the above
requestbin tool

requestbin works like described (encountered a few 500 errors, but mostly working)

It seems I could not open the hurl.it link from runscope community page.

I am reading this more technical webhooks blog by @brandur

My interest in webhooks is also inspired by this little JS program I wrote a long time ago. And this was rekindled recently due to the atomist-sdm (GitHub) (node.JS based SDM, automation, quick start here).

Categories
iPhone app

Node js tutorials and webtask

Reading Time: < 1 minute

(Original 11-30-2014, to be worked on)

I heard about Node js for a while, until recently I had opportunity to practice it. I used this tutorial from raywenderlich.com as a start, as I had good experience using the iOS tutorial on ray’s site. But I need to learn more. Here is another one (similar to Ray’s tutorial).

http://nodeguide.com/beginner.html (update 03-07-2019: it seems the site is no longer available)

How do I start with Node.js after I installed it?

Webtask (Auth0)
https://webtask.io/make (for me I used GitHub as SSO login)

If This Then Node.js

more about auth0 vs okta

JavaScript
http://eloquentjavascript.net/03_functions.html

Atomist: a SDM based on Node.js (SDM stands for Software Delivery Machine)
https://docs.atomist.com/quick-start/

I was also following the first few lessons of the advent of atomist automations. Got a bit stuck at the SDM team mode. Local mode seems working fine. I did receive the free trial for Atomist. Maybe I need to update the package as I downloaded Atomist a while ago (in August, I think).

Categories
iPhone app

Setup JBoss with Eclipse

Reading Time: < 1 minute

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” 🙂

Categories
iPhone app

Paradigm shift

Reading Time: < 1 minute

(11-03-2018) Alibaba just reported a quarter in which its cloud revenue grew 90% YoY. It appears Ali Cloud is No. 4 in the world: behind Amazon AWS, Microsoft Azure, and Google Cloud Platform (GCP). Thinking Ali may challenge Amazon in not too distant future (note Ali started the cloud much later than Amazon).

About Alibaba Cloud:
高盛:亚马逊AWS和阿里云将成全球最大基础设施技术公司
胡晓明

(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.

Categories
iPhone app

Firebase – second take

Reading Time: < 1 minute

Two years ago, I was trying to migrate an app back-end from now defunct Parse.com to Firebase, I was not successful. I was able to make it work last night, after reading more about the data structure in Firebase realtime database. I was able to do it by following the examples in this tutorial page.

I submitted the iOS app myNestEgg retirement calculator, and the update was approved this afternoon.

Categories
iPhone app Software development Technology

Docker – second take

Reading Time: 3 minutes

(Update 08-26-2020) Technically 3rd take. I was following along with the Google Cloud Storage ClamAV tutorial, and had an issue of not being able to connect to port 3310 on GCP. (Update 08-29-2020) It was solved. Some tips:

====

1) There were some typos: such as the directory related to the git project, as well as environment variable for the bucket (in couple places);

2) Need to run the below command before deploy: Assign bucket permissions before “gcloud app deploy” (as in section Create the malware-scanner service: step 5)

3) https://github.com/GoogleCloudPlatform/docker-clamav-malware-scanner/issues/1 (move the local variable out of the large bracket {})

4) https://github.com/GoogleCloudPlatform/docker-clamav-malware-scanner/pull/4 (the solution is to increase the memory footprint in the app.yaml file)

====

Last but not least, one does not have to delete the project, the quick way to save the money is just to turn off the app via app engine => settings => disable application.

I also looked around and found another ClamAV tutorial using Java. The second one worked for me locally. I was also able to put an image to the docker hub (using the code from the spring boot docker tutorial). I was able to push the docker image to pcf too. The one thing remaining is I had a 502 gateway issue when I test the end point (local was working fine; postman tip here). Actually later I was be able to make the GCP example (the node js example) work locally too. Now the next step is to make them work in a PCF or a GCP cloud environment (not just local).

(Update 02-04-2019) What Is Container Orchestration? (by Isaac Eldridge at New Relic).

I also followed along the Exploring Docker [1] – Getting Started by Traversy Media. I did make the node.js and MongoDB work on my local MacBook, but I could not make them working on my DigitalOcean droplet due to mismatch of Docker versions of “Docker Compose”, the root cause was the Ubuntu on my Droplet was a a bit old (14.0.4). I need to upgrade it to make the versions compatible.

Some more links for the Traversy Media docker-node-mongo example. Youtube video here. Github repo here.

Two more (TBD, or for references): Dockerize a Node.js app connected to MongoDb

Containerizing a Node.js Application for Development With Docker Compose

(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 startup Tomcat (build and deployment), 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 (11-18-2018: such as this one Demystify Docker; also noticed this one Docker for GCP. I will see if I can do the training exercise again I mentioned above).
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)”

References:

How To Remove Docker Images, Containers, and Volumes

Docker Usage

Part 1 — Virus Detection Service using ClamAV and Java

Part2 — Dockerized File Virus Detection Service using ClamAV and Spring Boot

Categories
Business China iPhone app

Alipay wechat Pay

Reading Time: 2 minutes

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.