Tuesday, October 10, 2006

Tracking visits to a Webpage, Website or Blogger Blog (A HOWTO)

This can be accomplished in a variety of ways. However, I'll tell you the one way that I've used that seemed easy to integrate with the Blogger platform.

I am using sitemeter one of the many tracking sites out there.

I admit the following only: their website interface isn't completely smooth. I know what I wanted and for some reason the sitemeter site didn't lead me to it immediately. Maybe they need a step-by-step for the I-am-too-busy-to-read soul?


To add sitemeter.com tracking to your Blogger Blog:

My step-by-step guide

  1. Sign up for an account: Sign-up to Sitemeter
  2. Sign in.
  3. Click on the Manger link [Near the top of the page]
  4. Click on the HTML code link [on the side bar]
  5. For those of you Blogger Users (beta users need a different link), click on the Adding Site Meter to a Blogger or Blogspot site
  6. Use your login/password for blogger, and it can add the Site Meter HTML to your Blogger template.
  7. Or you can add it yourself
    Something like:

    < href="http://s17.sitemeter.com/stats.asp?site=s17yourloginname" target="_top">
    < img src="http://s17.sitemeter.com/meter.asp?site=s17yourloginname" alt="Site
    Meter" border="0" />

To add your sitemeter.com tracking to a webpage/website
  1. Simply put the HTML code of Step 7 of the Blogger tracking into your HTML page.

Monday, October 09, 2006

install DB2 on Gentoo (Part 2)

It has come to my attention that there is significant interest in installing DB2 on Gentoo Linux.

I am running the kernel 2.6.17-gentoo-r8 on an AMD Athlon(tm) XP. It is a fully up to date on all installed packages as off the writing of this Blog.

1. Pre-requistes
Emerge the rpm package and any of its pre-requisites:

emerge rpm

2. Installation
Follow the installation section of 15.2 at: The Linux Documentation Project - Installing DB2 Version 8.2 on Gentoo (2005-01-17)
Pay attention to that step 4. It suprised me. You need to type in the product name of the only product on the list. Intuitive?
3. Post Installation configuration
Follow steps 1 - 3 in section 15.3 at: The Linux Documentation Project - Installing DB2 Version 8.2 on Gentoo (2005-01-17)
Insert a step 3.5: Ensure / directory access read permissions for users in my out of the box installation of gentoo see further detail in this post of mine. As root Run this command:
chmod a+rx /
Continue with step 4
4. I also enabled remote connections section 15.3.1: The Linux Documentation Project - Installing DB2 Version 8.2 on Gentoo (2005-01-17)
5. Install IBM Software Developer's Kit for Java:

rpm --force --nodeps -ivh db2/linux/Java-1.4/IBMJava2-SDK-1.4.1-2.0.i386.rpm

6. I was then able to run db2cc as the user db2inst1.


Following all that I created a database through the control center.

My next goal is going to be a tougher one (I suspect): to see if I can install Rational CQ on Gentoo.

Enjoy,
Paul

HOWTO find what network card is installed (PCI)

'Which network drivers to compile into the kernel? ' This has been a common question of mine theme over many years of using Linux. From Slackware of 1996 days to last month when I rebuilt the kernel on my Gentoo Linux server. I don't compile the kernel often, and in the months between it happening or when I bring up a new machine and I didn't remember which adapter I installed the week before, etc.

In the past this brought me to the following
(1) Non-optimal - Open up the computer case, physically inspect the network card
(2) Non-technical - Label the back of the Ethernet Adapter card with the vender/model
(3) Latest - run the command: lspci | grep Ethernet

lspci - List all PCI devices

Note this could also remind you of what video adapter is installed, or any other PCI adapter for that matter.

Bash Shell commands quick reference

I've been using www.ss64.com for several years to remember:

(1) Windows NT, 2000, XP, 2003, etc shell commands
(2) Oracle PL/SQL syntax
(3) Bash Shell commands

Here is a link to the Bash Shell commands: Linux commands

I also noticed while composing this post they have a SQL Server 2005 section. That is news to me. I recommend using this reference for either the Windows or bash shell in a 'what was that command syntax sort of moment'.

Sunday, October 08, 2006

Gentoo HOWTO Update Portage?

Even the simple things can confuse. Imagine seeing this message?

* An update to portage is available. It is _highly_ recommended
* that you update portage now, before any other packages are updated.
* Please do so and then update ALL of your configuration files.

What would a reasonable person do? Cry? Probably. Why doesn't it strike me immediately to use portage to update portage? I don't know.

