Categories
Software development Technology

GCP Data Fusion

Reading Time: < 1 minute

Couple tutorials

Targeting campaign pipeline

Creating a reusable pipeline

Permission issue (note the exact error will depends on the setup of network as well, for example, this DF service account needs to have network access to run the pipeline, and it needs that role if applicable).

Cost: the developer edition for data fusion instance costs 35 cents per hour. The basic edition is 1.80 per hour but comes with first 120 hours free, this is 5 days free usage and recommended. Also, there is ways in GCP to set up budgets and alerts.

Categories
Software development Technology

Terraform

Reading Time: < 1 minute

Doing

Prepare for Certification

Get Started – AWS : below has some issues, cannot find the image. Note I tried to find correct ami image id too (ami-032930428bf1abbff, via AWS console), but it appears there is another issue when a correct ami image id was used.

resource "aws_instance" "example" {
  ami           = "ami-830c94e3"
  instance_type = "t2.micro"
}

Error: Error launching source instance: VPCResourceNotSpecified: The specified instance type can only be used in a VPC. A subnet ID or network interface ID is required to carry out the request.
	status code: 400, request id: c8d85874-93fb-4e48-b515-97b50172826b

  on example.tf line 15, in resource "aws_instance" "example":
  15: resource "aws_instance" "example" {

*Amazon Linux AMI 2018.03.0 (HVM), SSD Volume Type – ami-032930428bf1abbff (from aws console)

Done

Get Started – Google Cloud

Get Started – Azure : one interesting part is it seems the user name and password for Azure in TF script is not checked (or in other words they are stateless?). Not sure why. Was using admin_username=plankton later while it was setup it was Password1234!

Two more comments on Azure: the Store Remote State part did not work perfectly. I believe Azure free tier has one year limit: it shows 6 cents so far for my infrastructure experiment. Also: the detailed cost.

Get Started – Terraform Cloud

Categories
Life Tips Software development Technology

hosts file for productivity

Reading Time: < 1 minute

Sometimes we need to get something done without the distraction of facebook, twitter or for that matter, linkedin (or some other sites you want to stay away). Here is a tip for how to do it on Mac.

sudo vi /etc/hosts
(note you don’t have to use vi, feel free to use nano or other editor of your choice)


referene entries below
====
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost

127.0.0.1 facebook.com
127.0.0.1 www.facebook.com

#127.0.0.1 linkedin.com
#127.0.0.1 www.linkedin.com

127.0.0.1 twitter.com
127.0.0.1 www.twitter.com
====

Then do this in command line.
sudo dscacheutil -flushcache

Reference articles:

How to Edit the Hosts File in Mac OS X with Terminal

How To Edit Hosts File In Linux, Windows, Or Mac

Categories
Fun Technology

Virtual Learning

Reading Time: < 1 minute

I normally use google calendar for kiddos’ Zoom meetings. My older daughter who is going to be FGC dragon knows get to Zoom via Google classroom. I can train her on the google calendar too. But now I am thinking I will take Monday off for the full time support of virtual learning (I feel I need a break from work too). || A bigger question though, this kind of management tool seems like new normal to all of us. In the past I used Google Calendar for all my personal appointments and all my kids activities, this includes my girl’s basketball (time, location), and my volunteer meeting at kids school etc. || Also, a side note, I have not looked into kiddos iPad yet, but I assume everything is setup including google classroom. But I prefer kids not to watching iPad whole day. So I setup bigger monitor with laptops (MacBooks) and webcams. I will need to provide some support for my 1st grader on this…

Categories
Software development Technology Web

API Gateway

Reading Time: < 1 minute

Kong

Kong is a cloud-native, fast, scalable, and distributed Microservice Abstraction Layer (also known as an API Gateway or API Middleware). Made available as an open-source project in 2015, its core values are high performance and extensibility.

Actively maintained, Kong is widely used in production at companies ranging from startups to Global 5000 as well as government organizations.

CA Layer 7 / API Gateway: was owned by CA Technology, formerly Computer Associates. Sold it to Broadcom the chip company in recent years. It used slightly older technology as Kong, apigee and Okta.

documentation:

architecture:

Categories
Java Software development Technology

Spring batch, Spring Scheduler, PCF

Reading Time: < 1 minute

Was experimenting running scheduled job on PCF. One natural choice is PCF scheduler, which comes with the Pivotal Web Services (PAAS). Googled around and found this example on DZone. The spring batch code is here. There was a small typo in the manifest.yaml,

path: build/libs/payment-processing-spring-batch-0.0.1-SNAPSHOT.jar
Note the snapshot.jar file name does not match what’s specified in the build.gradle file.

The correct file name is

spring-batch-job-0.0.1-SNAPSHOT.jar

The rest of the manifest.yml looks good, in fact I used the following options for my spring scheduler app manifest.

no-hostname: true
no-route: true
health-check-type: none

But PCF scheduler is not available in our environment. The Spring Scheduler is used instead. I followed this Get Started Guide from Spring. In my case I need to use Cron Expression, here is the code sample and here is the guide to cron expression.

Last but not least, in my case I need to send out email notification for the cron job conditionally. I used the java email code sample here.

======

Some PCF references

pivotal web serivce

cf login -a https://api.run.pivotal.io/

https://console.run.pivotal.io/tools

https://docs.pivotal.io/pcf-dev/index.html

cf login -a api.local.pcfdev.io --skip-ssl-validation

https://tanzu.vmware.com/tutorials/getting-started/local/deploy-the-sample-app

Categories
Software development Technology

How to generate a Lets encrypt SSL cert

Reading Time: < 1 minute

I followed the instruction here https://certbot.eff.org to get a free SSL cert for my website: (pretty cool, huh 🙂 (found it here)

To actually do it, I just go to the website: Scroll down a little, select the software and the system my website is running on, and it will generate all the command-lines for me, here is my link 🙂

There is one small glitch after the installation of ssl cert: that is in the wordpress, I need to set the home page from http to https

Also, an older post Move WordPress from Share Hosting to DigitalOcean

Earlier: I summarized it on twitter.

Categories
Software development Technology

Couple agile tools

Reading Time: < 1 minute

Point Poker: free (accepts donation). A nice pointing tool, click start session, for collaborators: put in name, and join the session.

Fun Retro: there are free and non-free choices. The free ones are public. It’s a bit like Trello. For that matter, if someone likes to keep it private, I think Trello is a good alternative: just put in swimming lanes such as liked, learned, lacked, longed for and action items

scrumpoker-online

Categories
Career Software development Technology

Job search advice amid COVID-19 pandemic

Reading Time: 5 minutes

We are at unprecedented times, in terms of the pandemic, and the economy aftermath. The IT software dev job market is not impacted as much as some of the hard hit ones such as. travel and leisure, but nobody is also insulated when there is a typhoon. For example, locally here in St. Louis, Enterprise rent a car, the largest car rental company in the US and in the world, has laid off more than 2,000 people, IT division included. I recall about 10 years ago I wrote a post about job search, and I like to update it, amid the time change and this specific pandemic change.

Some obvious things

No onsite interviews, remote or video interview only these days. Zoom is the most popular choice, and for developers there are some white-boarding online software. Realtime white boarding is actually quite challenging, from my personal experience, on both ends. It also depends on the friendliness of the interviewer, some interviewers like to be “above the interviewee”, they give the problem, did not like to talk or give hints, and expect a quick answer right away. On the other hand, there are some other interviewers who are more open and friendly, and sometimes they will throw a dog bone to rescue. As interviewer I always try to be the former, as I personally have been in the receiving end of “bad interviewers”, and don’t like the experience. Once at an onsite interview (long time ago), a guy who maybe quite sharp, made this comment: it sounds like you did much better than the other guys came in earlier, they really don’t know what they were talking about. And at least you put up this and that, blah blah blah… is this a compliment? I guess my English is already good enough to appreciate the underlying tone there. On the other hand, I can always appreciate good / friendly interviewers, once (not in coding or white boarding) during an onsite interview, the interviewer saw my schedule and saw that I was stuck in the little room all day, he offered let’s talk a walk, and talk in the company cafeteria. It was year early / winter 2005 as I recall, in middle of New Jersey.

Websites

Below two the most popular websites now.

Indeed: note Indeed.com is No. 1 in terms of the number of jobs. I found my last job and current job via Indeed.com. This is mind boggling when you think about it. I am not sure whether it exists in 2010. It’a an aggregator website. A bit like Google for information search.

LinkedIn: linkedIn became more meaningful too, I got a job offer in my last round job search and the lead is from LinkedIn. Many companies now post jobs at LinkedIn. Besides the number of jobs, we all know LinkedIn is the top 1 place that recruiters congregate. And as I built profile at LinkedIn, I also received more unsolicited messages or requests from mostly recruiters or website SEO people. Most recently I decided to be more discreet on accepting recruiters request. Most recruiters are young enthusiastic people and I bet they send out things blindly. This brings to another point.

Also, stackoverflow has a job portal, and some of the jobs are looking good too.

Recruiters

I think recruiters are still useful, if we are more discreet and we ask what we want. I have some recruiters friends from both ends as well: job search, or candidate technical screen. And I keep in touch with them from time to time, as a part of relationship building. Sometimes this could be a simple “hi” when the recruiter is in the hallway or in the office. I do understand, on linkedIn, or via database, sometime some younger recruiters will cold call (the reason I pick up the reason was probably the call from number is an agency I know). And we need to keep things in perspective that’s a part of their job and paycheck too. Also keep in mind we live in a small world especially in the St. Louis IT job market, and sometimes the table can turn quickly. I recall seeing a former coworker at two separate places (and I remember he was not being nice to me 🙂 I don’t have grudges against him, but I just know I probably won’t use him as reference, and vice versa.

Code Test

Not white-boarding or pairing either remote or on spot, but something like hacker rank, or filtered.ai. Those are okay as they are usually not overly difficult, they are fair test in other words. There is some random ones, which is usually some problem a tech lead, an architect came up with. And some of those can be nasty. Once I spent 24 hours on a problem, and could not solve it. I solved it a day later. Also noted the behavior type questions on filtered.ai or company recruiting website. Those are easy ones to score points, so don’t waste the opportunities. Usually they let you re-do if the first recording does not look good. The coding test, if done properly, you can run the unit test on the editor and you know it’s failed or passed.

(Update 05-19-2020) There are a lot of online code playground or white boarding tools for code testing on the spot. Those are mostly collaboration tools, with some syntax highlighting. But it’s usually not as powerful as the hacker rank or filterer.ai as the latter ones usually have the build-tests, so basically you will know your code is good enough or not by passing those tests (tests are usually hidden though). Tools such as code labstack are still pretty useful. One thing I am not sure is how they manage the sessions. From interviewer (hiring side) point of view, it maybe helpful to give a heads up if a quick code test is expected so that the candidate is aware. I have seen candidate just bail out without even trying. I have been on the receiving end of this kind of test as well. Again the interviewers friendliness (more precisely helpfulness, do they just want to see the candidate fail, or they want to be as human as possible) varies. (sample java code question here). Also JavaScript code playground such as codepen.io and jsbin.com .

My javascript code samples.

Last but not least, problem solving questions. One example: Suppose we have 8 balls: one is heavier than the other 7, the other 7 are identical. Now we have one balance (or scale), and we can put balls on two sides to weigh and compare. Use as few attempts as possible, to find the heavy ball? A follow up question is, if we have 2 or 3 attempts, how many balls can we handle (again one heavy ball with many identical lighter balls). 

About me. Also you may read about my other post on related topic.

Also, please note this guide on job search. I haven’t read the whole thing but it appears good. Much longer than this blog. Last but not least, this post is a good read too (Helen Anderson @helenanders26).

The Science Behind Making Software Engineering Interviews Truly Predictive of Job Performance by Geoff Roberts.

Categories
Software development Technology

Java thread and interview questions

Reading Time: 2 minutes(Update 3 10-28-2020) Link to JoelOnSoftware

(Update 2  10-27-2020)

Java
1) What is the difference between and interface and an abstract class(pre Java 8)?
2) Name a design pattern you have used (or would like to use)?
3) How would you implement the Singleton Design Pattern?
4) Since Java 8, what is the preferred way to avoid an NPE?
5) What goes on the heap and what goes on the stack? What can you tell me about the Garbage Collector in java? Can you have memory leaks in java?

