Today my feature branch could not be merged to master because one my commit message did not meet the merging requirements. This is how I dived into a haystack, found the commit, rebased and upated it.
First, let's find all the commits made by me 2 days ago
[code]
git log --since=2.days --author=hung
[/code]
[code]
commit 5e18ea5bd6b92d2382a545b07e3495c693fa6293
Author: Hung Dao
Date: Fri Nov 16 12:15:55 2012 -0800
sample commit message 1
commit d3727aafbadbd7befde0dd497afec3427f0bf151
Author: Hung Dao
Date: Mon Dec 3 12:57:12 2012 -0800
sample commit message 2
...
[/code]
Git doesn’t have a tool to modify history, so in order to modify a commit that is farther back in my history, there is the rebase tool to rebase a series of commits onto the HEAD. I must also define how far I want to go back and rewrite history. For this case, I want to go 1 step further than the culprit commit
[code]
git rebase -i d3727aaf~1
edit d3727aa change the commit message
pick ....
# Rebase dcfa286..5e18ea5 onto dcfa286
#
# Commands:
# p, pick = use commit
# e, edit = use commit, but stop for amending
# s, squash = use commit, but meld into previous commit
#
# If you remove a line here THAT COMMIT WILL BE LOST.
# However, if you remove everything, the rebase will be aborted.
#
Successfully rebased and updated ...
[/code]
Since the commits are listed in oposite order compared to chronological order I see in `git log`, the commit I want to change should be the first one. After rebasing, let's run `git log` one more time to confirm the change was there.
[code]
git log --since=2.days --author=hung
[/code]
And voilà!
Warning: Since it was only me who's working on the branch so I can do `git push --force origin `. It is strongly recommended not to rewrite history of a collaborative branch or repo since it may throw away other people's commits.
Eat less and more healthily.
Exercise more.
Spend more time with my family.
Live closer together.
Spend less time commuting.
Less business travel.
Have higher quality, better designed products.
Breathe cleaner air.
Drink cleaner water.
"A low energy lifestyle enables us to accomplish the things we want most in life."
From Jyri Engestrom, also check out his slides about climate change
Có một vì sao lạc
Cô đơn giữa lưng trời
Thả rơi dòng ký ức
Lạc lõng vòng tay vơi
Có một vì sao lạc
Cô đơn giữa chữ tình
Buông lơi kỷ niệm cũ
Thoáng nghe lòng vô minh
Có một vì sao lạc
Cô đơn giữa vô thường
Nửa khuya buồn trăn trở
Ngậm ngùi một chữ THƯƠNG
Có một vì sao lạc
Cô đơn lạc cõi hồn
Tên tuổi không ai gọi
Lặng buồn nỗi vô ngôn
Có một vì sao lạc
Cô đơn không bến bờ
Mãi tìm điều - không - thể
Suốt đời nhận chơ vơ
Có một vì sao lạc
Cô đơn vạn nỗi buồn
Kiếm tìm trong ý nghĩ
Muôn điều ngọt ngào hơn
Có một vì sao lạc
Một vì sao cô đơn
…..
Tử Nhi
First of all, make sure that the replica set is set up properly.
[code]
// In one of the replica servers
mongo
PRIMARY> rs.status()
[/code]
In the result, you can verify the members of the set, also check the health, uptime and ping of each member.
Now let's see the statistics for all members. When read or write is performed, we can see which member is servicing the request
[code]
mongostat --discover
[/code]
In my test scenario, I have 3 nodes (2 nodes and one arbiter) and in case I lose one, I still have enough nodes to elect a new primary and have replication to a backup node.
Now simulate a case when the secondary is down
[code]
mongo
SECONDARY> use admin
switched to db admin
SECONDARY> db.shutdownServer()
[/code]
Hitting the app to check and writing data from the app still works. Yay! Failover should be automatic since mongo client knows the right set members. More here
Bad news!
I have been wondering why my face start turning red after the first sip of alcohol and the condition runs in my family. It turns out that I have ADH1B gene coding which causes alcohol flush reaction. Here is the article from Wikipedia.
The gene results in an inhibited acetaldehydedehydrogenase enzyme, responsibile for the breakdown of acetaldehyde, the main substance produced by oxidation of ethylene glycol, a.k.a alcohol.
It is worse that people with that gene may be at a higher risk for alcohol-related diseases, such as liver and esophageal cancers and digestive tract cancer.
From now on, I just have to reduce the consumption of alcohol, or better, do not consume alcohol at all.
Sorry friends! I know it's awkward to have sober guy at the table but it has to be done.
Reference Link 1
Reference Link 2
It turned out that I got an approval for H1B petition in June and I'm about to visit Vietnam for winter holiday.
I need to prepare all the required documents for the visa interview as the timing gives me less than a month to be ready.
Step 1: Get all documents ready
Step 2: Book an interview at the US consulate in HCM city. Do not hesitate to book early since last time I didn't get the desired time and was spending half a day waiting in line.
Step 3: Bring all required documents and prepare for the interview.