存档

作者存档

Linux boot

2006年10月17日 没有评论

image=/boot/vmlinuz-2.2.15
This is the actual virtual memory compressed kernel of Linux

initrd=/boot/initd-2.2.15.img
This reveals the location of the second stage(RAM) load.

During the installation ,the RAM disk file system is started in Read-only mode. After the second stage is finished with a few tests, the RAM disk is unloaded from memory and the real root partition is mounted form the file system in Read/Write mode.

MBR: master boot recorder
# mkbootdisk /dev/fd0 `uname -r`

分类: 科技 标签:

PAM(Pluggable Authentication Modules)

2006年10月15日 没有评论

PAM(Pluggable Authentication Modules), invented by MicroSun, is a mechanism for authentication. It provides some dynamic libraries and a integreted API in order to seprete the system services with their authentication procedures. To the benifit, the Adminstrator could configure every authentication more flexibly, because he/she need not to modify the original service program. New authentication modules are also able to be added,respectively.

分类: 科技 标签:

Verify the OpenLDAP server/Add Starting dn

2006年10月15日 没有评论

After install OpenLDAP, use the following commands to check the LDAP service run well:
1. Start up LDAP service with specific port:
# sladp -h “ldap://:389”
2. Execute the “ldapsearch” utility,
# ldapsearch -x -b ” -s base ‘(objectclass=*)’ namingContexts
If return texts as:
dn:
namingContexts: dc=plasmon,dc=sit
It validate the LDAP is running well with correct setting.

Since the LDAP installed successfully, the next step is add root dn for all structure, in my case, “dc=plasmon,dc=sit” is the top node. Create an LDIF file named “phillip”by vi:
dn: dc=plasmon,dc=sit
objectclass: dcObject
objectclass: organization
o: Example Company
dc: plasmon
Then import this ldif to LDAP database:
# ldapadd -x -D “cn=root,dc=plasmon,dc=sit” -W -f phillip
The “dc=plamosn,dc=sit” will be added, note, if do not add this node, any operating to LDAP would meet frastrations.

分类: 科技 标签:

Configure /etc/samba/smb.conf for LDAP

2006年10月15日 没有评论

For LDAP authentication, Client’s /etc/samba/smb.conf could be configured as the following steps:
1. modify the ldap/ldaps address appended in the passdb line, for example(port:636):
passdb backend = ldapsam:ldaps://192.168.123.33:636
Note, 192.168.123.33 is the LDAP server running OpenLDAP with the ssl on. Here the original “passwd backend” is set as “smbpasswd”, if use LDAP, the term “smbpasswd” should be removed.
2. add the following lines to the “smb.conf”:
ldap suffix = “dc=plasmon,dc=sit”
ldap ssl = on
ldap timeout = 100

In the client, issue the “smbpasswd -W”, “-W” means setting stored password for “cn=root,dc=plasmon,dc=sit” in secretdb,This step could not be ignored before other machines want to enjoy this Client’s samba service. and then, the file/directory is able to accessed by samba. For better description, just assume the following test environment.
LDAP server: 192.168.123.33
Samba Server(the “Client” in this article): 192.168.123.68
Other machine access Samba server: 192.168.123.32
Run the LDAP service in .33, and modify the smb.conf in .68, then issue “smbpasswd -W” in .68.
In .32, access the share in .68 by executing:
# mount -t smbfs -o username=phillip //192.168.123.68/test /mnt
The //192.168.123.68/test should be mounted to local “.mnt” successfully. But I found this mount process seems to take a few seconds(about 40s-50s). I think it is caused by the LDAP server was built on a virtual machine.

分类: 科技 标签:

Next: RHCE

2006年10月10日 没有评论

Three months to get this certification.

分类: 科技 标签:

mplayer installation

2006年9月23日 没有评论

I still remembe, maybe in June,2005, I tried to install mplayer on Fedora Core 3. Though audio file (mp3,mp4) was played in text mode, the mplayer could not support video. After some times re-installing, I had to give up. This week,Thursday,is a big day for congratulation, I do install mplayer successfully!