API development
1) Difference between SOAP and REST
2) Difference between REST and RESTful
3) What are the best practices that are to be followed while designing RESTful web services?
4) Some of the methods (verbs) in REST: 1) GET, POST, PUT, DELETE; 2) Is Post idempotent?
5) Describe some of the API management tools you used, for example, Swagger, Apigee etc?

Microservices Cloud environment (Azure, AWS or GCP)
1) What are some features of a Microservices architecture?
2) What is 12 factor application? List some of the factors and explain them.
3) What cloud providers did you use? What are their strength and weakness? Or some pain points?
4) What are some of the frameworks and tools you used for micro-services development?
5) How do you monitor the apps? Do you have any recommendations or best practice for logging and tracing?

Some devops and automation experience as well (i.e. Docker, Kubernetes)
1) Where did you deploy the micro-services you or your team developed? Or what is your deployment environment? Is it IAAS (infrastructure as a service), or PAAS (platform as a service)?
2) How do you deploy apps to the dev, test and production environment? Did you use any CI / CD tools?
3) What are the main steps in a pipeline build / deployment?
4) Have you done any automated testing / validation?
5) For cloud infrastructure build out, do you use the console (UI), command line or some kind of source code (yaml etc) as well as tools such as Terraform?

(Update 09-01-2020) Java 8

