The Tech Diary

Your Online Notebook!

Tech Diary

Journal your struggles and achievements with technology.

Package has no origin recorded

Posted by: Brad Waite

Tagged in: Untagged 

After adding the HighPoint RocketRaid software package to FreeBSD, I'm now getting the following errors whenever I add or delete a package or port:

pkg_add: package hptraidconf-3.2 has no origin recorded
pkg_add: package hptsvr-3.13 has no origin recorded

The "origin" is normally the directory in the ports tree from which the package was built.  However, the 3rd-party HighPoint packages aren't part of the standard FreeBSD ports tree, and so the pkg_* utilities complain about a missing entry in the package database (/var/db/pkg).  Here's the first few lines of the +CONTENTS file in /var/db/pkg/ipmitool-1.8.11:

@comment PKG_FORMAT_REVISION:1.1
@name ipmitool-1.8.11
@comment ORIGIN:sysutils/ipmitool
@cwd /usr/local
bin/ipmitool 

Even though I added impitool with 'pkg_add -r', you can see the ORIGIN is listed as sysutils/ipmitool.

So, how do we fix this?  The 'pkgdb' tool has an option to fix the package database.  pkgdb is part of the portupgrade package, so install that first:

pkg_add -r portupgrade

-OR-

cd /usr/ports/ports-mgmt/portupgrade; make install

Now we can run pkgdb with the -F (fix) option:

# pkgdb -F
---> Checking the package registry database
[Rebuilding the pkgdb in /var/db/pkg ... - 10 packages found (-0 +10) .......... done]
Missing origin: hptraidconf-3.2
[Updating the portsdb in /usr/ports ... - 20037 port entries found .........1000.........2000.........3000.........4000.........5000.........6000.........7000.........8000.........9000.........10000.........11000.........12000.........13000.........14000.........15000.........16000.........17000.........18000.........19000.........20000 ..... done]
Skip this for now? [yes] no
Guessing... no idea.
Not in due form :
New origin? (? to help): ?
[Enter] to skip, [Ctrl]+[D] to unregister or deinstall,
[.][Enter] to abort, [Tab] to complete
New origin? (? to help): sysutils/hptraidconf
sysutils/hptraidconf: Not found. Force it? [no] yes
(? hptraidconf-3.2)Fixed. (-> sysutils/hptraidconf)
Missing origin: hptsvr-3.13
Skip this for now? [yes] no
Guessing... no idea.
Not in due form :
New origin? (? to help): sysutils/htpsvr
sysutils/htpsvr: Not found. Force it? [no] yes
(? hptsvr-3.13)Fixed. (-> sysutils/htpsvr)

pkgdb again informs us that there's no origin for hptraidconf and hptsvr and tries to find the proper origin.  Because these packages aren't part of the ports tree, it has "no idea", and asks us to provide one.  I chose to say they were part of the sysutils tree, but it really doesn't matter.  After entering a value, pkgdb warns that it can't find that port so we have to force the origin.

After this, all pkg_* utilities work without complaining.

 


Overview
-------

For new SSL servers:

1. Generate new server key
2. Generate CSR
3. Have key signed
4. Install signed key

For existing SSL servers:

1. Generate CSR
2. Have key signed
3. Install signed key

 

Generate new server key
-----------------------

This creates a new 1024 bit server key named website.key:

# openssl genrsa -out website.key 1024
Generating RSA private key, 1024 bit long modulus
...........................................++++++
................................++++++
e is 65537 (0x10001)

 

Generate CSR
------------

This creates a certificate signing request (CSR) from a key called website.key
and puts the request in website.csr:

# openssl req -new -key website.key -out website.csr
Using configuration from /etc/ssl/openssl.cnf
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [US]:US
State or Province Name (full name) [Colorado]:Colorado
Locality Name (eg, city) [Denver]:Denver
Organization Name (eg, company) []:The Tech Diary
Organizational Unit Name (eg, section) []:
Common Name (eg, YOUR name) []:www.tech-diary.com
Email Address []:admin@tech-diary.com

Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:

 

Have key signed
---------------

Send website.csr to a Certificate Authority (GeoTrust, Thawte, etc.) for
signing.

 

Install signed key
------------------

Your CA will return a signed key. Put this in website.crt.


Mount a Windows XP share under FreeBSD

Posted by: Brad Waite

Tagged in: xp , windows , samba , mount , freebsd

mount_smbfs -U -I -W ///

