Wednesday, April 30, 2008

enable subversion server come with Leopard

Mac Leopard actually come with subversion server and client that integrated with its own apache2.

Steps to enable it:
LoadModule dav_svn_module libexec/apache2/mod_dav_svn.so
LoadModule authz_svn_module libexec/apache2/mod_authz_svn.so
    • enable httpd-ssl.conf by removing the comment from the following line in /etc/apache2/httpd.conf:
    Include /private/etc/apache2/extra/httpd-ssl.conf
    • Add the following line at the end of file /etc/apache2/extra/httpd-ssl.conf but before the </VirtualHost>
    DAV svn
    SVNPath /opt/repos
    AuthType Basic
    AuthName "Authorization Realm"
    AuthUserFile /etc/svn-auth-file
    Require valid-user
    • create the /etc/svn-auth-file using the following command to create user id. It will prompt for password twice
    htpasswd -cm /etc/svn-auth-file
    • restart apache by
    /usr/sbin/apachectl restart
    • mkdir the subversion repository, generate the first repository and change ownership of the folder to match with apache user
    mkdir /opt/repos
    svnadmin create /opt/repos
    chown -R www:www /opt/repos
    • test the access to subversion server using the https://127.0.0.1/svn/
    • try with svn co https://127.0.0.1/svn/trunk --username

    Wednesday, March 26, 2008

    Concate VCDs to mp4 using VLC

    #!/bin/bash

    /bin/cat $* | /Users/xxx/Applications/VLC.app/Contents/MacOS/VLC - \
    --sout "#transcode{vcodec=h264,vb=1024,acodec=mp4a,ab=192,scale=1}:\
    standard{access=file,mux=mp4,dst=\"/Users/xxx/Movies/vcd.mp4\"}" \
    vlc:quit -I dummy

    Sunday, February 17, 2008

    My Mac Pro - use 2 extra sata as as esata



    The left is my Mac Pro bought in Feb 2008.
    I read http://www.anandtech.com/mac/showdoc.aspx?i=2832&p=3.  This is a little bit outdate as it is for 2006 Mac Pro.
    This is much easy now for 2008's Mac Pro. The heatsink cover can be easy removed as it is now put in place like Macbook MagSafe Connector.  There is no need to pull the memory cage back towards the rear of the case nor pushing the heat sink cover in the opposite direction to unlatch it as explained in the above url

    The fan assembly can be removed by just two screws.  One attached it to the motherboard at the top right.  The other is hidden between plastic fan assembly and the heat sink (bottom right of the fan assembly after removing the heat sink cover).  The the picture below showing the hidden screw to loose the fan assembly and on of the magnet to attach the heat sink cover

    Wednesday, December 19, 2007

    Export NFS through Firewall

    rpcinfo -p will list nfs ports used

    copy the following from http://linux.derkeiler.com/Mailing-Lists/Fedora/2007-07/msg02399.html

    1) You must have ports 2049 tcp+udp and 111 tcp+udp open in the nfs
    server firewall to allow clients to talk to nfs and portmap, respectively.

    2) There are a number of other daemons on the server, associated with
    nfs, namely rpc.statd, rpc.lockd, rpc.mountd and rpc.quotad. These must
    also be accessible to the clients. By default these start on random
    ports, which the firewall couldn't care less about. So to allow clients
    to get to the rpc services you must
    2a) force the rpc services to start on pre-assigned ports of your
    choice, like 4000 to 4003.
    2b) open ports 4000-4003 tcp+udp in the firewall (or whatever
    ports you used at (2a).


    Now, here is how you do all this. You implement 2a by creating a file
    /etc/sysconfig/nfs with the following contents:

    STATD_PORT=4000
    LOCKD_TCPPORT=4001
    LOCKD_UDPPORT=4001
    MOUNTD_PORT=4002
    RQUOTAD_PORT=4003

    Restart nfs.


    The rest is opening ports into the server firewall, which is a separate
    matter. On the server, something like

    /sbin/iptables -I RH-Firewall-1-INPUT 10 -s 192.168.1.0/255.255.255.0 -p
    tcp -m state --state NEW -m tcp --dport 4000:4003 -j ACCEPT

    will insert a rule at position 10 (if 10 is the position you want) in the
    RH firewall that opens the range 4000-4003 for incoming tcp connections
    from the local network. Run then the above command again with udp instead
    of tcp. Do the same (tcp+udp) for ports 111 and 2049. Finally, save the
    new firewall configuration

    /sbin/iptables-save > /etc/sysconfig/iptables # after backing up old
    iptables first.

    and restart iptables

    /etc/rc.d/init.d/iptables restart

    Wednesday, November 14, 2007

    Fedora-install-media.repo

    use autofs to mount the image

    have the belowin /etc/yum.repos.d/Fedora-install-media.repo
    [InstallMedia]
    name = Fedora 8
    mediaid=1194015916.783841
    metadata_expire=-1
    gpgcheck = 0
    cost=500
    baseurl = file:///mnt/disk/3/ (this line is required to autofs mount the device with the iso image)
    file:///misc/Fedora8/ (use autofs to mount the iso for actual use)
    failovermethod=priority

    Tuesday, November 06, 2007

    Build my Linux Software RAID5 at home

    It is great.

    I create raid5 with 3 disk
    then add one more disk by

    mdadm --manage /dev/mdX --add /dev/sd?1
    mdadm --grow /dev/mdX --raid-devices=4 (original is 3)

    This will reshape at the back. Very slow but find the below to speed up

    In Fedora 7, original value
    cat /proc/sys/dev/raid/speed_limit_min ==> 1000
    echo 100000 > /proc/sys/dev/raid/speed_limit_min

    Monday, November 05, 2007

    MBR fixes

    MBR appears to be blank.
    You can add an MBR to this device with
    # cat /usr/lib/syslinux/mbr.bin > /dev/sdk

    Thursday, August 02, 2007

    NAS

    Bought a Stardom SL3620-2S-SB2 on 31 Jul 2007

    It had firmware upgrade in http://www.shooting.com.hk/download.php?pr_id=50

    After downloading the firmware, unzip, get the following information from of the inside file. Search SL3516 from Google and realize it uses Gemini SL3516 Network Processor which is a Single 32-bit 400MIPS ARM9 RISC processor. It use MontaVista Linux 2.6 as its operating system


    UpgradeImages="zImage rd.gz hddapp.tgz"
    productName="SL3620-2S-LB2"
    hardwareName="SL3516 Verification Board"
    productVendor="RAIDON Technology INC.."
    manufacturerURL="http://www.stardom.com.tw"
    Description="STARDOMNAS"
    hostname="STARDOM-NAS"
    softwareVersion="2.6.0-n"
    TSS="enabled"
    DIRECT_MODE="disabled"
    Raid_Support="raid0_raid1"
    RaidTestDiskSize="0"
    DEFAULT_LAN_IPADDR="192.168.1.1"
    DEFAULT_LAN_NETMASK="255.255.255.0"
    DEFAULT_LAN_BOOTPROTO="dhcp"
    DEFAULT_WAN_BOOTPROTO="none"
    DEFAULT_WAN_ENABLED="no"
    DEFAULT_WLAN_DEVICENAME="ra0"
    DEFAULT_LAN_DEVICENAME="eth0"
    DEFAULT_HW_LAN_DEVICENAME="eth0"
    DEFAULT_WAN_DEVICENAME="eth1"
    DEFAULT_HW_WAN_DEVICENAME="eth1"
    SUPPORT_FILESYSTEM="ext2_ext3_fat32"
    SUPPORT_ENCRYPT_FILESYSTEM="ext2"
    DEFAULT_DHCP_ENABLED="0"
    SUPPORT_CODEPAGE="CP437_CP950_CP936_CP1145_CP1250_CP1252_CP932_CP949"
    DEFAULT_SERVER_CODEPAGE="CP950"
    FACTORY_RESET_ADMIN="0"

    Tuesday, July 10, 2007

    The GNU configure and build system - Configuration Names

    The GNU configure and build system - Configuration Names:

    include
    AC_CANONICAL_HOST
    in configure.in and use the following to check for host

    case "${host}" in
    i[3456]86-*-linux-gnu*) do something ;;
    sparc*-sun-solaris2.[56789]*) do something ;;
    sparc*-sun-solaris*) do something ;;
    mips*-*-elf*) do something ;;
    esac

    Friday, July 06, 2007

    Skype Phone

    Model LB-SP140 work for Mac OSx HK$199
    LOBOS Technology Inc.,

    Another cheap Skype Phone HK$65 also work for Mac OSX though it claims only work for Windows. But there is no way to control volume and it is very high

    Saturday, June 30, 2007

    Fedora 7 now support NTFS - read/write

    Try with my Dell XP-home and it works
    uname -a
    Linux 2.6.21-1.3228.fc7 #1 SMP Tue Jun 12 14:56:37 EDT 2007 x86_64 x86_64 x86_64 GNU/Linux
    ntfsprogs-1.13.1-4.fc7

    Sunday, June 24, 2007

    Skype for Fedora 7

    You need the following to run Skype. You have to find libsigc++20 somewhere because it does not include in Fedora 7

    1. skype-1.4.0.74-fc5
    2. qt4-x11-4.3.0-2.fc7
    3. nas-1.9-2.fc7
    4. qt4-4.3.0-2.fc7
    5. libsigc++20-2.0.17-2

    Upgrade DirectX 9 with Parallels on MacOSX

    Latest DirectX from
    DirectX9
    Build 4128 June 10, 2007

    Saturday, June 23, 2007

    Build Linux kernel module quick

    Centos don't provide ieee1394 module.

    So I based on the scripts provided in http://www.linux-ntfs.org
    kernel-module-ieee1394.spec
    mybuild

    Usage: ./mybuild specfile source-rpm {source-rpms} {archs}

    e.g. ./mybuild kernel-module-ieee1394.spec kernel-devel-2.6.21-1.3228.fc7.i686.rpm i686

    build rpm without root

    su -c 'yum install rpmdevtools yum-utils'
    rpmdev-setuptree

    Synology 101g+ crosstool - HOWTO

    Realize Synology 101g+ is running with Powerpc 106e

    Get the following from http://www.powerdeveloper.org/forums/viewtopic.php?p=7153

    Configured with: /home/jjw/v/crosstool-0.43/build/powerpc-603e-linux-gnu/gcc-4.1.0-glibc-2.3.6/gcc-4.1.0/configure --target=powerpc-603e-linux-gnu --host=x86_64-host_unknown-linux-gnu --prefix=/opt/crosstool/gcc-4.1.0-glibc-2.3.6/powerpc-603e-linux-gnu --with-cpu=603e --enable-cxx-flags=-mcpu=603e --with-headers=/opt/crosstool/gcc-4.1.0-glibc-2.3.6/powerpc-603e-linux-gnu/powerpc-603e-linux-gnu/include --with-local-prefix=/opt/crosstool/gcc-4.1.0-glibc-2.3.6/powerpc-603e-linux-gnu/powerpc-603e-linux-gnu --disable-nls --enable-threads=posix --enable-symvers=gnu --enable-__cxa_atexit --enable-languages=c,c++ --enable-shared --enable-c99 --enable-long-long
    Thread model: posix
    gcc version 4.1.0

    Get the following workable with my Synology 101g+

    powerpc-603e-linux-gnu.crosstoolconfig.txt
    GCC_HOST=
    GCC_LANGUAGES=c,c++
    GDB_DIR=
    GLIBC_ADDON_OPTIONS==linuxthreads,
    GLIBC_DIR=glibc-2.3.3
    GLIBC_EXTRA_CC_ARGS=
    GLIBC_EXTRA_CONFIG=
    GLIBC_EXTRA_ENV=
    JUST_DOWNLOAD=
    KERNELCONFIG=
    LINUX_DIR=linux-2.4.22
    LINUX_SANITIZED_HEADER_DIR=
    NO_DOWNLOAD=
    PREFIX=/opt/crosstool/gcc-3.3.4-glibc-2.3.3/powerpc-603e-linux-gnu
    PTXDIST_DIR=
    SHARED_MODE=--enable-shared
    SRC_DIR=/home/lama/Documents/crosstool/crosstool-0.43/build/powerpc-603e-linux-gnu/gcc-3.3.4-glibc-2.3.3
    TARBALLS_DIR=/home/lama/Download
    TARGET=powerpc-603e-linux-gnu
    TARGET_CFLAGS=-O -mcpu=603e
    TOP_DIR=/home/lama/Documents/crosstool/crosstool-0.43
    USE_SYSROOT=

    Sybase ASE on Linux FAQ - Fedora

    Extract from the link below:



    • Running ASE 12.5.1 on Fedora

    Fedora is the new name of Red Hat's "consumer" releases (as opposed to their "Enterprise" releases).

    ASE 12.5.1 requires a Java JVM to install. I downloaded mine from http://java.sun.com/j2se/1.4.2/download.html. There are some instructions on performing the JVM install at http://fedora.artoo.net/faq/#Java.

    Next, the dataserver binary is linked with some older libstdc++.so libraries. To get these libraries you need to install compat-libstdc++-7.3-2.96.118.i386.rpm. This is available in the Fedora distribution.

    Now you are ready to go ahead and install.

    Note that the 12.5.1 installer doesn't create a "sybase" user for you, doesn't install any rc files, and doesn't edit /etc/ld.so.conf, so you'll have to do that yourself. Also remember to set the kernel.shmmax entry in /etc/sysctl.conf and run /sbin/sysctl -p before building a new server.


    Sybase ASE on Linux FAQ