跳到主要內容

Access previous(old) version Amazon Linux AMI repository

Since Amazon Linux AMI will update about every 6 month.
If you need to keep repository in some specific version.
i.e. if the latest is 2013.09,  and you want to stay in 2013.03, you can change the repository file to some specific version.

#vi /etc/yum.d/amzn-main.repo
mirrorlist=http://repo.us-east-1.amazonaws.com/$releasever2013.03/main/mirror.list

#vi /etc/yum.d/amzn-updates.repo
mirrorlist=http://repo.us-east-1.amazonaws.com/$releasever2013.03/updates/mirror.list

#yum clean metadata

#yum search kernel-devel --showduplicates

Another tips regarding Amazon Linux is: if you use python platform.dist() to check distribution information. You will get empty string. However, I think you can use os.path.exists("/etc/image") to check if it is a AmazonLinux. That file contains detail information and it should only exists in AmazonLinux.

留言

這個網誌中的熱門文章

Access private API gateway from another account

最近在做一個 PoC 驗證說怎麼在現有的架構下,把一些 public API 移到 VPC 裡面,只讓特定網路的人可以存取。 當然最直覺的想法就是,建一個新的 VPC ,加上 execute-api VPC endpoint 然後這個 VPC 再跟特定網路做 Peering,建一個 Private API Gateway 在新的 VPC 裡面。 這樣新的 VPC 可以透過 VPC endpoint 去存取 API Gateway,然後再加一個 ALB ,裡面的 target group 指向 VPC endpoint 的 IP和 443 port,ALB 設定好 Domain Listener,API Gateway 也加上相同的 Custom Domain Name,這樣子 ALB 就可以當成特定網路 access 的 entry point,一但 Peering 完成後,從特定網路來的 request 就可以經由 ALB -> API GW 跨 VPC 存取原本環境的 backend resource。 但我一直在想,Peering 是必要的嗎? 沒想到隔天就看到這個教學  How can I access an API Gateway private REST API in another account using an interface VPC endpoint?  裡面的做法突破了原本我直覺上的盲點! 就是即使是 Internal API Gateway 似乎只要設定好了 resource policy 就可以允許其他 account 的 VPC endpoint 跨帳號存取! 所以例子裡面的 private API Gateway 是建立在 B 帳號裡面,A 帳號的 VPC 只是啟用了 VPC endpoint,一但 B 帳號的 private API Gateway 在 resource policy 設定好允許 A 帳號的 VPC endpoint 存取,即使兩個帳號之間沒有 peering 也是可以互通的! 雖然說這樣子要帶 hostname header or api-gw-id 但是 原本架構上的 ALB 也是為了 VPC endpoint 可以知道要 forward request 給哪個 API Gateway ...

flash tomato firmware on ASUS RT-N12-C1

Tomato by Shibby For RT-N12-C1 we have to download from: K26RT-N – MIPSR2 – special builds for E4200, RT-N10U, RT-N12B1/C1, RT-N15U, RT-N53, RT-N66U, WNR3500Lv2 and newer Linksys E-series routers Step: 1. Reset AP to factory default 2. Setup staic IP for you desktop or laptop 3. Unplug power 4. Press the reset button in the back of AP the plug power 5. Wait until the pwoer led falsh slowly 6. Open browser and connect http://192.168.1.1 7. You should see a firmware upload page, select the tomato firmware and upload it 8. After upload success wait 5 minutes 9. Connect http://192.168.1.1, if you see the tomato webpage, you have done the job!

3M UVA3000 更換濾芯紫外線燈匣

用了一年的3M濾水器提示說要換濾芯和燈匣 上 Youtube 想找教學的影片可是沒看到 UVA 3000 的 經過了一番奮戰後在這邊記錄一下 希望可以幫助後人,以免再重蹈覆轍。 Step 1. 拔掉插頭,把淨水器從牆上拿下來(基本上他是掛著而已),比較方便施工。 Step 2. 把前蓋往上拉,很容易就可以看到裡面的東西了。 Step 3. 打開後可以看到有兩個柱狀體,左邊的是燈匣,右邊的是濾芯。 Step 4. 這裡有個祕技是,這兩個柱狀體是可以往上 翻開30 度左右,這樣就可以有比較大的空間施工。 Step 4. 更換濾芯的話,柱狀體的瓶身上有箭頭,往左就是轉開,往右就是鎖緊。 Step 5. 更換燈匣的話比較麻煩一點,因為他底部是電源,頂部的右邊有個突出來的小方塊。對照淨水器上方連接處的話會有個弧形的凹槽,這是要 match 的.如果你只注意瓶身的箭頭往右鎖回去,就會造成漏水...Orz... Step 6. 把前蓋蓋回,機器掛回牆上,插插頭,開水,如果機器沒有告訴你有燈匣異常或漏水的話,就可以長按 C / UV  Reset 計數器了. 所以關鍵字就是,要往上翻 30 度,燈匣上面的小凸點要在右側,要看瓶身的 小箭頭. May it helps!