Archive for the ‘BSD’ Category.

The Utah Open Source Conference – October 7th, 8th, and 9th

Hey all,

I am going to be attending the Utah Open Source Conference and manning the BSD table for maybe part of or the majority of the time.

Here are some details:

There will probably be some BSD swag if you attend, courtesy of iXsystems and PC-BSD.

You can schedule a BSD Certification exam if you desire.

Hope all you computer geeks in Utah can attend.

If you aren’t into Open Source, then then this conference is especially for you. If you don’t know much about Open Source, then you are missing out.

If you are into Open Source, then you probably know about this conference already.

Installing and Using Postgresql on FreeBSD

Postrgesql is an excellent alternate to MySQL.

It is BSD Licensed instead of GPL, which is especially more attractive if you need to distribute the database software.  In fact, if you are reselling a product, and paying a license fee to MySQL you probably should save your company the money and move to Postgresql.  LANDesk, the company I work for, had just such an experience with our Management Gateway device.

Setting up FreeBSD

Ok, so I already have a post on this here:

How do I install FreeBSD?

Also, make sure to download ports.

What are the first commands I run after installing FreeBSD

Installing Postgresql on FreeBSD

As always, installing software on FreeBSD is simple using the ports system.

#
#
cd /usr/ports/databases/postgresql84-server
make WITH_OPTIMIZED_CFLAGS=true BATCH=yes install clean

Post-installation Setup

There a few post-installation steps.

Initialize the database

# /usr/local/etc/rc.d/postgresql initdb

Or starting with FreeBSD 8.1, you can now run this command:

# service postgresql initdb

Make any changes to the postgresql.conf

The postgresql.conf is located in /usr/local/pgsql/data.

Open the file and read through it and make any desired changes.

Common Changes

Here are two common changes.

Enabled remote connections

If the database is to be accessed by the network, then you should at least uncomment the setting #listen_addresses = 'localhost' and change it to listen_addresses = '*'.

Changing the default TCP Port

Uncomment the setting #port = 5432 and change the port number to the desired value.

Configure password authentication

  1. Change to the /usr/local/etc/pgsql/data directory.
  2. Edit the pg_hba.conf and change the default authentication method to something more secure, such as md5.
    # TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD# "local" is for Unix domain socket connections only
    local   all         all                               md5
    # IPv4 local connections:
    host    all         all         127.0.0.1/32          md5
    # IPv6 local connections:
    host    all         all         ::1/128               md5
    

Configure the postgresql server service to start on reboot

Add the string postgresql_enable="YES" to /etc/rc.conf.

# echo ‘postgresql_enable=”YES”‘ >> /etc/rc.conf

Creating a Database

To create a database, su to pgsql and run createdb.

#
$
su pgsql
createdb MyDBName

Note: Similarly, use dropdb to drop a database.

Creating a User or Role

To create a user, su to pgsql and run createuser.

#
$
su pgsql
createuser -P

Enter name of role to add: MyUserOrRoleName
Enter password for new role:
Enter it again:
Shall the new role be a superuser? (y/n) y

If you are not using password authentication, then you can exclude the -P.

Using psql client

A simple way to connect to postgresql is using the shell-based client, psql.

Connecting

To connect, use the following command.

$ psql MyDBName

MyDBName-#

You are now at the psql prompt.

Connecting as a different user

To connect, use the following command.

$ psql MyDBName MyUserOrRoleName

MyDBName-#

You are now at the psql prompt.

Changing a a User or Role Password

To change a password, use the following syntax.

MyDBName-# alter role pgsql with password ‘pw’;

Show Databases

To show database, simply type \l, (which is the lowercase letter L not the number 1) which is short hand in psql for this query:
SELECT datname FROM pg_database;

MyDBName-# \l

Show Tables

To show tables in the current database, simply type \d, which is short hand in psql for this query:
SELECT table_name FROM information_schema.tables WHERE table_schema = 'public';

MyDBName-# \d

Show Tables

To show columns of a table in the current database, simply type \d table, which is short hand in psql for this query:
SELECT column_name FROM information_schema.columns WHERE table_name ='table';

MyDBName-# \d MyTableName

Creating a Table

To create a table, use the following syntax:

MyDBName-# CREATE TABLE Users (
FirstName text,
LastName text,
DateOfBirth date
);

