August 9th, 2009
My installation of Gentoo on my laptop was completely destroyed when I tried to make standard hibernation work. I had updated to kernel version 2.6.30 with the tuxonice-sources, but the TuxOnIce hibernation did not work for the 2.6.30-r4 ebuild for some reason.
The kernel worked fine and I was all happy, because it fixed the trouble I had with X not loading the drm module correctly. But when I was done and tried to hibernate my laptop, it refused to do so. So I decided to use the normal gentoo-sources with the normal hibernation for the moment. So I copied my settings to these sources and ran the hibernation and this worked. The next morning when I booted my OS, fsck complained that there were some error and refused the let the OS boot. It told me I needed to check the partition manually. So I did this using the Gentoo minimal installation disk and it found some things and put them in the lost+found directory. The content didn’t seem interesting so I discarded it. But the next time I had hibernated, it complained again. So I repeated the process of checking manually and told it yes to all. This was a big mistake! :@ When it was done The complete content of my root partition was gone and all that was left was a lost+found directory with thousands of files with numbers as names and some hundreds of folders with the same. They didn’t resemble the original structure at all, so there was no way of fixing the problem and I was only able to recover some important files. But most of the files, including some important files were untraceable. To bad my back-up was over a week old :s
Because I was in a hurry, I decided to install Ubuntu for now. Lets see how long I will stick with it…
For know it showed me Gnome can be quite usefull and is low on resources. (After killing and stopping the necessary unneeded services/processes
I choose the normal Ubuntu, because Kubuntu is complete pain in the ass, because it keep crashing and I wonder how they can call it stable. So it went off as fast a put it on my laptop.
Tags: destroyed, fsck, Gentoo, root partition, Ubuntu
Posted in Fail, My Laptop | No Comments »
July 18th, 2009
Today I upgraded wordpress again,
All I did was upgrade wordpress via emerge (this happens automaticly when running emerge -uND world
), run webapp-config -U -h blog.leipie.com -u apache -g apache -s apache wordpress 2.8.1, run CONFIG_PROTECT="/var/www/blog.leipie.com/htdocs//" etc-update and execute http://blog.leipie.com/wp-admin/upgrade.php in my browser. Et voila, it was done.
I first made a backup off my mysql data just to be sure. using tar to backup my wordpress db in /var/lib/mysql
Edit: Did the same for 2.8.3 today, but this has overwritten wp-config.php
Luckily I keep a backup…
Tags: 2.8.1, 2.8.3, Gentoo, upgrade, vhost, webapp-config, wordpress
Posted in Upgrading, maintance, server install, wordpress | No Comments »
July 10th, 2009
Today I tried to use type hinting for one of my methods. I wanted to hint that one should provide an arbitrary object. This sounds very straightforward, if you familiar with Java. But in PHP it seems this is not as straightforward as you might expect. At first I made the method declaration like this: public function test(Object $object). But this the PHP parser complained that it could not find the class Object. So I tried class, but this is a reserved word. Same for default.
So I started an investigation via Google, but I couldn’t find anything useful. So I made this code and executed it:
<?php
class Test{
public function __construct() {
echo 'Class: ' . __CLASS__ . "\n";
echo 'Parent?: ' . get_parent_class(__CLASS__) . "\n";
echo 'Parent?: ' . get_class(parent) . "\n";
}
}new Test();
?>
This was the result:
Class: Test
Parent?:
Parent?:
A standard class seems to extend noting…
In conclusion, it seems PHP has no main class that is extended by default. As a result you cannot request for a generic object via type hinting. The only work around seems to call this at the beginning of your method: assert( is_object($object) );...
Tags: Fail, Main Object, OO, PHP, Type hinting
Posted in Fail | No Comments »
April 23rd, 2009
Running a TeamSpeak client on Gentoo is quite easy. But there is only a binary available. Installing it is as easy running “emerge media-sound/teamspeak2-client-bin“.
The only problem I had, was that it was blocking the sound-card when it was running. Teamspeak worked fine with alsa, but no other program could use the sound-card at the same time. This makes it completely useless for using during games… This happens because teamspeak uses the old oss sound system, which only allows multiple programs using the sound-card if it has a hardware mixer. And my sound card has none. Alsa emulates it, but this apparently doesn’t work right.
To fix this do “emerge media-libs/alsa-oss” and then run “aoss teamspeak” instead. I found the solution here.
Tags: Alsa, Aoss, Gentoo, Hardware mixer, linux, Multiple program, One soundcard, Oss, Teamspeak
Posted in My Laptop | No Comments »
March 14th, 2009
On this page I found a handy tip to drop the disc cache that Linux keeps in the main memory. I use this to reduce the amount of information written to disc when hibernating using TuxOnIce.
Linux has the tendency to keep all kinds of information cached in the memory. This is very handy when opening programs, but it can be a nousence when you have 2GB memory. Most of the times the disc cache is as large are even twice as large as the actual data in the memory.
When hibernating this results in writing up to 2GB to disk and this can take a while. And TuxOnIce seems not completely stable and crashes during resuming when the disc image is somewhere over 1GB.
So if my memory is filled I run the following commands as root and then I hibernate.
sync; echo 3 > /proc/sys/vm/drop_caches.
The sync command is also very handy for detaching USB drives, because it flushes the caches.
Tags: clear memory, Drop disc cache, flush, linux, TuxOnIce
Posted in Interesting, My Laptop, handy | No Comments »
March 14th, 2009
A couple off months ago I went to course to learn mind mapping.
I found it to be very useful to remember things in a much more efficient way then taking “classical” notes. I can recommend it to everybody. I use whenever I can.
Until recently I just used a pencil and a notebook, but a couple of days ago found some open source software on SourceForge. I found this software very useful, because now it is much easier to manage my mind-maps and I don’t run put of paper anymore.
Of course it was very easy to install on Gentoo, because there is an ebuild provided via portage
Tags: FreeMind, Gentoo, Mind-mapping, Open source, Portage
Posted in Interesting, handy | No Comments »
March 5th, 2009
A couple of days ago,
I decided to try updating the microcode of my Intel CPU. You need to do this each time you boot your computer, because it gets lost again when powering down your system. On the Gentoo Wiki an easy How-to can be found. For updating the microcode you need to compile in microcode support in the kernel and and do “emerge -av microcode-ctl” after this you need to add the daemon to the startup scripts and voila your microcode gets update each time the OS starts. Compiling microcode support as module allows the script to unload it, when it is finished.
The microcode that is provided by the installed package is not the latest. The latest version can be found on download site of intel and needs to placed in the /etc/microcode.dat.
I didn’t notice any difference yet, but it might give a warm felling inside, to know that it’s up to date
I am only still pondering if I need to manually run the script again when resuming from hibernation.
Tags: Gentoo, Intel, Microcode, Wiki
Posted in My Laptop, Upgrading | No Comments »
March 2nd, 2009
Today I finally upgraded from wordpress 2.6.5.
I just love Gentoo, for doing stuff like this. Before you start you must backup, your database and save all files that were not standard, like wp-config.php! After you have done this, it is as easy as “emerge -u wordpress” and install the new version into the webserver with “webapp-config -U -h blog.leipie.com wordpress 2.7.1“.
The only thing left is to copy back wp.config.php and run “http://blog.leipie.com/wp-admin/upgrade.php”
Wonderful!
Tags: Gentoo, upgrade, webconfig, Wordpress 2.7.1
Posted in Upgrading, maintance, photos, svn, wordpress | No Comments »
February 24th, 2009
TuxOnIce is next,
I always used hibernation when using Windows, so I wanted it on Gentoo too. I decided to use TuxOnIce because the main suspend-to-disk functionality already present in the kernel tree has a lot less room for customisation.
Installing it seems pretty easy. Just take the vanilla kernel sources and apply the patch provided by TuxOnIce. It is well maintained, so there are patches for all the release of the kernel. Patching the 2.6.27.12 kernel was as easy as downloading the patch and patching the kernel sources accourding to the manual and set the newly available settings using “make menuconfig”. After this build the new kernel and installed it.
After this you need to install the script package they also provide and create space to put the RAM image in. This includes the hibernation script, but also a script for cleaning up after resuming. It invalidates the RAM image after resuming, so it is not accidentally reused when booting another time.
I wanted to hibernate to a dedicated file using the filewriter, but after numerous attempt this failed. The hibernation script kept complaining that the image, where it needed to write to, was not consistent. I wanted to hibernate to a file, because in this way I am not dependent on how much swap space is used or present. I don’t actually use swap for now. The 2GB RAM is currently more then enough.
So I finally choose to hibernate to a swapfile that was not actualy used as swap space. This is essentially a dedicated file for hibernation. I use the following the following “script” to hibernate:
swapon /TuxOnIce.swap; hibernate; swapoff /TuxOnIce.swap
This makes sure enough swap space will always be present when hibernation is started. It is almost like just a dedicated file, but if other swap space is present that will be used first. And the third statement is actually executed when hibernation is finished and the resume already done, precisely when we don’t need the extra swap space anymore.
I am still pondering if I want to add an UI to the hibernation and resume process. The UI is also provided via a seperate download. It seems to make de hibernating and resuming slower, but does enable to cancel hibernation or resuming and show a progress bar. For now I just use TuxOnIce without an UI.
Tags: Dedicated swap file, Filewriter, Gentoo, Hibernation, Kernel 2.6.27.12, Swapwriter, TuxOnIce
Posted in My Laptop, Upgrading, maintance | No Comments »
February 18th, 2009
To continue last post,
After upgrading the drive of my laptop I wanted to install Linux on it. Because I am already familiar with Gentoo I choose to install this distribution. And it is quite easy to keep up to date, but more important it is very easy to update to a new version. I know it is a lot of work to install Gentoo! But hey you do learn a lot about the workings of Linux and the kernel.
Installing of Gentoo is best done with the Live CD they provide on there website. It provides a complete Linux environment from which you can install/manage/repair you system. They give you the option to install Gentoo really manually from the shell and have the latest portage tree installed right away or use their (GUI or shell) installer which copies part of the system installed on the live CD to the disk drive.
I installed Gentoo manually, because your install will be quite up-to-date and you do not have to update the complete system again once you have it running on its own. Their manual is very helpful and quite easy to use. With Gentoo you can choose with patch set use use for the kernel, I choose to use the vanilla kernel 2.6.27.12, because I heard that the patches of the Gentoo developers aren’t always up to standard… And the this is a newer kernel
The sources can easily be downloaded via emerge the install system of Gentoo. And did “cd /usr/src/linux” and “make menuconfig”. The result was hours of reading and deciding how to set up the kernel…
The kernel compiled with a warning for which I applied the following patch and it seems to be running smoothly:
— arch/x86/kernel/head_32.S.orig 2008-10-14 17:04:39.000000000 -0500
+++ arch/x86/kernel/head_32.S 2008-10-14 17:03:12.000000000 -0500
@@ -600,6 +600,7 @@
.section .cpuinit.data,”wa”
.align 4
+__REFDATA
ENTRY(initial_code)
.long i386_start_kernel
Once you are done, the system is completely bare. So after this I decided to install KDE. I tried Xfce2 also present on the Live CD before, but it was not mature enough for me. Because with Gentoo everything is build from the sources it took me a wooping 5 hours to build.
This with the kdeenablefinal USE key enable, which should make compiling faster by using enormous amounts of ram.
When it was done I still needed to find out how to get it running. I tried running xorgconfig, but X kept complaining it could not find a window port. After some trial and error I figured out I needed to load the intel-agp and i915 modules, because I forgot to build them directly into the kernel. After this the X would happily start. And I had a GUI for the first time on my system!
The only thing they don’t tell in the manual is that you can only have 4 primary partitions in your MBR. So I needed to fiddle around a bit with partitions when I wanted to add some more partitions afterwards. But for this I found a very handy tutorial. But it is not for the faint hearted, because it involves deleting and recreating partitions with data on them
To be continued once again
Tags: D400, Dell, Install Gentoo, Kernel patch 2.6.17.12, Latitude, linux, Linux kernel, Resize partitions
Posted in My Laptop, Upgrading, maintance | No Comments »