Categories
Software development Technology

Raspberry Pi

Reading Time: 2 minutes

Downloaded Noobs image installer (imager_1.6.2) to Mac, unpack (or install) so that I have “Raspberry Pi Imager” on Mac, and then used it to create the bootable OS on the sd card using that software.

Burn the image for Raspberry Pi on Mac

After that insert the sd card to the appropriate slot on p3, also plugged in hdmi for monitor, and usb keyboard and mouse. Turn on the power (plug in the power adapter for iPhone with proper cable).

The Pi 3 in action, ports counter clockwise: power, hdmi (monitor), USB (2, mouse and keyboard)

Raspberry Pi Desktop first impression: I mainly used the web browser Chromium “Version 92.0.4515.98 (Official Build) Built on Raspbian , running on Raspbian 10 (32-bit)”, there is some lagging (keyboard, gmail and wordpress self host / post) compared to the MacBook, but still manageable. Keep in mind this pi 3 is probably selling for $30 or less nowadays. Btw, I tried a YouTube video (it’s the CNN Virginis moms switching from Biden to Youngkin story) in the browser too and it was a bit laggy in the beginning (video streaming?), but it worked well after couple minutes. This is pretty impressive.

Raspberry Pi Desktop

Obviously in order to use it as a desktop replacement, I would need to do some more tests. But I came across one post using pi 4 just now. Seems very promising there as well. Every Sunday morning my 2 daughters will take Chinese classes virtually via Zoom, and they uses my two personal macbooks. So in that duration I could use the pi 3. I noticed the temperature of the motherboard is not too hot either (no fans, no enclosure, just look like the picture 2 above).

Some other thoughts: there are tons of ideas regarding pi on internet. One idea is use it as home security. I will just need to dig more into it, and once I have more knowledge, I may purchase more Pi’s like my old friend Jeff Geerling (projects, blog) does. I don’t think I would be as prolific as he does. But I am just going to try.

References
Raspberry Pi OS – Raspberry Pi (Install Raspberry Pi OS using Raspberry Pi Imager)

Installing Raspbian with NOOBS – Introduction | Raspberry Pi Projects

How to set up and use a Raspberry Pi 3 with a Mac (I have a pi 3)

Categories
Software development Technology Web

Roblox Outage

Reading Time: < 1 minute

(Update 4: 01-21-2022) Roblox published the root cause here.

(Update 3: 11-03-2021) I came across this website that shows nice stats for Roblox (I noticed downdetector only shows 24 hours history by default, not sure how to customize it). I vaguley recall I also see a github repo that can scan the roblox APIs, but I no longer see it when I tried to look through “roblox status” from twitter.

(Update 2: 10-31-2021) It appears the service is back as of 4:45 pm Pacific time, per Roblox status. Also the CEO blog post, and an article from Variety.

(Update 10-30-2021) Now I think that Roblox is likely hacked, unfortunately. The lack of transparency, as well as the length of outage are my main factors thinking they were hacked, btw. Now their official website says:

“We’re making things more awesome. Be back soon.”

Btw, I had a twitter thread going on this topic too.

(Original 10-29-2021) Roblox has a massive outage since yesterday, and it seems the impact is still going on as 11:35 pm US central 10-29-2021.

Downdetector :

What happens when Roblox is down?

Roblox status page

======

October 28, 2021 4:00PM PDT[Investigating] Many player experience are impacted.

stay tuned.

October 28, 2021 8:44PM PDT[Identified] We identify the root cause as internal system issue and work on the fix.

October 29, 2021 7:21AM PDT[Identified] We are actively working on recovery. Some users started to have limited access.

October 29, 2021 12:48PM PDT[Identified] The team continues active work on full site recovery.

======

Categories
Software development

GitHub 2FA and personal access token

Reading Time: < 1 minute

Even since I enabled the 2 factor authentication on GitHub, I am using the developer personal access token (PAT) for pushing the code.

The normal steps (please ignore the numbers in the beginning of each line):

  514  git remote remove origin
  515  git remote add origin https://my_developer_personal_access_token@github.com/major1xu/myNestEgg.git/
  516  git remote -v
  517  git push
  518  git push --set-upstream origin master

This works for both the public and private repo. I’m thinking another way to do it is when using “git clone” to begin with, we use the PAT. I am going to try it next time. Note I created the repo in the GitHub website first.

Categories
Career Software development Technology

Hiring Right

Reading Time: 2 minutes