(baeldung) Introduction to Java 8 Streams

Lambda Expressions and Functional Interfaces: Tips and Best Practices

New Features in Java 8

GitHub (eugenp) :

Core Java 8

Core Java 8 (part 2)

Also:

Java 8 Features with Examples

Prominent Java 8 Features With Code Examples

(Update 05-19-2020) There are a lot of online code playground or white boarding tools for code testing on the spot.

(Original ) Hibernate map one to many (Vlad Mihalcea)

A collection of the posts I saw recently.

Java World
Introduction to Java threads

Java 101: Understanding Java threads, Part 1: Introducing threads and runnables

Others
Java Callable Future Example

Java – Multithreading

Java Thread Tutorial: Creating Threads and Multithreading in Java

Vaadin chat example
It needs multi session (thread) support when we need to use tabs to chat back and forth. The app description is here.

The annotation to support this: @VaadinSessionScope

Java interview questions
Placeholder: I still need to clean up the list below (to incorporate my recent interview experience).

aop
dependency injection
refactor
agile
test driven
code review (what to look)
static vs. final
interface
spring
hibernate

java generics

tree set vs hash set

tree map vs linked hash map
https://dzone.com/articles/hashmap-vs-treemap-vs

.equals() vs ==

Java String equals()

Elasticsearch 

Digitalocean installation

Get started