Example:

mount_smbfs -U fred -I fileserver -W WORKGROUP //fileserver/files /mnt


"The Windows Installer Service Could Not Be Accessed"

Posted by: Brad Waite

Tagged in: Untagged 

After recovering from a failed XP registry software hive, my Windows Installer is reporting this error:

"The Windows Installer Service Could Not Be Accessed" 

The Microsoft KB says to perform the following functions:

msiexec /unregister

msiexec /register

However, when I do that I get a "Incorrect function" error. MS says the next step is a repair installation.  I'm going to play with a few things first.


"The registry cannot load the hive" - Corrupted XP registry

Posted by: Brad Waite

Tagged in: Untagged 

I nearly toasted my XP machine today.  Somehow, between installing some software, running a keygen that may have infected my machine with a virus, running a system restore and installing the latest updates, the software hive of my registry became corrupted.

On boot, I'd get a BSOD with the following error:

Stop: c0000218 {Registry File Failure}  The registry cannot load the hive (file): \SystemRoot\System32\Config\SOFTWARE or its log or alternate.

Microsoft has a KB article on how to fix this.  Here's there 3-step process in a nutshell:

  1. Boot into the Recovery Console from the XP CD; backup your registry files that are in \windows\system32\config; copy new registry files from \windows\repair in their place.
  2. Boot into XP, copy registry files from a previous System Restore point from \System Volume Information to a temp dir in \windows.
  3. Boot into the Recovery Console again and copy the files from the temp dir into \windows\system32\config.

For all intents and purposes, that does a manual System Restore.

In my case, there were no previous System Restore points (Step 2)  in my C:\System Volume Information, even though I *know* had nightly backups that I'd seen when I did the System Restore at the start of this mess.  So I was stuck.

I tried to skip Step 3 and just boot into XP with the hives from \windows\repair, but I could only log in as administrator on the local machine; my domain user wasn't recognized.

At this point I felt I had nothing to lose, so I copied all of my original hive files back to \windows\system32\config except for the software hive, which was still the "repaired" one.

I can now boot into XP normally and most of my system works.  I got a SQL Server error on boot, a few programs I had previously uninstalled are showing up in my Add or Remove Programs list, but other than that, things seem okay.   My Windows Installer seems broken and reports "The Windows Installer service could not be accessed", but I'm working on that now.

I'll post the results of that fix in another article.


FreeBSD IPMI

Posted by: Brad Waite

Tagged in: Untagged 

kldload ipmi or build into kernel to have local access.

To check server event log:
ipmitool sel info

To access remote IPMI server:
-I lan -H [0.0.0.0]

To print channel info for channel 6:
ipmitool channel info 6

To print lan config on channel 7:
ipmitool lan print 7

This set the authentication types on channel 7:
ipmitool lan set 7 auth CALLBACK NONE,MD2,MD5,PASSWORD
ipmitool lan set 7 auth USER NONE,MD2,MD5,PASSWORD
ipmitool lan set 7 auth OPERATOR MD2,MD5
ipmitool lan set 7 auth ADMIN MD2,MD5

This clears out the IPMI on channel 6
ipmitool lan set 6 ipaddr 0.0.0.0
ipmitool lan set 6 netmask 255.255.255.0
ipmitool lan set 6 defgw ipaddr 0.0.0.0
ipmitool lan set 6 ipsrc static
ipmitool lan set 6 snmp public
ipmitool lan set 6 user

ipmitool lan set 7 ipaddr 10.0.0.1
ipmitool lan set 7 netmask 255.255.255.128
ipmitool lan set 7 defgw ipaddr 10.0.0.254
ipmitool lan set 7 ipsrc static
ipmitool lan set 7 snmp public
ipmitool lan set 7 user

 


FreeBSD watchdog

Posted by: Brad Waite

Tagged in: Untagged 

FreeBSD supports watchdog timers in the kernel.  If a timer is set, and not reset or disabled within the specified time, the kernel can reboot the machine.

'watchdog -t ' starts a watchdog for n seconds. Runing watchdog(8) again in again in <n seconds, resets the timer. If 'watchdog -t 0' is run, the kernel disables the watchdog.

watchdogd(8) either runs stat(2) on /etc, or a user-defined cmd (with -e), and resets the watchdog only on a zero exit code.

Examples:

"watchdog -t 90" sets a new watchdog timer for 90 seconds.

