Category: Computer

Mar 14 2010

Triple Booting Windows 7, OS X (Chameleon), and Ubuntu 9.10 (Grub2)

So wouldn’t you know it, my video card died and I decided to get around to installing Windows 7 and Ubuntu 9.10 at the same time.  Of course, installing Windows 7 took over the booter, then installing Ubuntu 9.10 took over the booter and did a great job at identifying Windows 7 and OS X.  In fact, it did too good identifying OS X.

The new version of grub2 is able to work directly with OS X to start it up natively.  Unfortunately,  I like to try to not patch OS X as much as possibly, so I use Chameleon, which grub2 was bypassing.  I don’t know what a beautiful solution is, but I do know what a working solution is.

OS with Loaders:

  • Windows 7 (Default Boot Loader)
  • Ubuntu 9.10 (Grub2)
  • OS X 10.5.6 (Chameleon 2.0-RC4)

The first step is to install OS X however you usually do it.  Once it is installed, I chose to upgrade to the latest version of Chameleon for some of the additional video card identification that it was able to provide.  All that requires is downloading from the link above and following the directions.  Before you reboot, copy the boot0 file to removable media.

The next step is to install Windows 7.  Once this is done, Windows has now taken over the boot system and you can no longer start OS X.

Finally, it is time to install Ubuntu 9.10.   Once the install has finished, it has taken over the boot screen and you will see entries for Ubuntu, Windows, and OS X.  The only issue is, if you try to start OS X, it will bypass Chameleon and start the kernel directly.

To fix this issue, make the directory /boot/chameleon and then copy the boot0 from the removable media into that directory.  Then add or update the OS X section to the following:

menuentry “Mac OS X Chameleon (on /dev/sda2)” {
insmod hfsplus
set root=(hd0,2)
search –no-floppy –fs-uuid –set 88e76bb6d81f12fb
parttool (hd0,2) boot+
chainloader (hd0,4)/boot/chameleon/boot0
}

The “88e76bb6d81f12fb” is the uuid of the partition. You can find the uuid by:

# user@teh-lunix:~$ ls -l /dev/disk/by-uuid/

Jan 08 2009

OS X and Truemobile 1940 Issues Fixed

I currently picked up a $21 Dell Truemobile 1490 wireless card to put in my MSI Wind instead of the Realtek that’s in it. It install just fine, I got it working in Windows and Linux with no issues, but OS X was another story.

It wouldn’t connect to a wireless network at all by itself. On the menu bar it wouldn’t show any wireless networks. It did show “AirPort: Not configured”. If I opened the network preferences, it would show up as Ethernet 2 off. I would have to turn it back on each time I rebooted. I would then have to select the drop down box to pick a network because it still wouldn’t show any networks in the menu bar (and the menu bar would still say not configured). I could join my network and get an IP address, but the menu bar icon would not show any bars at all. It would be right next to the access point and I could surf the net just fine though.

Thanks to a post at InsanelyMac, I was able to finally fix this issue.

  1. Open Network Preferences
  2. Remove all devices except Firewire by highlighting the device and then clicking on the minus sign below the device list
  3. Reboot the machine
  4. Open Network Preferences
  5. Click the plus sign under the device list and select AirPort
  6. Click Apply

Since doing that, my menu bar works, networks are connected to automatically, even after reboots.

Jan 28 2008

Using regex on Syslog-ng to save to specific file locations

I had the problem of taking an external syslog feed (through UDP or TCP) that came from multiple devices and then separating them into folders that identified the feeds by customers / device type / host. The one thing I had on my side was that the hostname of the devices were broken up into three parts to help me get this information.

In the old Syslog-ng (1.6.x), there was not a way to regex out this information and then use it in the destination section. Each time we had a new combination, it required writing additional lines with additional regexs. Started to really feel it on performance. With the new branch of syslog-ng (2.0.x), this feature is now available.

You can use up to 256 different $NNN ($1 … $256) macros, but you can only use one regexp expression. This will be done using a filter.

Here’s a full example of what I had done then. What I wanted to do is put the line in a specific file based on part of the hostname. For example:

Hostname: subdomain.domain.tld
Save the log files for that device at:
/logs/$TLD/$DOMAIN/$SUBDOMAIN/$R_YEAR-$R_MONTH-$R_DAY.log

