Yet another bootstrap theme.

2022-10-06
gitbook-reset-commit

git reset, 一直是我沒有弄懂的部分,這篇要多看幾次

  • 節錄文章中的說明
    • Reset 這個英文單字的翻譯是「重新設定」,但事實上 Git 的 Reset 指令用中文來說比較像是「前往」或「變成」,也就是「go to」或「become」的概念
    • $ git reset HEAD~2
      • 正確的說,上面這個指令應該要解讀成「我要前往兩個 Commit 之前的狀態」或是「我要變成兩個 Commit 之前的狀態」,而隨著使用不同的參數模式,原本的這些檔案就會丟去不同的區域。

Reference

Read More

2022-10-06
gitbook-view-log-of-a-file

滿好用的技巧,之前不知道,@@

  • 使用 sample
    • git log welcome.html
    • git log -p welcome.html

Reference

Read More

2022-10-06
gitbook-ignore

Read More

2022-10-05
gitbook-convenient-settings

設定

  • 有設定了 git log & git l,可以多用用看

Reference

Read More

2022-10-05
github-book-local-config

為你自己學 Git,是一本我滿喜歡的 git 書籍,我有買了實體書 & 數位版
這邊筆記一下,我由網站上看到的資料

設定

  • 可以每個專案設定不同的作者嗎
  • $ git config --local user.name Sherly $ git config --local user.email sherly@5xruby.tw

Reference

Read More

2022-10-04
aws-rds-proxy-sqlalchemy

記錄使用 sqlalchemy 透過 PyMySQL 連線到 RDS proxy 遇到的問題

進行 ssl/tls 連線的方式

  • 設定 ssl_args
  • code example
    ssl_args = {'ssl': {'use': True}} echo_sql = True if os.environ.get('SQLALCHEMY_ECHO') == 'true' else False engine = db.create_engine(conn_sqlalchemy_str, echo=echo_sql, poolclass=NullPool, connect_args=ssl_args)

連線到 RDS proxy 解法

  • 遇到的問題
    • 有使用rds_client.generate_db_auth_token 取得 token,不過連到 DB 還是會出現
    • [ERROR] OperationalError: (pymysql.err.OperationalError) (1045, "Access denied for user 'master'@'172.31.58.218' (using password: NO)")
  • 解法
    • 關閉 IAM auth 的方式,改為使用傳統的 auth

Reference

Read More

2022-10-04
aws-find-by-ip

使用 cmd 範例

  • aws ec2 describe-network-interfaces --region=us-west-1 --filters Name=addresses.private-ip-address,Values=10.0.0.1

Reference

Read More

2022-09-28
aws-rds-proxy

Read More

2022-09-16
git-branch-tips

用 git 的好處,就是可以很方便的建立 & 刪除 branch
就記錄一下,目前有用到的 & 找到的使用 branch 的一些技巧 & 資料

使用 cmd 建立 local branch & 設定到 remote

  • 建立 local branch
    • git checkout -b <branch-name>
  • 將建立好的 branch push 到 remote
    • git push <remote-name> <branch-name>
      • <remote-name> is typically origin
  • 設定 push
    • git push --set-upstream <remote-name> <local-branch-name>
    • git push -u origin <local-branch-name>

清除 local branch 的方式 (單一的 branch)

  • 清 local branch 的方式
    • git branch -d <branch>

清除 remote branch 的方式 (一次 sync branch)

  • 跟 origin fetch 時,一併清除 remote 上不存在的 branch
    • $ git fetch --prune origin

清除 remote branch 的方式 (單一的 branch) - 不常用

  • 清 remote branch (已刪除的 branch)
    • $ git remote prune <remote>
    • `$ git remote -v

origin https://gitserver.com/user/repository.git (fetch)
origin https://gitserver.com/user/repository.git (fetch)
`

Reference

Read More

2022-09-16
aws-cost-anomaly-detection

在使用 AWS 的過程中,因為都是 pay as you go 的,有可能在開發的過程中,就不經意的花了過多的 cost
就試著設定 Cost Anomaly Detection 來試試看

Tips

  • 設定 alert Threshold 時,其中 Threshold 的值,就是你所花的錢,跟 machine learning 的結果,是無關的
    • Threshold: The spend amount for which you would like to receive alerts.
    • The threshold you set for the alert subscription is purely for alert notifications. It is separate from the anomaly detection threshold.

Reference

Read More