Tuesday, November 14, 2006

Find Files

This blog moved to a new location, please visit us at http://ramble.m2m.at.

To look for files older than a day:
find . -mtime +1
To look for files NOT older than a day:
find . -mtime -1
"." -> this folder and its sub folders
"-mtime" -> modification date
"+/-" -> older or newer
"1" -> number of days

Monday, November 13, 2006

44 Rules for Server Administration

This blog moved to a new location, please visit us at http://ramble.m2m.at.

The recent German Linux Magazin had a nice article about rules for server administration.

basics:
  1. use different machines for services which need the same performance resources
  2. monitor your services
  3. limit your swap processes
  4. do not waste memory installing unneeded applications
  5. separate partitions for system, logs and data
  6. log everything
  7. save the configuration before any change
  8. keep static content in the cache
  9. stop intruders at the firewall
  10. use port knocking
web server:
  1. choose the multi-processing module which fits your CPUs
  2. use caching
  3. limit usage of .htaccess
  4. do not use symbolic links
  5. do not use lookups
  6. optimize MaxClients
  7. do not log everything
  8. use sendfile
  9. use MMAP
  10. switch of server-status
mail server:
  1. limit the number of instances
  2. use the spam filter enabled RAM disk
  3. cache DNS requests
  4. use postfix only once per mail
  5. use reject_unkown_sender_domain
  6. only use local data for postfix lookups
  7. use rate limiting for clients
  8. kick problematic mails
database server:
  1. use the correct index type
  2. delete an unneeded index
  3. optimize your tables
  4. optimize your SQL statements
  5. use soft parsing
  6. limit the size of your tables
  7. separate OLTP and DSS
  8. use persistent connections
  9. be careful with the timing of batch jobs
  10. monitor the number of connections
samba:
  1. do not touch your configuration
  2. provide enough RAM
  3. monitor the network
  4. activate Oplocks
  5. use Winbind
  6. deactivate "case sensitive"
Read the article it is really nice.

Sunday, November 12, 2006

File Scrubber for iLiad

Copying files from Mac OS X to the iRex iLiad reader creates .DS_Store files and ._ files on the iLiad. Sometimes this seems to be a problem - some PDFs could not be opened any more. Unfortunately those files are not visible in the OS X finder. Connecting the iLiad to an WinXP computer allows to remove them but it is really clumsy having to use multiple computers.

Matt Jadud, wrote an OS X a application called iliad-scrub which runs through the iLiad folder and cleans the files automatically. Thanks Matt!

Friday, November 10, 2006

chm to pdf

CHM - Microsoft Compressed HTML Help - is a proprietary format for online help files, developed by Microsoft. Viewing CHM files using other operating systems is sometimes a little bit difficult.
Recently a CHM plug-in appeared for firefox which should be some help.
Sometimes it is still necessary to convert CHM files into other formats. While there are quite a lot of applications which could do that easily on Windows, it is still tricky for non-Windows systems.

e.g. for Mac OS X or other UNIX based OS

First you have to unpack the html files.
  1. Download the chmtools package.
  2. Unzip it: tar -zxf chmtools.tar.gz
  3. Go to the chmtools folder: cd chmtools
  4. Compile it: make
  5. Move the new command somewhere you can easily access it (you might have to become root to be able to do that), eg: su; cp chmdump /usr/bin
Step 1. to 5. you have to do only once.
  1. Now it is time to unpack the CHM file, eg: chmdump file.chm newFolder
Now we have to install two software packages which will do the actual html to pdf conversion.
  1. Download the fltk source (should be version 1.1 or above)
  2. Unzip it, eg: tar -yxf fltk-1.1.7-source.tar.bz2
  3. Go to the fltk folder, eg: cd fltk-1.1.7
  4. Compile it: make
  5. It could be you need to configure the compile process for your system - have a look at their manual.
  6. Install the new commands (you have to become root to be able to do that), eg: su; make install
  7. Download the htmldoc source
  8. Unzip it, eg: tar -yxf htmldoc-1.8.27-source.tar.bz2
  9. Go to the fltk folder, eg: cd htmldoc-1.8.27
  10. Compile it: make
  11. It could be you need to configure the compile process for your system - have a look at their manual.
  12. Install the new commands (you have to become root to be able to do that), eg: su; make install
Step 7. to 18. you have to do only once.
  1. Now look for the html files in the folder chmdump created.
  2. Go there, eg: cd newFolder
  3. Now you have to create a batch file containing all the html files you want to have in your pdf. Eg: ls *.thml > test.book
  4. Sometimes the files are not in the order you like. Use your favorite text editor to adjust that.
  5. Add the following two lines at the top of test.book to adjust the layout the pdf. The given format is best if you want to use the pdf file on your iLiad reader.
#HTMLDOC
-t pdf --webpage --size 12x15cm --pscommands --gray --jpeg -f test.pdf
  1. Run the batch file: htmldoc --batch test.book
  2. The result should be a pdf file called test.pdf.
Have fun