Download the following files first:
1.mplayer source code package: MPlayer-1.0pre8.tar.bz2
2.mplayer essential code package: essential-20060611.tar.bz2
3.font files: font-arial-cp1250.tar.bz2, font-arial-iso-8859-1.tar.bz2, font-arial-iso-8859-2.tar.bz2, font-arial-iso-8859-7.tar.bz2
4.mplayer skin: iTunes(Of course,I choose my favorite)

My operation system is CentOS4.2, and have most development packages installed. Unzip essential code package and move it to “/usr/lib/codecs”:
# tar -jxvf essential-20060611.tar.bz2
# mkdir /usr/lib/codecs
# mv essential-20060611 /usr/lib/codecs

Install mplayer:
# tar jxvf MPlayer-1.0pre8.tar.bz2
# cd MPlayer-1.0pre8
# ./configure –enable-gui –with-codecsdir=/usr/lib/codecs –with-win32libdir=/usr/lib/codecs –with-reallibdir=/usr/lib/codecs –with-xanimlibdir=/usr/lib/codecs –disable-inet6 – language=zh_CN,en –prefix=/soft/MPlayer1.0
During this configure process, it was interupted with the following error:
Checking for GUI … yes
Error: PNG support required for GUI compilation, please install libpng and libpng-dev packages.
Check “configure.log” if you do not understand why it failed.

I’m sure the libpng and libpnd-dev packages had been installed:
# rpm -qa | grep libpng
libpng-1.2.7-1
libpng-devel-1.2.7-1
What’s wrong? In the google, somebody said even they reinstalled or updated the libpng and libpng-devel packages, the above error still exist. I’m no going to reinstall those packages for the damn RedHat packages’ independence. When I considered I had to give up again, the resolution was found from google.
Just two lines, how simply it looks like!
/usr/bin/gtk-query-immodules-2.0 > /etc/gtk-2.0/gtk.immodules
/usr/bin/gdk-pixbuf-query-loaders > /etc/gtk-2.0/gdk-pixbuf.loaders

