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

Thursday, June 21, 2007

Sqlite: How To Build a Loadable Extension Shared Library on Linux

Details copy from http://www.sqlite.org/cvstrac/wiki?p=LoadableExtensions

How To Build a Loadable Extension Shared Library on Linux
0. untar latest sqlite3 source code in a new directory
1. cd to the newly untarred sqlite directory
2. Comment out the line in Makefile.in to enable loadable extensions:
# TCC += -DSQLITE_OMIT_LOAD_EXTENSION=1
3. ./configure LIBS=-ldl && make sqlite3
4. export LD_LIBRARY_PATH="`pwd`:$LD_LIBRARY_PATH"
5. gcc -I`pwd` -shared src/test_loadext.c -o half.so
6. ./sqlite3
SQLite version 3.3.17
Enter ".help" for instructions
sqlite> .load half.so testloadext_init
sqlite> select half(7);
3.5

Sunday, June 17, 2007

Fedora 7 imap imaps pop3 pop3s using dovecot

Details in the link QuickConfiguration - Dovecot Wiki

install dovecot-1.0.0-11.fc7
modify /etc/pki/dovecot/dovecot-openssl.cnf
rm /etc/pki/dovecot/certs/dovecot.pem
rm /etc/pki/dovecot/private/dovecot.pem
/usr/libexec/dovecot/mkcert.sh
service dovecot restart

Apache self signed certificate for Fedora7

Install the below:

mod_ssl-2.2.4-4
distcache-1.4.5-14.1
httpd-2.2.4-4
openssl-0.9.8b-12.fc7

cd /etc/pki/tls/certs
review make-dummy-cert and make copy say my_make_cert and modify the content of the copy
i.e. highlighted in red below:

#!/bin/sh
umask 077

answers() {
echo --
echo SomeState
echo SomeCity
echo SomeOrganization
echo SomeOrganizationalUnit
echo localhost.localdomain
echo root@localhost.localdomain
}

issue the below
./my_make_cert test
split the file test in between the lines into two parts:
-----END RSA PRIVATE KEY-----

-----BEGIN CERTIFICATE-----

The upper part save as file /etc/pki/tls/private/localhost.key
The bottom part save as file /etc/pki/tls/certs/localhost.crt

This matches with the default /etc/httpd/conf.d/ssl.conf that come with the mod_ssl rpm package

Tuesday, June 12, 2007

How to compile Boost in Sun Solaris

Compile Boost 1_33_1 with gcc 4.1.2 in Sun Solaris 10

#!/bin/bash
BOOST=/home/lama/tmp/boost_1_33_1
GCCPATH=/home/lama/gnu/gccCC=/home/lama/gnu/gcc/bin/gccexport CCPATH=/home/lama/gnu/gcc/bin:/home/lama/gnu/binutils/bin:/usr/binexport PATH
cd $BOOST/tools/build/jam_src
./build.sh gcc
cd $BOOST
$BOOST/tools/build/jam_src/bin.solaris/bjam \
-sBOOST_ROOT=. \
-sTOOLS=gcc \
-sGCC_ROOT_DIRECTORY=$GCCPATH \
--prefix=/home/lama/gnu/boost_1_33_1 \
--without-python \
--builddir=/home/lama/tmp/boost \
--stagedir=/home/lama/tmp/stage \
"-sBUILD=release static/dynamic single/multi" install

Sunday, May 20, 2007

Installing Mac OS X on a Flash Drive

Installing Mac OS X on a Flash Drive

change owner enable for disk
sudo /usr/sbin/vsdbutil -a /Volumes/xxx
sudo bless –verbose –folder “/Volumes/xxx/System/Library/CoreServices” –bootinfo

Friday, May 11, 2007

Subversion

This is a good article of Subversion Best Practices Subversion Best Practices

The book in pdf svn-book.pdf

Google Code - Summer of Code - Google Summer of Code

Do a check what I know of the below:
Google Code - Summer of Code - Google Summer of Code

Apply and use currently or in the past:
  • Boost C++
  • Debian
  • The Fedora Project
  • FFmpeg
  • Gallery
  • GCC
  • GNU Project
  • GNOME
  • KDE
  • MacPorts
  • MySQL AB
  • Open Source Applications Foundation
  • PHP
  • Samba
  • Subversion
  • VideoLAN
  • Vim
  • WordPress
Something I am learning:
  • Coppermine Photo Gallery
  • Gentoo
  • Google
  • Ubuntu
Something I know a little but give up for other priorities:
  • GnuCash
  • Mono Project
  • Mozilla Foundation
  • NetBSD
  • OpenOffice.org
  • PostgreSQL project
  • The Wine Project
  • X.Org
  • Zope Foundation, Inc
  • Etherboot Project