Inserting data into a Table

To insert data into a table, use the following syntax:

MyDBName-# CREATE TABLE Users (
UserId serial,
FirstName text,
LastName text,
DateOfBirth date
);

Ok, from here you should be able to start figuring everything out on your own.

Resources:
http://www.postgresql.org/docs/8.4/interactive/index.html


Copyright ® Rhyous.com – Linking to this page is allowed without permission and as many as ten lines of this page can be used along with this link. Any other use of this page is allowed only by permission of Rhyous.com.

FreeBSD now has the service command

So I was reading the FreeBSD 8.1 release notes today and noticed that FreeBSD added the services command.

Basically there are a lot of start up scripts in /etc/rc.d that are enabled in the /etc/rc.conf.  However, if you wanted to restart them, you always had to run /etc/rc.d/someservice start.  And if you didn’t remember the exact service syntax, you had to ls the dir.

Anyway, now with the services command, you can simple type this:

service someservice start

service someservice restart

I am familiar with this already as that is how Red Hat gets things done with their services.

If it was just /etc/rc.d scripts that this worked for, then this command doesn’t really save much typing. But it also works for installed services or services from ports. The start up scripts for services for ports are in /usr/local/etc/rc.d.

So after installing something you can use the simple service command to start it, instead of typing in the longer path.

Of course, service has other features, such as listing the start up scripts in the two directories: /etc/rc.d and /usr/local/etc/rc.d

Take a second to run man service to see all its options.

Netcraft: Most Reliable Hosting Company Sites in July 2010

Netcraft has posted the most reliable hosting companies and of the top ten, five are using FreeBSD.
Most Reliable Hosting Company Sites in July 2010

I was informed about this by an email to the FreeBSD advocacy mailing list: advocacy@freebsd.org

Seems that this is something worth pointing out to companies who ask whether to use Windows, Linux, or BSD.

FreeBSD 8.1 Released today!

So I was browsing the FreeBSD Ftp yesterday and saw that FreeBSD 8.1-Release ISOs were available, and I almost jumped the gun and announced this yesterday.

http://www.freebsd.org/news/newsflash.html#event20100723:01

How to determine if an MSI patch (.msp file) has been applied using C++?

Ok, so I need to determine if a patch has been applied to an MSI. Lets start with Enumerating the installed products and enumerating all the patches applied for each installed product.

I guess the title should be “How to enumerate installed MSI products and their applied MSP patches.”

I have to do it in C++, which is a drag because it looked like three lines of code in C#, but hey, maybe it isn’t so hard with C++ using .NET as well.

I researched on MSDN, of course.  It looks like I need to use this function: MsiGetPatchInfoEx.  However, I need to know the MSI GUID in order to use that function, so I might as well learn to use the MsiEnumProducts, MsiGetProductInfo, MsiEnumPatches to match the Product to an MSI Guid and that to a patch.

Creating the Project

  1. I created a new Project in Visual Studio to test this out. The project type I used was under C++ and is called Win32 Console application.
  2. I didn’t make any changes to the default code provided: targetver.h, stafx.h, stafx.cpp.
  3. Make sure you have the Platform SDK installed for the next step.
  4. I went to the project properties and went to Linker | Inpuut and added to Additional Dependencies the following line:
    "$(WindowsSdkDir)Lib\msi.lib"
    
  5. I wrote my code.

Learning the Code
So here is what the code I wrote in this little learning project will do:

  1. Create a list or vector to store each MSIProduct.
  2. Loop through each installed MSIs using the MsiEnumProducts function and for each installed MSI:
  3. Get MSI information using MSIProductInfo.
  4. Create an MSIProduct object using the information from MSIProductInfo and add the MSIProduct to the list or vector.
  5. Write to standard output the MSI count (as Id), the MSI name, and the MSI Guid.
  6. Create a list or vector to store each MSIPatch.
  7. Check if any patches or MSPs are applied to the MSI and for each patch:
  8. Get MSP information using MSIPatchInfoEx.
  9. Create an MSIPatch object using the information from MSIPatchInfoEx and add the MSIPatch to this list or vector.
  10. Write to standard output the MSP Guid.

Here is my code:

Run.cpp
This file does all the work and has the tmain function. It creates a list or vector of MSIProduct objects and then uses MsiEnumProducts and MsiGetProductInfo to create and add each MSIProduct to the vector.  It also loops through each of the MSIProduct‘s and find any installed patches.  It adds each patch found to the MSIProduct‘s _Patches vector.

// Run.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "windows.h"
#include "Msi.h"
#include "MSIProduct.h" // Includes MSIBase.h and MSIPatch.h as well
#include <iostream>
#include <vector>

using namespace std;

#define MYSIZE 512

int _tmain(int argc, _TCHAR* argv[])
{
	// Step 1. Create a list or vector to store each MSIProduct.
	vector<MSIProduct> *products = new vector<MSIProduct>();

	// Step 2. Loop through each installed MSIs using the MsiEnumProducts
	//            function and for each installed MSI:
	int i = 0;
	bool foundMoreApps = true;
	while (foundMoreApps)
	{
		DWORD size = MYSIZE;
		LPTSTR tmpGuid = new TCHAR[MYSIZE];
		LPTSTR tmpName = new TCHAR[MYSIZE];

		UINT ret1 = MsiEnumProducts(i, tmpGuid);
		if (ret1 > 0)
		{
			foundMoreApps = false;
			continue;
		}

		// Step 3. Get MSI information using MSIProductInfo.
		UINT ret2 = MsiGetProductInfo(tmpGuid, INSTALLPROPERTY_PRODUCTNAME, tmpName, &size);
		if (ret2 > 0)
		{
			// Todo: Handle failure
		}

		// Step 4. Create an MSIProduct object using the information from MSIProductInfo
		//            and add the MSIProduct to the list or vector.
		products->push_back(MSIProduct());
		products->at(i).SetName(tmpName);
		products->at(i).SetGuid(tmpGuid);

		// Step 5. Write to standard output the MSI count (as Id), the MSI name, and the MSI Guid.
		cout << endl;
		cout << "Id: " << i << endl;
		wcout << "Product: " << tmpName << endl;
		wcout << "Guid: " << tmpGuid << endl;
		cout << "Patches: ";

		// Step 6. Create a list or vector to store each MSIPatch.
		vector<MSIPatch> *patches = new vector<MSIPatch>();
		products->at(i).SetPatches(patches);

		// Step 7. Check if any patches or MSPs are applied to the MSI and for each patch:
		int j = 0;
		bool foundMorePatches = true;
		while (foundMorePatches)
		{
			DWORD size = MYSIZE;
			LPTSTR tmpPatchGuid = new TCHAR[MYSIZE];
			LPTSTR tmpPatchState = new TCHAR[MYSIZE];
			LPTSTR tmpPatchTransforms = new TCHAR[MYSIZE];

			UINT retPatch1 = MsiEnumPatches(tmpGuid, j, tmpPatchGuid, tmpPatchTransforms, &size);
			if (retPatch1 > 0)
			{
				cout << "(" << retPatch1 << ") :" << endl;
				foundMorePatches = false;
				continue;
			}

			// These values correspond to the constants the dwFilter parameter
			// of MsiEnumPatchesEx uses.

			// Step 8. Get MSP information using MSIPatchInfoEx.
			UINT retPatch2 = MsiGetPatchInfoEx(tmpPatchGuid, tmpGuid, NULL, MSIINSTALLCONTEXT_MACHINE, INSTALLPROPERTY_PATCHSTATE, tmpPatchState, &size);
			// Returns "1" if this patch is currently applied to the product.
			// Returns "2" if this patch is superseded by another patch.
			// Returns "4" if this patch is obsolete.
			if (retPatch2 > 0)
			{
				// Todo: Handle failure
			}

			// Step 9. Create an MSIPatch object using the information from MSIPatchInfoEx
			//            and add the MSIPatch to this list or vector.
			patches->push_back(MSIPatch());
			patches->at(j).SetPatchState(tmpPatchState);
			patches->at(j).SetGuid(tmpPatchGuid);
			patches->at(j).SetTransforms(tmpPatchTransforms);

			// Step 9. Write to standard output the MSP Guid.
			wcout << "\t" << "Patch Guid: " << tmpPatchGuid << endl;

			j++;
		}

		i++;
	}
}
&#91;/sourcecode&#93;

I did create some simple supporting classes for this:

<strong>MSIBase.h</strong>


#pragma once
#include "windows.h"

class MSIBase
{
  public:

