顯示具有 工具文章 標籤的文章。 顯示所有文章
顯示具有 工具文章 標籤的文章。 顯示所有文章

星期六, 5月 25, 2013

[Linux] Amazon EC2 Step-by-Step 試玩心得




  最近小莊電台一直有問題,總覺得快差不多了。加上我自己也想找個雲端放我一些實驗性的程式碼,就看 Amazon Web Sevice打廣告打很兇就來玩看看了。主要目標,架設 apache2,php5,以及把 github上面的 nodejs抓回來編譯就好了。

  申請到還蠻簡單的,我稍微列出幾點要注意的地方就好了。我是使用 ubuntu 13版32位元,由於怕被收費請記住開 Micro就好,如果你要在 Conference Demo再開到 Extra Large。

  • 架設過程會產生一組  pem的 key,可透過 puttygen的 Import Key匯入轉換為 ppk檔案讓 ssh能夠和 AWS連線。

  • 開啟 putty 輸入你的 aws 分配給你的 domanin name或是ip,然後選擇 private key進行驗證。



  • ubuntu請使用 ubuntu帳號登入,登入後請用 sudo passwd更換密碼。(這應該是常識吧)
  • 在 AWS的 console有一個 ec2-xxx-xxx-xxx-xxx.us-west-2.compute.amazonaws.com,那個xxx-xxx-xxx-xxx則是你的 IP,為浮動的,請到左邊功能列的Network & Security -> Elastic IPs進行調整。 (感謝 Study提醒)
  • AWS預設只有開 SSH 22 port,請到 Network & Security -> Security Group調整。(80 或其他port)

  • 然後使用 sudo apt-get install build-essential安裝編譯工具。 (感謝 Study提醒)
  • sudo apt-get update, sudo apt-get upgrade。
  • sudo apt-get install apache2,sudo apt-get install php5。
  • sudo apt-get install git ,抓nodejs回來編譯即可。
 另外推一下我們公司的 linux-config: https://github.com/kvzhuang/linux-config。只要執行一行程式都幫你的zsh設定安裝好好的。






星期二, 5月 21, 2013

[Tools] 挑色碼不求人好工具 Kuler

  這次在 JSDC聽到 UP Chen介紹了一款由 Adobe 出的挑色碼好工具 - Kuler。使用方法很簡單,輸入一個色碼或是上傳一張圖挑選其中一區塊得色碼。此工具會根據你輸入的色碼找出連續的色票出來。這樣我們很多時候再選取色票就不求人啦!

  我拿我們公司首頁基本常用色塊舉例,我取出色碼#78D5DC

  
  然後到 Kuler點選 Create,在下方 Base Color輸入色碼選擇一個你想要的 Rule即可取得一連串相關色票,其他還有許多功能大家快去嘗試阿。






星期三, 10月 03, 2012

[Radio][Linux] 小莊電台

小莊電台

緣起 : 自己以前就喜歡聽相聲, 也對電台很有興趣. 研究所時代就曾經使用學術資源架設, 出社會就想要重溫舊夢. 架設一個不營利的電台分享音樂.

已有資源 :

  • 一台 Pentium 4 , 512 SDRam Notebook (變壓器損毀). 250GB 硬碟. 
  • 1.5M CATV 寬頻.


缺少硬體資源 : 變壓器 (感謝肥貓支援)

軟體資源 :

  • OS :  Ubuntu 12 server console (很穩!)
  • Casting Server : Icecast
  • Source Client   : ices
    • 限制 - 只能撥放 ogg stream, mp3 需要轉檔.

架構 :







門檻值評估 :
  • CPU? RAM? Network?
  • 目前算過 Network 應該為最大門檻, 以 64kb 來算, 大概能承受最多 20 個 Client.
系統便利以及持續性運作 :
#!/bin/bash
find /home/kevin/music -type f -name "*.ogg" -exec ls -1 {} \; 2> ./log/output | sort >playlist.txt

  • 使用 Crontab 排程每禮拜 2 早上五點重開, 並且撰寫 Shell Script 置於 Ubuntu 的自動啟動程序所以服務.
  • 自動更新 DNS, 使用 FreeDNS 的 CURL 更新 DNS 指令.


目前問題 :
  • 偶發切換曲目時候使用者斷線, 必須要重連
  • ISP 可能跟中華電信之間有些問題, 一些朋友無法上來當 DJ. (請不要發 Ticket 給我)
  • 亂碼問題 (ID3 以及簡體中文檔名)

未來展望 :
  • 希望能有電台 DJ 加入!..


星期一, 8月 20, 2012

[git] tag checkout memo

Checkout a repository into your Github: (we fork yui3 into our github)
git@github.com:miiicasa/yui3.git

Checkout to your local repository.
git checkout git@github.com:miiicasa/yui3.git somefolder
or
git submodule add git@github.com:miiicasa/yui3.git somefolder

List all tag (go to somefolder):
git tag -l

Checkout tag:
git checkout "v3.6.0"

It will info you that the repository was detached from master.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

Checkout as a branch:
git checkout -b "v3.6.0"

星期四, 6月 28, 2012

[VIM] Vim hacks slide and cheat sheet

在Slide Share上的Vim Hacks,我是靠這篇開始學Vim的.

Vim Hacks

以及vgod的cheat sheet.
我這種菜鳥就需要直接印出來放在工作牆XD. vgod Vim cheat sheet.