Tuesday, November 20, 2007

Apt-Build for Intel Duo Core 2

I think I have an answer for what architecture option one should use with an Intel Duo Core 2 processor when installing apt-build.  From the Gentoo documentation, it looks like we should use prescott for this type of processor for 32-bit modes.  The first option about what level of optimization is more of a time versus performance question.  A strong optimization will take longer to compile and create bigger binaries.

Now I have the same benefits that Gentoo users have by running apt-build for various packages.

Check 'cat /proc/cpuinfo' to verify that you have the same cpu family and model.

Safe Cflags - Gentoo Linux Wiki
Intel Core 2 Duo/Quad / Xeon 51xx/53xx
vendor_id : GenuineIntel

cpu family : 6

model : 15

model name : Intel(R) Core(TM)2 CPU XXXX @ XXXGHz

32 bit profile (x86)


  CFLAGS="-march=prescott -O2 -pipe -fomit-frame-pointer"


64 bit profile (amd64)


  CFLAGS="-march=nocona -O2 -pipe"



* GCC 4.3 has -march=core2[1], but Gentoo has nothing above 4.2 in portage.


Monday, October 22, 2007

Ubuntu Open Week

I'm getting excited to participate in Ubuntu's Open Week on irc.  I was able to join a couple classes last release and found them to be very helpful and irc was a great way to learn.

If you have any interest in learning how to participate with an open source community, don't miss it.


Ubuntu Open Week

I'm getting excited to participate in Ubuntu's Open Week on irc.  I was able to join a couple classes last release and found them to be very helpful and irc was a great way to learn.

If you have any interest in learning how to participate with an open source community, don't miss it.


Powered by ScribeFire.

Wednesday, October 3, 2007

Ubuntu Host with Windows Guest Time Sync Problem

I've been running VMware server for 3-4 months on an Intel Duo Core 2 with Ubuntu Fiesty Fawn as my host OS. My windows guests would always run too fast and every article I could find about time sync issues only showed how to change the boot clock variable to clock=pit or clock=pmtmr under grub or lilo.

The problem and fix are different from what this vmware knowledgebase article. Clock in a Linux Guest Runs More Slowly or Quickly Than Real Time

This is the correct knowledgebase article from vmware. Host Power Management Causes Problems with Guest Timekeeping (Windows Hosts)


Quick Solution Steps

Install cpufrequtils and run cpufreq-info to get maximum frequency

Autoedification: VMware guest clock runs fast
Since my max CPU is 1.83 GHz, I added these lines to

host.cpukHz = 1830000
host.noTSC = TRUE
ptsc.noTSC = TRUE


Unfortunately, you will have to modify this file every time you run vmware-config to recompile the vmware modules for a new kernel.  I'm going to keep a copy under /etc/vmware/config.bak and run a quick 'sudo cp /etc/vmware/config{.bak,}'  after every time I need to recompile.

Friday, September 28, 2007

Slow Login Times when using My Documents Redirection

I used My Documents folder redirection in a Windows 2000 domain 5 years ago and never had any slow login errors or issues.  When I tried to implement the same type of policy on Windows XP SP2, I started seeing a minimum 20 second login time.  Especially when you refreshed the group policy.

It looks like Microsoft has identified a problem with Ntlanman.dll and created a hotfix.  It looks like they have rolled the update into Windows 2003 SP2 and may be slated to include the update in XP SP3.