The solution:

emerge portage


HOWTO - Gentoo on VMWare server

VMWare has been doing a great job in PC virtualization. I've been using VMWare as a test bed for attempting new configurations in Gentoo.

Many have worked on the Gentoo installation since I did my installation around May of 2006. It was a significant amount of work gleening thru the various different VMWare articles in the gentoo Wiki to understand it. Quite possibly I don't yet, but it works day in and day out, so it is a 'close enough'. I am writing this up months after the facts, so I might be a little fuzzy on the details, so don't let me distract you.

Googling on it today Oct. 8, 2006 reveals this, I might try that if I were ready to try again.
HOWTO Install VMWare Server - Gentoo Linux Wiki

The primary article I used in May 2006:
HOWTO Install Gentoo on VMware in Windows NT/2K/XP

Key recollections:
- Download Gentoo ISO
- boot from CD in the VMWare machine
- Recompile Kernel (to get the Network/Disk details all worked out)
- Install X Windows
- Install VMWare tools (this was the most work as I recall -- hopefully is has been cleaned up a little more)

As for a 'Should I run gentoo in VMWare'? I would say for sure! Once you are there it is highly useful. At work (a Windows development environment) if I want to use some UNIX tools, I can start up this tiny little VM (relative to my windows) that has a 6GB disk and 256 MB of RAM and it runs just fine, even starting up X Windows and then Eclipse.

Saturday, October 07, 2006

Changing the screen resolution in KDE

There is no good reason why I don't remember this, but going between OSs enough and I confuse myself on the simplest of things. For instance, changing the screen resolution in KDE is much like doing in Windows these days

  1. Right-click on the desktop
  2. Select Configure Desktop
  3. Select the Display Icon in the Left Window
  4. Adjust the screen Size to your hearts content

Friday, October 06, 2006

installing DB2 on Gentoo Linux

There is a well written article on howto do this:
Article Link -Installing DB2 Version 8.2 on Gentoo (2005-01-17)

My only issue I had with this on gentoo was with this command
/opt/IBM/db2/V8.1/instance/db2icrt -u db2fenc1 db2inst1
It was returning
DBI1088E Invalid access permission detected for directory "" IBM article describing the problem/solution

It wasn't really the permissions to the directory given it was a failure the script detected in /usr/bin/pwd

It turns out that the real problem is more in my configuration of gentoo and the /usr/bin/pwd executable. The DB2 installation scripts are peppered with the use of /usr/bin/pwd and doesn't use the built-in pwd in the shell. The problem is that the executable needs to be able to view /.
/ doesn't have read permissions for users in my out of the box installation of gentoo.

To give read access as root Run this command:
chmod a+rx /

The script should run successfully after that.

I've elaborated some further details on a second blog entry

Sunday, October 01, 2006

Linux, Gentoo, Weatherstations and uploading to Wunderground

I am using the Oregon Scientific WMR-968 weather station for monitoring the local weather. I upload the data to wunderground at station id: KWAREDMO10

Key piece of software is Timothy D. Witham's and Jay Denebeim's sourceForge wx200d project.

SourceForge - SourceForge Link
Project Homepage - wx200d Homepage


Steps (as best I can remember them)
(1) Get account at www.wunderground.com - register
(2) Install wx200d
(3) Setup a symlink for the serial port 1 (details below)
a new udev configuration file location: /etc/udev/rules.d/55-udev.rules
add the line: KERNEL=="ttyS0", SYMLINK="wx200"
(4) emerge lib-wwwperl
(5) Configure wx200d, for my case the launching of the daemon needed a '-r' because my station is a WMR-968 - TOUGH!. The README with wx200d is very clear.
The details in my /etc/conf.d/local.start:
if [ -x /usr/local/sbin/wx200d ]; then
echo -n " starting wx200d : "
/usr/local/sbin/wx200d -r
echo
fi
(4) Schedule a cron job to call the wunderground upload utility that came with wx200d. The argument to this utility wunderground is a path to the username/password file
Crontab information:
0-59/5 * * * * /usr/local/sbin/wunderground \
/etc/wunderground/wunderground.conf



Potentially the hardest part of this was learning what udev was all about and how to create a symlink to Serial port 1.

The next step in this process is the generation of a personalized page that I can put up on my domains like http://weather.paulcooley.com. This I've seen done very nicely with Virtual Weather Station. I would like to do this myself and save the cost of the Virtual Weather Station, the demo didn't like my Gentoo linux, X server, etc installation much and was fairly prone to crashing. It worked well in Windows, but my server is definiately linux.