In a little over last year or so, I was involved in many technical interviews, and sometimes hiring decisions (one vote only, but a No vote is usually a No for the candidate). This is quite different from normal technical contributor’s job. But I learn something from this process too. I think overall I had two bad “Yes”, meaning I should have said “No”, but I said “Yes”. In one instance it was purely my unforced error, in another case the process went haywire.

Let me recall my mistake first. I was talking to candidate, and I noticed something unusual in the resume. Basically it appears the resume has some contradiction with what’s been said by the candidate. I have two colleagues on the phone, not sure if they saw it on video (likely not as I may not have video camera for the laptop then). But basically at that moment the candidate grabbed the resume back from me. I was stunned to say the least. I told my two colleagues No. But they somehow asked me to re-think. And they talked me into “give him an opportunity”. Things did not work out eventually, as the manager eventually let that person go as he has some personality issue.

The second bad “Yes”, was process oriented. Basically after we made “hire” decision after interview, I recall I have seen the resume. I searched email and found out that candidate was “no show twice” in last September (sept 2019). No show is a red flag. No show without explanation is even worse. Not matter how talented someone is, it’s very hard to overcome this kind of issues. My regret there is we did not have a process to flag a candidate in our system. I recall at my former workplace, due to some back and forth, one hiring manager said “enough”, let’s flag this person on our system. So basically we are unlikely to see this person again. In a way it’s a good thing, because as minimum it gives some warning: one can always over-ride computer, but computer has better memory than human beings in many occasions. This process would have helped, if we had one.

Last but not least, some interview advice from Joel Spolsky. Quote: You should always try to have at least six people interview each candidate that gets hired, including at least five who would be peers of that candidate (that is, other programmers, not managers). || (more quote) So: don’t listen to recruiters; don’t ask around about the person before you interview them; and never, ever talk to the other interviewers about the candidate until you’ve both made your decisions independently. That’s the scientific method. || I spend about 30 seconds telling the person who I am and how the interview will work. I always reassure candidates that we are interested in how they go about solving problems, not the actual answer.

Categories
Software development Technology

Java keytool

Reading Time: < 1 minuteKeytool

The Most Common Java Keytool Keystore Commands

import

  • keytool -import -trustcacerts -alias root -file Thawte.crt -keystore keystore.jks (or cacerts)
    
    (keytool -keystore $CACERTS_STORE -storepass changeit -importcert -alias jfrog.root -file jfrog.root.cer -noprompt)
    
    

list

  • keytool -list -v -keystore $JAVA_HOME/jre/lib/security/cacerts

create

mulesoft

keytool -genkey -keyalg RSA -alias <key-alias> -keystore <keystore-name>.jks

sslshopper
keytool -genkey -keyalg RSA -alias mydomain -keystore keystore.jks  -keysize 2048

Install Spring STS on Mac

Drag the STS to the Application may not necessary, as it could not find the vFabric server (need to open the folder to let base_instance know)

Other setup for Maven (3.0.5)
home brew maven30 (stackoverflow thread)

Last but not least

Java dev blogs at Okta

Categories
Java Software development Technology

Database connection pool

Reading Time: < 1 minute

https://brandur.org/postgres-connections

https://news.ycombinator.com/item?id=18220906

https://github.com/brettwooldridge/HikariCP/wiki/About-Pool-Sizing

Categories
Software development Technology

GCP Data Fusion

Reading Time: < 1 minute

(Update 12-10-2020) Ran the DataFusionQuickstart from Data Fusion Hub. Need to make sure the compute@developer service account have the following roles:

BigQuery Admin
Cloud Data Fusion Runner
Dataproc Worker
Service Account User
Storage Admin

then the datafusion user service account still has “Service Account User” role (this is same as below). The big query and storage roles are needed because the pipeline uses both. When it runs successfully, at the end we will see “Pipeline ‘DataFusionQuickstart’ succeeded.”

(Original 10-26-2020) Tried running couple more pre-set pipelines from google. It took a while to run (don’t know why). More on permissions (IAMs): need to add “Dataproc Worker” role to “Compute Engine default service account”. Continue added Service Account User to “Cloud Data Fusion Service Account / Cloud Data Fusion API Service Agent”

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

(Update 12-16-2023)

https://twitter.com/stlplace/status/1736046754615717949

On AWS a competing technology is cloudformation. The nice thing about TerraForm is it supports multi-cloud (AWS, Azure and GCP, and more).

(Original 2020)

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
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: