使用 ssh tunnel 透過遠端機器 ip 測試 api

今天再測一隻 api 的時後, 因對方 api 有設定限制 ip local 的網路 ip 無法做測試, 因此要做一個 ssh tunnel step0. 在本機必須可以 ssh 到該台機器上 e.g. $ ssh dd3 dd3 是使用 ssh config 設定的 host step1. 建立 ssh tunnel $ ssh -D 9999 -C -N dd3 這行指令的意思是 ‘建立一個與 dd3 的 ssh tunnel, 在本機可以透過 port 9999 做 forwarding »

[DB] RDBMS 淺談

參加 Triton Ho 的 RDBMS 淺談 的一些筆記 簡報連結 1. 為何選擇 RDBMS 歷史悠久, 社群支援度良好, 基本上不會有太大的問題 比 NoSQL 有更快的發開速度 對於一般中小型系統, 效能足夠了 更加安全 快速開發 大部分系統 multiple records atomicity 不能避免的需求 (e.g. 把錢從用戶 A 轉到用戶 B、購買虛擬道具) 支援多種資料型態 支援十進制的 numeric, 在計算金錢數值時特別有用 中小型系統(資料量 < 100GB »

[Rails] 專案部署前, 機器設定

1. update and upgrade system $ sudo apt-get update $ sudo apt-get upgrade $ sudo apt-get autoremove $ sudo reboot 2. set timezone $ sudo dpkg-reconfigure tzdata // 測試 $ date 3. install required package sudo apt-get install curl zlib1g-dev build-essential »

[Rails] 使用 memcached 儲存 session

memcached 是一套 Name-Value Pair (NVP) 分散式記憶體快取系統, Key 的長度被限制在 250 characters, 儲存的資料不能超過 1 megabyte 要特別注意, memcached 不是 persistent data store, 只要關掉 memcahed 重開, 裡面的資料會通通不見 Rails 專案 Gemfile 內加上 gem 'dalli' 執行 bundle install 接著將 config/enviroment/production »

[Tool] 在 macOS High Sierra 使用 telnet

因為安全性關係(傳輸資料時未加密), 在 macOS 10.12 之後, telnet 從預設軟體被移除了 如果要使用的話, 要自己安裝回來 這裡使用 Homebrew 安裝 $ brew install telnet 裝完後可以輸入以下指令測試 (輸入後會在終端機以 ASCII 播放星際大戰4 XD) $ telnet towel.blinkenlights.nl Ref: How to Get Telnet for MacOS in Mojave or High Sierra »

使用 Let’s Encrypt Wildcard 萬用字元憑證

2018/01 後, Let’s Encrypt 推出 ACME v2 API 可以支援 Wildcard Certificates 使用 Wildcard Certificates 可以用一個憑證保護 base domain 下的數個 subdomain 在 Examples for DNS 01 hooks 這些別人包好的 script 裡面找到對應你使用的 DNS 服務 筆者使用 godaddy 所以用的是 le-godaddy-dns 這套 vps 環境: Ubuntu 16.04 »