	// Constructor
	MSIBase(void);

	// Destructor
	virtual ~MSIBase(void);

	// Accessor functions
	LPTSTR GetName();
	void SetName(LPTSTR inName);

	LPTSTR GetGuid();
	void SetGuid(LPTSTR inGuid);

  protected:
	LPTSTR _Guid;
	LPTSTR _Name;
};

MSIBase.cpp

#include "StdAfx.h"
#include "MSIBase.h"

MSIBase::MSIBase(void)
{
}

MSIBase::~MSIBase(void)
{
}

// Accessor functions
LPTSTR  MSIBase::GetName()
{
	return _Name;
}

void MSIBase::SetName(LPTSTR inName)
{
	_Name = inName;
}

LPTSTR  MSIBase::GetGuid()
{
	return _Guid;
}

void MSIBase::SetGuid(LPTSTR inGuid)
{
	_Guid = inGuid;
}

MSIProduct.h

#include "MSIBase.h"
#include "MSIPatch.h"
#include <vector>

#pragma once
class MSIProduct : public MSIBase
{
public:
	MSIProduct(void);
	~MSIProduct(void);

	std::vector<MSIPatch> GetPatches();
	void SetPatches(std::vector<MSIPatch> * inPatches);
	void AddPatch(MSIPatch inPatch);

protected:
	std::vector<MSIPatch> * _Patches;
};

MSIProduct.cpp

#include "StdAfx.h"
#include "MSIProduct.h"

MSIProduct::MSIProduct(void)
{
}

MSIProduct::~MSIProduct(void)
{
	delete _Patches;
}

std::vector<MSIPatch> MSIProduct::GetPatches()
{
	return * _Patches;
}

void MSIProduct::SetPatches(std::vector<MSIPatch> * inPatches)
{
	_Patches = inPatches;
}

void MSIProduct::AddPatch(MSIPatch inPatch)
{
	_Patches->push_back(inPatch);
}

MSIPatch.h

#pragma once
#include "MSIBase.h"

class MSIPatch : public MSIBase
{
public:
	MSIPatch(void);
	~MSIPatch(void);

	LPTSTR GetTransforms();
	void SetTransforms(LPTSTR inTransforms);
	int GetPatchState();
	void SetPatchState(int inPatchState);
	void SetPatchState(LPTSTR inPatchState);

protected:
	LPTSTR _Transforms;
	int _PatchState;
};

MSIPatch.cpp

#include "StdAfx.h"
#include "MSIPatch.h"

MSIPatch::MSIPatch(void)
{
}

MSIPatch::~MSIPatch(void)
{
}

LPTSTR  MSIPatch::GetTransforms()
{
	return _Transforms;
}

void MSIPatch::SetTransforms(LPTSTR inTransforms)
{
	_Transforms = inTransforms;
}

int  MSIPatch::GetPatchState()
{
	return _PatchState;
}

void MSIPatch::SetPatchState(int inPatchState)
{
	_PatchState = inPatchState;

}

void MSIPatch::SetPatchState(LPTSTR inPatchState)
{
	_PatchState = _wtoi(inPatchState);
}

Sorry, I am not explaining in more detail, my time is limited.

Note: I found one problem where an application has a ™ in the name. (Skype™ 4.2) and the output doesn’t work well after that.


Copyright ® Rhyous.com – Linking to this article is allowed without permission and as many as ten lines of this article can be used along with this link. Any other use of this article is allowed only by permission of Rhyous.com.

Connecting to Active Directory with Kerberos on FreeBSD

So, I am trying to get Active Directory integration with FreeBSD and I have been researching this for a while as I have stated.
http://rhyous.com/2010/01/13/researching-the-process-for-integrating-freebsd-with-active-directory

I don’t have it all integrated yet. I keep running into road blocks.

First, I want to be able to do integration with Kerberos alone.

One part that is really easy is connecting to active directory with kerberos.

Step 1 – Collect Active Directory information.

Active Directory Domain LD.LAB
AD Domain Controller vmdc.ld.lab
Domain Admin user name administrator
Domain Admin password pw

Step 2 – Create the /etc/krb5.conf

Here is mine. Supposedly this is case sensitive, so make sure to match the case.

[libdefaults]
  clockskew = 300
  default_realm = LD.LAB

