Install FreeNX Server on OpenSUSE 11.2

openSUSE 11.2

The FreeNX package is no longer present in the official openSUSE 11.2 repositories. You can find the package in the Build Service.

  • Install NX and FreeNX rpms from here and here. The versions from the repository X11:RemoteDesktop/openSUSE_11.2 should work fine.


rpm -ivh http://download.opensuse.org/repositories/X11:/RemoteDesktop/openSUSE_11.2/x86_64/FreeNX-0.7.2-26.1.x86_64.rpm http://download.opensuse.org/repositories/X11:/RemoteDesktop/openSUSE_11.2/x86_64/NX-3.2.0-22.1.x86_64.rpm

    • As pre-requisite before installing the rpm above, you may need to install packages like expect and rdesktop. Install using YaST’s Software Management or zypper on command line.
  • Run nxsetup –install –setup-nomachine-key –clean to install the server the first time
  • Use nxserver –status to check status of the server. The server runs on the ssh port, 22.
  • Test connecting using any NX client. Official No Machine client can be downloaded from www.nomachine.com which installs the client binary at /usr/NX/bin/nxclient See http://walter.deback.net/blog/archives/19 for using the NX client effectively.

在 Mac OS 10.6 安裝 git

  • Make sure your ports are up to date.
  • Install Git (You may want to include Subversion support if you want to import SVN repositories)

$sudo port selfupdate
$sudo port install git-core +svn

Reference: http://help.github.com/mac-git-installation

Mac OS X 10.6, MD5 checksum

由於 Mac OS X 10.6 並未內建 md5sum
所以先安裝 md5sum

sudo port install md5sha1sum

可以一次列出所有檔案的 MD5 Checksum,包含子目錄

find . ! type d print0 | xargs 0 md5sum

檢查所有檔案的 MD5 Checksum,包含子目錄

find . ! type d print0 | xargs 0 md5sum c check.md5

在 Mac OS X 10.6 安裝 SVN

Create User/Password for Access Control

sudo htpasswd -cm /etc/apache2/svn-auth-file username

Create /etc/apache2/other/svn.conf:

LoadModule dav_svn_module /usr/libexec/apache2/mod_dav_svn.so
<Location /svn>
    DAV svn
    SVNParentPath /Users/SVN-ROOT
    SVNListParentPath on
    AuthType Basic
    AuthName "Subversion repository"
    AuthUserFile /etc/apache2/svn-auth-file
    Require valid-user
</Location>

This will make the Subversion repository /Users/SVN-ROOT available at http://localhost/svn .

Update the repositories owner (otherwise commits would fail):


chown -R www:www /Users/SVN-ROOT

Restart Apache

sudo apachectl restart

WordPress latin1 轉utf-8

有效告別數據庫亂碼, gbk/gb2312/big5/latin1轉utf-8

1. 在shell中用root登陸服務器
2. 進入mysql目錄 (linux Server):

  • cd /var/lib/mysql/

3. 利用mysql自帶的mysqldump功能dump一下原有的latin1編集的數據庫:

  • mysqldump –user=username –password=password –default-character-set=latin1 –skip-set-charset dbname > dump.sql

4. 把數據庫數據從latin1轉換成utf-8編集:

  • sed -r ’s/latin1/utf8/g’ dump.sql > dump_utf.sql

5. 創建新的urf-8新數據庫:

  • mysql –user=username –password=password –execute=”DROP DATABASE dbname; CREATE DATABASE dbname CHARACTER SET utf8 COLLATE utf8_general_ci;”

6. 以正確編集導入轉碼後的數據庫數據:

  • mysql –user=username –password=password –default-character-set=utf8 dbname