Computer


1/28/2008: 5:45 pm: JamesComputer, Linux, Solaris

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);
};

3/1/2007: 5:03 pm: JamesComputer, Programming

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.

4/11/2006: 1:45 am: JamesComputer, Linux

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. 

3/24/2006: 10:52 am: JamesComputer, Linux

So here’s the issue, I bought the Inspiron E1705 with the upgraded video card option, which was the ATI Radeon Mobility X1400.  I also got the upgraded monitor, so the resolution on the monitor is 1920×1200.  Looks great in my opinion.  The issues are that there is currently no support at all for the video card in linux.  You can use the vesa drivers, which will give you a resolution of 1600×1200, which really does get annoying seeing things stretched.  The open source radeon drivers do not work with this chipset, and for some reason ATI has not released any linux drivers for this video card.

I’m going to keep a lookout for solutions on getting this video card working at the correct resolution in linux.  If you are a linux user, I would recommend that you try to get an nVidia card instead of an ATI if at all possible.  nVidia has already released linux video drivers for it’s newest mobility chipsets.  If I had that option when I got this laptop, I would definitely taken that option.

3/23/2006: 1:27 pm: JamesComputer, Linux

Well, the Dell Inspiron E1705 I bought showed up yesterday.  Only showed up two weeks before they said it was.  No compaints on this end.  Pretty nice laptop, all in all.

I’ve already started to install Gentoo Linux on the E1705.  Been taking notes what I do along the way.  With all new hardware, this is going to take a little bit to get everything working.  At this time, I have a somewhat stable system running.  I’m still trying new things constantly, so I haven’t gotten to the point to write a good guide to follow as of yet. 

For example, I have just gotten the Intel 3945ABG wireless network card to work, but to do so I’m using the mm-sources kernel tree (linux-2.6.16-rc6-mm2).  I have gotten xorg to work using the vesa drivers, but I am having issues with the ati-drivers (not sure if they will even work at this point).  I think I might stick with this kernel though since it did end up having a lot of nice things added, card reader support and a scheduler for multi-core systems.  I think by the end of this week I’ll have a nice guide up though.  I’ll put the lspci output up now though.

There is also one more issue I might need to solve first.  When trying to install my Windows XP Professional that I had got from school, I always get a blue screen of death during the installation.  Something about the pci.sys is causing trouble.  Still looking into that issue, but it was using a Windows XP Pro installation disk that did not have any service packs.

3/19/2006: 5:38 pm: JamesComputer

Decided to get a new laptop.  I’m going to give my old one, Inspiron 6000, to my wife to use since it is a lot better and nicer than her old laptop.  One of the main reasons for the upgrade is because my laptop is the laptop that I use at work, and I really could use a larger screen with a higher resolution.  The purpose of that is so that I can see more things at once: development screen, debugger, testing screen, etc.  Really helps out.

The new laptop I’m going with is another Dell.  I know I said I would not do another Dell, but after looking everywhere for the exact laptop I wanted, Dell was the only one that offerred the screen / resolution that I wanted.  Really came close to getting an HP, but even though they had the size screen I wanted, they didn’t offer the resolution.  The new laptop is an Inspiron E1705, which I think is basically the home edition of the Inspiron 9400.  I have no idea why two different Dell departments named the same exact laptop the same.

Once I get the laptop, I will be installing Gentoo Linux on it.  This time around I plan to write the documentation on how to install it correct WHILE I’m installing.  On the Inspiron 6000, I would do it then try to remember what I did which didn’t work out well at all.  Look for that in April, since the laptop is not supposed to be delivered until then.

Here’s the specs:

Processor: Intel Core Duo T2300 (1.66 GHz / 667 MHz FSB)
Memory: 1GB, DDR2, 533MHz 2 Dimm
Monitory: 17 inch Ultra Sharp TrueLife Wide-screen WUXGA (1920 x 1200)
Video Card: ATI Mobility Radeon X1400 HyperMemory 256MB
Hard Drive: 60GB 5400 RPM SATA
Optical Drive: 8X DVD+/- RW Drive
Wireless: Intel PRO / WIreless 3945 a/g Mini Card

 

10/24/2005: 12:41 pm: JamesComputer, Linux

I decided it would be a lot easier if I just created a seperate page that I could keep updating on how to install Gentoo Linux on an Inspiron 6000.  This would make it easier on me to just update one place instead of just throwing the updates into seperate posts or going back and constantly changing that post.  Also divided the sections up and made it a little easier to follow alongside the gentoo documentation.  You can get to it from the Pages section on the side bar or the direct link is here.

9/13/2005: 10:17 am: JamesComputer, Linux

So I finally have both Windows XP Pro and Gentoo Linux installed on my laptop and running correctly.  I’m currently using bios version A08 also.  The best part yet, X is working!!!  I’m pretty excited about that.  I documentated everything I did along the way and am trying to put my notes all together for an update to my original linux installation guide.

Some points to note for now are that I still had to patch the gentoo kernel source so that the cdrom worked currectly with DMA, I’m using Xorg CVS branch where I also had to apply patches to the source also, and I’m still using the ~x86 gcc version for pentium-m optimizations.  I found a lot of good information in the forums in my original thread that helped.  Expect to see a page added soon with the update to date installation instructions. 

9/8/2005: 9:17 am: JamesComputer

Well, the need to use the Windows section of my laptop has increased to the point where I really needed to give it more hard drive room than I had planned in March.  Since I haven’t been using the laptop too much, I decided just to reinstall everything.  I had upgraded to the A08 bios right before I planned doing the Windows install.  Life is a lot nicer when you install Windows before Linux.  So I popped in my Windows XP Professional CD that I got from school last March, and wouldn’t you know it, the install GUI cannot even display with the new bios update.  With these really bad bios updates lately, I’m recommending people to stay away from the Inspiron 6000 until Dell can get their act together.  Now Windows and Linux cannot use graphical interfaces.

Update (09/09/2005):

Still have not been able to get the Windows XP Pro to install.  I even tried a Windows XP disk that is about a year older for my desktop and the same thing occurred, screen going black after the initial hardware search before the blue gui displays.  I have opened up two threads so far at the forums at dell here and here with no luck as of yet.

Finally got it to work.  I had to boot the computer up with the Gentoo boot disk and remove all the partitions on the hard drive.  Once I did that, the Windows XP Pro installed correct.  Anybody think Windows XP Pro is allergic to Linux? 

7/30/2005: 11:15 pm: JamesComputer, Linux

Well, I updated the bios from A05 to A07 on my Inspiron 6000 with some really bad results.  X has decided it’s not happy at all with the new bios.  I have even tried to use the experimental (dev) version of x along with the kernel 2.6.12 with no luck in it working yet.  This is just a warning to those.  I’m going to spend a few more hours trying to get it to work.  I might just downgrade the bios back to A05 since I wasn’t having any problems with that version.

Next Page »