To recreate the problem:
  1. Apply the group policy (gpupdate /force) and logout
  2. Login as user with My Documents redirected
  3. Log out and in again to see no login time penalty
  4. Force the application of group policy (gpupdate /force) and logout
  1. or wait a day or two for the policy to refresh on its own
  • Login as the same user and see a minimum 20-second login time penalty when you see the "Apply personal settings"

  • You may experience a 20-second delay when you try to access a redirected folder by logging on to a Windows Server 2003 Service Pack 1-based computer or to a Windows XP Service Pack 2-based computer

    Friday, September 21, 2007

    Windows XP Remote Assistance URL


    Windows Vista is not a url but a full application.

    Now if I could only figure out how to pass variables to either the application or the url.

    Thursday, September 20, 2007

    Friday, August 24, 2007

    Powershell Notes

    I'm working on a Powershell script to change the owners of every home directory to {the domain}\{the folder name}.

    Here are some notes:

    Wednesday, August 15, 2007

    Citrix to buy virtualization company XenSource for $500 million

    One day after the spectacular public offering of virtualization company VMware, Citrix Systems on Wednesday said that it intends to acquire open-source virtualization company XenSource for about $500 million.

    By acquiring XenSou

    read more | digg story

    Tuesday, August 14, 2007

    Podcasting at Universities

    The Stingy Scholar: University Podcasts, Webcasts & OCWs

    My favorite podcast by far was Richard Muller's "Physics for Future Presidents" from Berkley webcast/courses.  In the course I learned so much about the general concepts of Physics, including my favorite lectures on how nuclear reactions work and radiation poisoning.

    Here is a link to Richard A. Muller's website.

    Powered by ScribeFire.

    Thursday, August 9, 2007

    Motorola Q Registry Hacks

    I don't like to normally modify my registry for minor tweaks.  Especially on the Motorola Q because I have to reset it back to factory defaults every 3-4 months, but the Bluetooth file transfer settings don't work for me unless I modify where the files are being stored.  That way I can use the 2 gig card and not run out of room caching everything under "My Documents" and then moving it.

    Instead of:
    "Root"="\\My Documents"


    "Root"="\\Storage Card"

    I can now say that the Motorola Q works very well but only because of the modifications I use.  Make sure to install TCMP to add a media player that will remember where you left off.  I have only been able to listen to podcasts on this device because of that feature.

    Powered by ScribeFire.

    Wednesday, July 11, 2007

    User Profile Service Failed the Logon - Vista


    This is the second time that I have gotten this error on Vista.  I have already destroyed my profile and started over but it appears like this will just keep happening.

    Thursday, May 31, 2007

    Motorola Q

    I traded m Blackberry 7250 for a Motorola Q. The main reason is because we had Exchange 2003 and couldn't justify a Blackberry server for the experimental use we had in mind.

    It was much easier justifying a new phone and spend some spare time getting ActiveSync up and running. Blackberry may need to give away the server component to compete with Microsoft. The only model that makes sense is to Open Source the server and allow a community (strongly influenced by Blackberry) to support the "free" market and sell professional services for the Enterprise. Too many people use Exchange to continue trying to sell a costly proprietary solution that isn'tthat different from ActiveSync.

    Most likely an Open Source community would be able to keep up and possibly surpass Microsoft's offerings.

    Friday, March 2, 2007

    Restoring Domain into Vmware virtual environment for a Lab or Test

    Key article KB249694: How to move a Windows installation to different hardware

    The first step is to make sure that you are using the same hal.dll's. In our environment almost every server has dual processors or more. I had to shutdown the virtual environment and switch to 2 processors. After logging in as an admininstrator for 5 minutes, Windows asked me to reboot to take advantage of new hardware.

    The first machine to install is a machine with the global catalog at the highest most domain a root level. When you restore

    Next I restored C: and the System State. No big problem there, just wait it out and don't reboot!!! Wait until you replace c:\boot.ini with your backup in c:\backup. Also make sure that c:\windows\repair\boot.ini doesn't revert (only if you did this once before and have an old backup boot.ini here) Microsoft has a step for the first domain controller in a new environment in the registry but we found that the registry entry wasn't available until the next reboot.

    Reboot the restored pc.

    Basically make a backup of boot.ini into a folder like c:\backup. After restoring through ntbackup and before rebooting, replace the c:\boot.ini with c:\backup\boot.ini. Also copy c:\backup\boot.ini to c:\windows\repair\

    We have 2 domains in our forest. An empty root domain that has the highest security and a primary domain which all users use for day to day activities. We have broken up the Active Directory roles between 2 machines at each level.  We found it easier to restore the global catalog domain controller because you have the entire database to authenticate against.  The first domain controller (per domain) needs a registry edit under HKLM\System\CurrentControlSet\Services\NtFrs\Parameters\Cumulative Replica Sets\{UUID value}\BurFlags of Hex x00000D4 (212)  If you have multiple UUIDs, use the UUID value that is found under the HKLM\System\CurrentControlSet\Services\NtFrs\Parameters\Replica Sets.  We had to do this twice, once for each domain!!!  The errors that we saw when we missed the second domain were from dcdiag and netdiag about replication errors and security channel errors and domain controllers not being part of the domain they are supposed to monitor.

    Our first step was to mimic our production network environment subnet in a host only setting.

    We then installed Windows 2003 to a virtual disk. We found out the hard way that we had to be at the same level of service pack, SP1 for us. I then created a sysprep.inf answer file to speed deployment. After resealing the image, I just copied the generic template 4 times. Each time I would have to wait through a mini-setup, but it was pretty easy to work on 4 machines at the same time.

    Right after we copied the boot.ini to the right spots, we would take a snapshot. Again, this was learned the hard way; snapshots can save you lots of time!

    Our last issue is the Netlogon share under each domain controller, but since the Sysvol share was automatically enabled after replication errors went away, we are hopeful that this will also correct itself.  I think the only thing that we are missing are group policies.

    Friday, January 26, 2007

    Steps to Learning Programming

    This may sound entirely backwards, but open source software has increased my desire to program. So much so, that I am willing to learn my arch nemisis, programming.

    My desire to contribute to an open source community, has driven my desire to learn how to program. I have been using Linux for about 4 years. In that time I have re-animated my love for computers. Being a Windows administrator, I would enjoy what I was doing but at the end of the day, I wouldn't touch a computer. With Linux, I am constantly trying something new at home and at the office. However I do all this without having to know a programming language.

    I specifically didn't major in Computer Science because I didn't want to 'waste' time learning a language that could be extinct before I graduated. Somewhere around 1985 I learned the chaotic way to program BASIC and found out there were better languages out there.

    I have picked up books on how to program Javascript, Java, C++, and most recently Ruby (with an emphasis on Rails) and Python.

    I have always wanted to master a programming language but I don't have a long attention span. I have done much better by fitting software pieces together as a system. System administration has fit me very well and I believe that if I could cross over to the programming side I would be even better at it.

    I would guess that I'm not alone. The difference between programmers and system admins is probably represented somewhere between learning a programming syntax and wanting the computer to do a specific job.

    I once heard or read that programming is getting computers to do what you want. But I think more specifically, programming is the art of getting computers to do what you want. Because it seems to me that sytem administrators is the practicality of getting computers to do what you want.

    As a system administrator, I don't care how a job gets done. I'll use multiple tools together to make a complex job easier all without needing to program.

    I've gotten to a place in Rails where I feel I could program in it but haven't found any projects to use it. I still don't know the scope of rails but I learned enough to create a web server using apache with cgi and with mongrel and reverse proxies. Recently, learning ruby has been increasing my desire to start using rails.

    Because of rails, I want to learn Ruby. I have a project I'd like to do, namely recreate a more versitle version of bashpodder in Ruby. This may not be practical but I'm learning that often, duplication of projects is what programmers do to learn a language. I know what I'm looking for but know enough that I don't know enough methods to do it.

    When searching for a "How to program" article I ran across a python site. I can find way more articles on how to program in python than in ruby. Python is also a very heavily used language in Linux distributions like Ubuntu and Debian. If I learn python, a bunch of opportunities open up. Specifically, I can help with bug fixes or patch actual bugs. Even better, I can scratch my own itch.
    This is the best guide I've found so far on the Internet, written by Alan Guald. I really like the approach of viewing multiple languages at the same time.  The only problem is that I also want to compare Ruby with his writing.

    Here is what I will use as a test of my knowledge of a programming language. This is the measuring stick of saying that I'm done and can move onto the next project.

    Original forum post written by Prashant N Mhatre. (I quote forum posts on the fear that the dynamic content will disappear)
    I've working knowledge of a bunch of programming languages but job demands to learn a new language frequently in a short time. Instead of reading hundreds manual/book pages, I quickly read 10-15 pages of tutorial or primer. (As you know google is the best search engine to look for such stuff). I keep printed copy of the language syntax reference card handy. (There are many reference cards available over internet. Type in 'language to learn' + 'reference card' in google.)

    First of all, get familiar with Compiler, compiler option, editor shortcuts or integrated development environment (IDE). Start with a simple 'Hello World' program. Compile it. Use basic functionalities of debugger like setting break points, printing variable values, moving to the next or specific position, stopping debugger etc.

    To grasp basics of a new language quickly, here are the exercises I use. Remember some programs may not good for beginners.

    1. Display series of numbers (1,2,3,4, 5....etc) in an infinite loop. The program should quit if someone hits a specific key (Say ESCAPE key).

    2. Fibonacci series, swapping two variables, finding maximum/minimum among a list of numbers.

    3. Accepting series of numbers, strings from keyboard and sorting them ascending, descending order.

    4. Reynolds number is calculated using formula (D*v*rho)/mu Where D = Diameter, V= velocity, rho = density mu = viscosity
    Write a program that will accept all values in appropriate units (Don't worry about unit conversion)
    If number is < 2100, display Laminar flow,
    If it’s between 2100 and 4000 display 'Transient flow' and
    if more than '4000', display 'Turbulent Flow' (If, else, then...)

    5. Modify the above program such that it will ask for 'Do you want to calculate again (y/n),
    if you say 'y', it'll again ask the parameters. If 'n', it'll exit. (Do while loop)

    While running the program give value mu = 0. See what happens. Does it give 'DIVIDE BY ZERO' error?
    Does it give 'Segmentation fault..core dump?'. How to handle this situation. Is there something built
    in the language itself? (Exception Handling)

    6. Scientific calculator supporting addition, subtraction, multiplication, division, square-root, square, cube,
    sin, cos, tan, Factorial, inverse, modulus

    7. Printing output in different formats (say rounding up to 5 decimal places, truncating after 4 decimal places,
    padding zeros to the right and left, right and left justification)(Input output operations)

    8. Open a text file and convert it into HTML file. (File operations/Strings)

    9. Time and Date : Get system time and convert it in different formats 'DD-MON-YYYY', 'mm-dd-yyyy', 'dd/mm/yy' etc.

    10. Create files with date and time stamp appended to the name

    11. Input is HTML table, Remove all tags and put data in a comma/tab separated file.

    12. Extract uppercase words from a file, extract unique words

    13. Implement word wrapping feature (Observe how word wrap works in windows 'notepad')

    14. Adding/removing items in the beginning, middle and end of the array.

    15. Are these features supported by your language: Operator overloading, virtual functions, references, pointers etc.

    Is there something called 'namespace / package / module' supported by your language? (Name mangling) - Read More on this.

    Article written by Prashant N Mhatre.

    Dell PCIe Wireless

    Abit AirPace Wi-Fi

    I ordered a number of Optiplex 745 small form factor pc's and tried to ask for a wireless solution to go with them.  I was told that Dell recommends a USB wireless device that clips on the top of the case.

    At any rate, I ordered the PC's and already had a medical PCI video adapter that needed to be installed in the PCI slot.  That left me with a PCIe x16 slot. 

    Luckily, I was able to find a progressive company that made a PCI express (PCIe) x1 card that works with the second slot in the machines.  I don't know why there is only 1 manufacturer for the new format.  Apparently you can reuse the same driver code and need only change the hardware (http://en.wikipedia.org/wiki/PCI_Express).  Maybe this is a chicken and the egg problem.

    Dell should really offer to sell these Abit AirPace Wi-Fi cards.

    Friday, January 12, 2007

    ATI Radeon X1300 Works!

    My ATI Radeon X1300 video card (Dell Optiplex 745) now works with the newest 8.33.6 driver which came out today.

    1. Download the new ATI Driver Installer

    2. chmod +x *.run

    3. fakeroot ./*.run --buildpkg Ubuntu/edgy

    4. sudo dpkg -i *.deb

    5. sudo module-assistant auto-install fglrx

    6. sudo /etc/init.d/gdm stop

    7. sudo modprobe -r fglrx

    8. sudo depmod -a

    9. sudo /etc/init.d/gdm start

    10. fglrxinfo

    11. fgl_glxgears

    I still have a minor issue with the mtrr but it doesn't affect the 3D.