"watchdog -t 0" unsets the timer.

 

 


Capture smtp email from command line with tshark

Posted by: Brad Waite

Tagged in: Untagged 

tshark -i em0 -f"host 127.0.0.1 and port 25" -R"smtp"

mavik Thumbnails

Posted by: Brad Waite

Tagged in: Untagged 

mavik Thumbnails is a simple plugin for Joomla! that automatically creates thumbnails for any and all images in your content.  Just like any other Joomla plugin, it's simple to install and configure.  However, I struggled for hours to get it to work, particularly with MyBlog for use here on Tech Diary.  Turns out it was working exactly like it was supposed to and I didn't know it.

 Here's how to use it:

  • Install & enable mavik Thumbnails
  • Insert an image into your content using the standard Joomla! editor method.  You can upload the image in the editor or use the Media Manager.
  • Resize your image in the editor to the size you'd like like thumbnail to appear.

When you view the content, you'll see the smaller "thumbnail" image, just like it would appear without this plugin.  However, the thumbnail is now linked to the original full-sized image.  You configure whether the full-sized pic opens up in Slimbox, Highslide or a Joomla! Modal pop-up.

My struggles were two-fold:

  1. I was using my frontpage as the test
  2. I was using MyBlog entries to test

In both of these test cases, the smaller thumbnail would show up properly, but was not linked to the original image.

In the case of 1, it turns out that mavik Thumbnails is set to NOT link to the original image when the content is displayed on the frontpage.  If you view the article itself, the thumbnail link automatically appears.  In a way, this makes sense, although I would have liked a heads-up about this "feature".

For 2, I had to publish the mavik Thumbnails plugin in the Content Mambots Integration section of the MyBlog configuration page.

I think the author assumes it to be intuitive, and maybe for other people it will be, but in my case, it was an exercise in frustration.

In my searches I also found FBoxBot, which does much the same thing, but adds a little magnifying glass to the lower-right corner of the image.  If you'd like some to give the use indication they can click on the image, this one might be a better choice for you.


CSV Improved for Joomla 1.5

Posted by: Brad Waite

CSV Improved for Joomla 1.5 is the fastest and best way to quickly and easily populate your Joomla 1.5 VirtueMart store.

We're setting up several new web stores that will be selling a variety of items.  VirtueMart is the most popular e-store / shopping cart component for Joomla 1.5 and I've used it a number of times in the past.  After spending a few years fighting with osCommerce, VirtueMart is an absolute thrill to implement.

CSV Improved VM New ProductOnce VirtueMart is set up, the first challenge is entering all of the products we wish to offer for sale.  If you're running a small store with only a handful of products, doing this by hand via VirtueMart's native interface is pretty simple.  If you've got hundreds, or even thousands of products, this would be a tiresome and tedious chore.

Fortunately, a number of our distributors with whom we're working supplied us with their product listings in CSV format.  I'll explain more about this file format later, but this allows us to import an entire catalog into our new store in just a few steps using another Joomla! component called "CSV Improved".  If you read the reviews of CSV Improved on Joomla's extensions site, you'll notice two things that nearly every reviews says:

  1. CSV Improved is THE tool to do what we're attempting.
  2. CSV Improved has a HUGE learning curve.

Since none of the alternatives were appealing, I decided to dig into CSV Improved and see how hard it really is.  I download and installed the 30-day trial and then headed over to the documentation.

I've worked with hundreds of third-party add-ons for various open source programs, and I found CSV Improved's documentation to be one of the most lacking examples I've encountered.  While I'll give CSV Improved's author credit for using a wiki to document his project, the examples and tutorials aren't very straightforward and there are NO pictures.  Of course I'm well versed in the English language (which appears to be a secondary language for the author), but when explaining how something works on the computer, a picture truly is worth a thousand words.

So I figured I'd take this opportunity to make a few journal entries here on the Tech Diary chronicling my learning process with CSV Improved.   My aim is to provide simple, easy-to-follow instructions on how to get CSV Improved fully up and running.

I'm doing it here on Tech Diary for a couple of reasons.  First, the Tech Diary is a place where I can keep track of the various projects I'm working on.  If I record everything here, I'll always know where to go when I have to do it again.  Second, I'm hoping that this will be a resource for other VirtueMart and CSV Improved users that might be initially discouraged by its apparent difficulty to use.  By the end of the tutorial you'll be an expert at using CSV Improved for Joomla 1.5.