WHERE $TLD is the tld of the hostname, $DOMAIN is the domain from the hostname, and $SUBDOMAIN is the subdomain from the hostname.

I would like to be able to regex this information out of the hostname to use in the destination.

To accomplish this, I was able to use this configuration:

filter f_filter { host(“^([0-9a-zA-Z\-]+)\.([0-9a-zA-Z\-]+)\.([0-9a-zA-Z\-]+)$”); };
destination f_logs { file(“/logs/$3/$2/$1/$YEAR-$MONTH-$DAY.log”); };
log {
     source(external);
     filter(f_filter);
     destination(f_logs);
     flags(final);
};

Mar 01 2007

MySQL DST Patch / Update

To update the MySQL server,  you really do not have to run a patch.  That is a common question I was getting from people was where to get the patch.  You actually have to patch the OS and then from there run a command on MySQL.  If you’re OS doesn’t use zoneinfo, there is even a fix for this without having to reinstall a newer version of MySQL.

Taken from http://dev.mysql.com/doc/refman/5.0/en/time-zone-support.html:

If your system has its own zoneinfo database (the set of files describing time zones), you should use the mysql_tzinfo_to_sql program for filling the time zone tables. Examples of such systems are Linux, FreeBSD, Sun Solaris, and Mac OS X. One likely location for these files is the /usr/share/zoneinfo directory. If your system does not have a zoneinfo database, you can use the downloadable package described later in this section.

The mysql_tzinfo_to_sql program is used to load the time zone tables. On the command line, pass the zoneinfo directory pathname to mysql_tzinfo_to_sql and send the output into the mysql program. For example:

shell> mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root mysql   

mysql_tzinfo_to_sql reads your system’s time zone files and generates SQL statements from them. mysql processes those statements to load the time zone tables.

mysql_tzinfo_to_sql also can be used to load a single time zone file or to generate leap second information:

  • To load a single time zone file tz_file that corresponds to a time zone name tz_name, invoke mysql_tzinfo_to_sql like this:

    shell> mysql_tzinfo_to_sql tz_file tz_name | mysql -u root mysql 

    With this approach, you must must execute a separate command to load the time zone file for each named zone that the server needs to know about.

  • If your time zone needs to account for leap seconds, initialize the leap second information like this, where tz_file is the name of your time zone file:

    shell> mysql_tzinfo_to_sql --leap tz_file | mysql -u root mysql 

If your system is one that has no zoneinfo database (for example, Windows or HP-UX), you can use the package of pre-built time zone tables that is available for download at the MySQL Developer Zone:

http://dev.mysql.com/downloads/timezones.html   

This time zone package contains .frm, .MYD, and .MYI files for the MyISAM time zone tables. These tables should be part of the mysql database, so you should place the files in the mysql subdirectory of your MySQL server’s data directory. The server should be stopped while you do this and restarted afterward.

Warning: Do not use the downloadable package if your system has a zoneinfo database. Use the mysql_tzinfo_to_sql utility instead. Otherwise, you may cause a difference in datetime handling between MySQL and other applications on your system.

Apr 11 2006

ATI Mobility x1400 on Linux Working … Kinda

I ran across a post in a forum on the Gentoo Forums that pointed out a VERY dirty hack to get the ATI Mobility x1400 working correctly at the correct resolutions.  I haven’t check to see if anything else is working (3D, accelleration, etc) because all I really needed was correct 2D working at 1920×1200.  I was able to get my laptop to work now with 1920×1200 resolution which just looks great.  One issue that I’m having is that when using the console, my font is fuzzy. Fuzzy meaning the pixels around the words are constantly turning on and off in some places.  This is not the console in Xorg, but the one when you hit ALT-F1 …

The only way I was able to get the ati drivers to compile correctly was to switch from using the -mm kernel branch to the standard gentoo sources branch.  I was then able to get the ati drivers to install correctly.  After that I was able to switch a driver out with one at this website.  At that point, everything worked correctly.

Since I switched kernels, my wireless card has stopped working again.  Since I want this laptop for work, which I have a wired connection at work, I’m not too worried about it.  I’ll get it working eventually, just need to spend more time getting it to work with the non -mm kernel. 

WordPress Themes