clone svn repository into git

## Install git-svn tool
# if CentOS
yum install subversion-perl

# if Ubuntu
sudo apt-get install libsvn-perl

## In git server, Create empty repo of exfat as my project

## Create Bare repo of /repo/exfat
cd /repo
git init --bare exfat.git
cd exfat.git
cp hooks/post-update.sample hooks/post-update
git symbolic-ref HEAD refs/remotes/trunk

## Clone svn with git-svn in work repo of /repo/svn/exfat
cd /repo/svn
git svn clone -s http://exfat.googlecode.com/svn /repo/svn/exfat
cd exfat
git config core.worktree /repo/svn/exfat
git gc

## Convert SVN Tag to Git Tag
/usr/local/bin/svn2git

##   Add svn ignore, if have
git svn show-ignore > .gitignore
git add .gitignore
git commit -m ‘Convert svn:ignore properties to .gitignore.’

# # Push git rep to bare repository
git remote add origin /repo/exfat.git
git push origin –mirror

## Put other svn branch into bare repo
# git branch -r
git checkout -t -b svn-trunk trunk
git push origin –mirror

git checkout -t -b svn-v1.0.x v1.0.x
git push origin –mirror

 

## Verify by checkout in workstation

cd /tmp/test
git clone ssh://git.zhenglei.net/repo/exfat.git
cd exfat

Adb driver on ubuntu 10.10

lsusb
sudo touch /etc/udev/rules.d/51-android.ruls
sudo chmod 755
gedit /etc/udev/rules.d/51-android.ruls
sudo /etc/init.d/udev restart
sudo adb kill-server
sudo adb devices

cat /etc/udev/rules.d/51-android.ruls

SUBSYSTEM==”usb”, SYSFS{idVendor}==”0bb4″, MODE=”0666″, GROUP=”lzheng”
SUBSYSTEM==”usb”, SYSFS{idVendor}==”18d1″, MODE=”0666″, GROUP=”lzheng”
SUBSYSTEM==”usb”, SYSFS{idVendor}==”05c6″, MODE=”0600″, GROUP=”lzheng”
SUBSYSTEM==”usb”, SYSFS{idVendor}==”0bb4″, MODE=”0600″, GROUP=”lzheng”
SUBSYSTEM==”usb”, SYSFS{idVendor}==”710d”, MODE=”0600″, GROUP=”lzheng”
SUBSYSTEM==”usb”, SYSFS{idVendor}==”0bb4″, MODE=”0600″, GROUP=”lzheng”
# adb protocol on passion (Nexus One)
SUBSYSTEM==”usb”, ATTR{idVendor}==”18d1″, ATTR{idProduct}==”4e12″, MODE=”0600″, OWNER=”lzheng”
# fastboot protocol on passion (Nexus One)
SUBSYSTEM==”usb”, ATTR{idVendor}==”0bb4″, ATTR{idProduct}==”0fff”, MODE=”0600″, OWNER=”lzheng”
# adb protocol on crespo/crespo4g (Nexus S)
SUBSYSTEM==”usb”, ATTR{idVendor}==”18d1″, ATTR{idProduct}==”4e22″, MODE=”0600″, OWNER=”lzheng”
# fastboot protocol on crespo/crespo4g (Nexus S)
SUBSYSTEM==”usb”, ATTR{idVendor}==”18d1″, ATTR{idProduct}==”4e20″, MODE=”0600″, OWNER=”lzheng”
# adb protocol on stingray/wingray (Xoom)
SUBSYSTEM==”usb”, ATTR{idVendor}==”22b8″, ATTR{idProduct}==”70a9″, MODE=”0600″, OWNER=”lzheng”
# fastboot protocol on stingray/wingray (Xoom)
SUBSYSTEM==”usb”, ATTR{idVendor}==”18d1″, ATTR{idProduct}==”708c”, MODE=”0600″, OWNER=”lzheng”
# adb protocol on maguro/toro (Galaxy Nexus)
SUBSYSTEM==”usb”, ATTR{idVendor}==”04e8″, ATTR{idProduct}==”6860″, MODE=”0600″, OWNER=”lzheng”
# fastboot protocol on maguro/toro (Galaxy Nexus)
SUBSYSTEM==”usb”, ATTR{idVendor}==”18d1″, ATTR{idProduct}==”4e30″, MODE=”0600″, OWNER=”lzheng”
# adb protocol on panda (PandaBoard)
SUBSYSTEM==”usb”, ATTR{idVendor}==”0451″, ATTR{idProduct}==”d101″, MODE=”0600″, OWNER=”lzheng”
# fastboot protocol on panda (PandaBoard)
SUBSYSTEM==”usb”, ATTR{idVendor}==”0451″, ATTR{idProduct}==”d022″, MODE=”0600″, OWNER=”lzheng”
# usbboot protocol on panda (PandaBoard)
SUBSYSTEM==”usb”, ATTR{idVendor}==”0451″, ATTR{idProduct}==”d00f”, MODE=”0600″, OWNER=”lzheng”
# usbboot protocol on panda (PandaBoard ES)
SUBSYSTEM==”usb”, ATTR{idVendor}==”0451″, ATTR{idProduct}==”d010″, MODE=”0600″, OWNER=”lzheng”
# adb protocol on grouper (Nexus 7)
SUBSYSTEM==”usb”, ATTR{idVendor}==”18d1″, ATTR{idProduct}==”4e42″, MODE=”0600″, OWNER=”lzheng”
# fastboot protocol on grouper (Nexus 7)
SUBSYSTEM==”usb”, ATTR{idVendor}==”18d1″, ATTR{idProduct}==”4e40″, MODE=”0600″, OWNER=”lzheng”

setup git server on centos 5

# Install Git on git.zhenglei.net
yum install expat-devel zlib-devel gettext-devel openssl-devel
unzip git-1.7.2.5.zip
cd git-1.7.2.5
make prefix=/usr/local install

## Create empty repository of test.git in /repo of git.zhenglei.net
mkdir /repo
cd /repo
GIT_DIR=test.git git init
cd test.git
git –bare update-server-info
cp hooks/post-update.sample hooks/post-update

## Access git.zhenglei.net via port XXXX over ssh
# Config ssh on workstation
echo “Host git.zhenglei.net” >>~/.ssh/config
echo “hostname git.zhenglei.net”>>~/.ssh/config
echo port XXXX >>~/.ssh/config

## Clone test.git
git clone ssh://root@git.zhenglei.net/repo/test.git

## Add README in local
cd test
touch README
git add README
git commit -m “add readme”

## Push back to server
git push origin master

Delete spam wordpress comment by script

bash tool to delete spam or un-approved comment in WordPress:

http://dl.dropbox.com/u/45095875/wp_comment_v1.sh

where:

WP_DIR is the directory where WordPress instaled.

Call WP_del_SPAM_Comment to remove spam comments

Call WP_del_UA_Comment to remove un approved comments.