Skip to content

Instantly share code, notes, and snippets.

View clarencetw's full-sized avatar
🏠
Working from home

Clarence clarencetw

🏠
Working from home
View GitHub Profile
route53 IN NS ns-108.awsdns-13.com.
route53 IN NS ns-1626.awsdns-11.co.uk.
route53 IN NS ns-1065.awsdns-05.org.
route53 IN NS ns-1008.awsdns-62.net.
@clarencetw
clarencetw / curl-body-automatically-brings-timestamp-1.sh
Created August 1, 2019 16:03
curl-body-automatically-brings-timestamp
timestamp=$(date +%s)
authorization=token
curl -v -H "Authorization: Bearer ${authorization}" -H 'content-type: application/x-www-form-urlencoded' -d "timestamp=${timestamp}" -X POST https://clarence.tw/api
@clarencetw
clarencetw / sample-1.sh
Created July 27, 2019 16:07
certificate-pinning-analysis
clarence:~$ curl -i https://api.github.com/users/octocat/orgs
HTTP/1.1 200 OK
Server: GitHub.com
Date: Thu, 08 Nov 2018 06:49:41 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 5
Status: 200 OK
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 46
X-RateLimit-Reset: 1541661588
@clarencetw
clarencetw / sample-1.sh
Created July 27, 2019 16:00
aws-ec2-new-instances-type-t2-to-t3
sudo apt-get update && sudo apt-get upgrade -y linux-aws
@clarencetw
clarencetw / bash-1.sh
Created July 27, 2019 15:48
wordpress-from-gke-to-digitalocean
clarence$ kubectl get all
NAME READY STATUS RESTARTS AGE
pod/mysql-0000000000-AAAAA 1/1 Running 0 6d
pod/wordpress-0000000000-AAAAA 1/1 Running 0 6d
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/kubernetes ClusterIP 10.0.0.0 <none> 443/TCP 1y
service/mysql ClusterIP 10.0.0.0 <none> 3306/TCP 1y
service/wordpress LoadBalancer 10.0.0.0 35.197.0.0 80:31737/TCP 1y
@clarencetw
clarencetw / sample-1.sh
Created July 27, 2019 15:43
when-the-website-is-good-or-bad-server-ip-address-not-found-analytical-method
clarence~: dig @8.8.8.8 blog.clarence.tw
; <<>> DiG 9.10.6 <<>> @8.8.8.8 blog.clarence.tw
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 43396
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
@clarencetw
clarencetw / sample.sh
Created July 27, 2019 15:33
internal-domain-mdnsmulticast-dns
clarence~: python -m SimpleHTTPServer 80
clarence~: curl http://clarence.local/
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html>
<title>Directory listing for /</title>
<body>
<h2>Directory listing for /</h2>
<hr>
<ul>
</ul>
@clarencetw
clarencetw / bash
Last active July 27, 2019 15:30
curl-details-tcp-ssl-connection-time
clarence:~$ curl https://blog.clarence.tw
clarence:~$ curl -o /dev/null https://blog.clarence.tw
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 32550 0 32550 0 0 27874 0 --:--:-- 0:00:01 --:--:-- 27892
clarence:~$ curl -w "@curl-format.txt" https://blog.clarence.tw
clarence:~$ curl -w "@curl-format.txt" -o /dev/null https://blog.clarence.tw
@clarencetw
clarencetw / npmrc
Last active July 27, 2019 15:26
github-package-registry-beta
//npm.pkg.github.com/:_authToken=PERSONAL-ACCESS-TOKEN
@Codertocat:registry=https://npm.pkg.github.com/
@clarencetw
clarencetw / sample-1.sh
Created July 27, 2019 15:10
use-dig-command-to-understand-the-characteristics-of-aws-vpc-in-dns
dig +nocmd +noall +answer +ttlid a google.com