2014年4月10日 星期四

[Wordpress] 修改Wordpress字型

Wordpresstwentyeleven預設的字型是使用GeorgiaHelvetica Neue
可以修改style.css的font和font-family, 換成微軟正黑體, 讓整體看起來比較舒服

修改地方如下
318 body, input, textarea {
319         color: #373737;
320         /*font: 15px "Helvetica Neue", Helvetica, Arial, ans-serif;*/
321         font: 15px "微軟正黑體", sans-serif;
322         font-weight: 300;
323         line-height: 1.625;
324 }
383 blockquote {
384         /*font-family: Georgia, "Bitstream Charter", serif;*/
385         font-family: "微軟正黑體", sans-serif;
386         font-style: italic;
387         font-weight: normal;
388         margin: 0 3em;
389 }
393 blockquote cite {
394         color: #666;
395         /*font: 12px "Helvetica Neue", Helvetica, Arial, sans-serif;*/
396         font: 12px "微軟正黑體", sans-serif;
397         font-weight: 300;
398         letter-spacing: 0.05em;
399         text-transform: uppercase;
400 }

2014年4月2日 星期三

[資訊安全] nmap掃IP和掃port

nmap是出門在外的好物, 簡單紀錄幾個常用語法

可掃網段, 看ping的回應(-sP: Ping Scan - go no further than determining if host is online)
$ sudo nmap -sP 192.168.1.0/24

可掃網段, 列出主機列表(-sL: List Scan - simply list targets to scan)
$ sudo nmap -sL 192.168.1.1-254

針對特定主機掃描(也可掃網段), 會顯示開啟的port
$ sudo nmap -vPN 192.168.1.x

針對特定主機掃描(也可掃網段), 會顯示開啟的port, 主機用的作業系統
$ sudo nmap -sV 192.168.1.x

以stealth SYN scan的方式掃描, 較不易被對方主機紀錄
$ sudo nmap –sS 192.168.1.x

reference:
* The Art of Port Scanning

2014年3月20日 星期四

[Vim] 去除^M

:%s/<Ctrl-V><Ctrl-M>//g
<Ctrl-V>表示組合鍵Ctrl+V , <Ctrl-M>表示組合鍵Ctrl+M
Ctrl+V是讓Vim顯示^字元

reference: 
* How to convert the ^M linebreak to 'normal' linebreak in a file opened in vim?

2014年3月16日 星期日

[應用程式] 安裝skype在64-bit的ubuntu上

最近換了新電腦, 是i7配上ssd硬碟, 用起來相當的快阿
可是發現有些程式裝得就不太順利了, 比如說skype, 一般只能找到32-bit的deb包還是裝不起來, 後來找到這篇就很順利了
sudo add-apt-repository "deb http://archive.canonical.com/ $(lsb_release -sc) partner"
sudo apt-get update
sudo apt-get install skype

reference:
* Installing Skype on Ubuntu 13.04 64-bit

2014年3月9日 星期日

[應用程式] PCManFM儲存檢視設定

LXDE是一個輕量級的X11桌面環境, PCManFM是預設的檔案管理員

如果要儲存檢視設定, 只要修改~/.config/pcmanfm/main.lxde

新增兩行即可
[General]
view_mode=1

reference:
* PCManFM default view

2014年2月4日 星期二

[RPi] 修改spidev的buffer size

因為用GPIO接LCD是透過spi將RGB傳送出去, 預設的buffer只有4096太小

查了一下這裡這裡說可以在載入時指定buffer的大小, 例如在/etc/modprobe.d/local.conf檔案中新增一行options spidev bufsiz=8192, 但是沒有成功

最後只好改drivers/spi/spidev.c, 將bufsiz改為153600(320x240x2), 畫面就出來了

2013年12月19日 星期四

[Git] error: The requested URL returned error: 403 while accessing https://github.com/username/repo.git

今天看了github的教學, 在github新增一個repo
然後在本機端要commit回去, 出現了這個錯誤訊息
error: The requested URL returned error: 403 while accessing https://github.com/username/repo.git

其實這也不奇怪, 預設HTTP是沒有write權限, 所以被擋住也是應該的, 但為什麼github的教學還用這當例子?

所以stackoverflow的人又回答了, 把https改成ssh就好了
1.edit .git/config file under your repo directory
2.find url=entry under section [remote "origin"]
3.change it from url=https://MichaelDrogalis@github.com/derekerdmann/lunch_call.git to url=ssh://git@github.com/derekerdmann/lunch_call.git. that is, change all the texts before @ symbol to ssh://git
4.Save config file and quit. now you could use git push origin master to sync your repo on GitHub