Compiling Exim and MySQL on a (CentOS) 64 bit Environment
Hey there!
I was recently trying to compile Exim with MySQL support on a CentOS 5.x 64 bit system. However, I had my dear share of trouble when it came to adjust the Local/Makefile for the 64 bit architecture.
The following error was what I got stuck on:
... gcc dkim-exim.c awk '{ print ($1+1) }' cnumber.h > cnumber.temp rm -f cnumber.h; mv cnumber.temp cnumber.h gcc version.c rm -f exim gcc -o exim /usr/bin/ld: cannot find -lmysqlclient collect2: ld returned 1 exit status make[1]: *** [exim] Error 1 make[1]: Leaving directory `/root/incoming/exim-4.69/build-Linux-x86_64' make: *** [go] Error 2
Turns out it was easier to solve than I thought. The point was that it was looking for 32 bit libraries where it should have been looking for 64 bit ones. I adjusted the following lines in Local/Makefile:
LOOKUP_INCLUDE=-I /usr/include/mysql LOOKUP_LIBS=-L/usr/lib/mysql -lmysqlclient -lz -lm
to say this:
LOOKUP_INCLUDE=-I /usr/include/mysql LOOKUP_LIBS=-L/usr/lib64/mysql -lmysqlclient -lz -lm
And - hurray! - it works 🙂
Be careful though, it seems to need the /mysql after /usr/lib64.
Firefox Lags + Sysinternals
Hey!
I've recently found out about a majorly annoying phenomenon that can be experienced if you launch a performance-hungry application through Firefox, mostly through downloading a file and opening it directly from Firefox.
Why?
Speaking in terms of process trees, firefox.exe is the root process (or parent process) of the child process, say for example Azureus / Vuze. Vuze is known to be rather performance demanding and when it needs resources, it will take them not only from the system itself, but also noticably from the parent process. I don't know if it's common behavior, but usually that shows in Firefox experiencing the occasional couple-of-seconds lags.
The solution? Close Firefox and restart it. That way, all its child processes are raised to the same level firefox.exe was on and you can now browse without any more lags disturbing your streaming videos or anything else 🙂
I realized this when I was running Process Explorer by Sysinternals (a company that creates awesome tools for Windows. In fact so awesome they ended up being bought by Microsoft :D). It's a great tool to see not only Process IDs, CPU usage, RAM usage and executable names, you can also see dependencies (parent/child processes), CPU time, threads, etc. As a very nice feature it can also show little diagrams of resource usage (CPU and I/O ops) as task icons in your task bar next to the system clock! So much better than the built-in task manager! 🙂
Also check out the other tools by Sysinternals. I use Process Explorer and Process Monitor.
How To: Migrate an Existing Windows System to Another Hard Drive Using Acronis TrueImage
Hi!
Because of a new hard drive I bought a week ago I decided to transfer my existing system, running on a 250 GB hard drive, to my new 1 TB one. I was lucky enough to at least have made some experiences with migrating an existing system to a Virtual Machine in conjunction with Acronis TrueImage Home 2009 before, so that's what came in handy for me.
What you need
- Backup software like Acronis TrueImage Home 2009
- BartPE with Acronis TrueImage Plug-In / bootable version of your backup software
- Windows installation disc (preferably the same Windows version as your current system)
- New system hard drive which is either empty or ready to be re-formatted (backup your important data on it!)
Procedure
- Start Acronis TrueImage Home 2009 and make a backup of your system partition.
- Save the backup to a partition / hard drive that you will have access to later on while using the bootable backup restorer. This means: No (TrueCrypt-)encrypted partition. Ideally it would fit on a disc or USB stick (which my didn't with a size of 7 GB). Just make sure you will be able to access it later on. I know BartPE is able to access all hard drives (without encryption at least) and should give you access to a USB drive as well, as long as you have it connected while it's booting up. If you don't want to move it over to a USB drive or DVD or anything else, there is also a nice little trick at the end of this howto: (*).
- Shut down your computer and make sure your new system drive is connected as the first device to avoid improper device numbering. This means using the first connector for SATA/IDE or whatever. If you are using both SATA and IDE, I don't know how that's handled. I'm just assuming you somehow have figured it out 🙂
- Boot from your Windows installation disc.
- If you haven't done it previously under Windows, partition the new system drive properly. That means to have the partitions created in the correct order. If you haven't (or aren't sure any more), delete them and do it over again just to make it right. Maybe the order is not necessary, but I had a lot of trouble with that before, so I'm just playing safe.
- Install Windows as usual to the point when you've started up your brand new Windows installation for the first time and are watching the Start Menu in awe.
- Boot from your bootable backup software (or BartPE with the plugin) and fire it up.
- Restore the image. Don't select MBR / Track 0, however, because we just created a proper MBR (Master Boot Record) by installing Windows.
- That's it! You should be done. Now a reboot should provide you with your old system on a new hard drive. Congratulations 🙂
I don't guarantee anything, and I admit to having tried several methods for half a day till I got it right 🙂 This should work fine though, because it basically is what I did the time when it finally worked.
If you have partitions with programs on it that would be started on bootup, make sure you copy it (file by file) before you start your system on the new hard drive.
While you could do that by connecting your old system drive and booting from that, then copying the files over, you could also do it beforehand by using the Windows Disk Management tool to erase all partitions and partition it properly before the Windows installation. This allows you to format the specific partitions and copy the files over to it while you're still on your old system. (*) Also, you can add the backup image onto that partition, so you don't have to burn a DVD or move the image over to a USB stick or ... (you get the point). However, if you create and format the partitions on your old system, make sure to
- (naturally) not touch them during the Windows installation progress or your data on them will be inaccessible
- rename your partitions properly after booting up your new system because your old Windows already assigned them (probably different) drive letters. You can do that in the Windows Disk Management tool as well.
I hope I didn't forget anything. If I did, I'll be sure to add it later on 🙂
Thanks for reading and good luck!
How To Migrate Your Live Windows System To VirtualBox
Hey!
Ever regret that Sun didn't include something like a migration assistant for your live Windows system in VirtualBox?
My method concentrates on these basic steps:
- Create a backup of your whole system partition
- Create a new VirtualBox Hard Disk
- Install Windows onto the VirtualBox Hard Disk to create a function MBR (Master Boot Record)
- Apply the backup onto your VirtualBox Hard Disk
Done!
What you need:
- Sun VirtualBox
- Acronis TrueImage Home 2009 (or an equivalent backup program)
- File-to-ISO converter (like a CD/DVD burning program, e.g. Ahead Nero or Alcohol 120%)
- The Windows installation disc
Process:
- Start Acronis TrueImage and create a backup of your whole system partition. For version 2009 doesn't mean System State but My Computer => Disk 1 => C:. Leave Back up sector-by-sector unchecked. Adjust the other settings to your liking and start the backup process.
- Go to Tools => Create Bootable Rescue Media and create the image as an ISO file.
- Use your File-to-ISO converter or burning software to convert your .tbi backup file to an ISO that you will be able to mount it as a CD/DVD later on. (Reason being that I had problems selecting the right partition to be replaced by the backup when I had two partitions mounted to the virtual machine - the other one included the backup file. Also you won't be able to install the Guest Additions, so you can't mount folders over the VirtualBox shared folders.)
- Start VirtualBox and create a new Machine. Choose your current OS and name it as you like.
- During the process create a new Boot Hard Disk and give it the same size as your current system partition (maybe less if you know the size will be enough).
- Adjust the settings of your new machine and start it.
- Mount the Windows installation disc and install Windows. This is so that a proper MBR (Master Boot Record) is created because we will need one in order to boot from the final system.
- After the Windows installation (as soon as you see the Windows Start Menu and stuff), mount the Acronis Bootable Rescue Media ISO as a CD/DVD and boot from it.
- Select Acronis True Image Home (Full Version) and you'll see the TrueImage program like you did in Windows.
- Dismount the current CD/DVD image.
- Mount your the ISO with your backup file.
- Click on Manage and Restore => Browse for backup... and open the CD/DVD Drive which should have the backup image file right there. If it doesn't, try unmounting and remounting it again.
- Right-click on the backup in the list and select Restore.
- Select the hard disk (partition) you just created and continue. Make sure that the Restore MBR (Master Boot Recover) / Track 0 checkbox is unchecked.
- Let it run through.
- Now reboot your machine.
- Congratulations! You should have a working copy of your live system in VirtualBox!
I guess there are a couple of kinks here and there because I didn't actually do it like that (I installed Windows on the virtual machine before I attempted to restore via Acronis Bootable Rescue Media ... yeah, silly me 😀 ) and it was about 3 days ago, so I'm writing off the top of my head.
Please give me feedback if it worked! (And also if it didn't!) 🙂
In the case of Windows XP (and probably Vista and 7) because of the major change of hardware (actual drivers replaced by virtual drivers) you will be required to re-activate your Windows copy. XP gives you a maximum of 3 days for that.
Just thought I'd mention it for clarity's sake 🙂
Good luck and have fun!
Compiling PHP 5 with IMAP support on SuSE / openSUSE Linux
If you get the following configure error:
configure: error: utf8_mime2text() has old signature, but U8T_CANONICAL is present. This should not happen. Check config.log for additional information.
It's probably because you're missing either the libc-client-devel package or imap-lib and imap-devel. Fire up yast and install those. You should be good to go now 🙂
(I have openSUSE 11.0 and it doesn't have the libc-client-devel package, but I read about it on another page and thought I'd add it, just to be safe 🙂 )
Asus P5B and the broken JMicron SATA/PATA controller
Hey there!
Yesterday, while I was trying out my new hard drive, I noticed that it apparently took ages to defragment. Not only that, but it also took away a major amount of resources. Funnily enough, the CPU usage didn't show up at all in the task manager (I'm using Windows XP x64 Professional). However, the mouse cursor was lagging behind and whenever I played audio or video - be it a YouTube video or an actual video in VLC - it lagged there as well.
So what could it be?
(Skip to the bottom to see the conclusion 🙂 )
My first guess was that there was a hardware failure. Probably with the new hard drive because my others all worked, right? Technically it was unlike for my new hard drive to be damaged though as I formatted it the day before (with TrueCrypt) and it showed around 90 MB/s of formatting speed.
After a series of rebooting and benchmarking via HD Tune (also in Windows Safe Mode) I realized that at the start (basically the first time after a bootup) the hard drive worked fine with an average of about a 100 MB/s transfer rate. However, at around 60%+ it sunk drastically to a minimum of 1.4 and a maximum of 1.5 MB/s. It stayed there till the end of the benchmark and for every following one (until you rebooted).
Next thing I did was to change the BIOS settings for the JMicron SATA/PATA Controller from Enabled / IDE to Enabled / AHCI. After the Windows bootup it recognized a new Primary IDE channel, Secondary IDE channel, Standard Dual Channel PCI IDE Controller and one of my two optical drives (why only one? Don't ask me :D). The hard drive didn't show up at all - neither in the Disk Management nor in the Device Manager. A change from Enabled / AHCI to Enabled / RAID (with "no raid" in the JMicron settings) did the same thing: recognition of new channels and no new hard drive.
For reference - this is what a healthy drive usually looks like:
When I looked that the Device Manager I found that there were two SATA controllers in the IDE ATA/ATAPI controllers category. One was the Intel(R) ICH8 2 port Serial ATA Storage Controller - 2825 and the other one was the Intel(R) ICH8 4 port Serial ATA Storage Controller - 2820. My main / old hard drives are all hooked to the 4 SATA ports on the lower half of the P5B, some of them using an eSATA to SATA cable. So that had to be the 4 port SATA controller, which worked fine. Thus, the 2 port controller was the one controlling the eSATA port in the back pane - and making trouble.
The moral of the story is that obviously the JMicron SATA/PATA Controller doesn't do his job on the ASUS P5B at all. So, in case you're looking for more SATA ports, you're going to have to buy a new SATA controller.
I myself will be settling with SATA and eSATA for my biggest drives and using USB for my smallest one.
Cheers 🙂