[realms]
  LD.LAB = {
    kdc = vmdc.ld.lab
    default_domain = LD.LAB
    kpasswd_server = vmdc.ld.lab
  }

[domain_realm]
  .LD.LAB = LD.LAB

Step 3 – Acquiring a ticket

  1. Use kinit and a domain user and password to acquire a certificate.# kinit administratorEnter the password when prompted.
  2. Use klist to list the kerberos tickets.

However, once I have this working, I don’t know how to change authentication using nsswitch.conf and /etc/pam.d/sshd or system to make it work.

I assumed I wouldn’t need to change nsswitch.conf and that for Step 4 I would just have to uncomment the pam_krb5.so lines in the the /etc/pam.d/sshd and /etc/pam.d/system but unfortunately, that isn’t enough.  Authentication is not working.

I can’t seem to find much documentation on pam and kerberos in FreeBSD.  I have tried to add “debug” to the lines in the /etc/pam.d/sshd and /etc/pam.d/system but if that is adding more logging then I am not seeing it.

BSD Magazine releases its May 2010 Issue.

Hello all,

BSDMag just released the may issue. Get it here.

http://bsdmag.org/magazine/1067-embedded-bsd

fdisk failure re-installing PCBSD 8

Ok, so I have an IBM T40 and I am installed PC-BSD 8.  Then for fun, I downloaded a more recent snapshot (PCBSD 8-Stable) and installed that.

However, woe is me, I ran into this FreeBSD bug: 131087. This prevents me from using my Wireless, which on a laptop is a show stopper.

So I got out the release version of the PCBSD 8 installer and tried to install again, however, now it fails.

Here is the log:

Running: find-update-parts
kern.geom.debugflags: 0 -> 16
Cleaning up ad0
Running: dd if=/dev/zero of=/dev/ad0 count=2048
2048+0 records in
2048+0 records out
1048576 bytes transferred in 0.391058 secs (2681383 bytes/sec)
Running fdisk on ad0
Running: fdisk -I /dev/ad0
fdisk: invalid fdisk partition table found
fdisk: Class not found
******* Working on device /dev/ad0 *******
ERROR: The slice ad0s1 doesn't exist! FDISK Failure
Running: umount /cdmnt-install
umount: /cdmnt-install: statfs: No such file or directory
umount: /cdmnt-install: unknown file system

So obviously something is broke with the partition table.  I am not sure if this can be duplicated but it sure is annoying.
So how do I fix this?  Well, right now I decided to use dd to wipe my drive.

dd if=/dev/zero of=/dev/ad0 bs=4096k

That took something more than an hour and then I reinstalled an all worked fine.

Anyway, I wonder if there is a bug with the installer that caused this or if this is a result of the multiple crashes that occurred due to the iwi bug that causes kernel panic.

PCBSD 8 on an IBM T40

Hello all,

I thought I would share my experiences of using PCBSD 8 on an IBM T40.  I am going to put the information in separate headings, and I am going to document who is responsible for the feature I am talking about by prefacing each line with the responsible party.  If it is a positive experience, the responsible party will be in Green.  If it is a negative experience the responsible party will be in Red.

I am probably going to reinstall and do all this over again with the “snapshot” version and look for any improvements and try to submit any bugs/suggestions to Kris and his team.

IBM T40 Hardware Specs

