Jan 4, 2015

Some useful git configurations

[set global]
git config --global ....
[set local repo]
git config ....

# Toggle file permission changes monitoring
core.fileMode false/true

# Toggle case-sensitive file name changes monitoring
core.ignorecase false/true






Others...
# Global ignore file
git config --global core.excludesfile ~/.gitignore_global

Sep 22, 2014

Making CryptoJS's encryption output compatible with PHP mcrypt_decrypt function

Recently, I've encounter a problem when migrating CryptoJS and PHP backend.
In CryptoJS, iv will be assigned automatically if iv is not given. But in PHP, NULL vectors will be used as iv...
So the result generated by CryptoJS cannot be decoded by PHP.
Hence, I've been digging up the solution to overcome this problem....
And the following code segment is what I found and tested.


Feel free to copy this. [ JsFiddle Test ]

BTW, This site can be used to test the encoding result. ( This site uses PHP as its backend... )

Aug 20, 2014

Disabling genome-ssh-askpass

I've encountered an issue trying to pull commits to a remote server by remote controlling via ssh using MacOSX Terminal.

However, the server keeps returning the following error

(gnome-ssh-askpass:18368): Gtk-WARNING **: cannot open display:

The remote server is a linux using gnome desktop environment. But the GUI cannot displayed when using tty mode. So I survey the Internet and found the following solution.

unset SSH_ASKPASS

You can add this line to rc.local or ~/.bash_profile if you wanna disable it forever and ever~

Referenced from:
[Blog @ Codonomics: How to disable gnome-ssh-askpass?]

Mar 10, 2014

Rule of linux kernel's versions

Linux kernel version is constructed by parts [ x.y.z ]
x - main version
y - even number means that the version is stable
z - error patch times

Mar 8, 2014

Modify phpMyAdmin's session timeout duration

Insert the following line into config.inc.php

$cfg['LoginCookieValidity'] = ;