git over http and the first repos push

Apache virtual host setup

cat /etc/apache2/sites-enabled/git

<VirtualHost 192.168.1.1:80>
ServerName git.expr.nsfocus
DocumentRoot /var/www/git/

SetEnv GIT_PROJECT_ROOT /var/www/git/
SetEnv GIT_HTTP_EXPORT_ALL
ScriptAlias /repos/ /usr/lib/git-core/git-http-backend/
Options Indexes FollowSymLinks MultiViews
<Location /repos/>
AuthType Basic
AuthName "Restricted Files"
AuthUserFile /etc/apache2/password.dav
Require valid-user
</Location>
</VirtualHost>

htpasswd -c  /etc/apache2/password.dav youraccount

Server side repos init

mkdir -p /var/www/git/app/
git init –bare(此处为两个-)
git update-server-info
chown www-data.www-data -R /var/www/git/app/

Client side repos push

cd d:\app
edit .gitignore
git init
git add *
git commit -a -m “first commit”
git remote add origin http://git.expr.region/app/
git push -u origin master

 

 

解决ftp乱码问题

http://linux.chinaunix.net/bbs/archiver/tid-747126.html

由于windows使用的编码是gbk,上传文件一般都是gbk的编码,而ftp服务器一般都是输出utf8,所以linux下用ftp看文件都是乱码。

好像一般的ftp服务器都没有转换编码的功能,所以需要另找方法。

具体的方法参考上面的链接,不过有几点不同的:

1 没有源码安装。我用的是testing的源,没有fuse-convmvfs包,所以我加了sid的源装fuse-convmvfs,同时需要安装fuse-utils运行fusermount

2 我的应用下,编码转换正好相反:

su fuser -c ‘/usr/bin/convmvfs -o srcdir=/home/marvel/psp,icharset=gbk,ocharset=utf8,allow_other /home/marvel/psp_gbk’

这样处理之后,用utf8编码即可访问我的psp_gbk目录了

linux驱上摄像头

debian方便啊……

插入摄像头,运行lsusb:
6# lsusb
Bus 003 Device 001: ID 0000:0000
Bus 002 Device 009: ID 045e:00b9 Microsoft Corp. Wireless Optical Mouse 3.0
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 001: ID 0000:0000
Bus 005 Device 014: ID 0a5c:2110 Broadcom Corp.
Bus 005 Device 015: ID 0483:2016 SGS Thomson Microelectronics Fingerprint Reader
Bus 005 Device 001: ID 0000:0000
Bus 004 Device 003: ID 0ac8:301b Z-Star Microelectronics Corp. ZC0301 WebCam
Bus 004 Device 001: ID 0000:0000

发现 Z-Star,ok,能认出来。

安装内核模块,用m-a编译安装gspca-source。

然后加载# modprobe gspca
mvision:/lib/modules/2.6.24-686# lsmod |grep spc
gspca 661028 0
videodev 26816 2 gspca,zc0301
usbcore 132776 7 gspca,zc0301,hci_usb,usbhid,uhci_hcd,ehci_hcd

现在驱上了,使用skype就能看了:

skype in linux

用kde4的kopete也可以:
kopete