Intel Pentium M
ATI Radeon Mobility M7 LQ (Mobility Radeon 7500 (fdds)
Intel PRO/Wireless 2200BG
Realtek AC97 Audio
Intel 82801DB PRO/100 VE Network Connection
UltraATA/100 EIDE Controller
34 GB 5400 RPM drive

Installation of PCBSD

9:20 AM started boot process
9:25 AM Finished configuring and clicked “Install”
9:37 AM 47% finished
Sorry, I was pulled away for an hour so I don’t know how long hte install took. I did find an install log, but unfortunately it had no date stamps. I rebooted before I realized that the log file itself might have had a timestamp.

PCBSD: So I don’t know how long the install took but it felt too long. I wonder if there are some tricks that can be done to speed this up.  For example, the install could use an image. It could lay down the image, then extend the last partition to fill the drive, and then modify the key files after the image is laid down, add any packages not included in the image.

Boot options

PCBSD: Adding the “Run X in Vesa mode” as item 6 is pretty cool.
PCBSD: Adding the “Run the Display setup wizard” is nice, so you can try to use a different video card post setup.
PCBSD: Single user mode and other boot options normal to FreeBSD still exist.
PCBSD: Splash screen works (this is an x86 box)
PCBSD: The bootup takes too long, there should be some ways to speed it up.

FreeBSD: I like to have a shorter delay when booting. 10 seconds is too long for me. So I added this to /boot/loader.conf

# Boot Options
autoboot_delay=”3″

Post-install Setup

Update: So I reinstalled because I tried a PC-BSD 8-stable snapshot, but ran into a FreeBSD bug, so I returned to PCBSD 8 release.  On Reinstall, the ATI-3D-Enabled drivers worked, so I am editing this to say so.  I am not sure why they didn’t appear to work the first time.  Maybe because I had tried the Radeon settings first, I don’t know.

PCBSD: On first boot, there was a great interface for configuring Xorg.

PCBSD: This has a Radeon card, but there was no option for Radeon, just ATI or Radeonhd and neither worked really.

  • Tried Radeonhd drivers – both normal and 3D failed to launch Xorg.
  • Tried ATI drivers – both worked but I used the one that enabled 3D features.

Note: I found another solution that added 3D features I wanted. See the Xorg and KDE4 Features section.

Networking

FreeBSD: Wired networking worked using DHCP without me having to do anything.
FreeBSD: Unplugging the wired network and plugging into a different subnet does not automatically cause dhclient to run again.  So in order to get new IP settings, I had to run /etc/netstart as root.  It didn’t work the first time either, I had to run it again.
PCBSD/KDE4: I couldn’t easily find a network tool to configure WIFI. I finally found it under System Settings.
PCBSD/KDE4: Once I did find the Newtork Configuration tool, it was easy to use and I connected to my WPA2 secured wireless network using a D-Link DIR-615 router.  It worked very well and I downloaded a lot with no hiccups.

Sleep/Resume

FreeBSD/ACPI: Put machine to sleep. Worked fine.
FreeBSD/ACPI/moused:
Woke machine up. No mouse. Had to use Ctrl + Alt + F1 to get a command prompt and fix this by restarting the moused daemon.

Note: Added this line before exit 0 in the /etc/rc.resume. This doesn’t resolve the bug, but restarts the mouse so it works, which is a workaround, but workable none-the-less.

/etc/rc.d/moused/restart

PCBSD/FreeBSD: Closing the lid does not put the machine to sleep.

Note: I fixed this by added this line to the /etc/sysctl.conf

hw.acpi.lid_switch_state=S3

After making the above settings, you can run this command to change it in the current booted system so you don’t have to reboot.  But the setting in /etc/sysctl.conf is what makes this persist on reboot.

sysctl -w hw.acpi.lid_switch_state=S3

Random Usability Notes

PCBSD: Ports Console is easily confused with a regular console as Icon Text is not always looked at, I recommend a different icon and naming it Ports Jail. I created this for myself.

KDE4/PCBSD: The fonts were a little off for the four default icons vs the background…but this only seems to be an issue with dark backgrounds.
Shutdown and Reboot works as a regular user by default.
KDE4: After selecting Reboot or Shutdown, there is a hesitation before the shutdown/reboot popup, so I sometimes double click. I don’t like how the shutdown/reboot popup just disappears if a second click occurs with the mouse anywhere but on the shutdown/reboot popup.

Web Usability

Firefox/Flash/FreeBSD: YouTube – Went online and clicked on one of the first videos and it played.

Xorg & KDE4 Features

Update: Do to a reinstall, I noticed that choosing ATI 3D actually worked an enabled 3D features.  I will check on the settings below to see whey they set.
Even though I had a Radeon, only the ATI or ATI 3D drivers worked. The RadeonHd drivers did not work.  Probably because it is an old Radeon and not a new RadeonHd.

Note: I got the Radeon driver to work myself by using the xorg.conf from the ati3d settting and changing the “Device” section to use the settings below. I didn’t make these up on my own, I found them here: http://userweb.cs.utexas.edu/~walter/geek/linux-t40.html#video

Section "Device"
	Identifier	"ATI Radeon"
	Driver	"radeon"
	Option	"DynamicClocks" "on"
	Option	"AGPMode" "4"
	Option	"RenderAccel" "on"
	Option	"EnablePageFlip" "on"
	Option	"BIOSHotkeys" "on"
	BusID	"PCI:1:0:0"
EndSection

After doing this, I got much better settings as described below:

Xorg/KDE4: Konsole supports transparency when using ATI 3D.
Xorg/KDE4/3D: Moving the cursor to the top of the screen will do a cool screen where it shows your configured screen in a line from left to right (four by default though I always change to 3).
Xorg/KDE4/3D: Moving the cursor to the top right corner of the screen will do a cool screen where it shows your configured screens in a 3D object (cube or pyramid).

Ctrl + Alt + Backspace is disabled

Ctrl + Alt + F1 does display the terminal sessions and then:

Alt + F2, F3, F4, …, F8 will all take you to one of the open console terminal sessions.
Alt + F9 returns you to your Xorg seesion

KDE4/PCBSD: Alt + F1 does NOT open the start bar. Right-clicking on the Fireball and choosing Application Launcher settings shows no shortcut, so you can configure it if desired. When I install KDE4 the default is Alt + F1, not None, so I assume this is something PCBSD changed.

KDE4: After selecting Reboot or Shutdown, I don’t like how the reboot option or shutdown option just disappears if I click with the mouse on the desktop.

Software Installation

PCBSD: PBIs make installing software fairly easy.
PCBSD: There are not enough PBIs.
PCBSD: The size of PBIs are HUGE, which is by design, they include every library they need to run, but by design or not, they are huge.
PCBSD: I installed Firefox and Open Office and Pidgin post install because there are updated version to those on disk anyway.

KDE4/Firefox: Firefox prompts every single time I open it to be the default browser. Saying yes appears to do nothing. I manually went to KDE4’s System Settings and change the default application for the web browser to be /Programs/bin/firefox3.sh and this issue stopped.

PCBSD: K3b installed perfected first try.

External Media

PCBSD: K3b burnt a DVD (the latest PC-BSD snapshot) without having to perform any tweak, and for those who know how many tweaks are required when using just FreeBSD and not PC-BSD, you know why this is awesome.

Weirdnesses

Every boot when loading KDE4, the following error displays: The profile “” has been selected but it does not exist.

I plan to update this from time to time with my experiences, so this post is in no way final.

PC-BSD's Ports Console in a jail is cool, but I keep clicking when I want a normal console!

Hello all,

PC-BSD’s Ports Console in a jail is cool, but I keep clicking when I want a normal console!

So today, I got fed up and I drew a new Icon for it:

I then renamed it from Ports Console to Ports Jail.

I’ll never make this mistake again and I think I will suggest this idea on the PC-BSD forums.

Oops!

This didn’t exactly work as expected.  Sure, I never confuse the Icon on the desktop anymore, or in the KDE Menu, but now I have a different problem.  If I open the Jail first, then open the regular Konsole, the icon for the running Konsole and Jail apps in the task bar are both Jail icons. The same in reverse.  If I open Konsole, then open the Jail, the icons for the running Konsole and Jail apps in the task bar are both Konsole icons.

I can’t seem to make this work how I want.

Yep…I now install FreeBSD with PCBSD's Installer

So today, I need to install FreeBSD clean in a VM for testing. I thought, I am going to use the PCBSD 8 install disk because it is faster.

I am sorry, but I am a Sysinstall hater.

Thanks PC-BSD for the much faster installer.

Why Bugzilla fails to authenticate a local user when LDAP integration is failing?

Problem

Authentication fails with the following error even when not using an LDAP user:

Failed to bind to the LDAP server. The error message was: 80090308: LdapErr: DSID-0C090334, comment: AcceptSecurityContext error, data 52e, vece�

To me this is a straight up bug.  I am not sure if it is reported.

Cause

Bugzilla will not even try authenticate a local user using another authentication method when LDAP integration is both list first and failing. If LDAP is the first option in the authentication methods, then if the credentials are invalid, it just stops the entire authentication process and returns this error:

Business/Impact

Low.  While this could disallow all logins to the bugzilla web page, including administrator logins.  A server administrator can make a manual change to one of configuration text files.

Resolution

Authentication is configured to use LDAP then DB.  It needs to be reversed, where it tries DB then LDAP.

There is a setting called user_verify_class in Bugzilla that allows you to select the different authentication methods you want to use.  There are two places to access this:

  1. Through the web administration
  2. Through the bugzilla/data/params file

Through Web Administration

Log in as an administrator and go to Administration | Parameters | User Authentication.

Then look for the user_verify_class setting.

Click on DB and click to move it up to the top of the list.

Through the bugzilla/data/params file

Using a text editor, open the params file located under the bugzilla website and under the data folder.

Look for the following line to configure this manually in text:

‘user_verify_class’ => ‘LDAP,DB’,

Change it to:

‘user_verify_class’ => ‘DB,LDAP’,

The user_verify_class setting

This setting allows for enabling and disabling authentication as well as providing the order for enabled authentication methods.

By default only DB is enabled.  But it can be configured so that both DB, and LDAP are enabled and they can be ordered so either is first.  However, LDAP should NOT be first.  The following setting should be used.

‘LDAP,DB’,

How to use relative paths when debugging in Visual Studio 2008?

Hello everyone,

I have a project one computer in the My Documents folder. When I copy it to another user computer (under their My Documents directory) I want it to work with no tweaking.

Do Macros work? No.

My build process uses build events to copy files to an Install directory and since build events uses macros so it works perfectly. I want to use these same Macros in either or both of two debugging options:

  • Start external program
  • Working directory

So I attempt to use the same Macros:

Start external program: $(SolutionDir)\Install\Program.exe

This fails with the following error:

Working Directory:
The working directory you entered does not exist.  Please enter a valid working directory.

Same failure pretty much if I try to use a macro int he Working directory text field.

Well, that is a let down.

Do Environment Variables Work? No.

So I tried to use environment variables. They didn’t work either.

Start external program:    “%USERPROFILE%\My Documents\My Project\Install\Program.exe”

That wasn’t a good solution anyway, cause I want it to work whether copied to a Desktop or a D: drive or whatever.

What can I do?

Well, I loaded up Process Monitor for Sysinterals Suite and checked where we look. I configured it to just look for the executable.

Start external program:    Program.exe

Turns out we check for the executable relative to either of two paths:

  • In the YourProjectDir\bin\debug\Program.exe (or if you are doing a release build, YourProjectDir\bin\release\Program.exe)
  • The current working directory for Visual Studio 2008’s devenv.exe process.
    • Ok, so if Visual Studio 2008 was launched by double-clicking the the solution file, the working directory is the directory the solution file is in.
    • If you open Visual Studio using the Start | All Programs | Microsoft Visual Studio 2008 | Launch Microsoft Visual Studio 2008 shortcut, then the working directory is “C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\” (or the equivalent 32 bit path).

Ok, so it will check relative to the Project directory without putting in a macro if I open Visual Studio by double-clicking the the solution file. I can work with that.

So if I have an Install directory that contains the Program.exe and if I open Visual Studio by double-clicking the the solution file, I can put this in the Start external program:

Start external program:    Install\Program.exe

I left the Working directory blank.

It worked!

To bad if I ever forget to open by double-clicking the the solution file, and I instead use the shortcut it doesn’t work.  But no biggie, I can close and re-open correctly.

What else did I try?

I thought that if I added a relative path, it would check there.  So I should be able to put something like this:

Start external program:   Program.exe
Working Directory:    Install

But the relative path doesn’t work the same way.  Anything put there is only relative to YourProjectDir\bin\debug (or if you are doing a release build, YourProjectDir\bin\release), so this didn’t work.

I tried to use environment variables, but they didn’t work either.

I tried Macros, they didn’t work either.

I tried this:

Start external program:   Program.exe
Working Directory:    ..\..\..\Install

Nope, that didn’t work.

So what is the working directory when debugging/running from Visual Studio 2008?

I loaded up a project with an Install directory and debugging set to run the executable from the install directory.  I added this line to the program and put a break point on it:

string workingDirectory = Directory.GetCurrentDirectory();

The working directory appears to remain this:

YourProjectDir\bin\debug\ (or if you are doing a release build, YourProjectDir\bin\release\)

Oh well.

In a few weeks I am going to try Visual Studio 2010 and I will have to check if they improved this.

K-3D 8 Released!

Hey all,

For those of you who want to work with 3D drawing and animation and can’t afford to buy one of the expensive 3D programs, K-3D is 8 just released.

Get it here:
http://www.k-3d.org/downloads