Friday, October 30, 2009

USB OTG

USB is a good interface but it can be very complicated and confusing(probably only for developers?)

The USB mini-male has 2 types:

  • Mini-A-male

  • Mini-B-male



The USB OTG devices detect itself as a host or client depends on the ID pin(pin 4). USB Mini-A-male has internal wiring to tie the ID pin to GND, which let the host to identify itself as USB host.

While most of the USB Mini-male cable you see on the market is Mini-B-male, which leave the pin unconnected.

Tuesday, October 13, 2009

gitweb on Ubuntu/Jaunty

Make sure these GIT packages are installed:

$ aptitude install git git-core gitk gitweb


Assume the default apache web server is /var/www/ ,
gitweb is the directory I want to install gitweb:

$ cd /var/www/
$ mkdir gitweb
$ cd gitweb


copy gitweb graphics and stylesheets(git-favicon.png git-logo.png gitweb.css) to its directory, their path should correspond to what states in /etc/gitweb.conf:

$ cd /var/www/gitweb/
$ cp /usr/share/gitweb/* .


add gitweb directory to apache2 configuration by creating a "gitweb" file inside apache conf.d directory:

$ vi /etc/apache/conf.d/gitweb


Paste the following text and modify if your path is different:

Alias /gitweb /var/www/gitweb

Options Indexes FollowSymlinks ExecCGI
DirectoryIndex /cgi-bin/gitweb.cgi
AllowOverride None


Modify gitweb.conf, assuming the public GIT repositories are located in /var/www/repo/

$ vi /etc/gitweb.conf



$projectroot = "/var/www/repo/";

# directory to use for temp files
$git_temp = "/tmp";

# target of the home link on top of all pages
#$home_link = $my_uri || "/";

# html text to include at home page
$home_text = "indextext.html";

# file with project list; by default, simply scan the projectroot dir.
$projects_list = $projectroot;

# stylesheet to use
# I took off the prefix / of the following path to put these files inside gitweb directory directly
$stylesheet = "gitweb.css";

# logo to use
$logo = "git-logo.png";

# the 'favicon'
$favicon = "git-favicon.png";



restart apache2 web server:

$ sudo /etc/init.d/apache2 restart


Now you should be able to view gitweb listing all GIT projects under /var/www/repo/:
http://localhost/gitweb