<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-23398672</id><updated>2012-02-17T10:57:09.869+08:00</updated><category term='Freebsd'/><category term='linux'/><category term='install'/><category term='ramdisk'/><category term='arm'/><category term='ar'/><category term='rotate log files'/><category term='shell script'/><category term='filesytem cleanup'/><category term='text editor'/><category term='sms'/><category term='vi'/><category term='linux programming'/><category term='install linux'/><category term='postfix'/><category term='logical volume manager'/><category term='df'/><category term='lvm'/><category term='nothing'/><category term='kernel 2.6'/><category term='trip'/><category term='getc'/><category term='initrd'/><category term='md5sum'/><category term='shell'/><category term='log files'/><category term='towneplace suite'/><category term='linux services'/><category term='beijing'/><category term='nm'/><category term='linux network'/><category term='linux kernel'/><category term='alpharetta'/><category term='partition'/><category term='georgia'/><category term='ranlib'/><category term='china'/><category term='user input'/><category term='c library'/><category term='c program'/><category term='pagefile'/><category term='svn'/><category term='checksum'/><category term='cross compile'/><title type='text'>daft pages</title><subtitle type='html'>---blah blah blah---</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://daftster.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23398672/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://daftster.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>daftster</name><uri>http://www.blogger.com/profile/00076860789674273180</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>37</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-23398672.post-2870478893770687980</id><published>2008-09-05T20:38:00.000+08:00</published><updated>2008-09-05T20:45:23.193+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Freebsd'/><category scheme='http://www.blogger.com/atom/ns#' term='postfix'/><title type='text'></title><content type='html'>Using Postfix instead of Sendmail in Freebsd&lt;br /&gt;&lt;br /&gt;Freebsd distros, usually installs sendmail as its mail server.  To replace Sendmail with Postfix, here are the steps.&lt;br /&gt;&lt;br /&gt;First, make sure that you have an active internet connections and you have setup your dns properly and do the following:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;# cd /usr/ports/mail/postfix-current&lt;br /&gt;# make install clean&lt;br /&gt;&lt;/span&gt;During installation, just say Y to all the questions.&lt;br /&gt;&lt;br /&gt;After the installation, we want to run postfix and not sendmail during startup.&lt;br /&gt;&lt;span style="font-style:italic;"&gt;# vi /etc/rc.conf&lt;/span&gt;&lt;br /&gt;Add the following lines:&lt;br /&gt;sendmail_enable="NO"&lt;br /&gt;sendmail_submit_enable="NO"&lt;br /&gt;sendmail_outbound_enable="NO"&lt;br /&gt;sendmail_msp_queue_enable="NO"&lt;br /&gt;postfix_enable="YES"&lt;br /&gt;&lt;br /&gt;Reboot and your good to go!&lt;br /&gt;&lt;br /&gt;Got this from &lt;a href="http://www.scriptinstallation.in/freebsd_postfix_install.html"&gt;ScriptInstallation.In&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/23398672-2870478893770687980?l=daftster.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://daftster.blogspot.com/feeds/2870478893770687980/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=23398672&amp;postID=2870478893770687980' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23398672/posts/default/2870478893770687980'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23398672/posts/default/2870478893770687980'/><link rel='alternate' type='text/html' href='http://daftster.blogspot.com/2008/09/using-postfix-instead-of-sendmail-in.html' title=''/><author><name>daftster</name><uri>http://www.blogger.com/profile/00076860789674273180</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23398672.post-4879810242129230654</id><published>2008-06-29T13:10:00.000+08:00</published><updated>2008-06-29T13:20:26.555+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='nothing'/><title type='text'></title><content type='html'>Just got back from Saint Clair's Sports Center Cafe.... After finishing a pitcher of beer, the fight wasn't over, so I ordered for another glass!  After I ordered my glass of beer, then the fight was over!  Watch my Filipino boxing idol, beating the hell out of his opponent (Diaz) on the ninth round.  I'm not really a boxing fan, but since I have nothing to do here and just feeling a little apart from home, I opted to try to watch Pacquiao's fight since they are usually exciting.&lt;br /&gt;&lt;br /&gt;Rollback:&lt;br /&gt;Decided to go to the bar instead of paying for pay per view and got a pitcher plus a glass and french fries to watch the game.  I would say that it was worth it, since my &lt;a href="http://www.daftology.com"&gt;wife&lt;/a&gt; somehow sponsored it to give her more time to do her digi-scrapping hobby.  Well, I guess I need to watch more fights of Pacquiao.&lt;br /&gt;&lt;br /&gt;actually, didn't cheer that much inside the bar since I notice that most of the people in the bar are cheering for Diaz.  Just do not want to be in a bad situation.  But, by the time the winner announced, I just started to cheer and clap for the winner, and noticed they were turning to me and acknowledges the victory.&lt;br /&gt;&lt;br /&gt;That's IT! forgive me if I'm unorganized! Hope you understand, after a pitcher and a glass of beer.  Once again, congratulations to Manny "PACMAN" Pacquiao.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/23398672-4879810242129230654?l=daftster.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://daftster.blogspot.com/feeds/4879810242129230654/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=23398672&amp;postID=4879810242129230654' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23398672/posts/default/4879810242129230654'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23398672/posts/default/4879810242129230654'/><link rel='alternate' type='text/html' href='http://daftster.blogspot.com/2008/06/just-got-back-from-saint-clairs-sports.html' title=''/><author><name>daftster</name><uri>http://www.blogger.com/profile/00076860789674273180</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23398672.post-8329700164067958053</id><published>2008-06-25T22:17:00.000+08:00</published><updated>2008-06-25T22:20:40.897+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='vi'/><category scheme='http://www.blogger.com/atom/ns#' term='install'/><title type='text'></title><content type='html'>&lt;span style="font-weight:bold;"&gt;Case Insensitive search in vi/vim&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Just got a tip for turning on/off case insensitive search in vi/vim:&lt;br /&gt;To search in case insensitive mode, in command mode:&lt;br /&gt;:set ignorecase&lt;br /&gt;OR&lt;br /&gt;:set ic&lt;br /&gt;&lt;br /&gt;To go back to case sensitive search, which is the default:&lt;br /&gt;:set noignorcase&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;Got this tip from:&lt;/span&gt;&lt;br /&gt;&lt;a href="http://www.tech-recipes.com/unix_tips406.html"&gt;http://www.tech-recipes.com/unix_tips406.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/23398672-8329700164067958053?l=daftster.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://daftster.blogspot.com/feeds/8329700164067958053/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=23398672&amp;postID=8329700164067958053' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23398672/posts/default/8329700164067958053'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23398672/posts/default/8329700164067958053'/><link rel='alternate' type='text/html' href='http://daftster.blogspot.com/2008/06/case-insensitive-search-in-vivim-just.html' title=''/><author><name>daftster</name><uri>http://www.blogger.com/profile/00076860789674273180</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23398672.post-7043504070345271359</id><published>2008-05-30T02:38:00.000+08:00</published><updated>2008-05-30T02:42:59.593+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='pagefile'/><title type='text'></title><content type='html'>&lt;span style="font-weight: bold;"&gt;Creating Page File in Linux&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;When you installed your linux previously without a swap partition and later you decided to add one, here is what you can do.&lt;br /&gt;&lt;br /&gt;# dd if=/dev/zero of=/swap1 bs=1024 count 8192             &lt;span style="font-style: italic;"&gt;Create 8MB file&lt;/span&gt;&lt;br /&gt;# mkswap /swap1 8192                                                            &lt;span style="font-style: italic;"&gt;Make file a swap device&lt;/span&gt;&lt;br /&gt;# sync; sync&lt;br /&gt;# swapon /swap1                                                                 &lt;span style="font-style: italic;"&gt;Activate page file&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;From:&lt;br /&gt;Oreilly's Essential System Administration, 3rd Edition&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/23398672-7043504070345271359?l=daftster.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://daftster.blogspot.com/feeds/7043504070345271359/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=23398672&amp;postID=7043504070345271359' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23398672/posts/default/7043504070345271359'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23398672/posts/default/7043504070345271359'/><link rel='alternate' type='text/html' href='http://daftster.blogspot.com/2008/05/creating-page-file-in-linux-when-you.html' title=''/><author><name>daftster</name><uri>http://www.blogger.com/profile/00076860789674273180</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23398672.post-2317305059289331239</id><published>2008-05-28T23:07:00.001+08:00</published><updated>2008-05-28T23:15:14.152+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='filesytem cleanup'/><title type='text'></title><content type='html'>&lt;span style="font-weight:bold;"&gt;Using find to delete old junk files on a system&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;#find / \( -name a.out -o -name core -o -name '*~'\&lt;br /&gt;   -o -name '#*#' \) -type f -atime +14 \&lt;br /&gt;   -exec rm -f {} \; -o -fstype nfs -prune&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Command explanation:&lt;br /&gt;This command searches the entire filesystem and removes various editor backup files, core dump files, and random executables (a.out) that haven't been accessed in two weeks and that don't reside on a remotely mounted filesystem. The logic is messy: the final -o option ORs all the options that preceded it with those that followed it, each of which is computed separately. Thus, the final operation finds files that match either of two criteria: &lt;br /&gt;&lt;br /&gt;*The filename matches, it's a plain file, and it hasn't been accessed for 14 days. &lt;br /&gt;&lt;br /&gt;*The filesystem type is nfs (meaning a remote disk). &lt;br /&gt;&lt;br /&gt;If the first criteria set is true, the file gets removed; if the second set is true, a "prune" action takes place, which says "don't descend any lower into the directory tree." Thus, every time find comes across an NFS-mounted filesystem, it will move on, rather than searching its entire contents as well. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Got it from OReilly's Essential System Administration 3rd Edition&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/23398672-2317305059289331239?l=daftster.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://daftster.blogspot.com/feeds/2317305059289331239/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=23398672&amp;postID=2317305059289331239' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23398672/posts/default/2317305059289331239'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23398672/posts/default/2317305059289331239'/><link rel='alternate' type='text/html' href='http://daftster.blogspot.com/2008/05/using-find-to-delete-old-junk-files-on.html' title=''/><author><name>daftster</name><uri>http://www.blogger.com/profile/00076860789674273180</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23398672.post-8778838735140302428</id><published>2008-05-28T22:56:00.000+08:00</published><updated>2008-05-28T23:00:11.006+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='shell'/><title type='text'></title><content type='html'>&lt;span style="font-weight:bold;"&gt;Determining Built-in Shell Commands&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Just got across a problem of determining which linux commands are built-in and which are aliases.&lt;br /&gt;&lt;br /&gt;# type &lt;linux command&gt;&lt;br /&gt;ie.  &lt;span style="font-style:italic;"&gt;# type echo&lt;span style="font-style:italic;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/23398672-8778838735140302428?l=daftster.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://daftster.blogspot.com/feeds/8778838735140302428/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=23398672&amp;postID=8778838735140302428' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23398672/posts/default/8778838735140302428'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23398672/posts/default/8778838735140302428'/><link rel='alternate' type='text/html' href='http://daftster.blogspot.com/2008/05/determining-built-in-shell-commands.html' title=''/><author><name>daftster</name><uri>http://www.blogger.com/profile/00076860789674273180</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23398672.post-8745492924022154868</id><published>2008-04-15T22:31:00.001+08:00</published><updated>2008-04-15T22:35:04.463+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='vi'/><category scheme='http://www.blogger.com/atom/ns#' term='text editor'/><title type='text'></title><content type='html'>&lt;span style="font-weight:bold;"&gt;Opening a file in vi editor as read only&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;To open a file in vi as read only, you can use either of the command.&lt;br /&gt;&lt;span style="font-style:italic;"&gt;view file&lt;/span&gt;&lt;br /&gt;or&lt;br /&gt;&lt;span style="font-style:italic;"&gt;vi -R file&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/23398672-8745492924022154868?l=daftster.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://daftster.blogspot.com/feeds/8745492924022154868/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=23398672&amp;postID=8745492924022154868' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23398672/posts/default/8745492924022154868'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23398672/posts/default/8745492924022154868'/><link rel='alternate' type='text/html' href='http://daftster.blogspot.com/2008/04/opening-file-in-vi-editor-as-read-only.html' title=''/><author><name>daftster</name><uri>http://www.blogger.com/profile/00076860789674273180</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23398672.post-5573070869462870234</id><published>2007-12-20T14:03:00.000+08:00</published><updated>2007-12-20T14:09:41.593+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='log files'/><category scheme='http://www.blogger.com/atom/ns#' term='shell script'/><category scheme='http://www.blogger.com/atom/ns#' term='rotate log files'/><title type='text'></title><content type='html'>&lt;span style="font-weight:bold;"&gt;Rotating log files&lt;/span&gt;&lt;br /&gt;If in case you need to write a script to rotate log files that you have.&lt;br /&gt;&lt;br /&gt;#!/bin/sh&lt;br /&gt;&lt;br /&gt;# Usage: rotate  &lt;br /&gt;&lt;br /&gt;PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin ; export PATH&lt;br /&gt;&lt;br /&gt;logfile=$1   # name of the logfile without any extensions&lt;br /&gt;to_num=$2   # extension that the rotated file will have&lt;br /&gt;&lt;br /&gt;while [ $to_num -gt 1 ] ; do&lt;br /&gt;    from_num=`expr $to_num - 1` # extension of the file to be rotated&lt;br /&gt;    if [ -f $logfile.$from_num ] ; then # if the logfile already exists&lt;br /&gt;        mv $logfile.$from_num $logfile.$to_num&lt;br /&gt;    elif [ -f $logfile.$from_num.gz ] ; then  # in case they are compressed&lt;br /&gt;        mv $logfile.$from_num.gz $logfile.$to_num.gz&lt;br /&gt;    fi&lt;br /&gt;    to_num=$from_num&lt;br /&gt;done&lt;br /&gt;&lt;br /&gt;if [ -f $logfile ] ; then # sanity check&lt;br /&gt;    cp $logfile $logfile.1&lt;br /&gt;    cp /dev/null $logfile # truncates the file&lt;br /&gt;    gzip --quiet $logfile.1 # compress it to save space&lt;br /&gt;fi&lt;br /&gt;&lt;br /&gt;Got it from &lt;a href="http://www.aoc.nrao.edu/~krowe/TCC/sysadmin/topics/tools.html"&gt;http://www.aoc.nrao.edu/~krowe/TCC/sysadmin/topics/tools.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/23398672-5573070869462870234?l=daftster.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://daftster.blogspot.com/feeds/5573070869462870234/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=23398672&amp;postID=5573070869462870234' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23398672/posts/default/5573070869462870234'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23398672/posts/default/5573070869462870234'/><link rel='alternate' type='text/html' href='http://daftster.blogspot.com/2007/12/rotating-log-files-if-in-case-you-need.html' title=''/><author><name>daftster</name><uri>http://www.blogger.com/profile/00076860789674273180</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23398672.post-6434416112268591360</id><published>2007-12-14T21:30:00.000+08:00</published><updated>2007-12-14T21:45:55.067+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='beijing'/><category scheme='http://www.blogger.com/atom/ns#' term='trip'/><category scheme='http://www.blogger.com/atom/ns#' term='china'/><title type='text'></title><content type='html'>&lt;span style="font-weight: bold;"&gt;Beijing Trip&lt;/span&gt;&lt;br /&gt;Last week from   Dec. 6 to Dec. 9, I went to Beijing, China to meet our client.  This was my first to visit China.  All the while, I thought that it would just be a few hours of flight, but it turned out to be more than 4 hour flight.  It was quite a boring trip for me since I'm traveling alone.  I hope I could travel with my family next time.&lt;br /&gt;&lt;br /&gt;Beside meeting our client, I was able to go to Tiananmen Square and The Great Wall of China.  No need to say much about them since I think those places are well heard of.  On this trip I noticed that everyone in China is preparing for the Beijing Olympics 2008.  While asking around, I think almost all of the infrastructure will be ready by the time the Olympics start next year.  One example is the Subway System.  Subway right now has 2 lines, but by the time Olympics starts, it would be 5 lines already.&lt;br /&gt;&lt;br /&gt;Here are some pics from my trip. (Airport, Hotel, Tiananmen and Great Wall of China)&lt;br /&gt;&lt;br /&gt;&lt;embed type="application/x-shockwave-flash" src="http://picasaweb.google.com/s/c/bin/slideshow.swf" flashvars="host=picasaweb.google.com&amp;amp;RGB=0x000000&amp;amp;feed=http%3A%2F%2Fpicasaweb.google.com%2Fdata%2Ffeed%2Fapi%2Fuser%2Fdaftster%2Falbumid%2F5142520559608022593%3Fkind%3Dphoto%26alt%3Drss" pluginspage="http://www.macromedia.com/go/getflashplayer" height="192" width="288"&gt;&lt;/embed&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/23398672-6434416112268591360?l=daftster.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://daftster.blogspot.com/feeds/6434416112268591360/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=23398672&amp;postID=6434416112268591360' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23398672/posts/default/6434416112268591360'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23398672/posts/default/6434416112268591360'/><link rel='alternate' type='text/html' href='http://daftster.blogspot.com/2007/12/beijing-trip-last-week-from-dec.html' title=''/><author><name>daftster</name><uri>http://www.blogger.com/profile/00076860789674273180</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23398672.post-853722820540599069</id><published>2007-11-20T12:01:00.000+08:00</published><updated>2007-11-20T13:11:33.289+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='arm'/><category scheme='http://www.blogger.com/atom/ns#' term='kernel 2.6'/><category scheme='http://www.blogger.com/atom/ns#' term='cross compile'/><title type='text'></title><content type='html'>&lt;span style="font-weight:bold;"&gt;Cross compiling 2.6 kernel for ARM&lt;/span&gt;&lt;br /&gt;I have to cross compile a kernel for an arm based system.  Here is what I did and it worked.&lt;br /&gt;&lt;br /&gt;make CROSS_COMPILE=arm-linux- ARCH=arm PATH=/cross-compiler-path/:$PATH&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;i.e: (toolchain is in /tools/arm-uclibc-3.4.6/bin/ directory.&lt;br /&gt;PATH=/tools/arm-uclibc-3.4.6/bin/:$PATH&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/23398672-853722820540599069?l=daftster.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://daftster.blogspot.com/feeds/853722820540599069/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=23398672&amp;postID=853722820540599069' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23398672/posts/default/853722820540599069'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23398672/posts/default/853722820540599069'/><link rel='alternate' type='text/html' href='http://daftster.blogspot.com/2007/11/cross-compiling-2.html' title=''/><author><name>daftster</name><uri>http://www.blogger.com/profile/00076860789674273180</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23398672.post-1167976930216500562</id><published>2007-10-22T16:45:00.000+08:00</published><updated>2007-10-22T18:03:30.216+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux programming'/><category scheme='http://www.blogger.com/atom/ns#' term='shell script'/><title type='text'></title><content type='html'>&lt;span style="font-weight:bold;"&gt;Linux Command to find zero file sizes&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Option 1: List all files in the directory and its subdirectories which has a filesize of zero&lt;br /&gt;# du -ak | awk '{if ($1 == 0) print $0}'&lt;br /&gt;&lt;br /&gt;You can also include in your command which directory you want to search.&lt;br /&gt;# du -ak "directory to search" | awk '{if ($1 == 0) print $0}'&lt;br /&gt;(replace "directory to search" with the directory you want to search)&lt;br /&gt;&lt;br /&gt;You can also change the condition inside the (). In this example you are looking for files which uses less than 12 bytes of disk space.&lt;br /&gt;# du -ak | awk '{if ($1 &lt; 12) print $0}'&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/23398672-1167976930216500562?l=daftster.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://daftster.blogspot.com/feeds/1167976930216500562/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=23398672&amp;postID=1167976930216500562' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23398672/posts/default/1167976930216500562'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23398672/posts/default/1167976930216500562'/><link rel='alternate' type='text/html' href='http://daftster.blogspot.com/2007/10/linux-command-to-find-zero-file-sizes.html' title=''/><author><name>daftster</name><uri>http://www.blogger.com/profile/00076860789674273180</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23398672.post-1987959138775179087</id><published>2007-10-18T15:07:00.000+08:00</published><updated>2007-10-18T15:10:42.010+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='svn'/><title type='text'></title><content type='html'>&lt;span style="font-weight:bold;"&gt;svn notes&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Creating your repository&lt;br /&gt;$ svnadmin create --fs-type fsfs /path/to/repos&lt;br /&gt;$ svnadmin create --fs-type bdb /path/to/other/repos&lt;br /&gt;&lt;br /&gt;Knowing the latest version of your repository&lt;br /&gt;$ svnlook youngest /path/to/repos&lt;br /&gt;&lt;br /&gt;svnadmin dump will output a range of repository revisions that are formatted using Subversion's custom filesystem&lt;br /&gt;dump format. The dump format is printed to the standard output stream, while informative messages are printed to&lt;br /&gt;the standard error stream. This allows you to redirect the output stream to a file while watching the status output in&lt;br /&gt;your terminal window.&lt;br /&gt;$ svnadmin dump myrepos &gt; dumpfile&lt;br /&gt;&lt;br /&gt;svnadmin load, parses the standard input stream as a Subversion repository&lt;br /&gt;dump file, and effectively replays those dumped revisions into the target repository for that operation. It also gives&lt;br /&gt;informative feedback, this time using the standard output stream:&lt;br /&gt;$ svnadmin load newrepos &lt; dumpfile&lt;br /&gt;&lt;br /&gt;svnadmin dump outputs a range of revisions. Use the --revision option to specify&lt;br /&gt;a single revision to dump, or a range of revisions. If you omit this option, all the existing repository revisions will&lt;br /&gt;be dumped.&lt;br /&gt;$ svnadmin dump myrepos --revision 23 &gt; rev-23.dumpfile&lt;br /&gt;$ svnadmin dump myrepos --revision 100:200 &gt; revs-100-200.dumpfile&lt;br /&gt;&lt;br /&gt;Importing your initial data to repository&lt;br /&gt;$ svn import . file:///path/to/repos --message 'Initial repository layout'&lt;br /&gt;&lt;br /&gt;you can use svn update and svn checkout with the --revision switch&lt;br /&gt;to take an entire working copy "back in time”&lt;br /&gt;$ svn checkout --revision 1729 # Checks out a new working copy at r1729&lt;br /&gt;$ svn update --revision 1729 # Updates an existing working copy to r1729&lt;br /&gt;&lt;br /&gt;To checkout:&lt;br /&gt;$ svn checkout file:///path/to/repos&lt;br /&gt;&lt;br /&gt;To know the version which you currently have&lt;br /&gt;$ svn info&lt;br /&gt;&lt;br /&gt;Adding a file to your repository&lt;br /&gt;$ svn add newfile&lt;br /&gt;&lt;br /&gt;Commiting Changes to your repository&lt;br /&gt;$ svn commit -F log_msg.txt (for txt message files)&lt;br /&gt;$ svn commit -m "put your message here"&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/23398672-1987959138775179087?l=daftster.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://daftster.blogspot.com/feeds/1987959138775179087/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=23398672&amp;postID=1987959138775179087' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23398672/posts/default/1987959138775179087'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23398672/posts/default/1987959138775179087'/><link rel='alternate' type='text/html' href='http://daftster.blogspot.com/2007/10/svn-notes-dumpfile-svnadmin-load-parses.html' title=''/><author><name>daftster</name><uri>http://www.blogger.com/profile/00076860789674273180</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23398672.post-3497840043539435268</id><published>2007-10-16T17:28:00.000+08:00</published><updated>2007-10-16T17:39:20.340+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='svn'/><title type='text'></title><content type='html'>&lt;span style="font-weight:bold;"&gt;svn checksum mismatch&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Recently I encountered this problem when I was trying to checkout from our svn server.  &lt;br /&gt;&lt;br /&gt;svn: Checksum mismatch on rep 'q7':&lt;br /&gt;&lt;br /&gt;To solve this, do the following:&lt;br /&gt;&lt;br /&gt;# Do a dump of the db/representations file: (go to your repository directory&lt;br /&gt;db_dump -kp representations &gt; representations.dump&lt;br /&gt;&lt;br /&gt;# Backup the representations.dump file just in case something happens&lt;br /&gt;cp representations.dump representations.dump.bak&lt;br /&gt;&lt;br /&gt;# Quoting from the mailing list message: "The dumpfile will contain lines like:&lt;br /&gt; ((fulltext 1 7 (md5 16 \fa\85\a5\e3\bdN7\95\03\e8\baq0\ad\9cn)) q7) &lt;br /&gt;&lt;br /&gt;Edit the part after '(md5 16 ' to 16 repeats of \00 - the all-zero checksum matches anything. "&lt;br /&gt; ((fulltext 1 7 (md5 16 \00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00)) q7) &lt;br /&gt;&lt;br /&gt;You can try to look for all q7 entries on representations.dump file and change their checksum to 16 \00&lt;br /&gt;&lt;br /&gt;q7 is the test i see in the error message I got:&lt;br /&gt;svn: Checksum mismatch on rep '&lt;span style="font-weight:bold;"&gt;q7&lt;/span&gt;':&lt;br /&gt;&lt;br /&gt;# Reload the edited representations file back in using db_load:&lt;br /&gt;db_load representations &lt; representations.dump&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Got this help from:&lt;br /&gt;&lt;a href="http://ilovett.com/blog/programming/subversion-checksum-error"&gt;http://ilovett.com/blog/programming/subversion-checksum-error&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/23398672-3497840043539435268?l=daftster.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://daftster.blogspot.com/feeds/3497840043539435268/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=23398672&amp;postID=3497840043539435268' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23398672/posts/default/3497840043539435268'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23398672/posts/default/3497840043539435268'/><link rel='alternate' type='text/html' href='http://daftster.blogspot.com/2007/10/svn-checksum-mismatch-representations.html' title=''/><author><name>daftster</name><uri>http://www.blogger.com/profile/00076860789674273180</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23398672.post-8362359950192769330</id><published>2007-10-04T14:54:00.000+08:00</published><updated>2007-10-04T15:04:48.727+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='checksum'/><category scheme='http://www.blogger.com/atom/ns#' term='md5sum'/><title type='text'></title><content type='html'>&lt;span style="font-weight:bold;"&gt;md5sum (Checksum of a file)&lt;/span&gt;&lt;br /&gt;&lt;a href="http://www.wigwam-framework.org/doc/x154.html"&gt;definition of md5sum:&lt;/a&gt;&lt;br /&gt;The program md5sum will tell you the md5 checksum (md5sum) of any stream of data or a file. It is a 32-digit hexidecimal number (with the a-f characters lowercase). If the md5sums of two files are identical, it is likely that the files are also identical. If the md5sum is different, the files are definitely different. This property is used to verify the integrity of downloaded packages.&lt;br /&gt;&lt;br /&gt;To get the checksum of a file in linux using md5sum,&lt;br /&gt;# md5sum file.tgz&lt;br /&gt;&lt;br /&gt;You can also do md5sum to multiple files by enumerating the files or by the use of wildcards in linux&lt;br /&gt;# md5sum file1.tgz file2.tgz file3.tgz&lt;br /&gt;or&lt;br /&gt;# md5sum file*.tgz&lt;br /&gt;&lt;br /&gt;You can also redirect them into a text file&lt;br /&gt;# md5sum file*.tgz &gt; md5sum.txt&lt;br /&gt;&lt;br /&gt;To verify on the other end, you can run the md5sum and compare the result&lt;br /&gt;# md5sum file1.tgz&lt;br /&gt;&lt;br /&gt;Or, if you want to verify all files that were saved into md5sum.txt&lt;br /&gt;# md5sum -c md5sum.txt&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;For more info, &lt;a href="http://en.wikipedia.org/wiki/Md5sum"&gt;http://en.wikipedia.org/wiki/Md5sum&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/23398672-8362359950192769330?l=daftster.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://daftster.blogspot.com/feeds/8362359950192769330/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=23398672&amp;postID=8362359950192769330' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23398672/posts/default/8362359950192769330'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23398672/posts/default/8362359950192769330'/><link rel='alternate' type='text/html' href='http://daftster.blogspot.com/2007/10/md5sum-checksum-of-file-definition-of.html' title=''/><author><name>daftster</name><uri>http://www.blogger.com/profile/00076860789674273180</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23398672.post-8290848480677660845</id><published>2007-09-18T09:14:00.000+08:00</published><updated>2007-09-18T09:17:12.626+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='install linux'/><title type='text'></title><content type='html'>&lt;a href="http://www.goudkov.com/public/articles/changing_distro.jsp"&gt;Changing distribution remotely -- HOWTO&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;How to completely change your distribution on a remote box without a boot disk, with only ssh access, using only one partition, and with only one reboot at the very end of the conversion process. And by completely, I mean completely. You can delete every single file of the old distro if you want.&lt;br /&gt;&lt;br /&gt;Why would you ever need to do something like that?&lt;br /&gt;&lt;br /&gt;Well, a lot of hosting companies offer only the software configuration of their choice. On top of that, most of them would not agree to send someone to the datacenter to be on the phone with you while inserting/changing CDs to help you install a distro of your choice.&lt;br /&gt;&lt;br /&gt;It's easier to completely switch a linux distribution if the original configuration includes a swap partition. That partition can be reformatted to contain a fully-working system. Then, it can be used for booting up to let you free up the main partition(s).&lt;br /&gt;&lt;br /&gt;But if there is no "spare" partition for you to use, of if it's too small for you to be comfortable in the future, or if you want to completely change the partition table, then here is how to do it.&lt;br /&gt;&lt;br /&gt;For this example, I am going to assume one large root partition, but you can just as easily perform the switch with multiple partitions.&lt;br /&gt;&lt;br /&gt;The original distribution is not important, and the new distribution I picked is Debian.&lt;br /&gt;&lt;br /&gt;You can use any distribution you want, but I used Debian because it has a debootstrap package, which can be used to create a basic installation in a chroot.&lt;br /&gt;&lt;br /&gt;I'm assuming that you have your distro prepared in a file called newinstall.tar. It can either be prepared elsewhere and uploaded to your remote box or prepared right on the box.&lt;br /&gt;&lt;br /&gt;Turn the swapping off and make sure it's off.&lt;br /&gt;&lt;br /&gt;# swapoff -a&lt;br /&gt;# free&lt;br /&gt;&lt;br /&gt;free should show swap 0. You only need to turn the swap off if you plan on changing something about your existing swap partition or if your swap is a file on the root partition.&lt;br /&gt;&lt;br /&gt;Shut down everything you can except for sshd (and except for system processes of course).&lt;br /&gt;&lt;br /&gt;You need to kill running processes until you can remount the root in read-only mode.&lt;br /&gt;&lt;br /&gt;Keep killing processes that you don't need until you can successfully run this command:&lt;br /&gt;&lt;br /&gt;# mount -o remount,ro /&lt;br /&gt;&lt;br /&gt;If you get&lt;br /&gt;&lt;br /&gt;mount: / is busy&lt;br /&gt;&lt;br /&gt;it means some process has a file open for writing on /.&lt;br /&gt;&lt;br /&gt;You can use fuser and lsof to see which files are being accessed.&lt;br /&gt;&lt;br /&gt;Once you have successfully remounted root in read-only mode and made sure there are no active processes writing to files on the root partition, remount it back in the read-write mode and move on to the next step.&lt;br /&gt;&lt;br /&gt;# mount -o remount,rw /&lt;br /&gt;&lt;br /&gt;Create a directory for your new distribution and put it on a temp drive. I'll use /newinstall and assume that the new distro is in /newinstall.tar.&lt;br /&gt;&lt;br /&gt;# mkdir /newinstall&lt;br /&gt;# mount -t tmpfs -o size=230M tmpfs /newinstall&lt;br /&gt;&lt;br /&gt;You should use a temp drive so that you can safely mess with your root partition. If you don't want to change the file system type of the root partition and prefer to selectively delete directories of the original distro then you should be fine without using a temp drive.&lt;br /&gt;&lt;br /&gt;Extract your new distro into the newinstall directory.&lt;br /&gt;&lt;br /&gt;# tar xfp newinstall.tar&lt;br /&gt;&lt;br /&gt;Chroot into your new distro.&lt;br /&gt;&lt;br /&gt;# chroot /newinstall&lt;br /&gt;&lt;br /&gt;# mount -t proc none /proc&lt;br /&gt;&lt;br /&gt;Once inside chroot, update your /etc/fstab to what it's supposed to be once your new distro is running. In the case of a single large root, you should have something like:&lt;br /&gt;&lt;br /&gt;proc /proc proc defaults 0 0&lt;br /&gt;/dev/hda1 / ext3 defaults,errors=remount-ro 0 1&lt;br /&gt;/dev/hda2 none swap sw 0 0&lt;br /&gt;&lt;br /&gt;Set up the kernel, network and disk drivers, boot loader, initrd and anything else that you need to make sure your new distro can boot. I'm not going to cover the details here because each of those tasks is well-documented elsewhere.&lt;br /&gt;&lt;br /&gt;If your kernel uses initrd then make sure to include the correct modules for your disk drives, the network card and run mkinitrd.&lt;br /&gt;&lt;br /&gt;If you are using grub then run grub-install and edit menu.lst.&lt;br /&gt;&lt;br /&gt;One everything is ready and you are sure your new distro can boot, exit from chroot.&lt;br /&gt;&lt;br /&gt;Try to remount root in read-only mode again just to be safe and remount it back to read-write.&lt;br /&gt;&lt;br /&gt;Here comes the magic.&lt;br /&gt;&lt;br /&gt;Change the running root of your system to your new distro.&lt;br /&gt;&lt;br /&gt;# mkdir /newinstall/oldroot&lt;br /&gt;# pivot_root /newinstall /newinstall/oldroot&lt;br /&gt;# mount -t proc none /proc&lt;br /&gt;&lt;br /&gt;At this point, your new root is in /newinstall and your old root (the real /) is in /oldroot.&lt;br /&gt;&lt;br /&gt;If you want to change anything on your root partition (besides simple rm) then fix up your /etc/mtab with the data from /proc/mounts adjusted for your oldroot. If /dev/hda1 was / then put it in mtab as /dev/hda1 /oldroot.&lt;br /&gt;&lt;br /&gt;Go to oldroot and remove everything you don't need.&lt;br /&gt;&lt;br /&gt;In my case, I removed everything except for /proc and /sys. You might also want to leave /dev/shm alone. Everything else can be removed at this point.&lt;br /&gt;&lt;br /&gt;Once your oldroot (which is the real /) is empty or in the state you want it to be, copy your new distro out into the oldroot.&lt;br /&gt;&lt;br /&gt;You might want to specify all directories separately to avoid error messages of oldroot not being copied onto itself.&lt;br /&gt;&lt;br /&gt;# cp -a -i /bin /etc /dev /usr ....... /oldroot/&lt;br /&gt;&lt;br /&gt;Do not include /proc and /sys in your copying command. They should still exist on the oldroot. If you changed your file system and it's now empty then create those directories.&lt;br /&gt;&lt;br /&gt;If you left more than a few things (like /dev/shm) on the oldroot and don't care about overwriting them then don't use -i with cp.&lt;br /&gt;&lt;br /&gt;Once you are done copying, verify that your settings are correct and the system is indeed ready to boot. Make sure sshd is configured in init.d to start at boot and your networking configuration is correct.&lt;br /&gt;&lt;br /&gt;Reboot.&lt;br /&gt;&lt;br /&gt;# shutdown -r now&lt;br /&gt;&lt;br /&gt;If the unimaginable happened and your box had booted successfully then consider yourself lucky. You are now running your new distro on a "clean" install.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Disclaimer: Use any information on this page at your own risk. There is a good chance that your system will become non-bootable and/or you will lose your data. As a matter of fact, if I had to bet money on the outcome of your distro change, I would bet against you. This is a very simple yet dangerous procedure. You have been warned.&lt;br /&gt;&lt;br /&gt;THIS INFORMATION IS PROVIDED TO YOU "AS-IS". NO WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED, ARE MADE TO YOU AS TO THE CONTENT OF THIS PAGE OR ANY MEDIUM IT MAY BE ON, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.&lt;br /&gt;&lt;br /&gt;I DISCLAIM ALL RESPONSIBILITY FOR THE ACCURACY AND RELIABILITY OF INFORMATION ON THIS PAGE.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/23398672-8290848480677660845?l=daftster.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://daftster.blogspot.com/feeds/8290848480677660845/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=23398672&amp;postID=8290848480677660845' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23398672/posts/default/8290848480677660845'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23398672/posts/default/8290848480677660845'/><link rel='alternate' type='text/html' href='http://daftster.blogspot.com/2007/09/changing-distribution-remotely-howto.html' title=''/><author><name>daftster</name><uri>http://www.blogger.com/profile/00076860789674273180</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23398672.post-2848338455365671533</id><published>2007-09-04T10:46:00.000+08:00</published><updated>2007-09-04T11:09:19.026+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux kernel'/><category scheme='http://www.blogger.com/atom/ns#' term='initrd'/><category scheme='http://www.blogger.com/atom/ns#' term='install linux'/><category scheme='http://www.blogger.com/atom/ns#' term='ramdisk'/><title type='text'></title><content type='html'>&lt;a href="http://instantfundas.blogspot.com/2007/08/install-any-linux-distro-directly-from.html"&gt;Install any Linux distro directly from hard disk without burning dvd&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Just &lt;a href="http://digg.com/"&gt;digging&lt;/a&gt; around and bumped into this useful tip :)&lt;br /&gt;Copying entire text from his blog. thanks!&lt;br /&gt;&lt;br /&gt;After you download any Linux distro from the internet, you have to burn it to a DVD, CD or a number of CDs to install it. That CD or DVD is generally used only once after which it lies unused , and worse, almost every Linux distro comes up with a new release every 6 months. So if you are in the habit of upgrading to every new version, you must have dozens of CDs lying at the bottom of your drawer. What a wastage of CDs! But with a little trick you can install any Linux directly from the hard disk without burning a single CD or DVD. The prerequisite of this trick is to have an operating system already installed on your computer. This is obvious because unless you are able to boot into your machine, you can't install anything; and we are not going to boot from the Linux disk because we aren't burning any. Here I'm going to focus on Microsoft Windows as the pre installed operating system.&lt;br /&gt;&lt;br /&gt;Almost all Linux installers uses two files to boot the computer: a Linux kernel, and an initial root file system containing a minimal set of directories that is mounted prior to when the real root file system is available. This initial root file system is also called Ram disk (initrd). We will use these two files to boot our PC. Now lets get to the actual procedure.&lt;br /&gt;&lt;br /&gt;1. The first thing you will have to do is copy the ISO file(s) of the Linux to your hard disk (ofcourse, you already have it). Make sure that the partition is FAT32 unless the distro you are installing has native NTFS read/write support. Some distros require you to copy the ISO file(s) to the root of the partition. If you keep it inside a folder, the setup might not be able to detect it.&lt;br /&gt;&lt;br /&gt;2. Use Winrar to open the ISO file (you need not need to extract it). Now you will have to extract the two files I talked about earlier. The files are usually found inside a directory called isolinux. Different distros might place the files in different location; you just have to search for it, but it isn't hard to locate. These two files are also named differently in different distros. The files that you will need to search and extract are: (the kernel file is on the left and Ram disk is shown on the 3rd column)&lt;br /&gt;&lt;br /&gt;Fedora: vmlinuz and initrd.img&lt;br /&gt;&lt;br /&gt;Suse: linux and initrd&lt;br /&gt;&lt;br /&gt;Mandriva: vmlinuz and all.rdz&lt;br /&gt;&lt;br /&gt;Ubuntu: vmlinuz and initrd.gz&lt;br /&gt;&lt;br /&gt;Gentoo: gentoo and gentoo.igz&lt;br /&gt;&lt;br /&gt;Knoppix:  vmlinuz and initrd.img&lt;br /&gt;&lt;br /&gt;Slackware: bzImage and initrd.img&lt;br /&gt;&lt;br /&gt;Debian:  vmlinuz and initrd.gz&lt;br /&gt;&lt;br /&gt;3. After you have extracted the two files, copy them to c:\boot (you will need to create the folder "boot")&lt;br /&gt;&lt;br /&gt;4. Now download the file called grub4dos from here. Extract the folder "boot" and the file "grldr" from the downloaded zip file. Inside the folder "boot" is another folder called "grub"; copy the folder "grub" to c:\boot. Copy the file "grldr" to c:\&lt;br /&gt;&lt;br /&gt;5. Open c:\boot\grub\menu.lst and add these following lines. (Notice that hd0 refers to the first hard drive. If you have more than one hard drive, they will be named hd1, hd2 etc. Replace hd0 with the proper hard drive number incase you have windows installed on another drive.) Replace Linux_kernel and Ram_disk with the appropriate file names below. (the ones you copied to c:\boot)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;title Install Linux&lt;br /&gt;kernel (hd0,0)/boot/Linux_kernel&lt;br /&gt;initrd (hd0,0)/boot/Ram_disk&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;6. Now you have to add grub to your c:\boot.ini file. You can open boot.ini by clicking on Start&gt;Run and typing c:\boot.ini. If Windows does not allow the file to be modified, then go to Control Panel&gt;System and click on the Advanced tab. Now under Startup and Recovery click Settings and then under System Startup click Edit. Open boot.ini and add this line in the end.&lt;br /&gt;&lt;br /&gt;C:\grldr=”Start GRUB”&lt;br /&gt;&lt;br /&gt;7. You are now ready to install Linux. Restart your PC and from the boot screen select "Start GRUB". This will load GRUB. From the grub screen select "Install Linux". During the setup you will be asked the source of installation. Choose hard disk and then select the hard drive partition where you copied the ISO files. Sometimes you might have to type the whole path of the partition and the exact name of the ISO. So write it down before you begin.&lt;br /&gt;&lt;br /&gt;I have personally tested this with Fedora, Suse and Mandriva and it works without problem. I have no doubt it will work for others too.&lt;br /&gt;&lt;br /&gt;Update: dougfractal adds that this is possible from Linux too. The method as he describes is:&lt;br /&gt;&lt;br /&gt;From the terminal enter these commands&lt;br /&gt;&lt;br /&gt;sudo mkdir /distro&lt;br /&gt;sudo chmod `whoami`:`whoami`&lt;br /&gt;cp MYLINUX.iso /distro/distro.iso&lt;br /&gt;&lt;br /&gt;Now extract Linux_kernel &amp; Ram_disk to /distro#&lt;br /&gt;&lt;br /&gt;Open  /boot/grub/menu.lst&lt;br /&gt;&lt;br /&gt;#ADD NEW ENTRY#&lt;br /&gt;title Install Linux&lt;br /&gt;root (hdX,X)&lt;br /&gt;kernel /distro/Linux_kernel&lt;br /&gt;initrd /distro/Ram_disk&lt;br /&gt;&lt;br /&gt;Reboot and select "Install Linux" from grub.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/23398672-2848338455365671533?l=daftster.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://daftster.blogspot.com/feeds/2848338455365671533/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=23398672&amp;postID=2848338455365671533' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23398672/posts/default/2848338455365671533'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23398672/posts/default/2848338455365671533'/><link rel='alternate' type='text/html' href='http://daftster.blogspot.com/2007/09/install-any-linux-distro-directly-from.html' title=''/><author><name>daftster</name><uri>http://www.blogger.com/profile/00076860789674273180</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23398672.post-945106862682216919</id><published>2007-08-30T15:20:00.000+08:00</published><updated>2007-08-30T15:27:38.665+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='nm'/><category scheme='http://www.blogger.com/atom/ns#' term='c library'/><category scheme='http://www.blogger.com/atom/ns#' term='ranlib'/><category scheme='http://www.blogger.com/atom/ns#' term='ar'/><title type='text'></title><content type='html'>&lt;span style="font-weight:bold;"&gt;Creating your C library in linux gcc&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In creating APIs, most of the time, you would like to hide what's being done underneath and would just like to let the users of your API to use the functions that you have written.  Here is one way of creating your library.&lt;br /&gt;&lt;br /&gt;1.  Prepare your .o files. (you can create multiple .o files)&lt;br /&gt;&lt;span style="font-style:italic;"&gt;# gcc -g -O2 -O0 -g3 -c sample.c sample.o&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;2.  Create an archive of your library.&lt;br /&gt;&lt;span style="font-style:italic;"&gt;# ar r libsample.a sample.o&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;3.  Generate index to archive.&lt;br /&gt;&lt;span style="font-style:italic;"&gt;# ranlib libsample.a&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;4.  To check functions of your library. (you can use nm - list symbols from object files)&lt;br /&gt;&lt;span style="font-style:italic;"&gt;# nm libsample.a&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/23398672-945106862682216919?l=daftster.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://daftster.blogspot.com/feeds/945106862682216919/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=23398672&amp;postID=945106862682216919' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23398672/posts/default/945106862682216919'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23398672/posts/default/945106862682216919'/><link rel='alternate' type='text/html' href='http://daftster.blogspot.com/2007/08/creating-your-c-library-in-linux-gcc-in.html' title=''/><author><name>daftster</name><uri>http://www.blogger.com/profile/00076860789674273180</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23398672.post-2254998589141933886</id><published>2007-08-30T10:13:00.000+08:00</published><updated>2007-08-30T10:25:07.274+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux programming'/><category scheme='http://www.blogger.com/atom/ns#' term='getc'/><category scheme='http://www.blogger.com/atom/ns#' term='c program'/><category scheme='http://www.blogger.com/atom/ns#' term='user input'/><title type='text'></title><content type='html'>&lt;span style="font-weight:bold;"&gt;Getting User input as they press the key (Without pressing ENTER)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I need to read the key pressed by the user as they press it without pressing the ENTER key.  Current functions that I found in C (getc, fgets, scanf, etc), buffers user input and needs to press ENTER key to read the user input.  getch() worked with me, but I want to avoid using the curses library.  More research work brought me this code:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;#include &lt;stdio.h&gt;&lt;br /&gt;#include &lt;termios.h&gt; &lt;br /&gt;#include &lt;unistd.h&gt;&lt;br /&gt;&lt;br /&gt;#define END_FILE_CHARACTER 0x04  /* ctrl-d is unix-style eof input key*/&lt;br /&gt;&lt;br /&gt;int linux_getch(void);&lt;br /&gt;&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt;  int kb_char;&lt;br /&gt;&lt;br /&gt;  printf("\n\n  This is a test of a function that (more-or-less)\n");&lt;br /&gt;  printf("  emulates the classic DOS \"getch()\" function.\n\n");&lt;br /&gt;  printf("  The keyboard input is not echoed; each character is\n");&lt;br /&gt;  printf("  is returned to the calling program as a key is pressed.\n\n");&lt;br /&gt;  printf("  For test purposes, this program echos the hex value returned\n");&lt;br /&gt;  printf("  from the keyboard input routine.\n\n");&lt;br /&gt;  printf("Press any key(s)");&lt;br /&gt;  printf(" (the keyboard routine is set so that ctlr-d is EOF).\n\n");&lt;br /&gt;  while ((kb_char = linux_getch()) != EOF) {&lt;br /&gt;    printf("%02X ", kb_char);&lt;br /&gt;  }&lt;br /&gt;  printf("\n\n  Function linux_getch() says that you entered EOF\n\n");&lt;br /&gt;  return 0;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;int linux_getch(void) &lt;br /&gt;{&lt;br /&gt;  struct termios oldstuff;&lt;br /&gt;  struct termios newstuff;&lt;br /&gt;  int    inch;&lt;br /&gt;  &lt;br /&gt;  tcgetattr(STDIN_FILENO, &amp;oldstuff);&lt;br /&gt;  newstuff = oldstuff;                  /* save old attributes               */&lt;br /&gt;  newstuff.c_lflag &amp;= ~(ICANON | ECHO); /* reset "canonical" and "echo" flags*/&lt;br /&gt;  tcsetattr(STDIN_FILENO, TCSANOW, &amp;newstuff); /* set new attributes         */&lt;br /&gt;  inch = getchar();&lt;br /&gt;  tcsetattr(STDIN_FILENO, TCSANOW, &amp;oldstuff); /* restore old attributes     */&lt;br /&gt;&lt;br /&gt;  if (inch == END_FILE_CHARACTER) {&lt;br /&gt;    inch = EOF;&lt;br /&gt;  }&lt;br /&gt;  return inch;&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Btw, I also saw how to make this work on Solaris machines.  They say that &lt;blockquote&gt;The termio value of MIN is set to 4 on solaris and set to 1 on linux.&lt;/blockquote&gt;&lt;br /&gt;To make it work on both platforms:&lt;br /&gt;After this line:&lt;br /&gt;newstuff.c_lflag &amp;= ~(ICANON | ECHO); /* reset "canonical" and "echo" flags*/&lt;br /&gt;&lt;br /&gt;add this line:&lt;br /&gt;newstuff.c_cc[VMIN] = 1;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;reference:&lt;br /&gt;&lt;a href="http://www.gidforums.com/t-3386.html"&gt;http://www.gidforums.com/t-3386.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/23398672-2254998589141933886?l=daftster.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://daftster.blogspot.com/feeds/2254998589141933886/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=23398672&amp;postID=2254998589141933886' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23398672/posts/default/2254998589141933886'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23398672/posts/default/2254998589141933886'/><link rel='alternate' type='text/html' href='http://daftster.blogspot.com/2007/08/getting-user-input-as-they-press-key.html' title=''/><author><name>daftster</name><uri>http://www.blogger.com/profile/00076860789674273180</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23398672.post-4511712673310704071</id><published>2007-08-28T10:44:00.000+08:00</published><updated>2007-08-30T15:11:45.733+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='logical volume manager'/><category scheme='http://www.blogger.com/atom/ns#' term='partition'/><category scheme='http://www.blogger.com/atom/ns#' term='df'/><category scheme='http://www.blogger.com/atom/ns#' term='lvm'/><title type='text'></title><content type='html'>&lt;a href="http://www.sun.com/bigadmin/content/submitted/increase_fs_lvm.jsp"&gt;Increasing the Size of a File System With Linux Logical Volume Manager&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Just came across this site and bookmarking it :)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Here are the steps you need to increase your file system using Linux Logical Volume Manager (LVM).&lt;br /&gt;&lt;br /&gt;First check the file systems available in LVM and the free space.&lt;br /&gt;# df -k&lt;br /&gt;&lt;br /&gt;Check the free space on the disk.&lt;br /&gt;# vgdisplay -v&lt;br /&gt;&lt;br /&gt;Check which users are currently logged in to the system.&lt;br /&gt;# who -a&lt;br /&gt;&lt;br /&gt;We need to kill all the users before unmounting the file system. The fuser command will show the PIDs using the /home file system.&lt;br /&gt;&lt;br /&gt;# fuser -kc /homeKill the processes one by one to remove the users.&lt;br /&gt;&lt;br /&gt;# kill -9 pid&lt;br /&gt;&lt;br /&gt;Before changing the size, we need to unmount the file system.&lt;br /&gt;&lt;br /&gt;# umount /home&lt;br /&gt;&lt;br /&gt;Now extend the logical volume first (/home is available in /dev/vg00/lvol5; -L 1024 will increase the size by 1024 MB).&lt;br /&gt;&lt;br /&gt;bash-2.04# lvextend -L 1024M  /dev/vg00/lvol5&lt;br /&gt;&lt;br /&gt;Now extend the file system using the extendfs command, which will increase the file system available in lvol5, that is, /home.&lt;br /&gt;&lt;br /&gt;bash-2.04# extendfs /dev/vg00/lvol5&lt;br /&gt;&lt;br /&gt;Now mount the file system.&lt;br /&gt;&lt;br /&gt;bash-2.04# mount home&lt;br /&gt;&lt;br /&gt;Now you can check the file system size by using the following command:&lt;br /&gt;&lt;br /&gt;bash-2.04# bdf  or bdf&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/23398672-4511712673310704071?l=daftster.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://daftster.blogspot.com/feeds/4511712673310704071/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=23398672&amp;postID=4511712673310704071' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23398672/posts/default/4511712673310704071'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23398672/posts/default/4511712673310704071'/><link rel='alternate' type='text/html' href='http://daftster.blogspot.com/2007/08/increasing-size-of-file-system-with.html' title=''/><author><name>daftster</name><uri>http://www.blogger.com/profile/00076860789674273180</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23398672.post-5645683668590441421</id><published>2007-08-22T11:16:00.000+08:00</published><updated>2007-08-25T00:40:01.788+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='georgia'/><category scheme='http://www.blogger.com/atom/ns#' term='towneplace suite'/><category scheme='http://www.blogger.com/atom/ns#' term='alpharetta'/><title type='text'></title><content type='html'>Today, out of nothing, just popping out that it's two years now since I was able to spend some time in Alpharetta G.A. last Aug-Oct, 2005.  And I've seen this new google feature.  I stayed in Towneplace Suite.  Here is to test the new feature of google maps :)&lt;br /&gt;&lt;br /&gt;&lt;iframe width="425" height="350" frameborder="no" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps?daddr=7925+Westside+Pkwy,+Alpharetta,+GA+30004+(Towneplace+Suites)&amp;geocode=11027368419754613117,34.061380,-84.287279&amp;dirflg=&amp;saddr=ATL+airport&amp;f=d&amp;hl=en&amp;dq=towneplace+suites+loc:+7925+Westside+Pkwy,+Alpharetta,+GA+30004&amp;cid=34061380,-84287279,811107989770185358&amp;ie=UTF8&amp;om=1&amp;ll=33.8497,-84.367695&amp;spn=0.42336,0.16463&amp;output=embed&amp;s=AARTsJrHQEO4ClYrmDJDFsTcMdetdOwCHg"&gt;&lt;/iframe&gt;&lt;br/&gt;&lt;a href="http://maps.google.com/maps?daddr=7925+Westside+Pkwy,+Alpharetta,+GA+30004+(Towneplace+Suites)&amp;geocode=11027368419754613117,34.061380,-84.287279&amp;dirflg=&amp;saddr=ATL+airport&amp;f=d&amp;hl=en&amp;dq=towneplace+suites+loc:+7925+Westside+Pkwy,+Alpharetta,+GA+30004&amp;cid=34061380,-84287279,811107989770185358&amp;ie=UTF8&amp;om=1&amp;ll=33.8497,-84.367695&amp;spn=0.42336,0.16463&amp;source=embed" style="color:#0000FF;text-align:left;font-size:small"&gt;View Larger Map&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/23398672-5645683668590441421?l=daftster.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://daftster.blogspot.com/feeds/5645683668590441421/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=23398672&amp;postID=5645683668590441421' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23398672/posts/default/5645683668590441421'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23398672/posts/default/5645683668590441421'/><link rel='alternate' type='text/html' href='http://daftster.blogspot.com/2007/08/today-out-of-nothing-just-popping-out.html' title=''/><author><name>daftster</name><uri>http://www.blogger.com/profile/00076860789674273180</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23398672.post-4936883901227429917</id><published>2007-08-21T15:53:00.000+08:00</published><updated>2007-08-21T16:06:53.170+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux kernel'/><title type='text'></title><content type='html'>&lt;span style="font-weight:bold;"&gt;Patching a Linux Kernel&lt;/span&gt;&lt;br /&gt;I know that this might be easy, but, since I do not use this frequently, I tend to forget how to patch an existing kernel.  :)&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;&lt;br /&gt;cd [kernel-directory]&lt;br /&gt;cat [patch file] | patch -p1&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;For example:&lt;br /&gt;&lt;span style="font-style:italic;"&gt;cd /usr/src/linux-2.6.11&lt;br /&gt;cat linux-2.6.11.patch | patch -p1&lt;/span&gt;&lt;br /&gt;(in this case, linux-2.6.11.patch is inside /usr/src/linux-2.6.11 directory also)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/23398672-4936883901227429917?l=daftster.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://daftster.blogspot.com/feeds/4936883901227429917/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=23398672&amp;postID=4936883901227429917' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23398672/posts/default/4936883901227429917'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23398672/posts/default/4936883901227429917'/><link rel='alternate' type='text/html' href='http://daftster.blogspot.com/2007/08/patching-linux-kernel-i-know-that-this.html' title=''/><author><name>daftster</name><uri>http://www.blogger.com/profile/00076860789674273180</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23398672.post-3584573528478749503</id><published>2007-08-03T09:11:00.000+08:00</published><updated>2007-08-03T09:17:18.226+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux services'/><title type='text'></title><content type='html'>How to include a service during linux startup (REDHAT distro)?&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;chkconfig httpd  on --level 235&lt;br /&gt;chkconfig vsftpd  on --level 235&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Those two lines would add httpd(webserver) and vsftpd(ftp server) into startup script and enable them everytime you boot with run level 2, 3, or 5.&lt;br /&gt;&lt;br /&gt;To list all services' status you can use&lt;br /&gt;&lt;span style="font-style:italic;"&gt;chkconfig --list&lt;/span&gt;&lt;br /&gt;or&lt;br /&gt;&lt;span style="font-style:italic;"&gt;chkconfig --list &lt;service name&gt;&lt;/span&gt; for a specific service.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/23398672-3584573528478749503?l=daftster.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://daftster.blogspot.com/feeds/3584573528478749503/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=23398672&amp;postID=3584573528478749503' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23398672/posts/default/3584573528478749503'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23398672/posts/default/3584573528478749503'/><link rel='alternate' type='text/html' href='http://daftster.blogspot.com/2007/08/how-to-include-service-during-linux.html' title=''/><author><name>daftster</name><uri>http://www.blogger.com/profile/00076860789674273180</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23398672.post-8803214490481290630</id><published>2007-08-01T09:43:00.000+08:00</published><updated>2007-08-01T09:45:12.995+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux network'/><title type='text'></title><content type='html'>Linux - Networking HowTo/Tips&lt;br /&gt;&lt;a href="http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch03_:_Linux_Networking"&gt;http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch03_:_Linux_Networking&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/23398672-8803214490481290630?l=daftster.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://daftster.blogspot.com/feeds/8803214490481290630/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=23398672&amp;postID=8803214490481290630' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23398672/posts/default/8803214490481290630'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23398672/posts/default/8803214490481290630'/><link rel='alternate' type='text/html' href='http://daftster.blogspot.com/2007/08/linux-networking-howtotips-httpwww.html' title=''/><author><name>daftster</name><uri>http://www.blogger.com/profile/00076860789674273180</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23398672.post-9148795651779667713</id><published>2007-07-19T10:35:00.000+08:00</published><updated>2007-07-19T10:38:26.879+08:00</updated><title type='text'></title><content type='html'>While reading through this site, http://wilsonet.com/mythtv/fcmyth.php I saw this part and I think that this might be a very common problem for fc users.  Just in case we got into this trouble:&lt;br /&gt;&lt;br /&gt;After the big upgrade(yum -y upgrade), you MAY get an error about being unable to open the rpm database (this used to happen to me w/RHL9, but hasn't ever with FC). If you do encounter this error, try the following:&lt;br /&gt;&lt;span style="font-style:italic;"&gt;&lt;br /&gt;# rm -f /var/lib/rpm/__db*&lt;br /&gt;# rpmdb -vv --rebuilddb&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The database rebuild will take quite a while to complete. After it completes, you'll see an error message, but you can safely ignore it and move on to see if the rebuilddb cleared the problem. If not, good luck... Note that the presence of those __db* files doesn't indicate a problem, they're supposed to be there, they just get corrupted every once in a while.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/23398672-9148795651779667713?l=daftster.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://daftster.blogspot.com/feeds/9148795651779667713/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=23398672&amp;postID=9148795651779667713' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23398672/posts/default/9148795651779667713'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23398672/posts/default/9148795651779667713'/><link rel='alternate' type='text/html' href='http://daftster.blogspot.com/2007/07/while-reading-through-this-site.html' title=''/><author><name>daftster</name><uri>http://www.blogger.com/profile/00076860789674273180</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23398672.post-7351784112694201767</id><published>2007-07-18T14:11:00.000+08:00</published><updated>2007-07-18T22:47:08.844+08:00</updated><title type='text'></title><content type='html'>I am faced with a problem wherein sometimes I can't connect to my embedded system or download a file to it through ftp with mget.  I noticed that when I check the disk space, it is running out of space.  Wondered what's causing this.  I noticed that there are some log files that are using out available disk space.&lt;br /&gt;&lt;br /&gt;To solve this, I wrote a script to check the file size of /var/log/messages and /var/log/wtmp which are the two files that is filling up my system.&lt;br /&gt;Here is the script....&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;&lt;br /&gt;### Script to check log file sizes for ARM Embedded System&lt;br /&gt;### Files watched:&lt;br /&gt;###     /var/log/messages&lt;br /&gt;###     /var/log/wtmp&lt;br /&gt;&lt;br /&gt;#!/bin/bash&lt;br /&gt;&lt;br /&gt;### Maximum /var/log/messages size allowed before deleting cron jobs&lt;br /&gt;MSGMAXSIZE=5000&lt;br /&gt;TMPMAXSIZE=2000&lt;br /&gt;&lt;br /&gt;### Check filesize If &gt; MSGMAXSIZE, remove cron entries&lt;br /&gt;MSIZE=`ls -l /var/log/messages | busybox awk '{print $5}'`&lt;br /&gt;if test $MSIZE -gt $MSGMAXSIZE&lt;br /&gt;then&lt;br /&gt;  echo "Maximum filesize reached.  Deleting cron entries..."&lt;br /&gt;  grep -v cron /var/log/messages &gt; mtemp.txt&lt;br /&gt;  cp mtemp.txt /var/log/messages&lt;br /&gt;  rm mtemp.txt&lt;br /&gt;### Check file size again.  If &gt; MSGMAXSIZE, remove first 10 lines&lt;br /&gt;  MSIZE=`ls -l /var/log/messages | busybox awk '{print $5}'`&lt;br /&gt;  if test $MSIZE -gt $MSGMAXSIZE&lt;br /&gt;  then&lt;br /&gt;    echo "Maximum filesize still reached.  Deleting first 10 entries"&lt;br /&gt;    tail -n +10 /var/log/messages &gt; mtemp.txt&lt;br /&gt;    cp mtemp.txt /var/log/messages&lt;br /&gt;    rm mtemp.txt&lt;br /&gt;  fi&lt;br /&gt;  echo "/var/log/messages clean up complete."&lt;br /&gt;else&lt;br /&gt;  echo "/var/log/messages within size limit"&lt;br /&gt;fi&lt;br /&gt;###&lt;br /&gt;&lt;br /&gt;### This section would check /var/log/wtmp and /var/run/utmp sizes&lt;br /&gt;MSIZE=`ls -l /var/log/wtmp | busybox awk '{print $5}'`&lt;br /&gt;if test $MSIZE -gt $TMPMAXSIZE&lt;br /&gt;then&lt;br /&gt;  echo "Maximum filesize of /var/log/wtmp reached... Reset /var/log/wtmp and /var/run/utmp"&lt;br /&gt;  rm /var/log/wtmp /var/run/utmp&lt;br /&gt;  touch /var/log/wtmp /var/run/utmp&lt;br /&gt;  echo "/var/log/wtmp clean up complete."&lt;br /&gt;else&lt;br /&gt;  echo "/var/log/wtmp within size limit"&lt;br /&gt;fi&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/23398672-7351784112694201767?l=daftster.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://daftster.blogspot.com/feeds/7351784112694201767/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=23398672&amp;postID=7351784112694201767' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23398672/posts/default/7351784112694201767'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23398672/posts/default/7351784112694201767'/><link rel='alternate' type='text/html' href='http://daftster.blogspot.com/2007/07/i-am-faced-with-problem-wherein.html' title=''/><author><name>daftster</name><uri>http://www.blogger.com/profile/00076860789674273180</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23398672.post-2347528396138267351</id><published>2007-06-19T09:53:00.000+08:00</published><updated>2007-06-19T09:59:01.679+08:00</updated><title type='text'></title><content type='html'>Yesterday, I had to cross compile another downloaded source from the net and I got this error:&lt;br /&gt;&lt;br /&gt;"stray '\' in program"&lt;br /&gt;&lt;br /&gt;I was wondering I suddenly got this error, since when I was compiling a previous version of the source, this error does not appear.  Tried to find out what type of error this is using google of course :)  It so happened that the source i guessed were edited in Windows.  Have to change the file format from dos to unix.&lt;br /&gt;&lt;br /&gt;Solution I did:&lt;br /&gt;# dos2unix *.[ch]&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/23398672-2347528396138267351?l=daftster.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://daftster.blogspot.com/feeds/2347528396138267351/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=23398672&amp;postID=2347528396138267351' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23398672/posts/default/2347528396138267351'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23398672/posts/default/2347528396138267351'/><link rel='alternate' type='text/html' href='http://daftster.blogspot.com/2007/06/yesterday-i-had-to-cross-compile.html' title=''/><author><name>daftster</name><uri>http://www.blogger.com/profile/00076860789674273180</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23398672.post-702115326891627774</id><published>2007-06-18T13:51:00.000+08:00</published><updated>2007-06-18T14:23:45.595+08:00</updated><title type='text'></title><content type='html'>Recently, I had to cross compile liveMedia to arm, I encountered problem as the source code are written in C++, but I only have a gnu cross compiler....&lt;br /&gt;Here is what I did. &lt;br /&gt;1.  Download a precompiled cross compiler version 2.95.3( try to google arm cross compiler)&lt;br /&gt;2.  Download live media source (www.live555.com)&lt;br /&gt;3.  Edit config.armlinux to &lt;br /&gt;&lt;br /&gt;CROSS_COMPILE=          /usr/local/arm/2.95.3/bin/arm-linux-&lt;br /&gt;COMPILE_OPTS =          $(INCLUDES) -I. -O2 -DSOCKLEN_T=socklen_t -DNO_STRSTREAM=1 -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64 -L./&lt;br /&gt;C =                     c&lt;br /&gt;C_COMPILER =            $(CROSS_COMPILE)gcc&lt;br /&gt;C_FLAGS =               $(COMPILE_OPTS)&lt;br /&gt;CPP =                   cpp&lt;br /&gt;CPLUSPLUS_COMPILER =    $(CROSS_COMPILE)c++&lt;br /&gt;CPLUSPLUS_FLAGS =       $(COMPILE_OPTS) -Wall -DBSD=1&lt;br /&gt;OBJ =                   o&lt;br /&gt;LINK =                  $(CROSS_COMPILE)gcc -o&lt;br /&gt;LINK_OPTS =             -L.&lt;br /&gt;CONSOLE_LINK_OPTS =     $(LINK_OPTS)&lt;br /&gt;LIBRARY_LINK =          $(CROSS_COMPILE)ld -o&lt;br /&gt;LIBRARY_LINK_OPTS =     $(LINK_OPTS) -r -Bstatic&lt;br /&gt;LIB_SUFFIX =                    a&lt;br /&gt;LIBS_FOR_CONSOLE_APPLICATION =&lt;br /&gt;LIBS_FOR_GUI_APPLICATION =&lt;br /&gt;EXE =&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;4. After doing that I would encounter this error&lt;br /&gt;cpp: installation problem, cannot exec `cpp': Argument list too long&lt;br /&gt;&lt;br /&gt;For bug reporting instructions, please see:&lt;br /&gt;&lt;URL:http://www.gnu.org/software/gcc/faq.html#bugreport&gt;&lt;br /&gt;make[1]: *** [Media.o] Error 1&lt;br /&gt;&lt;br /&gt;5.  To fix error on number four, i tried running &lt;br /&gt; a.  /usr/local/arm/2.95.3/bin/cpp -print-search-dirs&lt;br /&gt;Output:&lt;br /&gt;install: /usr/local/arm/2.95.3/lib/gcc-lib/arm-linux/2.95.3/&lt;br /&gt;programs: /usr/local/arm/2.95.3/lib/gcc-lib/arm-linux/2.95.3/:/usr/local/arm/2.95.3/lib/gcc-lib/arm-linux/:/usr/lib/gcc/arm-linux/2.95.3/:/usr/lib/gcc/arm-linux/:/usr/local/arm/2.95.3/arm-linux/bin/arm-linux/2.95.3/:/usr/local/arm/2.95.3/arm-linux/bin/&lt;br /&gt;libraries: /usr/local/arm/2.95.3/lib/gcc-lib/arm-linux/2.95.3/:/usr/lib/gcc/arm-linux/2.95.3/:/usr/local/arm/2.95.3/arm-linux/lib/arm-linux/2.95.3/:/usr/local/arm/2.95.3/arm-linux/lib/&lt;br /&gt; b.  add /usr/local/arm/2.95.3/lib/gcc-lib/arm-linux/2.95.3/ to env PATH&lt;br /&gt;&lt;br /&gt;6. type make and it's ready to go...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/23398672-702115326891627774?l=daftster.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://daftster.blogspot.com/feeds/702115326891627774/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=23398672&amp;postID=702115326891627774' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23398672/posts/default/702115326891627774'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23398672/posts/default/702115326891627774'/><link rel='alternate' type='text/html' href='http://daftster.blogspot.com/2007/06/recently-i-had-to-cross-compile.html' title=''/><author><name>daftster</name><uri>http://www.blogger.com/profile/00076860789674273180</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23398672.post-7797087876496698453</id><published>2007-05-29T16:21:00.000+08:00</published><updated>2007-05-29T16:54:18.410+08:00</updated><title type='text'></title><content type='html'>Last month, my task was to write a script to detect the ip address of a hardware device having only the MAC address of the device.  This time, I need to the script using DOS batch scripting.  Here is the scirpt I wrote:&lt;br /&gt;&lt;br /&gt;echo OFF&lt;br /&gt;echo SCANNING NETWORK....&lt;br /&gt;ipconfig | find "IP Address" &gt; ~ip01.txt&lt;br /&gt;for /f "tokens=1-2 delims=:" %%i in (~ip01.txt) do echo %%j&gt; ~ip02.txt&lt;br /&gt;for /f "tokens=1-3 delims=." %%i in (~ip02.txt) do echo %%i.%%j.%%k&gt; ~ip03.txt&lt;br /&gt;echo .....&lt;br /&gt;for /f %%i in (~ip03.txt) do call :PING %%i&lt;br /&gt;echo None &gt; ipaddress.txt&lt;br /&gt;arp -a | find "%1" &gt; ip1.txt&lt;br /&gt;for /f %%i in (ip1.txt) do echo %%i &gt; ipaddress.txt&lt;br /&gt;del ~ip01.txt ~ip02.txt ~ip03.txt ip1.txt&lt;br /&gt;goto :EOF&lt;br /&gt;&lt;br /&gt;:PING&lt;br /&gt;for /L %%x in (1,1,254) do echo %1.%%x &amp; ping -n 1 -w 50 -i 6 %1.%%x | find "Reply" &amp;&amp; echo %1.%%x&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/23398672-7797087876496698453?l=daftster.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://daftster.blogspot.com/feeds/7797087876496698453/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=23398672&amp;postID=7797087876496698453' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23398672/posts/default/7797087876496698453'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23398672/posts/default/7797087876496698453'/><link rel='alternate' type='text/html' href='http://daftster.blogspot.com/2007/05/last-month-my-task-was-to-write-script.html' title=''/><author><name>daftster</name><uri>http://www.blogger.com/profile/00076860789674273180</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23398672.post-7777160515567985716</id><published>2007-03-28T17:50:00.000+08:00</published><updated>2007-03-28T18:08:14.473+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sms'/><title type='text'></title><content type='html'>&lt;span style="font-weight:bold;"&gt;Sending SMS through serial port (RS-232) with your GSM Modem/Phone&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;My goal now is to be able to send sms using a gsm modem through serial port.&lt;br /&gt;The following hardware setup has been used:&lt;br /&gt;Debian sarge kernel 2.6&lt;br /&gt;WaveCom M1306B GSM/GPRS-Modem Fastrack Modem&lt;br /&gt;&lt;br /&gt;Using minicom, you can try the following to test the modem&lt;br /&gt;&lt;span style="font-style:italic;"&gt;&lt;span style="font-weight:bold;"&gt;AT&lt;/span&gt;&lt;br /&gt;OK&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;AT+CMGF=1&lt;/span&gt;&lt;br /&gt;OK&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;AT+CMGW="+639221234567"&lt;/span&gt;&lt;br /&gt;&gt; &lt;span style="font-weight:bold;"&gt;A simple demo of SMS text messaging.&lt;/span&gt;&lt;br /&gt;&gt; &lt;span style="font-weight:bold;"&gt;CTRL-Z&lt;/span&gt;&lt;br /&gt;+CMGW: 1&lt;br /&gt;&lt;br /&gt;OK&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;AT+CMSS=1&lt;/span&gt;&lt;br /&gt;+CMSS: 20&lt;br /&gt;&lt;br /&gt;OK&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;blockquote&gt;Line by line explanation:&lt;/blockquote&gt;&lt;br /&gt;Line 1: "AT" is sent to the GSM / GPRS modem to test the connection. The GSM / GPRS modem sends back the result code "OK" (line 2), which means the connection between the HyperTerminal program and the GSM / GPRS modem works fine.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Line 3: The AT command +CMGF is used to instruct the GSM / GPRS modem to operate in SMS text mode. The result code "OK" is returned (line 4), which indicates the command line "AT+CMGF=1" has been executed successfully. If the result code "ERROR" is returned, it is likely that the GSM / GPRS modem does not support the SMS text mode. To confirm, type "AT+CMGF=?" in the HyperTerminal program. If the response is "+CMGF: (0,1)" (0=PDU mode and 1=text mode), then SMS text mode is supported. If the response is "+CMGF: (0)", then SMS text mode is not supported.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Line 5 and 6: The AT command +CMGW is used to write an SMS text message to the message storage of the GSM / GPRS modem. "+639221234567" is the recipient mobile phone number. After typing the recipient mobile phone number, you should press the Enter button of the keyboard. The GSM / GPRS modem will then return a prompt "&gt; " and you can start typing the SMS text message "A simple demo of SMS text messaging.". When finished, press Ctrl+z of the keyboard.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Line 7: "+CMGW: 1" tells us that the index assigned to the SMS text message is 1. It indicates the location of the SMS text message in the message storage.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Line 9: The result code "OK" indicates the execution of the AT command +CMGW is successful.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Line 10: The AT command +CMSS is used to send the SMS text message from the message storage of the GSM / GPRS modem. "1" is the index of the SMS text message obtained from line 7.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Line 11: "+CMSS: 20" tells us that the reference number assigned to the SMS text message is 20.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Line 13: The result code "OK" indicates the execution of the AT command +CMSS is successful&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Got this from:&lt;br /&gt;&lt;a href="http://www.developershome.com/sms/howToSendSMSFromPC.asp"&gt;http://www.developershome.com/sms/howToSendSMSFromPC.asp&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/23398672-7777160515567985716?l=daftster.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://daftster.blogspot.com/feeds/7777160515567985716/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=23398672&amp;postID=7777160515567985716' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23398672/posts/default/7777160515567985716'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23398672/posts/default/7777160515567985716'/><link rel='alternate' type='text/html' href='http://daftster.blogspot.com/2007/03/sending-sms-through-serial-port-rs-232.html' title=''/><author><name>daftster</name><uri>http://www.blogger.com/profile/00076860789674273180</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23398672.post-1143937244834441727</id><published>2007-03-23T12:55:00.000+08:00</published><updated>2007-03-23T15:33:09.099+08:00</updated><title type='text'></title><content type='html'>&lt;span style="font-weight:bold;"&gt;Debian Linux&lt;/span&gt;&lt;br /&gt;I am currently testing a card that is known to work in debian sarge linux.  My installer is a debian sarge kernel 2.4.  I have to upgrade it to kernel 2.6.  I used apt-get to do this.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;apt-get install kernel-image-2.6.8-3-686&lt;/span&gt;  (686 is the architecture needed)&lt;br /&gt;&lt;br /&gt;Also, I need the kernel source and to get this, I typed in&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;&lt;br /&gt;cd /usr/src&lt;br /&gt;wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.8-3.tar.bz2&lt;br /&gt;tar xjf linux-2.6.8-3.tar.bz2 &lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/23398672-1143937244834441727?l=daftster.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://daftster.blogspot.com/feeds/1143937244834441727/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=23398672&amp;postID=1143937244834441727' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23398672/posts/default/1143937244834441727'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23398672/posts/default/1143937244834441727'/><link rel='alternate' type='text/html' href='http://daftster.blogspot.com/2007/03/debian-linux-i-am-currently-testing.html' title=''/><author><name>daftster</name><uri>http://www.blogger.com/profile/00076860789674273180</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23398672.post-116114008530161169</id><published>2006-10-18T10:51:00.000+08:00</published><updated>2006-10-18T10:54:45.970+08:00</updated><title type='text'></title><content type='html'>&lt;span style="font-weight:bold;"&gt;Concatenation of Pointers&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Here is a little program/function to let you concatenate pointers.  In this example it concatenates strings specifically.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;#include &lt;stdio.h&gt;&lt;br /&gt;&lt;br /&gt; void concat( char *, char *, char * );&lt;br /&gt;&lt;br /&gt; /* this functions copies the strings a and b to the destination string c */&lt;br /&gt; void concat( char *a, char *b, char *c)&lt;br /&gt; {&lt;br /&gt;  while( *a )  {           /* while( *c++ = *a++ );  */&lt;br /&gt;   *c = *a; ++a; ++c;&lt;br /&gt;  }&lt;br /&gt;  while( *b )  {&lt;br /&gt;   *c = *b; ++b; ++c;&lt;br /&gt;  }&lt;br /&gt;  *c = '\0';&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; main()    &lt;br /&gt; {&lt;br /&gt;  static char string1[] = "Bye Bye ";&lt;br /&gt;  static char string2[] = "love.";&lt;br /&gt;  char string3[20];&lt;br /&gt;&lt;br /&gt;  concat( string1, string2, string3);&lt;br /&gt;  printf("%s\n", string3);&lt;br /&gt; }&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;a href="http://ftp.tuwien.ac.at/languages/c/programming-bbrown/c_104.htm"&gt;http://ftp.tuwien.ac.at/languages/c/programming-bbrown/c_104.htm&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/23398672-116114008530161169?l=daftster.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://daftster.blogspot.com/feeds/116114008530161169/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=23398672&amp;postID=116114008530161169' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23398672/posts/default/116114008530161169'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23398672/posts/default/116114008530161169'/><link rel='alternate' type='text/html' href='http://daftster.blogspot.com/2006/10/concatenation-of-pointers-here-is.html' title=''/><author><name>daftster</name><uri>http://www.blogger.com/profile/00076860789674273180</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23398672.post-115993302980755421</id><published>2006-10-04T11:29:00.000+08:00</published><updated>2006-10-04T11:45:24.650+08:00</updated><title type='text'></title><content type='html'>Command Line to burn a cdrom&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Getting Device Description&lt;/span&gt;&lt;br /&gt;Use "cdrecord -scanbus" to  scan your SCSI bus to determine the device description. (i.e. 0,0,0). This will perform a scan and provide results for real SCSI systems or for the virtual SCSI subsystem Linux uses with IDE CD/DVD's.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Blanking a CD-RW&lt;/span&gt;&lt;br /&gt;    *  Fast blanking. Data is not overwritten:&lt;br /&gt;    cdrecord dev="0,0,0" -v -eject speed=4 blank=fast&lt;br /&gt;    * Full blanking. Data is overwritten and entire media is erased:&lt;br /&gt;    cdrecord dev="0,0,0" -v -eject speed=4 blank=all&lt;br /&gt;where dev is the device defined in "cdrecord -scanbus"&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Backup a directory to a CD&lt;/span&gt;&lt;br /&gt;mkisofs -r -R -J -l -L /home/user1 | cdrecord dev=0,0,0 -v --eject speed=4 -&lt;br /&gt;&lt;br /&gt;Make sure directory does not hold more than CD capacity (700Mb typically). Check with the command: du -s /home/user1  You can use speed=0 if you want to write in maximum write speed of cdrom.&lt;br /&gt;where dev is the device defined in "cdrecord -scanbus"&lt;br /&gt;&lt;br /&gt;You can type "cdrecord -help" for more information on using cdrecord&lt;br /&gt;&lt;br /&gt;You can visit &lt;a href="http://yolinux.com/TUTORIALS/LinuxTutorialCDBurn.html"&gt;http://yolinux.com/TUTORIALS/LinuxTutorialCDBurn.html&lt;/a&gt; for more information on cd burning&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/23398672-115993302980755421?l=daftster.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://daftster.blogspot.com/feeds/115993302980755421/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=23398672&amp;postID=115993302980755421' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23398672/posts/default/115993302980755421'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23398672/posts/default/115993302980755421'/><link rel='alternate' type='text/html' href='http://daftster.blogspot.com/2006/10/command-line-to-burn-cdrom-getting.html' title=''/><author><name>daftster</name><uri>http://www.blogger.com/profile/00076860789674273180</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23398672.post-115881803232751783</id><published>2006-09-21T13:51:00.000+08:00</published><updated>2006-10-27T21:19:48.710+08:00</updated><title type='text'></title><content type='html'>A general purpose script used for processing table data.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.sun.com/bigadmin/scripts/submittedScripts/match.sh.txt"&gt;http://www.sun.com/bigadmin/scripts/submittedScripts/match.sh.txt&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;#!/bin/ksh&lt;br /&gt;# @(#)match     1.3     06/05/06&lt;br /&gt;# seppeler@yahoo.com&lt;br /&gt;#&lt;br /&gt;# match() is a general purpose script used for processing table data.&lt;br /&gt;#&lt;br /&gt;# A line of input constitutes a table row.  Each line is a list of&lt;br /&gt;# values which constitutes a table column.  The first line of input&lt;br /&gt;# is a list of field names which identifies each column of data.  The&lt;br /&gt;# /etc/passwd file is an example of a table without the field header.&lt;br /&gt;#&lt;br /&gt;# Example usage:&lt;br /&gt;#&lt;br /&gt;#   (echo "name:passwd:uid:gid:gcos:home:shell";cat /etc/passwd)&lt;br /&gt;#       | match IFS=: shell=/bin/false name uid&lt;br /&gt;#&lt;br /&gt;# The above example creates the input stream with a one line field descriptor&lt;br /&gt;# followed by a table of data.  This input stream is then filtered by&lt;br /&gt;# the match script.  The field separater used by the table is&lt;br /&gt;# specified via 'IFS=:'.  The table is then searched for all entries having&lt;br /&gt;# the 'shell' field matching the value of '/bin/false'.  Output is then&lt;br /&gt;# confined to only printing the 'name' and 'uid' fields.&lt;br /&gt;#&lt;br /&gt;# NOTE1: match() can be used for filtering data, or it can be used as a means&lt;br /&gt;# to cut/rearrange fields within a table.  The order of command line arguments&lt;br /&gt;# is not important, however the order of output field names is.  Output&lt;br /&gt;# will be in the order in which output field names appear.  So to rearrange&lt;br /&gt;# the /etc/passwd table such that 'uid' is printed first, followed by 'name'&lt;br /&gt;# then 'gcos' information, one would do:&lt;br /&gt;#&lt;br /&gt;#(echo "name:passwd:uid:gid:gcos:home:shell";cat /etc/passwd)&lt;br /&gt;# | match IFS=: uid name gcos&lt;br /&gt;#&lt;br /&gt;# NOTE2: patterns are allowed as part of an expression, however patterns&lt;br /&gt;# follow ksh syntax.  Ksh patterns are not the same as regular expressions.&lt;br /&gt;# In 'grep', zero or more characters is written '.*'. In ksh, zero or more&lt;br /&gt;# character is simply '*'.&lt;br /&gt;#&lt;br /&gt;# NOTE3: The trick to understanding this script is to understand&lt;br /&gt;# how the following code works:&lt;br /&gt;# &lt;br /&gt;# (&lt;br /&gt;#  read vars&lt;br /&gt;#  while read ${vars}; do&lt;br /&gt;#   for var in ${vars}; do&lt;br /&gt;#    eval value=\$${var}&lt;br /&gt;#    print "${var}=${value} \c"&lt;br /&gt;#   done&lt;br /&gt;#   print&lt;br /&gt;#  done&lt;br /&gt;# ) &lt;&lt;-.&lt;br /&gt;# fruit color&lt;br /&gt;# apple red&lt;br /&gt;# grape purple&lt;br /&gt;# bannana yellow&lt;br /&gt;# .&lt;br /&gt;#&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;# This boolean function returns true if the current&lt;br /&gt;# ${line} contains a ${field}:${value} pair matching any&lt;br /&gt;# one of ${expressions}.  By default, if there are&lt;br /&gt;# no ${expressions}, then assume a 'match' is found.&lt;br /&gt;#&lt;br /&gt;fields_match() {&lt;br /&gt;        expressions="$*"&lt;br /&gt;&lt;br /&gt;        if  [[ -z "${expressions}" ]]; then&lt;br /&gt;                return 0&lt;br /&gt;        fi&lt;br /&gt;&lt;br /&gt;        for expression in ${expressions}; do&lt;br /&gt;                eval field=\"\$${expression%%=*}\"&lt;br /&gt;                value="${expression#*=}"&lt;br /&gt;&lt;br /&gt;                if [[ "${field}" == ${value} ]]; then&lt;br /&gt;                        return 0&lt;br /&gt;                fi&lt;br /&gt;        done&lt;br /&gt;&lt;br /&gt;        return 1&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;# This output function prints the ${values} of all&lt;br /&gt;# the specified ${fields}.  By default, if there are&lt;br /&gt;# no ${fields} specified, then print the current ${line}.&lt;br /&gt;#&lt;br /&gt;output() {&lt;br /&gt;        fields="$*"&lt;br /&gt;        values=''&lt;br /&gt;&lt;br /&gt;        if [[ -z "${fields}" ]]; then&lt;br /&gt;                print -- "${line}"&lt;br /&gt;                return&lt;br /&gt;        fi&lt;br /&gt;&lt;br /&gt;        for field in ${fields}; do&lt;br /&gt;                eval value=\"\$${field}\"&lt;br /&gt;  values="${values:+${values}${IFS}}${value}"&lt;br /&gt;        done&lt;br /&gt;        print -- "${values}"&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;# Main function&lt;br /&gt;#&lt;br /&gt;# Input is read from stdin.  The first line of input is a list of field names&lt;br /&gt;# (ie: ${header}).  The field names are treated as variables within the&lt;br /&gt;# script, so field names must be unique as well as conform to variable name&lt;br /&gt;# specifications.&lt;br /&gt;#&lt;br /&gt;# Command line arguments are one of ${expression} or ${field}.  An ${expression}&lt;br /&gt;# is a ${field}=${value} pair.  Due to the way matching is performed in&lt;br /&gt;# the field_matches() function, ${value} can be any valid ksh pattern.  A list&lt;br /&gt;# of ${field} arguments specifies which ${fields} will be output() for a&lt;br /&gt;# ${line} matching any one of ${expressions}.&lt;br /&gt;#&lt;br /&gt;# The special ${expression} of the form 'IFS=&lt;char&gt;' will not be used in&lt;br /&gt;# ${line} matching.  It will be evaluated prior to processing any input.&lt;br /&gt;# This ${expression} is used for setting the field separator (ie: IFS)&lt;br /&gt;# character used in the input stream for delimiting fields.&lt;br /&gt;#&lt;br /&gt;# Output consists of a one line list of ${field} names followed by&lt;br /&gt;# each matching ${line} of input.  If specific ${field} names are specified&lt;br /&gt;# as command line arguments, then only those ${field} ${values} will be&lt;br /&gt;# output.&lt;br /&gt;#&lt;br /&gt;match() {(&lt;br /&gt;        if (( $# == 0 )); then&lt;br /&gt;                print "usage: match [ IFS=&lt;char&gt; ] [ &lt;field&gt;=&lt;value&gt; [...] ] [&lt;field&gt; [...] ]"&lt;br /&gt;                return&lt;br /&gt;        fi&lt;br /&gt;&lt;br /&gt;        for arg in $*; do&lt;br /&gt;                if [[ "$arg" == IFS=* ]]; then&lt;br /&gt;                        eval $arg&lt;br /&gt;                elif [[ "$arg" == *=* ]]; then&lt;br /&gt;   expressions="${expressions:+${expressions}${IFS}}${arg}"&lt;br /&gt;                else&lt;br /&gt;   fields="${fields:+${fields}${IFS}}${arg}"&lt;br /&gt;                fi&lt;br /&gt;        done&lt;br /&gt;&lt;br /&gt;        set -f&lt;br /&gt;&lt;br /&gt;        read header&lt;br /&gt;&lt;br /&gt;        print "${fields:-${header}}"&lt;br /&gt;&lt;br /&gt;        while read line; do&lt;br /&gt;&lt;br /&gt;                print -- "${line}" | read ${header}&lt;br /&gt;&lt;br /&gt;                if fields_match ${expressions}; then&lt;br /&gt;                        output ${fields}&lt;br /&gt;                fi&lt;br /&gt;        done&lt;br /&gt;)}&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;# Main&lt;br /&gt;#&lt;br /&gt;# This is the entry point to the script.  It serves as a wrapper&lt;br /&gt;# to the main function.  This script may be executed directly via:&lt;br /&gt;#&lt;br /&gt;#       chmod a+x match.ksh; cat input | match.ksh field=value ...&lt;br /&gt;#&lt;br /&gt;# or it may be used as a ksh function by sourcing it from a ksh shell:&lt;br /&gt;#&lt;br /&gt;#       . ./match.ksh&lt;br /&gt;#       cat input | match field=value&lt;br /&gt;#&lt;br /&gt;if [[ "${0##*/}" == 'match'* ]]; then&lt;br /&gt;        match $*&lt;br /&gt;fi&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/23398672-115881803232751783?l=daftster.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://daftster.blogspot.com/feeds/115881803232751783/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=23398672&amp;postID=115881803232751783' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23398672/posts/default/115881803232751783'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23398672/posts/default/115881803232751783'/><link rel='alternate' type='text/html' href='http://daftster.blogspot.com/2006/09/general-purpose-script-used-for.html' title=''/><author><name>daftster</name><uri>http://www.blogger.com/profile/00076860789674273180</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23398672.post-115881785492417074</id><published>2006-09-21T13:50:00.000+08:00</published><updated>2006-09-21T13:50:55.310+08:00</updated><title type='text'></title><content type='html'>Script to check which process is accessing an open file&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.sun.com/bigadmin/scripts/submittedScripts/get_open_files.ksh.txt"&gt;http://www.sun.com/bigadmin/scripts/submittedScripts/get_open_files.ksh.txt&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;#!/bin/ksh&lt;br /&gt;&lt;br /&gt;###&lt;br /&gt;### Pass in a mounted filesystem or a file and get the users&lt;br /&gt;### and processes attached to that system.&lt;br /&gt;###&lt;br /&gt;### Demonstrates the use of 'fuser' and 'ps'.&lt;br /&gt;###&lt;br /&gt;### Arguments:&lt;br /&gt;###   &lt;type&gt; - file|dir or filesystem&lt;br /&gt;###   &lt;arg&gt;  - The file, directory or filesystem&lt;br /&gt;###&lt;br /&gt;### Formed from shell-me submittal&lt;br /&gt;### Submitted by: Eric Steed&lt;br /&gt;###&lt;br /&gt;&lt;br /&gt;### Check we have 2 args&lt;br /&gt;if [[ $# -lt 2 ]]; then&lt;br /&gt;    print "\n Usage: get_open_files &lt;file|dir|filesystem&gt; &lt;fs|file|dir&gt; \n\n"&lt;br /&gt;    exit 1;&lt;br /&gt;fi&lt;br /&gt;&lt;br /&gt;### Set the args to vars&lt;br /&gt;type_of_check=${1}&lt;br /&gt;item_to_check=${2}&lt;br /&gt;&lt;br /&gt;### Test the types and do the correct command&lt;br /&gt;if [[ "$type_of_check" = "file" || "$type_of_check" = "dir" ]]; then&lt;br /&gt;    /bin/ps -fp `fuser $item_to_check 2&gt; /dev/null| xargs | sed 's/ / -p /g'`&lt;br /&gt;elif [[ "$type_of_check" = "filesystem" ]]; then&lt;br /&gt;    /bin/ps -fp `fuser -c $item_to_check 2&gt; /dev/null| xargs | sed 's/ / -p /g'`&lt;br /&gt;else&lt;br /&gt;    print "Invalid argument: ${type_of_check} \n"&lt;br /&gt;    exit 1&lt;br /&gt;fi&lt;br /&gt;&lt;br /&gt;### Exit&lt;br /&gt;exit 0;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/23398672-115881785492417074?l=daftster.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://daftster.blogspot.com/feeds/115881785492417074/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=23398672&amp;postID=115881785492417074' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23398672/posts/default/115881785492417074'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23398672/posts/default/115881785492417074'/><link rel='alternate' type='text/html' href='http://daftster.blogspot.com/2006/09/script-to-check-which-process-is.html' title=''/><author><name>daftster</name><uri>http://www.blogger.com/profile/00076860789674273180</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23398672.post-115639711335651504</id><published>2006-08-24T13:21:00.000+08:00</published><updated>2006-10-27T21:26:35.703+08:00</updated><title type='text'></title><content type='html'>Checking your Unix/Linux Filesystem for free space&lt;br /&gt;I recently found two useful scripts on finding available disk space of your system. :-)&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Script 1 from http://www.sun.com/bigadmin/scripts/submittedScripts/fscheck.ksh.txt&lt;/span&gt;&lt;br /&gt;#! /usr/bin/ksh&lt;br /&gt;&lt;br /&gt;###&lt;br /&gt;### This script can be run from cron to periodically check&lt;br /&gt;### filesystems for low disk space and send an e-mail.&lt;br /&gt;###&lt;br /&gt;###  Variables:&lt;br /&gt;###     MAXSIZE = percentage filesystem must be full before notification&lt;br /&gt;###     NOTIFY = email address to notify when file system reaches MAXSIZE&lt;br /&gt;###&lt;br /&gt;&lt;br /&gt;### Configurable variables here&lt;br /&gt;MAXSIZE=90&lt;br /&gt;NOTIFY=you@yourcompany.com&lt;br /&gt;HOSTNAME=`hostname`&lt;br /&gt;&lt;br /&gt;# Add filesystems you wish to skip from checking&lt;br /&gt;FSLIST=`df -k | grep -v "cdrom" | grep -v "mnt"  | awk '{ fssize=substr($5,1,index($5,"%")-1)&lt;br /&gt;              if (int(fssize) &gt; int(maxsize)) {&lt;br /&gt;                      print $6":"fssize&lt;br /&gt;              }&lt;br /&gt;      }' maxsize=$MAXSIZE`&lt;br /&gt;&lt;br /&gt;### Were there any fs to report?&lt;br /&gt;if [ -z $FSLIST ]; then&lt;br /&gt;echo "There were no reportable filesystems."&lt;br /&gt;exit 0&lt;br /&gt;fi&lt;br /&gt;&lt;br /&gt;### Mail out the list if there is one&lt;br /&gt;for fs in $FSLIST&lt;br /&gt;do&lt;br /&gt;      FS=`echo $fs | cut -f1 -d:`&lt;br /&gt;      SIZE=`echo $fs | cut -f2 -d:`&lt;br /&gt;      MESSAGE="Subject: $HOSTNAME File System Alert: $FS at $SIZE %"&lt;br /&gt;      echo $MESSAGE | mail $NOTIFY&lt;br /&gt;done&lt;br /&gt;&lt;br /&gt;### Exit gracefully&lt;br /&gt;exit 0&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;### This script is submitted to BigAdmin by a user of the BigAdmin community.&lt;br /&gt;### Sun Microsystems, Inc. is not responsible for the&lt;br /&gt;### contents or the code enclosed.&lt;br /&gt;###&lt;br /&gt;###&lt;br /&gt;### Copyright 2006 Sun Microsystems, Inc. ALL RIGHTS RESERVED&lt;br /&gt;### Use of this software is authorized pursuant to the&lt;br /&gt;### terms of the license found at&lt;br /&gt;### http://www.sun.com/bigadmin/common/berkeley_license.html&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Script 2 from http://www.sun.com/bigadmin/scripts/submittedScripts/dfh.sh.txt&lt;br /&gt;&lt;/span&gt; #!/bin/sh&lt;br /&gt;#&lt;br /&gt;#             title: Displays the amount of disk space&lt;br /&gt;#          subtitle: Disk space mounted in MB or GB&lt;br /&gt;#     creation date: 11 november 2002&lt;br /&gt;# modification date: 26 janvier 2006&lt;br /&gt;#           version: 1.0&lt;br /&gt;#            author: Fabbri Pascal @ ?pfL&lt;br /&gt;#                    Swiss Federal Institute of Technology Lausanne&lt;br /&gt;#             email: pascal.fabbri@epfl.ch&lt;br /&gt;#         file name: $HOME/scripts/dfh&lt;br /&gt;#       description: Display the amount of disk space occupied by file systems&lt;br /&gt;#                    in MB or in GB.&lt;br /&gt;#&lt;br /&gt;&lt;br /&gt;ECHO="/bin/echo"&lt;br /&gt;&lt;br /&gt;if [ $# -gt 0 ] || [ $# -lt 2 ]&lt;br /&gt;then&lt;br /&gt;case $1 in&lt;br /&gt;  -g)&lt;br /&gt;    sizeIn='GB'&lt;br /&gt;    ;;&lt;br /&gt;  -m)&lt;br /&gt;    sizeIn='MB'&lt;br /&gt;    ;;&lt;br /&gt;  -h)&lt;br /&gt;    ${ECHO} Usage: `basename $0` \[-m\|-g\]&lt;br /&gt;    ${ECHO} "\t -m space in MegaByte (MB)"&lt;br /&gt;    ${ECHO} "\t -g space in GigaByte (GB)"&lt;br /&gt;    exit 1&lt;br /&gt;    ;;&lt;br /&gt;  *)&lt;br /&gt;    sizeIn='MB'&lt;br /&gt;    ;;&lt;br /&gt;esac&lt;br /&gt;else&lt;br /&gt;${ECHO} "Too many options !"&lt;br /&gt;exit 1&lt;br /&gt;fi&lt;br /&gt;&lt;br /&gt;DF="/bin/df"&lt;br /&gt;AWK="/usr/bin/awk"&lt;br /&gt;&lt;br /&gt;if [ -r '/usr/bin/uname' ]&lt;br /&gt;then&lt;br /&gt;OSName=`/usr/bin/uname -s`&lt;br /&gt;elif [ -r '/bin/uname' ]&lt;br /&gt;then&lt;br /&gt;OSName=`/bin/uname -s`&lt;br /&gt;else&lt;br /&gt;${ECHO} "uname command not found !"&lt;br /&gt;exit 1&lt;br /&gt;fi&lt;br /&gt;&lt;br /&gt;AWK_FILE_GB='&lt;br /&gt;  BEGIN {&lt;br /&gt;    size=0&lt;br /&gt;    used=0&lt;br /&gt;    avail=0&lt;br /&gt;    getline;&lt;br /&gt;    printf "%-21s %6s %6s %6s %4s\n","","(gb)","(gb)","(gb)","(%)"&lt;br /&gt;    printf "%-21s %6s %6s %6s %4s %s\n","Filesystem","size","used","avail","used","Mounted on"&lt;br /&gt;  }&lt;br /&gt;  {&lt;br /&gt;    printf "%-21s %6.2f %6.2f %6.2f %4s %s\n",$1,$2/1024/1024,$3/1024/1024,$4/1024/1024,$5,$6&lt;br /&gt;    size+=$2&lt;br /&gt;    used+=$3&lt;br /&gt;    avail+=$4&lt;br /&gt;  }&lt;br /&gt;  END {&lt;br /&gt;    printf "%-21s %6s %6s %6s\n","","------","------","------"&lt;br /&gt;    printf "%-21s %6.2f %6.2f %6.2f\n",            "",size/1024/1024,used/1024/1024,avail/1024/1024&lt;br /&gt;  }'&lt;br /&gt;&lt;br /&gt;AWK_FILE_MB='&lt;br /&gt;  BEGIN {&lt;br /&gt;    size=0&lt;br /&gt;    used=0&lt;br /&gt;    avail=0&lt;br /&gt;    getline;&lt;br /&gt;    printf "%-21s %6s %6s %6s %4s\n",            "","(mb)","(mb)","(mb)","(%)"&lt;br /&gt;    printf "%-21s %6s %6s %6s %4s %s\n",            "Filesystem","size","used","avail","used","Mounted on"&lt;br /&gt;  }&lt;br /&gt;  {&lt;br /&gt;    printf "%-21s %6d %6d %6d %4s %s\n", $1,$2/1024,$3/1024,$4/1024,$5,$6&lt;br /&gt;    size+=$2&lt;br /&gt;    used+=$3&lt;br /&gt;    avail+=$4&lt;br /&gt;  }&lt;br /&gt;  END {&lt;br /&gt;    printf "%-21s %6s %6s %6s\n",            "","------","------","------"&lt;br /&gt;    printf "%-21s %6d %6d %6d\n",            "",size/1024,used/1024,avail/1024&lt;br /&gt;  }'&lt;br /&gt;&lt;br /&gt;case $sizeIn in&lt;br /&gt;GB)&lt;br /&gt;  AWK_FILE=${AWK_FILE_GB}&lt;br /&gt;  ;;&lt;br /&gt;MB)&lt;br /&gt;  AWK_FILE=${AWK_FILE_MB}&lt;br /&gt;  ;;&lt;br /&gt;*)&lt;br /&gt;  ${ECHO} "Do nothing !"&lt;br /&gt;  ;;&lt;br /&gt;esac&lt;br /&gt;&lt;br /&gt;case ${OSName} in&lt;br /&gt;SunOS)&lt;br /&gt;  (${DF} -kF ufs; ${DF} -kF zfs | ${AWK} 'BEGIN{getline} {print}') | ${AWK} "${AWK_FILE}"&lt;br /&gt;  ;;&lt;br /&gt;FreeBSD)&lt;br /&gt;  ${DF} -kt ufs | ${AWK} "${AWK_FILE}"&lt;br /&gt;  ;;&lt;br /&gt;Darwin)&lt;br /&gt;  ${DF} -kt hfs,ufs,msdos | ${AWK} "${AWK_FILE}"&lt;br /&gt;  ;;&lt;br /&gt;Linux)&lt;br /&gt;  ${DF} -k | ${AWK} "${AWK_FILE}"&lt;br /&gt;  ;;&lt;br /&gt;*)&lt;br /&gt;$ECHO Error: Unknown Operating System!&lt;br /&gt;esac&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;### This script is submitted to BigAdmin by a user of the BigAdmin community.&lt;br /&gt;### Sun Microsystems, Inc. is not responsible for the&lt;br /&gt;### contents or the code enclosed.&lt;br /&gt;###&lt;br /&gt;###&lt;br /&gt;### Copyright 2006 Sun Microsystems, Inc. ALL RIGHTS RESERVED&lt;br /&gt;### Use of this software is authorized pursuant to the&lt;br /&gt;### terms of the license found at&lt;br /&gt;### http://www.sun.com/bigadmin/common/berkeley_license.html&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/23398672-115639711335651504?l=daftster.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://daftster.blogspot.com/feeds/115639711335651504/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=23398672&amp;postID=115639711335651504' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23398672/posts/default/115639711335651504'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23398672/posts/default/115639711335651504'/><link rel='alternate' type='text/html' href='http://daftster.blogspot.com/2006/08/checking-your-unixlinux-filesystem-for.html' title=''/><author><name>daftster</name><uri>http://www.blogger.com/profile/00076860789674273180</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23398672.post-114172105051985171</id><published>2006-03-07T15:52:00.000+08:00</published><updated>2006-03-07T16:44:10.540+08:00</updated><title type='text'></title><content type='html'>&lt;span style="font-weight: bold;"&gt;Cross Compiling SQLite 3 Library in Fedora Core 3 to be used for compiling appications that would support SQLite for your ARM system.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Download &lt;a href="http://www.sqlite.org/sqlite-3.3.4.so.gz"&gt;sqlite version 3.3.4&lt;/a&gt; from sqlite.org.  Untar the file and go to the directory.&lt;br /&gt;# tar xvzf sqlite-3.3.4.so.gz&lt;br /&gt;# cd sqlite-3.3.4&lt;br /&gt;&lt;br /&gt;Edit the Makefile to set your cross compiler tool app and do the following changes:&lt;br /&gt;BCC = arm-linux-gcc -g -O2&lt;br /&gt;USLEEP = -DHAVE_USLEEP=1&lt;br /&gt;THREADSAFE = -DTHREADSAFE=1&lt;br /&gt;THREADLIB = -lpthread&lt;br /&gt;OPTS = -DNDEBUG=1&lt;br /&gt;OPTS += -DHAVE_FDATASYNC=1&lt;br /&gt;OPTS += -DNO_TCL&lt;br /&gt;TCC = arm-linux-gcc -O6&lt;br /&gt;AR = arm-linux-ar cr&lt;br /&gt;RANLIB = arm-linux-ranlib&lt;br /&gt;READLINE_FLAGS =&lt;br /&gt;LIBREADLINE = -static&lt;br /&gt;&lt;br /&gt;Now that you have setup the Makefile the next thing we should do is try to run the make command.&lt;br /&gt;# make&lt;br /&gt;&lt;br /&gt;You would be encountering an ERROR since in the makefile there are some commands that needs to be executed to generate some more files.  Upon encountering the error, search for the line ./lemon $(OPTS) parse.y and put a comment '#' before that line.  Now, you have to do that command on the platform in which you would be porting SQLite.  After exectuting the command on the target platform, copy the files generated into the sqlite installation directory.&lt;br /&gt;&lt;br /&gt;Run make again.  This time you would encounter another ERROR.  Comment out the line ./mkkeywordhash &gt;keywordhash.h and again, execute the app on your target platform and copy  keywordhash.h file.  Run make again.&lt;br /&gt;&lt;br /&gt;It would finish the compilation and you now have a crossed compiled sqlite 3 library for arm linux.&lt;br /&gt;Copy the library file generated to your library directory.&lt;br /&gt;# cp libsqlite3.a /usr/local/arm-linux/lib/&lt;br /&gt;&lt;br /&gt;Vist &lt;a href="http://www.sqlite.org"&gt;http://www.sqlite.org&lt;/a&gt; for more information on Sqlite.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/23398672-114172105051985171?l=daftster.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://daftster.blogspot.com/feeds/114172105051985171/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=23398672&amp;postID=114172105051985171' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23398672/posts/default/114172105051985171'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23398672/posts/default/114172105051985171'/><link rel='alternate' type='text/html' href='http://daftster.blogspot.com/2006/03/cross-compiling-sqlite-3-library-in.html' title=''/><author><name>daftster</name><uri>http://www.blogger.com/profile/00076860789674273180</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23398672.post-114161464454845897</id><published>2006-03-06T11:01:00.000+08:00</published><updated>2006-03-06T11:28:09.296+08:00</updated><title type='text'></title><content type='html'>&lt;span style="font-weight: bold;"&gt;Building Cross-Compiling Toolchain&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The following packages are needed:&lt;br /&gt;&lt;table style="width: 384px; height: 236px;" border="1" cellpadding="4" cellspacing="0"&gt; &lt;tbody&gt;&lt;tr&gt;&lt;th&gt;Package&lt;/th&gt;         &lt;th&gt;Used version&lt;/th&gt;         &lt;th&gt;Download&lt;/th&gt;        &lt;/tr&gt;        &lt;tr&gt;         &lt;td&gt;Linux Kernel&lt;/td&gt;         &lt;td&gt;2.4.17&lt;/td&gt;         &lt;td&gt;          &lt;a href="http://ftp.kernel.org/pub/linux/kernel/v2.4/linux-2.4.17.tar.gz"&gt;ftp.kernel.org&lt;/a&gt;         &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;         &lt;td&gt;ARM Kernel patch&lt;/td&gt;         &lt;td&gt;2.4.17-rmk4&lt;/td&gt;         &lt;td&gt;          &lt;a href="ftp://ftp.arm.linux.org.uk/pub/armlinux/source/kernel-patches/v2.4/patch-2.4.17-rmk4.gz"&gt;ftp.arm.linux.org&lt;/a&gt;         &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;         &lt;td&gt;binutils&lt;/td&gt;         &lt;td&gt;2.11.2&lt;/td&gt;         &lt;td&gt;          &lt;a href="ftp://ftp.gnu.org/gnu/binutils/binutils-2.11.2.tar.gz"&gt;ftp.gnu.org&lt;/a&gt;         &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;         &lt;td&gt;gcc&lt;/td&gt;         &lt;td&gt;2.95.3&lt;/td&gt;         &lt;td&gt;          &lt;a href="ftp://ftp.gnu.org/gnu/gcc/gcc-2.95.3.tar.gz"&gt;ftp.gnu.org&lt;/a&gt;         &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;         &lt;td&gt;glibc&lt;/td&gt;         &lt;td&gt;2.2.4&lt;/td&gt;         &lt;td&gt;          &lt;a href="ftp://ftp.gnu.org/gnu/glibc/glibc-2.2.4.tar.gz"&gt;ftp.gnu.org&lt;/a&gt;         &lt;/td&gt;        &lt;/tr&gt;        &lt;tr&gt;         &lt;td&gt;glibc linuxthreads add-on&lt;/td&gt;         &lt;td&gt;2.2.4&lt;/td&gt;         &lt;td&gt;          &lt;a href="ftp://ftp.gnu.org/gnu/glibc/glibc-linuxthreads-2.2.4.tar.gz"&gt;ftp.gnu.org&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt; &lt;/table&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;binutils&lt;br /&gt;&lt;/span&gt; &lt;p&gt; Unpack the binutils tarball into a temporary directory, change to the unpacked binutils directory and run the following commands: &lt;/p&gt;         &lt;p&gt;        &lt;code&gt;# ./configure --target=arm-linux&lt;/code&gt;&lt;br /&gt;    &lt;code&gt;# make&lt;/code&gt;&lt;br /&gt;    &lt;code&gt;# make install&lt;/code&gt;&lt;br /&gt;   &lt;/p&gt;         &lt;p&gt;        You have now some &lt;code&gt;arm-linux-*&lt;/code&gt; binaries in /usr/local/bin. These are the binutils used by the cross-compiling toolchain. And you'll find the new directory &lt;code&gt;/usr/local/arm-linux/&lt;/code&gt;. This is        where the cross-compiling toolchain will be installed.       &lt;/p&gt;         &lt;p&gt;        You can check if the binutils are compiled correctly by calling        &lt;code&gt;arm-linux-ar&lt;/code&gt;. This tool outputs the supported targets in its        command line help. You should find targets like &lt;em&gt;elf32-littlearm&lt;/em&gt; there.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt; &lt;h4&gt;Linux Kernel header files&lt;/h4&gt; To compile gcc we need some header files from the linux kernel source. Unpack the kernel source code in a temporary directory and change to the unpacked source directory. You'll need to patch the kernel with the ARM kernel patch. You do this by running this command: &lt;p&gt;        &lt;code&gt;# zcat &lt;em&gt;path-to-arm-patch&lt;/em&gt;/patch-2.4.17-rmk4.gz | patch -p1&lt;/code&gt;&lt;br /&gt;    &lt;/p&gt;         &lt;p&gt;        Now you need to configure the kernel by calling this command:       &lt;/p&gt;         &lt;p&gt;        &lt;code&gt;# make menuconfig ARCH=arm&lt;/code&gt;&lt;br /&gt;    &lt;/p&gt;         &lt;p&gt;        Notice that you need to specify &lt;code&gt;ARCH=arm&lt;/code&gt; otherwise        you are going to configure the kernel for your host architecture which maybe        a x86 machine.       &lt;/p&gt;         &lt;p&gt; You don't need to do a complete configuration unless you want to compile the kernel now. Up to now you don't have a cross compiler so you can't compile it anyway. All you need to do is to select the correct processer type. Now save the configuration and call the following command to finish the kernel configuration: &lt;/p&gt;         &lt;p&gt;         &lt;code&gt;# make dep&lt;/code&gt;&lt;br /&gt;    &lt;/p&gt;         &lt;p&gt;        Now copy the include files from the kernel source to the toolchain directory:       &lt;/p&gt;         &lt;p&gt;        &lt;code&gt;# mkdir /usr/local/arm-linux/include&lt;/code&gt;&lt;br /&gt;     &lt;code&gt;# cp -dR include/asm-arm /usr/local/arm-linux/include/asm&lt;/code&gt;&lt;br /&gt;     &lt;code&gt;# cp -dR include/linux /usr/local/arm-linux/include/linux&lt;/code&gt;&lt;br /&gt;    &lt;/p&gt;         &lt;p&gt;        Finally change to the toolchain directory and create a symbolic link from        &lt;em&gt;include&lt;/em&gt; to &lt;em&gt;sys-include&lt;/em&gt;:       &lt;/p&gt;         &lt;p&gt;        &lt;code&gt;# cd /usr/local/arm-linux/&lt;/code&gt;&lt;br /&gt;     &lt;code&gt;# ln -s include sys-linux&lt;/code&gt;&lt;br /&gt;    &lt;/p&gt;         &lt;p&gt;        gcc, which we will compile now, is searching for the include files in        &lt;em&gt;sys-linux&lt;/em&gt; by default. You can use the &lt;code&gt;--with-headers&lt;/code&gt; configure-option to specify an other directory but this results in copying the specifed directory to sys-linux. So I think it's better to create a symbolic link to avoid redundant files.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt; &lt;h4&gt;gcc&lt;/h4&gt; &lt;p&gt; Unpack the gcc source code and change to the unpacked source directory. We currently don't have a running glibc so we can't compile the whole compiler suite. But for now it is enough to compile only the C compiler. Later we can compile the glibc with this cross compiler and after that we can compile the whole compiler suite. &lt;/p&gt;         &lt;p&gt;        It may be necessary to modify the gcc source a little bit.  Edit the file &lt;code&gt;gcc/config/arm/t-linux&lt;/code&gt;, search this        line:       &lt;/p&gt;         &lt;p&gt;        &lt;code&gt;TARGET_LIBGCC2_CFLAGS = -fomit-frame-pointer -fPIC&lt;/code&gt;       &lt;/p&gt;         &lt;p&gt;        And change it to this:       &lt;/p&gt;         &lt;p&gt;        &lt;code&gt;TARGET_LIBGCC2_CFLAGS = -fomit-frame-pointer -fPIC -Dinhibit_libc -D__gthr_posix_h&lt;/code&gt;       &lt;/p&gt;         &lt;p&gt;        Now configure the source code, compile and install:       &lt;/p&gt;         &lt;p&gt;        &lt;code&gt;# ./configure --target=arm-linux --disable-threads --enable-languages=c&lt;/code&gt;&lt;br /&gt;     &lt;code&gt;# make&lt;/code&gt;&lt;br /&gt;     &lt;code&gt;# make install&lt;/code&gt;&lt;br /&gt;    &lt;/p&gt;         &lt;p&gt;        You have now a running cross compiler (&lt;code&gt;/usr/local/bin/arm-linux-gcc&lt;/code&gt;)         but without glibc it is not really useful.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt; &lt;h4&gt;glibc&lt;/h4&gt; &lt;p&gt;Before, proceeding with glibc, check link files /usr/local/arm-linux/include/asm/proc and /usr/local/arm-linux/include/asm/arch are correctly link. In my case, I'm using ARM920T and these links should be proc-armv and arch-integrator respectively.&lt;/p&gt; &lt;p&gt;Unpack the glibc tarball in a temporary directory as usual. Then switch to the unpacked source directory and unpack the linuxthreads add-on into it: &lt;/p&gt;         &lt;p&gt;        &lt;code&gt;# tar xvfz glibc-2.2.4.tar.gz&lt;/code&gt;&lt;br /&gt;     &lt;code&gt;# cd glibc-2.2.4&lt;/code&gt;&lt;br /&gt;     &lt;code&gt;# tar xvfz ../glibc-linuxthreads-2.2.4.tar.gz&lt;/code&gt;&lt;br /&gt;    &lt;/p&gt;         &lt;p&gt;        Now set the environment variable CC to &lt;em&gt;arm-linux-gcc&lt;/em&gt; because we        want the glibc to be cross-compiled for the ARM platform. Then configure,        compile and install:       &lt;/p&gt;         &lt;p&gt;        &lt;code&gt;# export CC=arm-linux-gcc&lt;/code&gt;&lt;br /&gt;     &lt;code&gt;# ./configure arm-linux --target=arm-linux --prefix=/usr/local/arm-linux --enable-add-ons&lt;/code&gt;&lt;br /&gt;     &lt;code&gt;# make&lt;/code&gt;&lt;br /&gt;     &lt;code&gt;# make install&lt;/code&gt;&lt;br /&gt;    &lt;/p&gt;         &lt;p&gt;        Be sure you use the &lt;code&gt;--prefix&lt;/code&gt; parameter correctly, otherwise you        mess up your hosts glibc installation.       &lt;/p&gt;         &lt;p&gt;        You'll now find a lot of new files and directories in &lt;code&gt;/usr/local/arm-linux&lt;/code&gt;.        These are the glibc headers, libraries and utitilies.       &lt;/p&gt;         &lt;p&gt; Notice that you can't use this compiled glibc on the target machine because of the specified prefix. If you want to compile a glibc which you can copy to your target machine, use an empty prefix (&lt;code&gt;--prefix=&lt;/code&gt;) instead and        use the &lt;code&gt;install_root&lt;/code&gt; parameter to specify the installation directory:       &lt;/p&gt;         &lt;p&gt;        &lt;code&gt;# make install install_root=/path/to/target/root&lt;/code&gt;       &lt;/p&gt;         &lt;p&gt;        Finally, make sure you unset the CC environment variable (with &lt;code&gt;unset CC&lt;/code&gt;).&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;br /&gt;Thanks to &lt;a href="http://www.ailis.de/%7Ek/docs/crosscompiling/toolchain.php"&gt;http://www.ailis.de/~k/docs/crosscompiling/toolchain.php&lt;/a&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;       &lt;/p&gt; &lt;p&gt;       &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/23398672-114161464454845897?l=daftster.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://daftster.blogspot.com/feeds/114161464454845897/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=23398672&amp;postID=114161464454845897' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23398672/posts/default/114161464454845897'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23398672/posts/default/114161464454845897'/><link rel='alternate' type='text/html' href='http://daftster.blogspot.com/2006/03/building-cross-compiling-toolchain.html' title=''/><author><name>daftster</name><uri>http://www.blogger.com/profile/00076860789674273180</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
