原创 使用ascii方式得到26個字母

大寫A的ascii值是0x41,以此類推即可。 <?php $a = 0x41; $b = $a + 1; // var_dump(chr(0x41));exit; // var_dump(chr($b));exit;

原创 調試Crypt_GPG的過程

我使用了Crypt_GPG這個開源項目來解密GPG,這是我找到的幾個爲數不多的PHP的GPG庫中比較好的了,但是中間遇到一些問題。 在瀏覽器端的錯誤輸出信息: ( ! ) Fatal error: Uncaught <table

原创 svn不小心ignore了怎麼辦

直接到被ignore的位置,執行: svn add <你被ignore的文件名> --no-ignore –no-ignore是取消忽略 如果是add目錄,你可以: svn add * --force --no-ignore –

原创 爲php安裝libssh2擴展

首先我是使用brew安裝的: andy@AndyMacBookPro:~brewsearchssh2libssh2php53−ssh2php54−ssh2php55−ssh2php56−ssh2andy@AndyMacBookPr

原创 Swift 命令行工具

轉自:http://www.cocoachina.com/swift/20140927/9772.html Swift 的 REPL (Read-Eval-Print Loop) 環境可以讓我們使用 Swift 進行簡單的交互式編程

原创 安裝openssh-portable時遇到的問題及解決辦法

問題1: configure: error: Your OpenSSL headers do not match your library. Check config.log for details. If you a

原创 如何更新centos的系統時間

如果你的服務器是centos,你登陸輸入date之後發現時間並不是當前的中國時間。 那麼怎麼同步時間到中國呢? cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime 然後 ntpdate

原创 install gem on osx

因爲想要在osx中安裝gitlab,而gitlab是ruby寫的,在安裝rails和gem的過程中碰到了一些問題: 關於gem的管理: gem sources -l 如果你使用https://rubygems.org 會有問題,因爲被GF

原创 你的osx中沒有gitk?

你的osx中沒有gitk?一句話:你的git版本太低了,gitk是跟隨git一起安裝的。 解決辦法:重新使用brew安裝git就好了。 先看下git版本: andy@AndyMacBookPro:~$ git --version git

原创 centos中爲php安裝GnuPG擴展

基本上所有需要用到的包和庫都在官網: https://www.gnupg.org/index.html 1.到http://pecl.php.net/package/gnupg下載gnupg包。 2.make gnupg包的時候,會提示你

原创 weechat : can not be installed because plugin "perl" is not loaded

想要爲weechat安裝script,但是遇到問題,我安裝的是buffers.pl,提示: 13:28:12 weechat | script: script "buffers.pl" can not be installed

原创 osx中沒有gitk?

你的osx中沒有gitk? 看了下git版本: andy@AndyMacBookPro:~$ git --version git version 1.9.5 (Apple Git-50.3) 可以使用brew重新安裝git: 首先升級br

原创 php 一致性hash

一致性hash

原创 selinux 與 Can't connect to MySQL server

Warning: mysql_connect(): Can't connect to MySQL server on 'xxx' 在命令行使用php執行可以正常訪問數據庫,但是使用url訪問apache卻報錯無法訪問。 問題比較迷惑人,看

原创 eth0:01的意思

eth0:1是eth0的分ip存儲文件 分ip存儲文件格式爲ifcfg-eth0:X X爲任意正整數(包括0) 具體作用是實現單網卡多ip 類似與windows的多ip