Google home not responding to ‘Hey Google’ but ‘Okay Google’

Recently I found my Google home becomes a bit silly. It never responds to my Hey Google command any more like before. However Okay Google still works. Also while playing my Google music playlists, it randomly stops and drops songs which is quite annoying. Then I notice in the version, its language value is Japanese which I set…

npm git private repo auth

Our enterprise Github recently made a change so all anonymous access from work laptop are blocked. This causes problem as we have some private repo dependencies in our package.json like below: dependencies { … “sun”: “git+https://github.kdc.capitalone.com/NeX/sun-ng2-nex.git”, … } Whenever I try to do npm install, it gives me authentication error. I can get it installed…

oauth grant types

Recently we need to integrate our frontend spa with oauth(call third party apis), Need to figure out which grand type fit which use case. The specification describes five grants for acquiring an access token: Authorization code grant Implicit grant Resource owner credentials grant Client credentials grant Refresh token grant So most common is 1 and…

you should never use WEP in router

Today I received another mail from Verizon saying my speed is upgraded to 75/75. However every time I test it is always 20/20. I also restart my router and even push the reset button at the back to do reset still no luck. So i decided to call them to see whether they throttled my bandwidth….

stateful firewall with inbound outbound traffic

Background I have worked as Devops for cloud migration in the recent 3 months without really writing much code. Even though being exposed to many AWS services like EMR/EC2/ASG(auto scaling group)/LC(launch config)/CF(cloud formation) etc.. with the need of setting up security groups(SG), i find myself still a bit confusing with inbound and outbound traffic rules….

DNS原理以及A/NS Record Cname

阮一峰 老师的一篇关于DNS的好博客,尤其喜欢里面对于分级查询以及A-Record, NS-Record, CNAME的解释, 简单明了, 所以转载了这一部分如下:   四、域名的层级 DNS服务器怎么会知道每个域名的IP地址呢?答案是分级查询。 请仔细看前面的例子,每个域名的尾部都多了一个点。 比如,域名math.stackexchange.com显示为math.stackexchange.com.。这不是疏忽,而是所有域名的尾部,实际上都有一个根域名。 举例来说,http://www.example.com真正的域名是http://www.example.com.root,简写为http://www.example.com.。因为,根域名.root对于所有域名都是一样的,所以平时是省略的。 根域名的下一级,叫做”顶级域名”(top-level domain,缩写为TLD),比如.com、.net;再下一级叫做”次级域名”(second-level domain,缩写为SLD),比如http://www.example.com里面的.example,这一级域名是用户可以注册的;再下一级是主机名(host),比如http://www.example.com里面的www,又称为”三级域名”,这是用户在自己的域里面为服务器分配的名称,是用户可以任意分配的。 总结一下,域名的层级结构如下。 主机名.次级域名.顶级域名.根域名 # 即 host.sld.tld.root 五、根域名服务器 DNS服务器根据域名的层级,进行分级查询。 需要明确的是,每一级域名都有自己的NS记录,NS记录指向该级域名的域名服务器。这些服务器知道下一级域名的各种记录。 所谓”分级查询”,就是从根域名开始,依次查询每一级域名的NS记录,直到查到最终的IP地址,过程大致如下。 从”根域名服务器”查到”顶级域名服务器”的NS记录和A记录(IP地址) 从”顶级域名服务器”查到”次级域名服务器”的NS记录和A记录(IP地址) 从”次级域名服务器”查出”主机名”的IP地址 仔细看上面的过程,你可能发现了,没有提到DNS服务器怎么知道”根域名服务器”的IP地址。回答是”根域名服务器”的NS记录和IP地址一般是不会变化的,所以内置在DNS服务器里面。 下面是内置的根域名服务器IP地址的一个例子。 上面列表中,列出了根域名(.root)的三条NS记录A.ROOT-SERVERS.NET、B.ROOT-SERVERS.NET和C.ROOT-SERVERS.NET,以及它们的IP地址(即A记录)198.41.0.4、192.228.79.201、192.33.4.12。 另外,可以看到所有记录的TTL值是3600000秒,相当于1000小时。也就是说,每1000小时才查询一次根域名服务器的列表。 目前,世界上一共有十三组根域名服务器,从A.ROOT-SERVERS.NET一直到M.ROOT-SERVERS.NET。 六、分级查询的实例 dig命令的+trace参数可以显示DNS的整个分级查询过程。 $ dig +trace math.stackexchange.com 上面命令的第一段列出根域名.的所有NS记录,即所有根域名服务器。 根据内置的根域名服务器IP地址,DNS服务器向所有这些IP地址发出查询请求,询问math.stackexchange.com的顶级域名服务器com.的NS记录。最先回复的根域名服务器将被缓存,以后只向这台服务器发请求。 接着是第二段。 上面结果显示.com域名的13条NS记录,同时返回的还有每一条记录对应的IP地址。 然后,DNS服务器向这些顶级域名服务器发出查询请求,询问math.stackexchange.com的次级域名stackexchange.com的NS记录。 上面结果显示stackexchange.com有四条NS记录,同时返回的还有每一条NS记录对应的IP地址。 然后,DNS服务器向上面这四台NS服务器查询math.stackexchange.com的主机名。 上面结果显示,math.stackexchange.com有4条A记录,即这四个IP地址都可以访问到网站。并且还显示,最先返回结果的NS服务器是ns-463.awsdns-57.com,IP地址为205.251.193.207。 七、NS 记录的查询 dig命令可以单独查看每一级域名的NS记录。 $ dig ns com $ dig ns…

bcrypt 加密算法

The prefix “$2a$” or “$2b$” (or “$2y$”) in a hash string in a shadow password file indicates that hash string is a bcrypt hash in modular crypt format.[3] The rest of the hash string includes the cost parameter, a 128-bit salt (base-64 encoded as 22 characters), and B184 bits of the resulting hash value (base-64…

2015 in review

The WordPress.com stats helper monkeys prepared a 2015 annual report for this blog. Here’s an excerpt: The concert hall at the Sydney Opera House holds 2,700 people. This blog was viewed about 31,000 times in 2015. If it were a concert at Sydney Opera House, it would take about 11 sold-out performances for that many…

Create an alias for your gmail without creating a new account

When I apply my google account, I did not include my name in the user name. In some scenarios this might be not easy for others to recognize my email address like for example in the church’s mailing list. However I donot want another gmail account since it is too much to manage 2 email…

git pull fetch merge

Difference In the simplest terms, git pull does a git fetch followed by a git merge. You can do a git fetch at any time to update your remote-tracking branches under refs/remotes/<remote>/. This operation never changes any of your own local branches under refs/heads, and is safe to do without changing your working copy. I…

Security Stocks Bond Equities Shares 区别

Securities:证券,是各类财产所有权或债权凭证的通称,是用来证明证券持有人有权依票面所载内容,取得相就权益的凭证。所以,证券的本质是一种交易契约或合同,该契约或合同赋予合同持有人根据该合同的规定,对合同规定的标的采取相应的行为,并获得相应的收益的权利。按其性质不同可将证券分为证据证券,凭证证券和有价证券。有价证券又可分为:(1)资本证券,如股票、债券等;(2)货币证券,包括银行券、银行票据等;(3)财物证券,如货运单、提单、栈单等。 An instrument representing ownership (stocks), a debt agreement (bonds) or the rights to ownership (derivatives). A security is essentially a contract that can be assigned a value and traded. Examples of a security include a note, stock, preferred share, bond, debenture, option, future, swap, right, warrant, or virtually any other financial asset. Securities are…

git command line commit

Git has a “staging area” where files need to be added before being committed, you can read an explanation of it here. So if you make some change and commit directly, you get some message like: no changes added to commit (use “git add” and/or “git commit -a”) preview Before you add, you could have…