This is a case spotted recently, the file system disk usage was high and triggered the alert.

From df -hT we see the utilization of this file system has 52GB used, but checking from du -s -BG * | sort -nr I did not see any big file or folder that can explain for the big usage.

Even checking with hidden option du -sch .[!.]* * |sort -h, no answer.

Then I realized that probably the files have been deleted but they were held by live process, for example, thread.

To identify the pending deleted files:

1
2
3
4
5
6
7
8
# +L1: list files that have fewer than 1 link, so likely is deleted
# you can use | head to find the column meaning, specifically the file size
lsof -nP +L1 | grep '(deleted)'

# or using find command to get deleted file hold by process
# but this will not show the file size, the pid is in /proc/<pid>/fd
# so you which process is it.
find /proc/*/fd -ls | grep '(deleted)'

Then kill(if not needed) or restart the process or service, for example by systemctl restart, after that checked again with df -Th, the disk space got released.

The reference of Google SQL language.

Here are some sample Spanner SQL for quick revisit.

Sample Interactive SQLs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
-- Launch spanner interactive terminal with parameters
span sql --max_value_lines=300

-- help
help

-- Select DB in target scope
use /span/xxxx/cloud-example-domain:test;

-- For write and update operation
set dml_concurrency interactive_transactional;


-- Partial string match with like operator
select Device
from Devices
where Device.name like '%foo-%';

-- Use ltrim and cast
select device.region,device.area,device.name
from Devices
where device.id in ('bar','foo')
-- "apple23" will be trimmed to "23" and cast to number 23
order by region,area,cast(ltrim(d.name, 'apple') as int32)
desc
limit 3;

-- Use UNEST, in and limit
select distinct Device.reference_id
from Devices
where "example_id" in UNNEST(Device.ids)
limit 1;

-- To check timestamp change between a time period
-- it is UTC timestamp: current - 9 hour <= target time period < current - 8 hour
select Device.id,timestamp_seconds(Metadata.last_updated_timestamp.seconds)
from Devices
where Metadata.last_updated_timestamp.seconds
>= UNIX_SECONDS(TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 9 HOUR))
and Metadata.last_updated_timestamp.seconds
< UNIX_SECONDS(TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 8 HOUR))

-- Use array_length for repeated proto field
select Device.id
from Devices
where array_length(Device.ids) > 1;

-- Use group by and count(*)
select Device.service_level,count(*)
from Devices
where Device.type='SWITCH'
group by Device.service_level;

-- Insert with proto
insert into ProjectMappings(ProjectMapping, Metadata)
values(
{project_number: 1357913579,
billing_account: "test-billing-account",
project_state: "PROJECT_STATE_ACTIVE",
alias: "test-alias"
},
{
last_updated_timestamp: {seconds: 1689901201},
version_id: 1555444333222111000,
state: "LATEST",
created_by: "example@gmail.com"
}
);

-- Compare timestamp seconds
SELECT *
from PrivateCloudMetadata
WHERE PrivateCloud.region in ('us-east4', 'us-central1')
AND Metadata.last_updated_timestamp.seconds
> UNIX_SECONDS(TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 5 DAY));

Redirect

1
2
3
4
5
6
7
8
-- Run sql from input.txt, absolute path
Source /home/user/chengdol/input.txt;

-- Capture into output.txt, absolute path
TEE /home/user/chengdol/output.txt;

-- cancel output redirect
NOTEE

In our day to day JSON usage, the JSON is usually used as an object with string key and various value type pairs, for example:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
{
"squadName": "Super hero squad",
"homeTown": "Metro City",
"formed": 2016,
"secretBase": "Super tower",
"active": true,
"members": [
{
"name": "Molecule Man",
"age": 29,
"secretIdentity": "Dan Jukes",
"powers": ["Radiation resistance", "Turning tiny", "Radiation blast"]
},
{
"name": "Madame Uppercut",
"age": 39,
"secretIdentity": "Jane Wilson",
"powers": [
"Million tonne punch",
"Damage resistance",
"Superhuman reflexes"
]
},
{
"name": "Eternal Flame",
"age": 1000000,
"secretIdentity": "Unknown",
"powers": [
"Immortality",
"Heat Immunity",
"Inferno",
"Teleportation",
"Interdimensional travel"
]
}
]
}

The JSON can also made out of arrays:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
[
{
"name": "Molecule Man",
"age": 29,
"secretIdentity": "Dan Jukes",
"powers": ["Radiation resistance", "Turning tiny", "Radiation blast"]
},
{
"name": "Madame Uppercut",
"age": 39,
"secretIdentity": "Jane Wilson",
"powers": [
"Million tonne punch",
"Damage resistance",
"Superhuman reflexes"
]
}
]

And JSON can actually take the form of any data type that is valid for inclusion inside JSON, not just arrays or objects. So for example, a single string or number would be valid JSON (reference).

Single number or string JSON:

1
110
1
"hello, json"

You can validate them in the online formetter.

Objective:

  1. become better at casual conversation/small talk/short interaction.
  2. build social confidence
  3. keep smiling in facial expression

Chapter 1

The small talk mindset

Prepare for the conversation beforehand, to get ready psychologically, otherwise your thoughts are unorganized, lack of focus and awareness.

Simply like:

1
2
Hello there!
How's your day going? Great to hear, bye!

Do you eat lunch solo/ˈsoʊloʊ/? Set beside a coworker and start the conversation by asking recent company/team events.

Daily short interactions with people:

  • cashier at checkout counter
  • shuttle driver
  • waiter
  • valet/ˈvælɪt/
  • doormen

They need to be courteous/ˈkɜːrtiəs/ to you, so don’t be fear of crashing and burning.

Make it a goal to initiate and create a 10 seconds interaction with a stranger each day, and especially on the way to functions, events and parties, this will warm you up for conversation and build the habit of being interested in people.

A childlike exercise

Read out loud physically, to help your speaking muscles and get them in shape.

You can have short excerpt to stretch your emotion, express them with high and low points. Pay attention to the tonality, the rate of speech, for big point you need to slow the pace.

Your conversation resume

Developing and constantly updating your conversation resume can save you from awkward silence and make it nearly effortless to connect to others.

When someone ask you a question, you don’t need to answer it literally and instead can redirect them to sth else you’ve prepared on your resume.

Practice the resume before you go to socailly intense situations.

Converstaional stages

Getting to know someone happens in a sequential manner, we cannot skip steps if we want to go deepers:

  1. small talk
  2. fact disclosure (share details of your life)
  3. opinion disclosure (common ground to share viewpoint and opinions)
  4. emotion disclosure (be cautious be the intimacy level)

Chapter 2

For new people, first remain reserved so you can calibrate your interactions, read your new acquaintance, and determine how familiar or relaxed you can be.

You are making impression on everyone you meet, send a signal of comfort and familiarity

Set the tone

Remeber not to be so literal and serious, be playful, relaxing attitude is right.

Make the first move

Don’t think you are interrupting people, come up with a compelling reason to interrupt people or walk up to a stranger, that would override your fear of judgment.

  1. Ask people for objective/subjective info.

Switch the perspective to “I don’t feel condifent or comfortable” more than an “I don’t know what to say”. It does not matter that the people you are asking know the answer, it is just a way to begin a dialogue, it does not even matter you don’t know the answer.

  • do you know what time the speech begin?
  • do you know where the closest starbucks is?
  1. comment on sth in the environment, context, or specific situation.

  2. comment on a commonality you both share.

  • why do you know here?
  • how do you know jack?

Find similarity

Find similarity by:

  1. mirroring the behavior: gesture, tone, words, etc
  2. share a heathy amount of info, enrich the details.

Manufacture connection

For people that are less talktive, not good at opening up themselves, you can use elicitation/i,lisi’teiʃən/ tech to ask question indirectly and guide their response.

  1. Recognition: your sweater is nice!
  2. Complaining, people love mutual dislike or they defend your point
  3. Correction, people love to be right and correct you
  4. Naive, but not mean to act stupid

Or:

  1. ask a question that your think may be answered, act as if they answered it and react to that hypothetical answer.

Chapter 3 How to be captivating

How to use storytelling in your everyday and small talk: talk about the past in a way that makes people pay attention.

Instead of give one-word answer, get into habit of framing your answers as a story with a high point.

Bring people’s curiosity, you can have compelling anecdotes/ˈænɪkdoʊt/ at hand in response to very common and widespread questions.

1:1:1 method for mini story

  1. has one action.
  2. can be summed up in one sentence.
  3. evokes one primary emotion in the listener.

Chapter 4 Keep it flowing and smooth

Keep small talk anything but small.

How can you think more quickly on your feet? This requires practice: by simply taking a word and naming a few words or concepts that it reminds you of, to train your brain’s quick response.

Acronyms to help assit you in never running out of things to say on the fly:

  • HPM: history(your personal experience), philosophy(your opinion on the topic), Metaphor(what the topic makes you think of)
  • SBR: specific(more detail on the topcic), board(broader context of topic), related(related topics)
  • EDR: emotion(emotion the topic evokes in the other person), detail(on topic), restatements(restarting the topic to prompt greater elaboration)

Chapter 5 Go Deeper, Be Better

let people guard down and build an actual relationship:

  1. positive compliment on people’s conscious choice that reflect their thinking process.
  2. Listening, having a listening mindset, if they said sth, there is a reason.
  3. better questions: ask open-ended questions, follow-up questions.

Get comfortable with dead air and utilize it.

Chapter 6 Looking Inwards

Looking inward to yourself, are you someone who is easy to make small talk with?

If not, take action and build yourself, find passions and hobbies, proactively learn about what you are interested in.

When working on update target field in Cassandra in batch, the IN operator is used with comma separated primary keys.

To get a list of primary keys is simple, for example, you can CAPTURE them to a text file and find them out by bash pipeline if needed, then we need to put them into a single line with comma as separator.

For example, the file test.txt conatins primary keys:

1
2
3
4
aaaaa
bbbbb
ccccc
ddddd

There are multi-way to do it, one is using paste command:

1
cat test.txt | paste -s -d, -

The output is:

1
aaaaa,bbbbb,ccccc,ddddd

Using tr command can do the same with an additional tail comma, for example:

1
2
cat test.txt | tr '\n' ','
# aaaaa,bbbbb,ccccc,ddddd,

Imposter/imˈpästər/ syndrome

Be aware we all feel like imposter syndrome sometimes, and don’t let it get to you. It is fun not knowing what to do and figuring it out as opposed to fearing it, the more you fear it, the more control it has over you.

The importance of data to convince others

Engineers are data-driven people. Always back up your ideas with data, the more you provide, the easier you convince others.

How often should you interview

  1. meet amazing people.
  2. know your market value.
  3. get backup options: turn down the offer, ask match the offer, jump to new opportunity, negotiate.
  4. opportunity to find sth you love.
  5. stay sharp about domain knowledge.
  6. learn what you know well and what you do not.

Learn to say no and brutal prioritization

  • You are assigned work based on your experience and reputation.
  • Opportunity cost: if comes at a cost of missing your deadline.

Always calculate the opportunity cost, prioritize brutally, and learn to say no to people with an explanation of why it is a no.

Never say no

  • say no but never use actual word “no” directly
  • I would love to help on this, but to set expectation, here are the tasks I need to do for this week that are higher priority.

Keep a good blacklog and always use it to your advantage to tell people why you cannot prioritize what they are asking instead of saying no, stay away from saying no as much as possible.

Finding a mentor

  • Pick a design decision and study it as much as possible, discuss on blind spot/spɑːt/.

Always look out for mentors, the more the better. But pick them carefully to make sure their goals are aligned with yours.

Prototype fast, first working prototype always wins

Always turn your ideas into working prototypes as fast as possible. Everyone has great ideas, but a working prototype is game-changer.

Visibility is everything

  • which one do you think deserves promotion?
  • which one do you think should be let go if company is downsizing?
  • for repeated questions, write a playbook and answer for others reference.

Always find ways to increase your visibility. If no one knows you did sth, no one will believe you have done anything important.

Let people fail, help them fall slowly

  • You need to remind yourself of how you felt as a junior with a micromanaging monster.

Don’t be a micromanager. Set a direction and let people do their best while preparaing a safety net in case they fall.

The tiebreaker - reaching consensus

  • The problem starts when the discussion is about sth non-quantifiable and people’s options come from their intuition.
  • The majority wins will not help you get global optimum, but if things go wrong, nobody is to be blamed and everyone is responsible, the failure will still make team move forward and make better decision next time.

Always have an odd number of people in decision-making so you can have a tiebreaker, remove egos from the picture, the majority wins.

Or ask the authority to decide and clarify when you cannot speak in power.

The importance of allies in design decisions

  • A better approach is composing the design with different options without too many details and sending it around for a small group of people to get feedback as early as possible and keep the design an evolving collaborative document.
  • Doing iterative design help you pick the solution that has the agreement.
  1. Use design discussion to utilize other people’s brain as much as possible.
  2. Make sure all the decisions and the alternatives are documented so everyone can follow.
  3. Make the design an evolving design instead of an end-to-end design.
  4. Have a small group of engineers and get them to you allies before the final design discussion.

The power of meeting summary emails/notes

  • give them chance to correct any misunderstandings, brings everyone to consensus.
  • keep track of all decisions made and people’s positions.

Get yourself in the habit of taking notes and sharing them with stakeholders after each meeting.

Align and Align

  • The secret of success of any company is to figure out long-term vision, the short-term direction.
  • join the all-hands meetings in your company to get a better understanding of the leadership’s long-term goals, keep asking questions, have meetings with the skip-manager to learn from them.
  • Be a regular user of your product; keep an eye on what other projects are going around.
  • The more alignment, the higher impact of your projects, the higher chance to get promoted.

Make sure both you and team are aligned with management, vision and company, this should be a regular exercise for you.

The power of giving credit

Giving credit to the owner either by directly telling them or spreading in meeting or email, the more credits you give, the better.

Sharing the responsibility

For oncall specifically:

After heavy on-call week, the on-call engineers try their best to mitigate and prioritize things, and drive the sync up to distribute(visible to team) the remaining tasks to the team(for example owner who introduced them) and make sure they don’t have too much during the sprint.

Pay attention to patterns and come up with process to solve problems instead of getting frustrated.

Taking responsibility & ownership

Leaders step up, take responsibility for all the risks that carries, and try their best to avoid it ever happening again.

Pick an area, start acting like an owner, take responsibility and shield/ʃiːld/ people.

How to disarm assholes

  1. Try your best to change your perspective and see things from their side.
  2. Change the way you communiate with them. If in-person is a problem, utilize messages/emails
  3. Take a break, let your emotions calm down, and look at the conflict objectively.
  4. Start documenting conflicts and ask someone to give you advice.
  5. Pick projects that do not involve working with them.
  6. Ignore them at all cost.
  7. Talk to manager.
  8. Change the team.
  9. Change the company.

Adaptability

Be positive to the changes around you, calm down and think about the challenges and opportunities introduced rather than being fearful, keep good mindset.

The important of tools and patterns

Always consider whether there is any tool that can help your task better, faster and with fewer mistakes, keep learning tool consistently in your career.

Open source internally

Even for company internal project, treat and evolve it as the open source style, this can remove yourself as a single dependency from the project in the long-term.

The general workflow for open source project:

  1. code sth useful
  2. doc how it works and API usage
  3. doc how to contribute
  4. upload the code to a repo
  5. preferably add doc for each component, the more the better.
  6. add unit test, the more tested the better.
  7. preferably functional tests.
  8. keep an excellent backlog to prioritize and track tasks.
  9. advertise the project and get more engineers invested.
  10. drive the long-term vision and assign task to appropriate engineers.
  11. stay on top of code reviews to keep code quality high.
  12. keep repeating maintaining, docing, adding tests, prioritizing, etc.

How to get more headcount

  1. Switch project unimportant as fast as you can.
  2. Increase your project visibility, advertise the project and yourself better.
  3. Maintain a good backlog and make it visible.
  4. Make sure other team requests are visible, do not fix things before discussing them during sprint.
  5. Seek feedback and improve yourself.
  6. Find another team with management that has faith in you.

Side projects and knowing your surroundings

Tracking other projects will be confused at beginning but it takes less and less time later. Networking is important to achieve that, pls see below section.

Benefits:

  1. Become the go-to person for others, by helping others know what is going on, you become more senior.
  2. Become the bridge between teams, start impacting on projects by commenting and knowing priorities than teammates.
  3. Chance to help other teams to make right choices in their design.

Most of the engineers in big company are working on existing project by doing incremental changes, it is lucky and not common to start sth from scratch and watching it grow.

You can working on small things with surrounding projects, get insider knowledge of how system is being designed and long-term vision for it, this can also help you find critical-priority project that truely care about.

The importance of networking

Started building relationships before you need anything:

  1. Eating lunch with coworkers.
  2. Attend the happy hours, events.
  3. Monthly/biweekly meeting, ask pick up a topic.

After networking, you will not feel you are approaching someone for gain but approaching a friend for help, people love help friends.

Changing teams, risks, timing, making the switch

Familiarize with performance deadlines. The best time to switch team is after your results are finalized, especially right after a promotion, if possible.

How fast to respond email/chat

  1. The one who always replies answer fast in chat/email is the go-to person.
  2. Find the “sweet spot” to decide how often to check the notifications: are you good at context switch?
  3. The ack can be:
  • ASAP: ack, acked, checking
  • will respond in a minute, have meeting and will get back to this in half hour, will answer by EOD
  • how urgent is it? can I look at it later, get back to you later today.
  1. tag people if you are not the right owner, if not very sure, say: pls take a look and tag the right person
  2. create post for repeated questions and share.

1 on 1 with leadership

Status update only is not useful to you, to have right perspective for these meetings, make best use of them, they are here to support you:

  1. happy with your career?
  2. burning out?
  3. plan the career development.
  4. plan the long-term goal.
  5. help you not fail.

For project:

  1. set boundaries with another team?
  2. need someone to drive the discussion, tiebreaker?

You need to get good at reading people, take notes in things you see, this will help you recognize patterns, keep noting the things they do amazingly and the things the are not doing that well.

More important in one-on-one:

  1. career developlment, what you want to learn or get involved?
  2. long-term vision, what your team is trying to achieve? great chance to know the surrounding projects, what others are working on?
  3. getting high quality feedback, make sure the feedback is proactive and actionable, keep follow-up questions, ask to be more concrete and how to improve? Put a plan to move forward.
  4. ask for recommendation when need help, who to access, etc.
  5. ask for mentors, manager has larger network than you.
  6. talk about other people who need help, make sure to pick your words wisely so don’t like you are complaining about someone and focus on what kind of help you manager can bring.
  7. not to be stranger to higher management, ask for meeting with them, they have long-term goal and details. Stay away from yes/no question, instead:
    • how do you see my project aligning with the long-term goal?
    • how do you envision my project evolving in time?
    • what the best outcome you think we can get?

Ack then think

  1. Never let yourself be quiet when you have sth important to say, no matter how early or late, it has to come out.
  2. You can give up safely, say: “Never mind?”

Stop thinking too much and start acting. Start with simplest step to force yourself. At the very least, start making sounds like “Umm” or send out the meeting invite, and then you can figure out the rest later.

Do not be scared to take the time off

If you are sick or have a family situation going on, or have vacation saved up, use it! You should put you 100% at your job, if cannot, take the PTO until you can.

Biggest regret

How to answer interview questions:

  1. what is your biggest regert?
  2. what is the big risks you have taken?

If you cannot answer these questions, that means you are playing too safe. Work on things you will be proud to mention in the future, you can work on 2 safe projects and jump to a risk one, and repeat.

Perfectionism the biggest enemy

Focus on MVP(here it means most valuable product), focus on selling point and make sure that is working and nothing more, don’t spend on too many details, too much perfecting, avoid overengineering.

Don’t let the sneaky ego ruin your life.

Finding an owner area

  1. Establish authority and job security, knowing how to add new features and make sure things do not get broken is super valuable.
  2. Who is in charge of what when join a new team, what is the dependency structure like? Any old system that everyone scared to touch and avoids working on?
  3. After gaining ownership, you can slowly start replacing pieces with better designs.
  4. New and high impact projects will have many people trying to stay as an owner.

Lookout any system without clear owners and try to take them over, or start a new system.

Do not redesign a working system

  1. No working code is bad code! System/requirement keeps changing, the “perfect” design will be short-lived.
  2. Your new system is likely not very different from the old one, when crashing hacky solution(inelegant solution to a particular problem) could be added.
  3. weigh the pros and cons of redesigning a system.

Do not touch a working system thinking you can make it better. Every project starts super clean and nicely design. Then life happens, and each hacky code you see is actually fixing a business logic for sth important.

The important of culture

  1. Company culture, the division adds their own culture on top if it and team further adds sth on their own, for example, how much do you feel encouraged to break things?
  2. Different team/project can have differet pace, think about that: (1) fast prototype and implementation, breaking and fix fast? (2) rethink and do many sanity check before submit?
  3. adding sth of your own to the culture.

Pick the company that aligns with your cultural expectations.

Ambiguity

  1. Dealing with unknowns
  2. Chasing after dozens of people, asking right questions and bringing everyone to a consensus, this is the hardest part.
  3. requirements are constantly changing.
  4. senior people work more on influencing people to the right choice.
  5. A half working system is better than a not working one.

Keep fighting the ambiguty. Start an evolving design doc, collect requirements: must-haves vs nice-to-haves and use cases, prioritize, find solutions that fit, do comparative analysis(pros and cons), setting deadline, bring tiebreaker, sharing meeting summary, prototype fast, repeat until ambiguity disappears.

Hold that question

Hold your questions for a second, build your process, and do basic searches before asking questions. If you cannot find answers, mention your process and ask for help.

Put it on my tasks, unblock yourself

  1. what if you keep ending up stuck in a discussion you don’t believe is worth the time?
  2. never shut someone up in discussion and push back by saying “No”.

Make sure people feel valued when they share suggestions by writing them down to notes, design documents, or simply by creating tasks. If you cannot get into the task soon, it is nice gesture to reach out to the person and explain why you cannot prioritize it right now.

Do you have sometime, ask my calendar

Get better at using calendars, they are like have an executive assistant without actually paying for one. Try incorporating them into your personal life as well.

Setting focus time on calendar

Utilize the calendar tool to set up starting, ending business hours, lunch block and focus time, so people know when not to schedule meetings or ping you directly.

Make people think it was their idea

  1. People let their egos get involved in the decision-making process.
  2. Ask yourself how to reach the idea? past learning, data, experience?
  3. direct people by asking questions.
  4. If no agreement, step back and find the missing pieces.

Do not tell people what your solution is. Give them the data that help you reach the idea and ask leading questions until they reach the same solution.

Being more active on interviewing others

Answer common questions from candidates:

  1. what are you working on?
  2. how much you like it?
  3. how much chance you get for self-development?
  4. what your day-to-day life is like?

Be more involved in the interview process.

What to expect from a brand-new manager

The new manager career has to learn a lot, pick up new perspectives, give up an old habits, and let go of control.

Do your best to help them with every challenge they face, otherwise, change your team as quick as possible.

Collecting actionable feedback

  1. write down the things that need to be improved in each cycle, document how you had done to improve through the cycle and show the progress at the end.
  2. get “constructive” feedback, actionable from your colleagues, managers.
  3. ask feedback sooner rather than later, anonymized comments, also ask feedback on product and process.

Always think of what you can improve about yourself, share it with peers and work on it. Ask for actionable feedback throughout the cycle, find an useful tools to anonymize/ə’nɔnimaiz/(hide identity) them if needed to make your peers feel comfortable about their honest opinions.

Dogfooding

Just list private preivew.

  1. It is the process of using or testing your own services before going public.

Keep using your service as much as possible, and plan dogfooding sessions. Make them organized, assign some parts to everyone involved, grant incentives.

The importance of knowing terms, office jargon

Acronym /'ækrənɪm/: OOO, LGTM, AFAIK, LMAO.

Every time you hear an acronym or term you don’t know, loop them up and note them down until you memorize them. Terms are super helpful to communication and design discussion, never underrestimate their value.

  1. This is essential to senior track.
  2. search google trends or github trends to see which projects are trending.
  3. Know cloud provider’s new product and try it.
  4. Take a note of this project in case later you need it, run small prototype.

This can prepare yourself for a great design discussion and have an idea of what are the available solution out there and how they solved similar problems you are facing

Never keep all your eggs in the same bucket

  1. Implement and landing project, then start onboarding other engineers and focus more on leading them and offloading your time to set the direction.
  2. When you feel the project is not too challenging anymore or not taking all of your time, it is a sign to look for other projectsm, and so on.

Solve the hard challenges, put things in order, onboard more engineers, and focus on becoming a great leader who is hard to replace.

The importance of positive surroundings

We are the average of the closet friends we have. Make sure you pick the close friend wisely.

Being the happy coworker

Find ways to love what you are working on or find projects you will love working on. If you can achieve being happy during the day, your teammates will love working with you.

Working at a start-up

Start-up concerns:

  1. move fast, insane/ɪnˈseɪn/ paces, good fit?
  2. shared office spaces.
  3. layoffs due to financial difficulty.
  4. tech stack, more open-sources and build from scratch.
  5. long work hours, less WLB.
  6. income, stock compensation may not be fulfilled before IPO.

Practice to be good at context-switch and multitasking. What stage the start-up is in, and the risk is different.

Start-up can teach you a lot, before decision making connect with engineers to get some insider info on what they like and dislike.

Office politics

  1. the long-term vision is driven by the leadership, project distributions are influenced by the leadership.
  2. remember that management tends to change regularly; positions get realigned all the time.

Build connections with the leadership but use it more for influencing long-term vision and not to bully people. Always prefer other conflict resolution tactics, but if you no other choices, having strong connections is always better than not having them.

How to help your manager work for you

  1. working on your expectation document improvements.
  2. ask for feedback actionable:
  • what areas would you improve on?
  • do you need to be better at communication?
  • should you increase your visibility?
  • is you code quality not up to the standards?
  • do you need to work on higher impact project?
  1. help on priority tasks from other teams and talk to others, share the task details, your insight and how valuable you think.
  2. tag your manager in all your design review for visibility, even if they do not have time to fully review or comment.
  3. use your manager as central people database.
  4. start writing your GRAD/performance doc early and keep asking review and feedback.
  5. ask for more interview opportunities.
  6. ask for the promotion template.
  7. ask to find your mentors.
  8. share your long-term vision to them, how the project you working on can set the team at a privileged position in the future and get feedback.
  9. have your manager resolve conflicts for you.

The importance of intelligence

Be good at networking. Build your intelligence netowrk, remember trust is a two-way thing.

Comparative analysis

  1. putting things in pros and cons list/table and comparing them, highlight the difference for reviewer.

Using comparative analysis to visualize the pros and cons and make a choice to fit all requirements easily.

Power of A/B testing

People might suggest things like bias, seasonality or random shifts in user actions, but if you have strong metrics to prove your contribution, they cannot say much about it.

Learn how A/B testing works and uses it on your projects so you get data to prove exactly how you have helped the critical metrics. Data is hard to argue against.

Logs, events, metrics and dashboards

Always write self-explanatory log messages and add as many events as possible; create good dashboards to make sure your system is functioning correctly.

Dashboard with meaningful data is a easy way to convince people, learn dashboard build tool and SQL.

Debuggers and crash investigation

  1. breakpoint, step in, variable value display, auto crash detection, edit code and exection on the fly, change vars value, etc
  2. there could be some tunnel extension to help you debug on live server remotely.

Use debuggers on your code smartly and help you fix issues.

Remember it is not your company

Always remember it is not your company. Use all benefits, enjoy your time there, focus on learning the most and being more productive.

Playing for the long game

Focus on the long game, not short-term gain in your career and life.

Unexpected Shenzhen Street Food Bargains

  • chinese hamburger, chinese pork burger
  • claypot beef: thick/θɪk/, meaty soup
  • street vender, vibrant/ˈvaɪbrənt/ street/night market
  • it is so delicious, so much flavors and all the ingredients are fresh as well
  • flaky pastry/ˈpeɪstri/ bread 酥饼, the skin is a little bit dry, crunchy /'krʌntʃi/ bread, very crunchy texture (such as fried fish)
  • coriander/ˌkɔrɪ’ændɚ/
  • meat is tender and juicy 鲜嫩多汁
  • roasted potato, outer layer is crispy/'krɪspi/, a bit salty
  • sweet potato sheet packed/wrapped with other ingredients, tasty inside
  • I wish I have a bigger belly so I can keep on eating

TOP 7 Delicious Chinese Mooncakes You Got to Try

  • mid-autumn/moon festival, the second biggest festival in China
  • mooncake, original classic, nutty mooncake 五仁, just sweet enough for me black sesame/'sɛsəmi/: jet black 乌黑(jet blue 深蓝)
  • red bean paste 豆沙, perfect amount of sweetness just chewy/'tʃui/ enough
  • jujube/ˈdʒuˌdʒub/, dates paste
  • I am not a big fan of durian, very well known for its smell, smelly/'smɛli/
  • way better than the previous one, different flavor and texture/ˈtekstʃər/
  • the flavor is actually pretty mild, not imagined overwhelmingly strong…

All-You-Can-Eat Buffet in Shenzhen China

  • find the cheapest place ever to eat
  • meatball: Braised pork ball in brown/braʊn/ sauce 红烧狮子头
  • chinese pickle, 泡菜,咸菜,榨菜, taste a bit pickle
  • texture is moist/mɔɪst/ not too dry
  • it is flavorless/bland so I put sugar on it
  • it is still good value but the variety nowhere near as good as here.
  • it is very jelly 类似素毛肚的口感
  • tray/treɪ/, holder 托盘

Exploring the Vibrant Chinese Street Food Culture in Our Local Neighbourhood

  • let’s check it out
  • stool/stuːl/ vs chair, stool typicallylacks a backrest and armrests.
  • flat noodle 河粉
  • bean sprout
  • squid tentacle/'tɛntəkl/

Dragon Boat Festival

  • let’s dig in: 深入研究一下
  • yummy/ˈjʌmi/: casual way to express pleasure or satisfaction regarding the taste of food
  • I don’t know how to explain its texture
  • dragon boat festival
  • zongzi: everyone eats them around the dragon boat festival so I have been eating them as well; weird triangle, sticky, meat insdie and wrapped with leaf; sweet one and meat one

Shenzhen Top 5 | Why We Love Living in Shenzhen

  • time to do a top five of why …
  • ebike culture, moving around on a ebike
  • stick around to the end of the video to find out sth we don’t like
  • the spontaneity/ˌspɑːntəˈneɪəti/ and friendiness of all the people: 自发性
  • they don’t care about what they look like while having fun, no self-conscious/ˈkɑːnʃəs/ in any way, without any fear of being judged or shamed or mocked: 不自然的,忸怩的,害羞的
  • you have abundance/əˈbʌndəns/ of restaurants, bars, snack bars

Eat Dinner in Supermarket

  • spicy crispy: 麻辣脆
  • tester/sample: 试吃
  • it is nice and steamy, soft, freshly cooked
  • giant crab, lobster/'lɑbstɚ/
  • look at this feast/fiːst/: 筵席,宴会
  • here is your deluxe/dɪˈlʌks/
  • beef is very thin cut, very well seasoned
  • do you know what reminds me of this? 这个让我想起什么
  • dried cranberry/'kræn’bɛri/ 蔓越莓

Veggie Sausage

  • what that tastes like?
  • made out of/without meat
  • flour or starch/stɑrtʃ/ sausage
  • I gonna have it more often actually

Noodle All You Can Eat

  • You can eat any amount you want
  • celery/'sɛləri/ 芹菜
  • there is a misconception that foreigners don’t like spicy food
  • reddish pickle 粉红
  • square方形, flat/flæt/扁的, round圆的, fat宽的 noodle

Some random eatings

  • the texture is slimy/ˈslaɪmi//(slimier): a moist, soft, and slippery, similar to chewy.
  • dipping sauce: vinegar, soy sauce, onion, garlic, chilli
  • sizzling hot plate/'sizliŋ/ with beef and rice: 铁板牛肉
  • lamb skewer/'skjʊɚ/ 羊肉串

Mountain campus tour

  • tent campus, campus tour
  • today is really misty/ˈmɪsti/(foggy) and we are in the clouds
  • trampoline/'træmpəlin/: 蹦床
  • hermetic sealed meat, you need to pull it open
  • cannot wait to dine/daɪn/
  • diarrhea/ˌdaɪə’riə/ 腹泻, bellyache/'bɛlɪek/ 腹痛
  • sticky candy with caramel/'kærəmɛl/ flavor 焦糖

Dongbei Malatang

  • super good winter food
  • that’s crazy (insane/ɪnˈseɪn/)
  • I have never tried it before, today its gonna be the first time, let’s go.
  • quail egg/kweɪl/, little egg
  • peanut sauce 麻酱

Fabric market in GuangZhou

  • We are *on the hunt for some new stuff
  • let’s go and look for that
  • This fabric is soft, super cozy for winter
  • accessory section, they have buttons, beads/biːd/ 珠子, you name it

Why We LOVE China’s CHEAPEST Italian Family Restaurant

  • foreign food Aisa style
  • Japanse family-style chain restaurant
  • the flavor has been changed to suit the local customer
  • it is really a massive bargain
  • we ordered 11 dishes and 4 drinks
  • really moist, wet/wɛt/ and juicy and garlicky/'gɑrlɪki/, salty cheese on top
  • escargot/ˌɛskɑrˈɡo/: (法)食用蜗牛

Chinese fried rice

  • You speak impeccable/ɪmˈpekəbl/ mandarin: in accordance with the highest standards of propriety; faultless
  • how much work is still outstanding(remaining to be paid, done, or dealt with)
  • your support has been outstanding(exceptionally good).
  • the flavor is mind blowing/'bləuiŋ/: overwhelmingly impressive!
  • the flavor is magnificent /mæɡˈnɪfɪsnt/: impressively beautiful or excellent
  • pear/per/

Play bowling in China

  • bowling/'bolɪŋ/, bowling alley/ˈæli/
  • do you have any technique? skill or ability in a particular field
  • This is the new technique/skill I learned
  • unveil/ˌʌnˈveɪl/ the truth

The CRAZY WORLD of Beef Hotpot in China

  • lamb/beef hotpot
  • look, hard work pays off
  • Do you have any recommends, what set meal is good for a family 4 people
  • the meat is too fatty
  • it is a little bit lighter than other hotpots
  • main dish: 主食

outdoor food in shenzhen

  • speciality/ˌspɛʃɪ’æləti/: especially a type of food, which a person or region is famous for making well
  • outdoor restaurant 大排档
  • rice soup 类似粥
  • seafood cake, omelette/'ɑmlət/ style dish with mussels or clams: 煎蛋卷
  • ice cream cone/koʊn/ filled with little chocolate and cookies
  • it is made out of fruit(haw/hɔ/), texture is a little bit hard, chewy/'tʃui/
  • made out of yoghurt/ˈjoɡɚt/ 奶疙瘩
  • this one is not for me
  • giant pancake folded 山东煎饼零食

celebrate the year of the dragon

  • to celebrate the chinese new year
  • cool chinese decoration
  • stick the “fu” character upside down on their doors

China dimsum

  • traditional and authentic /ɔːˈθentɪk/ chinese food
  • the spring roll is oily/ˈɔɪli/
  • i can go from being a dimsum skeptic to being a dimsum fan
  • fried and steamed chicken feet: 凤爪
  • out of politeness, I ate it
  • the congee is very gooey/'ɡui/: sticky, like the paste: a thick/θɪk/, soft, moist substance.
  • crispy/crunchy durian snack: 榴莲酥

the fattest noodle ever!

  • is this chinese food at its best: highest or most excellent level of quality
  • xi’an noodle place, serving xi’an noodle cuisine /kwɪˈziːn/
  • meat inside is tender, succulent/'sʌkjələnt/(tender, juicy and tasty), full of flavor
  • the spicy overtakes the flavor of the pork a little bit
  • authentic way to eat raw garlic: first take a bite of noodle and then raw garlic, great combination!
  • enjoy your video’s vibe/vaɪb/, so relaxing

rural china life

  • it turned out great!
  • we’ve brought our herd of friends and family
  • the crew(team) is intrigued/ɪnˈtriːɡ/ by the little tiny car
  • creepy things in the room
  • lush/^/ bamboo forests
  • the weather was not it 不给面子
  • the mist is sublime/səˈblaɪm/ 给力的
  • do you like the night vibe? 夜景
  • I’ve only been away for like 2 months 仅仅离开2个月, and there are new stuff
  • this is a social zone
  • seasonal creek, it only flows right after the rain
  • how has your experience been? 目前为止感觉如何
  • that’s deep 深奥

Chengdu street food

  • peppercorn 干胡椒,胡椒粒 vs pepper 胡椒粉
  • feel the numbness/ˈn ʌmnɪs/ now? -> electricity shot on your tongue I cannot feel my mouth right now
  • MSG: food additive used to enhance the savory/ˈsevəri/ taste of foods
  • lard: pork oil
  • fragrant chili oil; bubbling/^/ hot pot
  • noodle submerged in a flavorful broth or dry noodle style
  • salty solution 咸溶液 to make tofu jello/jelly

This is a convenient function to create isolated, self-contained environment for development.

For example, I want to test my Go/Python app in different versions w/wo external service dependencies. Previsouly I need to set up virtual env for Python or managing multiple versions for Go. Now by taking the advantage of dev container I can easily develop code inside the full-feature container(or docker compose) with SVC editor even in parallel.

Prerequisite

The dev container overview.

  • Docker installed at target machine(local or remote)
  • VSC Dev Container extension installed

Setup

How to Create a Dev Container

  1. create a .devcontainer folder in your project root directory.
  2. create a devcontainer.json(not hidden) file inside .devcontainer folder and add settings, for example:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/go
{
// A name for the dev container displayed in VSC left corner status bar
"name": "Demo",
// other pre-build image to use, it has better support and features.
// https://github.com/devcontainers/images/tree/main/src
"image": "golang:1.21.3-bullseye",

// Dockerfile is most suitable for installing packages and tools independent of your workspace files.
// https://code.visualstudio.com/docs/devcontainers/create-dev-container#_dockerfile
// "build": { "dockerfile": "Dockerfile" },

// Docker compose
// https://code.visualstudio.com/docs/devcontainers/create-dev-container#_use-docker-compose

// Features to add to the dev container. More info: https://containers.dev/features.
// For example, you can install go, git here instead of using post create command
// "features": {
// "ghcr.io/devcontainers/features/common-utils:2": {},
// "ghcr.io/devcontainers/features/sshd:1": {}
// },

// Configure tool-specific properties.
"customizations": {
// Configure properties specific to VS Code.
"vscode": {
"settings": {},
"extensions": [
"streetsidesoftware.code-spell-checker"
]
}
},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [9000],

// Use 'portsAttributes' to set default properties for specific forwarded ports.
// More info: https://containers.dev/implementors/json_reference/#port-attributes
// "portsAttributes": {
// "9000": {
// "label": "Hello Remote World",
// "onAutoForward": "notify"
// }
// },

// Use 'postCreateCommand' to run commands after the container is created.
// you can have a utility script in your workspace folder to indicate what
// to install here, but a Dockerfile may be more efficient.
// "postCreateCommand": "bash -i scripts/install-dependencies.sh",

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
"remoteUser": "root"
}
  1. open the dev container config folder in VSC, then start the dev container:
1
Dev Containers: Reopen in Container
  1. if any change is made in .devcontainer.json, rebuild it:
1
Dev Containers: Rebuild Containers

How to Attach to a Running Container

Visual Studio Code can create and start containers for you but that may not match your workflow and you may prefer to “attach” VS Code to a running Docker container - regardless of how it was started.

Once attached, you can install extensions, edit, and debug like you can when you open a folder in a container using devcontainer.json.

This is useful to modify and test a running docker container on the fly without codebase on your local.

  1. attach VSC to a running container
1
Dev Containers: Attach to Running Container

If you need to repeatedly attach to a running container, you can set up configuration in image or container-name level, so next time the attach will start in the right step and place.

Templates

There is a bunch of exisitng dev container template to pick up, please check:

1
Dev Containers: Add Dev Container Configuration Files

For example, Go & PostgreSQL Docker compose dev container setup.

Other Use Cases

1.Open a folder on a remote SSH host in a container

  • install Docker on remote host.
  • SSH to the remote host and open the target folder by VSC.
  • create and set up the dev container config file.
  • start the remote dev container from VSC.

2.Open a folder on a remote Tunnel host in a container

3.Attach to a container in a Kubernetes cluster

This is a design and good practice about how to manage data in table for Spanner, and you can extend it to other types of DB accordingly.

Table Schema

Basically, the table will have 2 columns:

  • Object: proto or encoded JSON, can be easily backward compatible in case of adding new fields or deprecating old fields.
  • Metadata: proto or encoded JSON, stores the info associated with the paired Object.

For Metadata, it consists of:

  • version_id: uint64, such as 100000000023
  • version_state: enum
    • UNDEFINED: should never be used
    • LATEST: current object
    • ARCHIVED: stale object (must be followed by either LATEST or DELETED)
    • DELETED: deleted object
  • created_by: string, such as bob@corp.com
  • last_update_time: UTC, timestamp or uint64 for seconds

The primary key of the table is the combination of Metadata.verion_id and certain fields from Object.

How it works

The primary idea is that we never physically delete the record from the table within the data retention period.

  1. A new object foo is created by user alice@corp.com, the metadata#1 is
1
2
3
version_id: 100000000001
version_state: LATEST
created_by: alice@corp.com
  1. Some fields of the object foo’s are updated by leo@corp.com, the original foo record metadata#1 will be changed to
1
2
3
version_id: 100000000001
version_state: ARCHIVED
created_by: alice@corp.com

At meanwhile, a new foo object is written into the table with the metadata#2 below:

1
2
3
version_id: 100000000002
version_state: LATEST
created_by: leo@corp.com
  1. Later, user john@corp.com want to delete the foo object, the metadata#2 will be changed to:
1
2
3
version_id: 100000000002
version_state: ARCHIVED
created_by: leo@corp.com

At meanwhile, the foo object with metadata#3 is created:

1
2
3
version_id: 100000000003
version_state: DELETED
created_by: john@corp.com

In this foo’s lifecycle, we totally have 3 records and we know who did what and when.

Please note that each operation(create, update, delete) should be in a transaction as old one(if exists) needs to be marked as ARCHIVE and new one will be created (LATEST or DELETED), otherwise there will be duplicate records from Object perspective although the Metadata.version_id is different.

For DB which has changelogs for history, auditing, debugging, you may not need this design as it compliates the client side implementation, but they may be not that straightforward in real case for quickly checking.

Data Access Layer

You need to create data access layer for common operations like above, the app or service should not access the DB directly via SQL query but using the API provided by data access layer, for example:

  • list object
  • upsert object
    • archive object
  • delete object
    • archive object
  • query object by certain fields

For human, it is still available to run CRUD on DB directly, but should be cautious and with AOD(access on demand) for production.

Base Management Class

A base management class can be created to handle common operations and specific Object class inherits from it, for example:

Data Retention

If physical deletion is required in terms of data retention policy, you can have scheduled job to scan the table in off-peak time in 2 steps:

  1. loop through all LATEST objects, if invalid, logically delete it in a transaction.

  2. loop through all DELETED objects, if invalid, physically delete it and all ARCHIVED ones, no transaction is needed.

This is the abridged summary of team tech talk ;-)

Type of Testing

Amount of tests from high to low:

  • Unit tests: functions in your code, you use Mock/Fake for external dependencies, focus on good coverage.

  • Functional tests: isolated functionality of single component, whthin its boundaries, focus on business logic, every path should have a test.

  • Integration tests:** components are being actively developed are involved, focus on different combinations, not all the functions.

  • E2E tests: often the first “real” env being tested, inevitable for a product, need to exercise main product features(happy path), for example: create, update, delete a PC, focus on main use cases.

  • CUJ(critical user journey) tests: usually manual process, like UAT(user acceptance test), focus on common user cases, for example, not just only create a PC but also deploy and run the workload.

CUJ can help to improve the user experience, while UAT can help to ensure that the system meets the user’s requirements.

Regression test(can be of anyone above) ensure new feature does not break exsiting code.

0%