NTP - Network Time Protocol

It is probably just me, but time is important. Having accurate time down to the millisecond is very important. And having you computer's time sync with a near-atomic clock is ideal. Hence NTP.

With Gentoo here is howto - NTP HOWTO

Once setup here are a few command to watch which servers you are connected to, what stratum you are in, and more data about the time than you are generally interested in.

Who are you connected to?
ntpq -c pe

What stratum are you?
ntpq -c rv | grep stratum

More data than necessary.
ntpq -c rv

Gentoo Cron job for backing up your data

Using one of those emerge commmands the other week to rebuild everything after a GCC 4.1.something upgrade, I overwrote a couple of key config files under /etc/... . Ouch, not wise. I made the rash assumption that it was a smart merge of the .config files. Don't do that, it is only as smart as the user :^). The only real loss was in the starting of a daemon for pulling data off of my weather station, but it took awhile to recollect the configuration.

A wiser way to go would be to goto my backups. Not having any didn't help -- it was on the to-do list. I found this to be a simple backup scheme for getting those all important configuration files and other data I might need.

Wikipage for Backupscripts and the cron jobs

I will now not repeat that mistake.

Keywords: Gentoo, Linux, cron job for backups, cron script for backups, simple script for linux backups.

Useful Portage commands (emerge)



Sync up your portage tree with a mirror


emerge --sync
--sync
Initiates a portage tree update with one of the rsync.gentoo.org mirrors. Note that any changes you have made to the portage tree will be erased. Except for special circumstances, this uses rsync to do the update. See make.conf(5)'s description of PORTDIR_OVERLAY for a method to avoid deletions.



Build/install the latest updates in the portage tree.
I use this after 'emerge --sync'


emerge --update --deep world

--update (-u)
Updates packages to the best version available, which may not always be the highest version number due to masking for testing and development. This will also update direct dependencies which may not be what you want. In general, use this option only in combination with the world or system target.



Rebuild Everything
Making deep changes to the compiler toolchain may have lowlevel affects, forcing you do rebuild everything (if you are particularly inclined to play it safe). It could also be that you just like using CPU time ...


emerge -eav system
emerge -eav world

-emptytree (-e)
Reinstalls all world packages and their dependencies to the current USE specifications while differing from the installed set of packages as little as possible. You should run with --pretend first to make sure the result is what you expect.



Search for portage packages
Used to look into the portage tree and find something. It also will tell you if it is install, what version it is, and other useful tidbits.


emerge -s package_name
Example
#emerge -s nut
[snipping the none relevant matches]
* sys-power/nut
Latest version available: 2.0.4-r1
Latest version installed: 2.0.4-r1
Size of files: 683 kB
Homepage: http://www.networkupstools.org/
Description: Network-UPS Tools
License: GPL-2



External References
Rockfloat's tips and tricks also has a good reference

An introduction to Portage: link
A simple portage Wiki page: Portage and Ebuilds
The man page: Portage Man page
The "best-known practices" for working with Portage: HOWTO_Use_Portage_Correctly



Keywords: Gentoo Portage, Gentoo Package Management, Gentoo Portage Commands, Gentoo emerge commands, Gentoo Linux Portage, Useful Portage commands.

Gentoo Linux

Currently I am using Gentoo Linux as my primary Linux machine in my home network.

You can get to the Gentoo homepage via this link.

I've found it is very well documented and easy to use because of portage, the integrated software distrubution system. It is a one-step system to get the latest source, build it, install it for linux. For instance if you want the pine email system, simply type 'emerge pine' and wait for it to complete compiling, once it is complete you can run 'pine'. Simply as 1,2; no 3 even necessary.

In the beginning

there was darkness: In terms of knowledge sharing and documentation.

My intention for this blog is to record the learning and lore of my experiences with Linux; mostly so that I keep my documentation in one location. However, I hope to be able to share my information to others that might find this useful.

To the root of the word lore, see the definition below. I am hoping to aim more for (1) and (2) rather than the definition (3).

Lore dictionary.com link
–noun
1. the body of knowledge, esp. of a traditional, anecdotal, or popular nature, on a particular subject: the lore of herbs.
2. learning, knowledge, or erudition.
3. Archaic.
a. the process or act of teaching; instruction.
b. something that is taught; lesson.

Paul Cooley

Other Sites of interest
http://www.cooley.ca
http://www.paulcooley.com