This one is just kind of my cheatsheet.

The host on which runs the Build/CI process (i.e. make, gcc, unitest..etc) is in the company’s network, and my development host is at my home network.

I personally don’t like work on coding remotely on the build host, through SSH or the SSH remote addion of Vscode, and another important reason is that the DevOps team would clean up the disk on the build host once a while in order to save the disk space, without informing all the users. …


NOTE, it’s not permission error, that is another story!

This kind of issue could be all kind of reasons.

But, anyway, first of all, you should check the NFS version in your server and the client. Make sure you configure it based on the right version. Actually, the help info /etc/exports has this info, I quote

#
# Example for NFSv2 and NFSv3:
# /srv/homes hostname1(rw,sync,no_subtree_check) hostname2(ro,sync,no_subtree_check)
#
# Example for NFSv4:
# /srv/nfs4 gss/krb5i(rw,sync,fsid=0,crossmnt,no_subtree_check)
# /srv/nfs4/homes gss/krb5i(rw,sync,no_subtree_check)

So, make sure you use the correct config format in the /etc/exports.

In my case, both client and server use V4. At beginning, I used

/srv/homes       hostname1(rw,sync,no_subtree_check)

it didn’t work.

I changed it to

/srv/homes       hostname1(rw,sync,fsid=0,crossmnt,no_subtree_check,no_root_squash)

Now it works.

Do NOT forget to restart the NFS server after you make any change in /etc/exports.

Have a good day.


Maybe I should consider github for this kind of document…uh…anyway, let me go with Medium.

  • How many files are modified in the local repo, but with only file name
git ls-files -m | wc -l
  • Compare files in different branches
git diff <branch name a>:<file path>  <branch name b>:<file path>For instance: git diff v9700:Shared/copy_coredumps.rb v9800:Shared/coredump_check/copy_coredumps.rb
  • Adds currently tracked files (which have been modified) to the staging area and also checks if they have been deleted (if yes, they are removed from staging area). NOTE it does not stage new files
git add -u
  • TBD

To be honest, the UI of Office 365 Outlook doesn’t get any improvement except for the ‘Focus View’. There are difference places you can change the view, fonts, layout…etc, which is quite confused.

Anyway, if you just want to change the font size of the email content, here is how.

In the right-bottom, there is a little tiny Zoom in/out bar:

By clicking the “+” or “-”, you can enlarge or shrink the fonts of the current email’s content temporarily, yes, temporarily, and only for the current email opened in the pane, only for this time.

If you want to change the font size permanently, click the percentage number (I circled it in red), a dialog box will pop up:


Problem: Virtualbox Guest VM (Linux OS in my case) cannot start on Windows 10 with the error: “ VT-x is not Available”.

If you have tried the following:

  • Enable VT-x in BIOS
  • Disable Hyper-V on Windows 10
  • Play around any kind of settings in local Group Policy

But, the problem still persists. It could be due to Windows Defender Credential Guard. This setting cannot be disabled via UI.

Microsoft provides a WIKI on how to do so: https://docs.microsoft.com/en-us/windows/security/identity-protection/credential-guard/credential-guard-manage

But this WIKI is really long and confusing. Actually, what you need to do is:

  1. Save this powershell scripts in to a…

Here is my real situation. The product I’m working on is deployed to both AWS and Azure. The product is exactly the same in both platform, so I do not want to waste time maintain two sets of Rspec examples which do the same tests. I want the examples can be shared by the specs.

All the sample codes in https://relishapp.com/rspec have the shared_examples block and the describe block in the same file. It doesn’t work for me. The deployment procedures for AWS and Azure are different. Alright, in order to share the Rspec examples, but still do different setup/teardown…


Recently, I’m quite happy with Sublime Text.

The theme and fonts settings of mine, just for my own record:

{
"color_scheme": "Packages/Theme - One Dark/Widget - One Dark.tmTheme",
"font_face": "Hack",
"ignored_packages":
[
"Vintage"
],
"theme": "Gravity.sublime-theme",
"enable_tab_scrolling": false,
// Determines what character(s) are used to terminate each line in new files.
// Valid values are 'system' (whatever the OS uses), 'windows' (CRLF) and
// 'unix' (LF only).
"default_line_ending": "unix",
// Display file encoding in the status bar
"show_encoding": true,
// Display line endings in the status bar
"show_line_endings": true
}

All credits go to https://hitchhikingtheweb.wordpress.com/2014/09/02/portforwarding-with-vmware-player-and-nat/

Virtual Box has a quite friendly UI to do so, just go to Settings-> Network -> Adapter<n> , click “Port Forwarding”. Configure a NAT rule, for instance:

name: external SSH incoming
protocol: TCP
Host IP: <Your Windows public IP>
Host port: The port the remote SSH connects to, for instance, 2244
Guest IP: The IP of your guest OS
Guest Port: it’s TCP 22 for SSH

That’s it for Virtual Box. Now, you can SSH to your VirtualBox Guest VM from remote host using the command:

ssh -p 2244 <username>@<your windows 10 IP>

But Vmware…


I spent some time on this topic because the code I got was a bit confused. I didn’t understand why it worked in this way. The code is really messy. I’m now doing the refactoring…

Well, anyway, I’ve been using Rspec for over past 2+ year, but I have to say, I’m still new…so, maybe, the following info is not 100% correct… let me know if you have any input.

  1. When you run command “rspec” in cmd, it calls Runner.invoke()
  2. Runner.invoke calls Runner.run()
  3. Runner.run() initializes a ConfigurationOption object and assign it to parameter ‘option’. This ConfigurationOption object reads and loads…


In my case, I get a resource ID of a subnet, which looks like:

subnet-009abbace367f2c03

And, I want to get all the tags of this subnet.

To do so:

# Aws SDK 2@ec2 ||=  Aws::EC2::Client.new(region: region)# See Comment 1
resp = @ec2.describe_tags(
{
filters: [
{
name: "resource-id",
values: ["#{resource_id}"],
},
],
}
)
# See comment 2
resp.to_h[:tags].find{|n| n[:key] == "Name"}[:value]

Comment 1:

Rspec actually got an array of hash, below is an example:

{:tags=>[{:key=>"Application", :resource_id=>"subnet-009abbace367f2c03", :resource_type=>"subnet", :value=>"arn:aws:cloudformation:us-east-1:490780517948:stack/test-239-xg-standalone-783/ad0f61c0-43a6-11ea-8522-0a200f00c284"}, 
{:key=>"AutomationDowntime", :resource_id=>"subnet-009abbace367f2c03", :resource_type=>"subnet", :value=>"off"},
{:key=>"AutomationExcluded", :resource_id=>"subnet-009abbace367f2c03", :resource_type=>"subnet", :value=>"false"},
{:key=>"BusinessUnit", :resource_id=>"subnet-009abbace367f2c03", :resource_type=>"subnet", :value=>"NSG"},
{:key=>"Component", :resource_id=>"subnet-009abbace367f2c03", :resource_type=>"subnet", :value=>"UTM Base team"}…

Stanley Meng

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store