Stanley Meng

OS: Ubuntu 20.04

While following RVM: Ruby Version Manager — Installing RVM to install RVM, got the following error:

curl: (77) error setting certificate verify locations:
CAfile: /etc/ssl/certs/ca-certificates.crt
CApath: /etc/ssl/certs

I tried a few ways around, but didn’t fix. Finally this one works for me.

$ sudo apt reinstall ca-certificates
$ sudo update-ca-certificates

The second command is important. I ran the first command first, but the problem didn’t fix, so I thought ca-certificates package was fine. Then I went with other posts which kind of wasting lots of time.

Then, finally, I realized I have to run the second command too.

--

--

For instance, you have a parameter in the template:

"EnableWebServer": {
"Default": "No",
"Description": "Enable Web Server in the Ubuntu or not",
"Type": "String"
}

You want to pass it to the Shell Scripts in UserData to run some commands based on this parameter. Here is an sample:

"UserData": {
"Fn::Base64": {
"Fn::Join": [
"",
[
"#!/bin/bash -xe\n",
"if [[ \"Yes\" == ",
{
"Ref": "EnableWebServer"
},
" ]]; then ",
"echo yes > /tmp/1.txt; ",
"else ",
"echo no > /tmp/1.txt;",
"fi\n",
]
]
}
}

--

--

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

--

--