Ok, go on with the installation:
[root@localhost MPlayer-1.0pre8]# ./configure –enable-gui –with-codecsdir=/usr /lib/codecs –with-win32libdir=/usr/lib/codecs –with-reallibdir=/usr/lib/codecs –with-xanimlibdir=/usr/lib/codecs –disable-inet6 –enable-png –language=zh_C N,en –prefix=/soft/MPlayer1.0
Detected operating system: Linux
Detected host architecture: i386
Checking for cc version … 3.4.5, ok
Checking for host cc … cc
Checking for cross compilation … no
Checking for CPU vendor … GenuineIntel (15:1:3)
Checking for CPU type … Intel(R) Pentium(R) 4 CPU 1.70GHz
Checking for GCC & CPU optimization abilities … pentium4
Checking for kernel support of mmx … yes
Checking for kernel support of mmxext … yes
Checking for kernel support of sse … yes
Checking for kernel support of sse2 … yes
Checking for mtrr support … yes
Checking for xmmintrin.h … yes
Checking for assembler support of -pipe option … yes
Checking for assembler (as 2.15.92.0.2) … ok
Checking for Linux kernel version … 2.6.9-34.EL, ok
Checking for MPlayer binary name … mplayer
Checking for awk … gawk
Checking for extra headers … none
Checking for extra libs … none
Checking for -lposix … no
Checking for -lm … yes
Checking for langinfo … yes
Checking for language … using zh_CN (man pages: en en)
Checking for enable sighandler … yes
Checking for runtime cpudetection … no
Checking for restrict keyword … __restrict
Checking for __builtin_expect … yes
Checking for kstat … no
Checking for posix4 … no
Checking for lrintf … yes
Checking for round … yes
Checking for nanosleep … yes
Checking for socklib … yes (using -lnsl)
Checking for inet_pton() … yes (using -lnsl)
Checking for inttypes.h (required) … yes
Checking for int_fastXY_t in inttypes.h … yes
Checking for word size … 32
Checking for stddef.h … yes
Checking for malloc.h … yes
Checking for memalign() … yes
Checking for alloca.h … yes
Checking for mman.h … yes
Checking for dynamic loader … yes
Checking for dynamic a/v plugins support … no
Checking for pthread … yes (using -lpthread)
Checking for rpath … no
Checking for iconv … yes
Checking for sys/soundcard.h … yes
Checking for sys/dvdio.h … no
Checking for sys/cdio.h … no
Checking for linux/cdrom.h … yes
Checking for dvd.h … no
Checking for BSDI dvd.h … no
Checking for HP-UX SCSI header … no
Checking for userspace SCSI headers (Solaris) … no
Checking for termcap … yes (using -lncurses)
Checking for termios … yes (using sys/termios.h)
Checking for shm … yes
Checking for linux devfs … no
Checking for scandir() … yes
Checking for strsep() … yes
Checking for strlcpy() … no
Checking for strlcat() … no
Checking for fseeko() … yes
Checking for localtime_r() … yes
Checking for vsscanf() … yes
Checking for swab() … yes
Checking for POSIX select() … yes
Checking for gettimeofday() … yes
Checking for glob() … yes
Checking for setenv() … yes
Checking for sys/sysinfo.h … yes
Checking for Mac OS X APIs … auto
Checking for Mac OS X Finder Support … no
Checking for Mac OS X Bundle file locations … no
Checking for Samba support (libsmbclient) … yes
Checking for 3dfx … no
Checking for tdfxfb … no
Checking for s3fb … no
Checking for tdfxvid … no
Checking for tga … yes
Checking for DirectFB headers presence … not found
Checking for DirectFB … no
Checking for X11 headers presence … yes (using /usr/X11R6/include)
Checking for X11 … yes (using /usr/X11R6/lib)
Checking for DPMS … yes (using Xdpms 4)
Checking for Xv … yes
Checking for XvMC … no
Checking for Xinerama … yes
Checking for Xxf86vm … yes
Checking for XF86keysym … yes
Checking for DGA … 2 (using DGA 2.0)
Checking for OpenGL … yes
Checking for /dev/mga_vid … no
Checking for xmga … no
Checking for GGI … no
Checking for GGI extension: libggiwmh … no
Checking for AA … no
Checking for CACA … no
Checking for SVGAlib … no
Checking for FBDev … no
Checking for DVB … no (specify path to DVB/ost/include with –with-dvbincdir=D IR)
Checking for DVB HEAD … yes
Checking for PNG support … yes
Checking for JPEG support … yes
Checking for PNM support … yes
Checking for md5sum support … yes
Checking for GIF support … yes
Checking for broken giflib workaround … disabled
Checking for VESA support … no
Checking for SDL … yes (using sdl-config)
Checking for Windows waveout … no
Checking for Directx … no
Checking for NAS … no
Checking for DXR2 … no
Checking for DXR3/H+ … no
Checking for libmp1e … no
Checking for libfame … no
Checking for OSS Audio … yes
Checking for aRts … no
Checking for EsounD … yes
Checking for esd_get_latency() … yes
Checking for Polyp … no
Checking for JACK … no
Checking for OpenAL … no
Checking for ALSA audio … yes (using alsa 1.0.x and alsa/asoundlib.h)
Checking for Sun audio … no
Checking for Sun mediaLib … no
Checking for SGI audio … no
Checking for VCD support … yes
Checking for DVD support (libmpdvdkit2) … yes
Checking for DVD support (libdvdread) … no (disabled by libmpdvdkit2)
Checking for cdparanoia … no
Checking for libcdio … no
Checking for freetype >= 2.0.9 … yes
Checking for fontconfig … yes
Checking for fribidi with charsets … no
Checking for ENCA … no
Checking for zlib … yes
Checking for RTC … yes
Checking for external liblzo support … no
Checking for mad support … no
Checking for Toolame … no
Checking for Twolame … no
Checking for OggVorbis support … yes (internal Tremor)
Checking for libspeex (version >= 1.1 required) … no
Checking for OggTheora support … no
Checking for mp3lib support … yes
Checking for liba52 support … yes
Checking for libdts support … no
Checking for libmpeg2 support … yes
Checking for libmpcdec (musepack, version >= 1.2.1 required) … no
Checking for FAAC (AAC encoder) support … no
Checking for internal FAAD2 (AAC) support … yes
Checking for external FAAD2 (AAC) support … no
Checking for LADSPA plugin support … no
Checking for Win32 codec DLL support … yes (using /usr/lib/codecs)
Checking for Win32 loader support … yes
Checking for DirectShow … yes
Checking for XAnim DLL … yes (using /usr/lib/codecs)
Checking for RealPlayer DLL … yes (using /usr/lib/codecs)
Checking for LIVE555 Streaming Media libraries … no
Checking for FFmpeg libavutil (static) … yes
Checking for FFmpeg libavcodec (static) … yes
Checking for FFmpeg libavformat (static) … yes
Checking for FFmpeg libpostproc (static) … yes
Checking for AMR narrowband … no
Checking for AMR narrowband, fixed point … no
Checking for AMR wideband … no
Checking for libdv-0.9.5+ … no
Checking for zr … no
Checking for bl … no
Checking for XviD … no
Checking for x264 … no
Checking for DivX4linux/DivX5linux/OpenDivX decore … no
Checking for libmp3lame (for mencoder) … no
Checking for DivX4linux encore (for mencoder) … no
Checking for mencoder … yes
Checking for fastmemcpy … yes
Checking for UniquE RAR File Library … yes
Checking for TV interface … yes
Checking for *BSD BrookTree 848 TV interface … no
Checking for Video 4 Linux TV interface … yes
Checking for Video 4 Linux 2 TV interface … yes
Checking for audio select() … yes
Checking for network … yes
Checking for ftp … yes
Checking for vstream client … no
Checking for byte order … little-endian
Checking for OSD menu … no
Checking for QTX codecs … yes
Checking for Subtitles sorting … yes
Checking for XMMS inputplugin support … no
Checking for inet6 … no
Checking for gethostbyname2 … yes
Checking for GUI … yes
Checking for XShape extension … yes
Checking for GTK+ version … 2.8.20
Checking for glib version … 2.8.6
Creating Gui/config.mak
Checking for automatic gdb attach … no
Checking for compiler support for -fno-PIC … yes
Checking for compiler support for noexecstack … yes
Checking for ftello() … yes
Checking for VIDIX (internal) … yes
Checking for VIDIX (external) … no
Checking for joystick … no
Checking for lirc … no
Checking for lircc … no
Creating config.mak
Creating config.h
Creating libvo/config.mak
Creating libao2/config.mak
Creating libaf/config.mak
Config files successfully generated by ./configure !
Install prefix: /soft/MPlayer1.0
Data directory: /soft/MPlayer1.0/share/mplayer
Config direct.: /soft/MPlayer1.0/etc/mplayer
Byte order: little-endian
Optimizing for: pentium4 mmx mmxext sse sse2 mtrr
Languages:
Messages/GUI: zh_CN
Manual pages: en en
Enabled optional drivers:
Input: ftp network tv-v4l2 tv-v4l tv mpdvdkit2 vcd dvb smb
Codecs: qtx libavcodec real xanim dshow/dmo win32 faad2(internal) libmpeg2 liba52 mp3lib tremor(internal) gif
Audio output: alsa esd oss sdl mpegpes(dvb)
Video output: xvidix cvidix sdl gif89a md5sum pnm jpeg png mpegpes(dvb) opengl dga xv x11 xover tga
Audio filters:
Disabled optional drivers:
Input: vstream tv-bsdbt848 live555 cdda dvdread
Codecs: opendivx x264 xvid libdv amr_wb amr_nb faac musepack libdts libtheora speex twolame toolame libmad liblzo
Audio output: sgi sun openal jack polyp arts dxr2 nas dsound win32
Video output: winvidix bl zr zr2 dxr3 dxr2 directx vesa fbdev svga caca aa ggi xmga mga xvmc directfb tdfx_vid s3fb tdfxfb 3dfx
Audio filters: ladspa
‘config.h’ and ‘config.mak’ contain your configuration options.
Note: If you alter theses files (for instance CFLAGS) MPlayer may no longer
compile *** DO NOT REPORT BUGS if you tweak these files ***
‘make’ will now compile MPlayer and ‘make install’ will install it.
Note: On non-Linux systems you might need to use ‘gmake’ instead of ‘make’.
Please check mtrr settings at /proc/mtrr (see DOCS/HTML/en/video.html#mtrr)

Check configure.log if you wonder why an autodetection failed (check whether
the development headers/packages are installed).
Do not report compilation errors if you used any of the –enable-* options
(except –enable-gui and maybe –enable-debug).
If you suspect a bug, please read DOCS/HTML/en/bugreports.html.

Yeah! Go pass the configure successfully!
# make
# make install
Here, the main program was installed. In the next steps, will add fonts to support Chinese, and changed the ugly default skin of Mplayer. Aha, I always love iTunes.

Install fonts:
# tar xjvf font-arial-cp1250.tar.bz2
# tar xjvf font-arial-iso-8859-1.tar.bz2
# tar xjvf font-arial-iso-8859-2.tar.bz2
# tar xjvf font-arial-iso-8859-7.tar.bz2
Move these unzipped files to : “/soft/MPlayer1.0/share/mplayer/font/”
# mv font-arial-cp1250/ /soft/MPlayer1.0/share/mplayer/font/
# mv font-arial-iso-8859-1/ /soft/MPlayer1.0/share/mplayer/font/
# mv font-arial-iso-8859-2/ /soft/MPlayer1.0/share/mplayer/font/
# mv font-arial-iso-8859-7/ /soft/MPlayer1.0/share/mplayer/font/

Install the iTunes skin:
# tar -jxvf iTunes-1.1.tar.bz2
# mv PowerPlayer-1.1 default
# mv default /soft/MPlayer1.0/share/mplayer/Skin

Now, run the mplayer. It has two running mode: text and GUI. the command for text is “mplayer”, and for GUI is “gmplayer”. Note, when issue gmplayer now, there would be some error messages(I forgot the details), and could fix this with the following:
# cd ~/.mplayer
# ln -s /usr/share/fonts/zh_CN/TrueType/gbsn001p.ttf subfont.ttf
Note, the ~/.mplayer file only will be created after run “gmplayer”. So, the gmplayer should run firstly(for testing).

Finally, I could use mplayer to enjoy media(mp3,wmv) on my Linux. Some rmvb movies seem to be not supported now.

分类: 科技 标签:

ftp and http service

2006年9月23日 没有评论

SNAZ support ftp and http service. Ftp uses vsftp, and http is based on tomcat.

The service should be start/restart as following:
ftp service: #service vsftpd restart
http service: # /etc/init.d/jsp_init restart

And the related Pam files are located at “/etc/pam.d”
ftp service: /etc/pam.d/vsftpd
http service: /etc/pam.d/login

分类: 科技 标签:

Repair the SNAZ

2006年9月23日 没有评论

Sometimes, the SNAZ meets crash in the hard testing or overload. We need to repair the SNAZ online.

1. log on the target machine as admin and turn to root.
2. # portmap
3. # mount 192.168.123.3:/builds /mnt
4. # cp /mnt/4.02/S4.02.17/vmlinuz /boot
5. # cp /mnt/4.02/S4.02.17/initrd_loop /boot
6. # cp /mnt/4.02/S4.02.17/rootfs.zbd /boot
7. # lilo -C /boot/lilo.conf
8. # clean-slate –force SYSTEM
In this step, answer “yes” to confirm clean all data on the harddisk.
9. # shutdown -r now

When the system restart, it will run in the former stable version4.02.17. Use the corresponding ISO to update the system to what you want. I think this way gives my some advices at how to repair other linux crashing issues. Verify the /boot and make sure it would work well.

分类: 科技 标签:

Configure OpenLDAP and OpenSSL

2006年9月19日 没有评论

Run “/usr/local/libexec/slapd” to start openldap service. In this article, I’ll configure this openldap service with OpenSSL(self signed certification). All the steps including the failure would be written here.

At first, edit the “/usr/loca/etc/openldap/slapd.conf”. Note, samba schema is not included as default, I copied the samba.schema form /Chengdu/build/smb/example/ldap/samba.schema. All these schema items must be added as the following sequence, or it will failed during running: core,cosine,inetorgperson,misc,openldap,nis,smb.
Also the following lines are added to slapd.conf:
database bdb
suffix dc=plasmon,dc=sit
rootdn “cn=root,dc=plasmon,dc=sit”
rootpw hello123 # root’s password
directory /usr/local/var/openldap.dat

I modified the path with adding “/usr/local/libexec” in the .bash_profile. then run the slapd directly like “slapd” in the command line. Check the ldap port,192.168.123.33 is my openldap server.
# nmap 192.168.123.33
or # netstat -ant | grep 389
Port 389 is default as ldap service. To check to see if the server is running and configured correctly, by issuing the following command:
# ldapsearch -x -b ” -s base ‘(objectclass=*)’ nameingContext
If the configuration is correct, there would show:
dn:
namingContexts: dc=plasmon,dc=sit
Yes, the openldap works well, and next step I will add entries by LAT and ldif. Here, I only want to say how to add “ou”.Create a file named “ou.ldif”:
dn: ou=People,dc=plasmon,dc=sit
ObjectClass: top
ObjectClass: organizationalUnit
ou: People
description: User info
Note, it must not have space in the end of line in ldif files. Hmm,I see why I failed to import those ldif files to Iplanet early. Save the “ou.ldif” and import to OpenLdap by LAT or by issuing on the “192.168.123.33”:
# ldapadd -x -D “cn=root,dc=plasmon,dc=sit” -W hello123 -f ou.ldif
As the result, ou=People was added to OpenLdap.
————————–
More attention here! Does this add ou operation could be done successfully as the above words? The answer is no. In the Sep 22nc, I reinstall OpenLDAP in other machine. I found this issue. The resolution is add “dc=plasmon,dc=sit” firstly. just as following:
dn: dc=plasmon, dc=sit
objectclass: dcObject
objectclass: organization
o: Exmaple Company
dc: plasmon
Save the file name “begin.ldif”, and then issue:
# ldapadd -x -D “cn=root,dc=plasmon,dc=sit” -W hello123 -f begin.ldif
The “dc=plasmon,dc=sit” RN is created. then would go to add ou.

Configure OpenSSL.
First, we need to create server.pem file.
# openssl req -newkey rsa:1024 -nodes –keyout server.pem -out server.pem
Please be very careful at setting the Common Name here! It must be server’s FQDN(fully qualified distinguished name). Run “hostname” will get the FQDN, for example, the “192.168.123.33” is “localhost.localdomain”. I tried to set another hostname by issuing “hostname plasmon.sit”. this new hostname only be used in the current session. If the system restart, the hostname will return to its original name “localhost.localdomain”. Steven said the hostname could be modified permanently in “/etc/host” even reboot, I have not tested this way. So, I would still identify the Common Name as “localhost.localdomain”. Then, a certificated file “sever.pem” was create, add the relative info to “slapd.conf” as its tips.

Restart system, and run :
# sldap -h “ldaps://:636”
As the above, use netstat and namp to check if the Port 636 is open.

In the client machine, configure the following file in order to access openldap:
1./etc/ldap.conf, the bindpw must be “hello123”. the root’s password.
2./etc/samba/smb.conf add the ldapserver
3./etc/nsswitch.conf add the “ldap” before password, user and group.
Then, “getent passwd” could return items both from ldapserver and local file.

Client’s “/etc/openldap/ldap.conf” is the only file decided the result from “ldapsearch -x”, just add the ldapserver to this file. Normally, “ldapsearch -x ” returns all the entries(Note, the “size limit” setting in ldapserver’s “slapd.conf” will limit the number of returned items, ‘-1’ means nolimitation. just as iPlanet “look though” parameter).

分类: 科技 标签:

Translate PDF to Microsoft .doc

2006年9月17日 没有评论

In the Adobe Reader, open the pdf file, and click the print item. Select the printer as “Microsoft Office Document ImageWaiter”, translate the pdf document to “.mdi” formation. If no “Microsoft Office Document ImageWaiter” is not found, try to install this program with Microsoft Office 2003 CD(Microsoft Draw).

Second, run Microsoft Office Document Imaging, open the created “.mdi” file, “Tools – Send to word”, set the OCR as English or Chinese. then this tools will create a Web file contains the PDF’s texts.

Only Office 2003 has this function. other Office version could not get such job.

分类: 科技 标签: