
[PHP Framework] How to implement Plurk API in CodeIgniter

介紹一堆美食日記,生活日記,電腦筆記
R–A–B–C–D–E–HEAD接下來要移除 B 跟 C 的 commit tree,變成
R–A–D’–E–HEAD有兩種方式可以移除 B & C
# detach head and move to D commit git checkout另一種方法是利用 cherry-pick 方式# move HEAD to A, but leave the index and working tree as for D git reset --soft # Redo the D commit re-using the commit message, but now on top of A git commit -C # Re-apply everything from the old D onwards onto this new place git rebase --onto HEAD master # push it git push --force
git rebase --hard這會直接忽略 B 跟 C 的 history,詳細資料可以查詢 git help cherry-pick 或者是 git help rebase 參考: Git: removing selected commits from repository Git: how to remove file and commit from history Re: ! [rejected] master -> master (non-fast forward)git cherry-pick git cherry-pick
Dec 9 21:17:02 freebsd kernel: fxp0: link state changed to DOWN Dec 9 21:17:03 freebsd kernel: fxp0: link state changed to UP Dec 9 21:17:10 freebsd kernel: fxp0: link state changed to DOWN Dec 9 21:17:12 freebsd kernel: fxp0: link state changed to UP在網路上 FreeBSD mail list 查到一篇:『Interface Status changes to UP and Down』,裡面提到通常是硬體的問題,換過 switch 以及網路線,測試還是有問題,網路會斷斷續續,後來就用主機板上面另外兩個網孔測試,網路就不會時好時壞了,由於時常更改 /etc/rc.conf 裡面的 ip 設定,要重新啟動網路卡介面,這樣會造成遠端 ssh 斷線,解決方式請用下面指令: How do I restart network service over ssh session?
/etc/rc.d/netif restart && /etc/rc.d/routing restart底下一些常用 FreeBSD 網路指令:
#關閉網卡 ifconfig network-interface down #啟動網卡 ifconfig network-interface up #觀看尚未啟動的網卡 ifconfig -d #觀看已啟動網卡 ifconfig -u # FreeBSD Update / restart routing tables / service /etc/rc.d/routing restartReference FreeBSD: How To Start / Restart / Stop Network and Routing Service FreeBSD IP Alias: Setup 2 or More IP address on One NIC
supplied argument is not a valid MySQL result resource in這是因為平常在寫 SQL 語法,會是底下這種寫法:
$sql = "SELECT id, title, content FROM articles WHERE id = '".$_GET['id']."'"; $result = mysq_query($sql);因為沒有處理跳脫字元 ‘,所以造成 SQL 語法錯誤,才會出現該錯誤訊息,但是如果又針對跳脫字元做防護得時候,還有另一種攻擊方式:
/articles.php?id=0 union select 1,2,load_file(char(47,101,116,99,47,112,97,115,115,119,100))其中的數字就是/etc/passwd 字符串的ASCII,除此之外,還可以使用字串 16 進位方式:
/articles.php?id=0 union select 1,2,load_file(0×2f6574632f706173737764)可以參考一下 MySQL LOAD_FILE(file_name),底下文章提到了很多方式解決。 Continue reading “PHP+MySQL 環境下 SQL Injection 攻防戰”