<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.3.2" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>acogitosis</title>
	<link>http://acogitosis.krop.pl</link>
	<description>polscy naukowcy udowodnili: myślenie boli</description>
	<pubDate>Wed, 28 Jul 2010 17:40:19 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.2</generator>
	<language>en</language>
			<item>
		<title>[en] Fixing Ubuntu boot process after restoring tar backups to newly formatted disk (with UUID changed)</title>
		<link>http://acogitosis.krop.pl/2010-07-28-en-fixing-ubuntu-boot-process-after-restoring-tar-backups-to-newly-formatted-disk-with-uuid-changed/</link>
		<comments>http://acogitosis.krop.pl/2010-07-28-en-fixing-ubuntu-boot-process-after-restoring-tar-backups-to-newly-formatted-disk-with-uuid-changed/#comments</comments>
		<pubDate>Wed, 28 Jul 2010 17:40:19 +0000</pubDate>
		<dc:creator>Grzegorz</dc:creator>
		
		<category><![CDATA[English]]></category>

		<category><![CDATA[Informatyka]]></category>

		<category><![CDATA[Krótkie]]></category>

		<category><![CDATA[Porady]]></category>

		<guid isPermaLink="false">http://acogitosis.krop.pl/2010-07-28-en-fixing-ubuntu-boot-process-after-restoring-tar-backups-to-newly-formatted-disk-with-uuid-changed/</guid>
		<description><![CDATA[Mostly note to my self for future reference.

What they don&#8217;t tell You in the tar backup tutorial is that it&#8217;s not enough to edit /etc/fstab (and their instructions for grub are for grub-legacy).

Because after restoring you probably have new partition UUIDs, you must:


    boot livecd
    mount your root fs
 [...]]]></description>
			<content:encoded><![CDATA[<p>Mostly note to my self for future reference.</p>

<p>What they don&#8217;t tell You in the <a href="https://help.ubuntu.com/community/BackupYourSystem/TAR" onclick="javascript:pageTracker._trackPageview('/outbound/article/help.ubuntu.com');">tar backup tutorial</a> is that it&#8217;s not enough to edit /etc/fstab (and their instructions for grub are for grub-legacy).</p>

<p>Because after restoring you probably have new partition UUIDs, you must:</p>

<ul>
    <li>boot livecd</li>
    <li>mount your root fs</li>
    <li><code>mount -B /dev /rootfs/dev</code>, etc. (with proc and sys at least) to be able to chroot from livecd to your root fs</li>
    <li><code>chroot /rootfs</code></li>
    <li>edit /etc/fstab and change UUIDs there (new ones you can get using <code>blkid</code></li>
    <li>do <code>sudo dpkg-reconfigure -plow grub-pc</code> to automatically upgrade grub config files, just let it install to the drive(s) it was on</li>
    <li>do <code>update-initramfs -u</code> so UUID stored inside initramfs get updated, too</li>
</ul>

<p>Then you should be able to boot it.</p>
]]></content:encoded>
			<wfw:commentRss>http://acogitosis.krop.pl/2010-07-28-en-fixing-ubuntu-boot-process-after-restoring-tar-backups-to-newly-formatted-disk-with-uuid-changed/feed/</wfw:commentRss>
		</item>
		<item>
		<title>[en] Fixing VirtualBox 3.1, 3.2 (and others?) slowness for Ubuntu host and Windows XP guest</title>
		<link>http://acogitosis.krop.pl/2010-07-08-en-fixing-virtualbox-31-32-and-others-slowness-for-ubuntu-host-and-windows-xp-guest/</link>
		<comments>http://acogitosis.krop.pl/2010-07-08-en-fixing-virtualbox-31-32-and-others-slowness-for-ubuntu-host-and-windows-xp-guest/#comments</comments>
		<pubDate>Thu, 08 Jul 2010 19:30:44 +0000</pubDate>
		<dc:creator>Grzegorz</dc:creator>
		
		<category><![CDATA[English]]></category>

		<category><![CDATA[Informatyka]]></category>

		<category><![CDATA[Krótkie]]></category>

		<category><![CDATA[Porady]]></category>

		<guid isPermaLink="false">http://acogitosis.krop.pl/2010-07-08-en-fixing-virtualbox-31-32-and-others-slowness-for-ubuntu-host-and-windows-xp-guest/</guid>
		<description><![CDATA[Install VirtualBox Guest Additions in Windows&#8217; safe-mode so system file protection doesn&#8217;t interfere with the installation, it&#8217;s that simple and fixed all my VirtualBox performance problems.
]]></description>
			<content:encoded><![CDATA[<p>Install VirtualBox Guest Additions in Windows&#8217; <b>safe-mode</b> so system file protection doesn&#8217;t interfere with the installation, it&#8217;s that simple and fixed all my VirtualBox performance problems.</p>
]]></content:encoded>
			<wfw:commentRss>http://acogitosis.krop.pl/2010-07-08-en-fixing-virtualbox-31-32-and-others-slowness-for-ubuntu-host-and-windows-xp-guest/feed/</wfw:commentRss>
		</item>
		<item>
		<title>[en] Fix PNG images dark in IE</title>
		<link>http://acogitosis.krop.pl/2009-06-26-en-fix-png-images-dark-in-ie/</link>
		<comments>http://acogitosis.krop.pl/2009-06-26-en-fix-png-images-dark-in-ie/#comments</comments>
		<pubDate>Fri, 26 Jun 2009 10:29:14 +0000</pubDate>
		<dc:creator>Grzegorz</dc:creator>
		
		<category><![CDATA[English]]></category>

		<category><![CDATA[Informatyka]]></category>

		<category><![CDATA[Krótkie]]></category>

		<category><![CDATA[Porady]]></category>

		<guid isPermaLink="false">http://acogitosis.krop.pl/2009-06-26-en-fix-png-images-dark-in-ie/</guid>
		<description><![CDATA[IE can&#8217;t do anything right. If you save some graphical elements to PNG, and try to put them on an area with CSS-defined color, there will be a difference even if you used the same color in the PNG &#8212; IE renders PNGs darker than it should.
The reason for this is misinterpretation of gAMA frame [...]]]></description>
			<content:encoded><![CDATA[<p>IE can&#8217;t do anything right. If you save some graphical elements to PNG, and try to put them on an area with CSS-defined color, there will be a difference even if you used the same color in the PNG &#8212; IE renders PNGs darker than it should.
The reason for this is misinterpretation of gAMA frame saved in PNGs that makes it possible to better color-match pictures. The fix is to remove this frame, and doing it on Ubuntu is as easy as:</p>

<p><code>aptitude install pngcrush<br/>
cd your-graphics-directory<br/>
mkdir fixed<br/>
find . -type f -exec pngcrush -d fixed -rem cHRM -rem gAMA -rem iCCP -rem sRGB {} \;<br/>
</code></p>

<p>Now you have a &#8220;fixed&#8221; directory where you have PNGs that will work properly in IE (and are a bit smaller which is a nice side effect). If you&#8217;re sure they&#8217;re ok, just do</p>

<p><code>mv fixed/* ./<br/>
rmdir fixed<br/>
</code></p>

<p>That&#8217;s all.</p>
]]></content:encoded>
			<wfw:commentRss>http://acogitosis.krop.pl/2009-06-26-en-fix-png-images-dark-in-ie/feed/</wfw:commentRss>
		</item>
		<item>
		<title>[en] Fix irregularity of Java Timer and ScheduledThreadPoolExecutor</title>
		<link>http://acogitosis.krop.pl/2009-06-03-en-fix-irregularity-of-java-timer-and-scheduledthreadpoolexecutor/</link>
		<comments>http://acogitosis.krop.pl/2009-06-03-en-fix-irregularity-of-java-timer-and-scheduledthreadpoolexecutor/#comments</comments>
		<pubDate>Wed, 03 Jun 2009 09:51:13 +0000</pubDate>
		<dc:creator>Grzegorz</dc:creator>
		
		<category><![CDATA[English]]></category>

		<category><![CDATA[Informatyka]]></category>

		<category><![CDATA[Porady]]></category>

		<guid isPermaLink="false">http://acogitosis.krop.pl/2009-06-03-en-fix-irregularity-of-java-timer-and-scheduledthreadpoolexecutor/</guid>
		<description><![CDATA[Using Java Timer class one can schedule a task for recurring execution. Even though ScheduledThreadPoolExecutor makes it possible to create timers with nanosecond resolution (but beware of underlying operating system clock precision!), regularity of task execution is by default awful.

I have run into this once and had to explain the customer that it&#8217;s not fixable. [...]]]></description>
			<content:encoded><![CDATA[<p>Using Java Timer class one can schedule a task for recurring execution. Even though ScheduledThreadPoolExecutor makes it possible to create timers with nanosecond resolution (but beware of underlying operating system clock precision!), regularity of task execution is by default awful.</p>

<p>I have run into this once and had to explain the customer that it&#8217;s not fixable. When I measured the delay between timer executions, etc. it turned out that doing as much as new Thread(runnable).start() usually takes 1-5 milliseconds, but at times it takes two orders of magnitude longer: even half a second!</p>

<p>Same customer, other project and this time I thought of a reason for this behaviour: garbage collection. I started with calling System.gc() explicitly inside measured code and it takes 200-500 milliseconds! So it must be it.</p>

<p>Is there a solution? Of course there is. It&#8217;s called <a href="http://java.sun.com/docs/hotspot/gc5.0/gc_tuning_5.html#0.0.0.%20The%20Concurrent%20Low%20Pause%20Collector|outline" onclick="javascript:pageTracker._trackPageview('/outbound/article/java.sun.com');">The Concurrent Low Pause Collector</a>  and has been in Java since version 5. Read the linked article for many, many details, but shortly just add:</p>

<p>-XX:+UseConcMarkSweepGC</p>

<p>to the usual java -jar command and the garbage collection will be done in parallel with your code execution. Of course it&#8217;s no golden bullet, it makes overall performance worse (now instead of 1-5 milliseconds, a single loop pass takes 4-10 milliseconds), but for this particular use, it makes Timer regularity better by two orders of magnitude.</p>
]]></content:encoded>
			<wfw:commentRss>http://acogitosis.krop.pl/2009-06-03-en-fix-irregularity-of-java-timer-and-scheduledthreadpoolexecutor/feed/</wfw:commentRss>
		</item>
		<item>
		<title>[en] Solution to SIL3124-2 &#8220;no valid device&#8221;</title>
		<link>http://acogitosis.krop.pl/2009-05-29-en-solution-to-sil3124-2-no-valid-device/</link>
		<comments>http://acogitosis.krop.pl/2009-05-29-en-solution-to-sil3124-2-no-valid-device/#comments</comments>
		<pubDate>Fri, 29 May 2009 20:29:16 +0000</pubDate>
		<dc:creator>Grzegorz</dc:creator>
		
		<category><![CDATA[English]]></category>

		<category><![CDATA[Informatyka]]></category>

		<category><![CDATA[Porady]]></category>

		<guid isPermaLink="false">http://acogitosis.krop.pl/2009-05-29-en-solution-to-sil3124-2-no-valid-device/</guid>
		<description><![CDATA[SIL3124 is a PCI (as in old PCI, not PCI express) SATA-II controller which I had to buy because my NAS&#8217; old Gigabyte motherboard supports (downspeeded) SATA-II drives only to 750GB size. Of course I got to know this AFTER buying 1,5TB drive  

Anyway, it&#8217;s always uphill and even though SIL3124 card sees the [...]]]></description>
			<content:encoded><![CDATA[<p>SIL3124 is a PCI (as in old PCI, not PCI express) SATA-II controller which I had to buy because my NAS&#8217; old Gigabyte motherboard supports (downspeeded) SATA-II drives only to 750GB size. Of course I got to know this AFTER buying 1,5TB drive <img src='http://acogitosis.krop.pl/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>

<p>Anyway, it&#8217;s always uphill and even though SIL3124 card sees the drive and I&#8217;ve installed Ubuntu Server with no problems to it, I couldn&#8217;t boot the card. It kept saying &#8220;no valid device&#8221;. Turns out it has a RAID-only BIOS by default so if someone - like me - wants to use it as an JBOD (Just a Bunch Of Disks) controller, BIOS upgrade is needed. How user friendly not to mention it in a - Czech-language - manual.</p>

<p>Of course, being mainly a Linux user with no CD- or DVD-drive, I have it even more uphill. BIOS flashing tools are available for Windows and DOS. Soooo the solution is:</p>

<ol>
<li>Use HP USB Disk Storage Format Tool to create bootable DOS pendrive, here&#8217;s Polish language tutorial: http://forum.purepc.pl/Dyski-twarde-cdromy-dvd-pendrive-inne-pamieci-f55/Boot-Pendrive-t254005.html if You don&#8217;t speak Polish, just google &#8220;boot pendrive dos&#8221;, in the tutorial is a link to Win98 boot files You might use.</li>
<li>Download UPDFLASH and the newest BIOS zip from http://www.siliconimage.com/support</li>
<li>The zip file has more than one BIOS inside, read the README and see which one is &#8220;IDE&#8221; BIOS or &#8220;non-RAID&#8221; BIOS. Copy the file together with UPDFLASH to the pendrive.</li>
<li>Boot the PC with the PCI SATA Controller from the pendrive.</li>
<li>Run &#8220;updflash biosfile.bin&#8221;</li>
<li>If you don&#8217;t have a UPS, pray to Atheist&#8217;s God(TM) that there&#8217;s no blackout during flashing process.</li>
<li>Use motherboard&#8217;s (not SATA controller&#8217;s) BIOS to set Hard Drive as first boot priority, make sure there&#8217;s &#8220;Bootable Add-In Cards&#8221; enabled somewhere.</li>
<li>Reset and enjoy bootable large drives.</li>
</ol>

<p>Note: Drive&#8217;s UUIDs change because of that so it&#8217;s best to do it BEFORE installing Ubuntu, otherwise You get a maintanance console.</p>
]]></content:encoded>
			<wfw:commentRss>http://acogitosis.krop.pl/2009-05-29-en-solution-to-sil3124-2-no-valid-device/feed/</wfw:commentRss>
		</item>
		<item>
		<title>[en] Ubuntu 9.04 Jaunty on my AMD64 system - notes to myself</title>
		<link>http://acogitosis.krop.pl/2009-03-31-en-ubuntu-904-jaunty-on-my-amd64-system-notes-to-myself/</link>
		<comments>http://acogitosis.krop.pl/2009-03-31-en-ubuntu-904-jaunty-on-my-amd64-system-notes-to-myself/#comments</comments>
		<pubDate>Tue, 31 Mar 2009 12:25:54 +0000</pubDate>
		<dc:creator>Grzegorz</dc:creator>
		
		<category><![CDATA[English]]></category>

		<category><![CDATA[Informatyka]]></category>

		<category><![CDATA[Porady]]></category>

		<guid isPermaLink="false">http://acogitosis.krop.pl/2009-03-31-en-ubuntu-904-jaunty-on-my-amd64-system-notes-to-myself/</guid>
		<description><![CDATA[Update 2009-11-18, using Ubuntu 9.10 now


Wine has finally font anti-aliasing, to enable do this in regedit:
============
REGEDIT4

[HKEY_CURRENT_USER\Control Panel\Desktop]
"FontSmoothing"="2"
"FontSmoothingType"=dword:00000002
"FontSmoothingGamma"=dword:00000578
"FontSmoothingOrientation"=dword:00000001
============



Mainly notes to myself, but maybe some random Googlers will find some of them useful. I may add more in time.


    If many of texts in your system, including Firefox are not in your native language, [...]]]></description>
			<content:encoded><![CDATA[<p><b>Update 2009-11-18, using Ubuntu 9.10 now</b></p>

<ul>
<li>Wine has finally font anti-aliasing, to enable do this in regedit:
<code>============
REGEDIT4

[HKEY_CURRENT_USER\Control Panel\Desktop]
"FontSmoothing"="2"
"FontSmoothingType"=dword:00000002
"FontSmoothingGamma"=dword:00000578
"FontSmoothingOrientation"=dword:00000001
============
</code></li>
</ul>

<p>Mainly notes to myself, but maybe some random Googlers will find some of them useful. I may add more in time.</p>

<ul>
    <li>If many of texts in your system, including Firefox are not in your native language, make sure you have installed appropriate language-pack-XX package (language-pack-pl for Polish). It should be downloaded by Ubuntu installer but it never fully worked for me since 5.04.</li>
    <li>Pidgin has <a href="http://nic.com.pl/~alek/pidgin-tlen/" onclick="javascript:pageTracker._trackPageview('/outbound/article/nic.com.pl');">a plugin for Tlen protocol</a>. Just download the newest .tar.gz, unpack and make. You should have pidgin-dev package installed for it to succeed. I didn&#8217;t try make install, just copied over resulting libtlen.so to /usr/lib/purple-2 and .png files to /usr/share/pixmaps/pidgin/protocols, one file - renamed to just tlen.png - to each folder.</li>
    <li>Nice <a href="http://pingway.w.interia.pl/pidgin-original.tar.gz" onclick="javascript:pageTracker._trackPageview('/outbound/article/pingway.w.interia.pl');">Pidgin smiley pack</a> which has original emotikons for protocols I use. Just go to Pidgin settings, smiley sets tab and click add.
    <li><a href="https://addons.mozilla.org/pl/firefox/addon/4868" onclick="javascript:pageTracker._trackPageview('/outbound/article/addons.mozilla.org');">Firetray</a> contrary to what its name suggests, also works in Thunderbird, allowing it to minimize itself to system tray. Just open Thunderbird&#8217;s Add-ons window and drag install link there from Firefox to install this extension.</li>
    <li>Polish <a href="http://www.niecko.pl/adblock/" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.niecko.pl');">set of Adblock filters</a> I&#8217;ve been using for some time now.</li>
    <li>Installing Aurora GTK Theme engine (most good themes seem to use it):<blockquote>
<pre>
aptitude install build-essential libgtk2.0-dev
# download from 
# http://www.gnome-look.org/content/show.php/Aurora+Gtk+Engine?content=56438 
# unpack and cd to source directory
./configure --prefix=/usr --enable-animation
make
sudo make install
</pre>
</blockquote></li>
    <li>Download <a href="http://www.egillsigurdur.com/fonts/" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.egillsigurdur.com');">Myriad Pro font</a>. <b>Here&#8217;s <a href="http://www.speedyshare.com/153351180.html" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.speedyshare.com');">Myriad in TTF</a> version (thanks Misiek) which looks better in Java programs (think OpenOffice).</b></li>
    <li><a href="http://hcalves.deviantart.com/art/Fresh-Dark-Gnome-Theme-2-1-95737856" onclick="javascript:pageTracker._trackPageview('/outbound/article/hcalves.deviantart.com');">Fresh Dark</a> - a very nice dark theme for Gnome. Also see <a href="http://perfectska04.deviantart.com/art/GNOME-Colors-87655584" onclick="javascript:pageTracker._trackPageview('/outbound/article/perfectska04.deviantart.com');">matching icons</a>. If Metacity/Emerald (window borders) theme doesn&#8217;t work, just check file and directory permissions of the unpacked theme. If windows run as root look ugly, make sure you copy the theme to /usr/share/themes instead of just ~/.themes.</li>
    <li><a href="http://www.winehq.org/download/deb" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.winehq.org');">Wine repository</a> which usually has newer version than default Ubuntu repos.</li>
    <li>A nice way to integrate MS Office (I have a license so I use it through Wine instead of OpenOffice, same goes to Photoshop which I prefer over Gimp in spite of all those holy wars about it) is to create /opt/wine-start.sh script with following contents<blockquote>
<pre>
#!/bin/bash
wine start "z:$1"
</pre>
</blockquote>and then chmod +x it and use it with Gnome&#8217;s Open With function on .doc, .xls and .ppt files. That way I&#8217;m able to open those files in Word, Excel and PowerPoint just by double clicking them.</li>
    <li>There is Java Plugin for Firefox on AMD64 at last (just install sun-java6-plugin package).</li>
    <li>Wammu (nice mobile phone manager with a great feature of copying your SMSes to your e-mail inbox) just works in Jaunty with my Nokia 6021 over bluetooth which was never a case before.</li>
    <li><a href="http://sshmenu.sourceforge.net/download/deb_repo.html" onclick="javascript:pageTracker._trackPageview('/outbound/article/sshmenu.sourceforge.net');">SSH Menu</a> is a nice little gnome applet to build a fast-access menu of SSH servers you connect to. Ubuntu repository is also there.</li>
    <li>I always forget that Eclipse PDT (PHP Development Tools) all-in-one download is for 32bits only. To install it on AMD64 architecture, download <a href="http://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/ganymede/SR1/eclipse-jee-ganymede-SR1-linux-gtk-x86_64.tar.gz" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.eclipse.org');">64-bit version of Eclipse for JavaEE</a> and do the following:<blockquote>
<pre>
tar xzvf eclipse-jee-ganymede-SR1-linux-gtk-x86_64.tar.gz
sudo mv eclipse /opt
# you probably should think twice about chown and chmod, 
# but I myself make my PC physically secure so don't care
sudo chown -R user.group /opt/eclipse
sudo chmod -R 770 /opt/eclipse
sudo nano /etc/environment # put path to JDK by adding a 
# line something like JAVA_HOME="/usr/lib/jvm/java-6-sun"
/opt/eclipse/eclipse # choose your workspace location and start Eclipse
</pre>
When in Eclipse, just use <a href="http://wiki.eclipse.org/PDT/Installation" onclick="javascript:pageTracker._trackPageview('/outbound/article/wiki.eclipse.org');">their instructions</a> on installing PDT:
<pre>
Help > Software Updates... > Available Software > Manage Sites...
  Add... > add the DLTK 1.0 interim site: http://download.eclipse.org/technology/dltk/updates-dev/1.0/
  Add... > add the PDT 2.0 interim site: http://download.eclipse.org/tools/pdt/updates/2.0/
  Enable the Ganymede Update site (if not already enabled): http://download.eclipse.org/releases/ganymede/
  Expand the DLTK site and select the Dynamic Languages Toolkit - Core Frameworks or Dynamic Languages Toolkit - 
                                                                                          Core Frameworks SDK Feature 
  Select the PDT or PDT SDK Feature
  Install...
</pre>
</blockquote></li>
    <li>To make Subclipse plugin work in Eclipse (to be able to use Subversion repositories), aptitude install libsvn-javahl and then nano /opt/eclipse/eclipse.ini and add a line that says (sans quotes) &#8220;-Djava.library.path=/usr/lib/jni&#8221; just under &#8220;-vmargs&#8221; line.</li>
    <li>I&#8217;ve finally found a way to change Gnome&#8217;s clock appearance, fire up gconf-editor, go to /apps/panel/applets/clock_screen0/prefs, change &#8220;format&#8221; to &#8220;custom&#8221;, &#8220;custom_format&#8221; to something like &#8220;&lt;span color=&#8221;#99ccff&#8221;>&lt;sup>&lt;b>%A, %d %B %Y&lt;/b>&lt;/sup>&lt;/span>   &lt;big>&lt;b>&lt;big>%H&lt;/big>&lt;sup>%M&lt;/sup>&lt;/b>&lt;/big>&#8221; and voila!</li>
    <li>Even though dailystrips (a script that download comic strips for you) at sourceforge seems to be abandoned, they have updated <a href="https://misterhouse.svn.sourceforge.net/svnroot/misterhouse/trunk/bin/" onclick="javascript:pageTracker._trackPageview('/outbound/article/misterhouse.svn.sourceforge.net');">dailystrips</a> and <a href="https://misterhouse.svn.sourceforge.net/svnroot/misterhouse/trunk/web/comics/dailystrips/" onclick="javascript:pageTracker._trackPageview('/outbound/article/misterhouse.svn.sourceforge.net');">strips.def</a> at MisterHouse project.
</ul>
]]></content:encoded>
			<wfw:commentRss>http://acogitosis.krop.pl/2009-03-31-en-ubuntu-904-jaunty-on-my-amd64-system-notes-to-myself/feed/</wfw:commentRss>
		</item>
		<item>
		<title>[en] How to mount LVM VG and restore data from it when one of its PV drives has failed</title>
		<link>http://acogitosis.krop.pl/2009-03-29-en-how-to-mount-lvm-vg-and-restore-data-from-it-when-one-of-its-pv-drives-has-failed/</link>
		<comments>http://acogitosis.krop.pl/2009-03-29-en-how-to-mount-lvm-vg-and-restore-data-from-it-when-one-of-its-pv-drives-has-failed/#comments</comments>
		<pubDate>Sat, 28 Mar 2009 23:49:21 +0000</pubDate>
		<dc:creator>Grzegorz</dc:creator>
		
		<category><![CDATA[English]]></category>

		<category><![CDATA[Informatyka]]></category>

		<category><![CDATA[Porady]]></category>

		<guid isPermaLink="false">http://acogitosis.krop.pl/2009-03-29-en-how-to-mount-lvm-vg-and-restore-data-from-it-when-one-of-its-pv-drives-has-failed/</guid>
		<description><![CDATA[However great LVM is in Linux, allowing one to span single &#8220;partition&#8221; over several hard drives, if the underlying &#8220;drives&#8221; are real hard drives and not RAID volumes, You can get pretty fucked when one of those disks fails.

It took me several hours of googling around and trials to find out how to recover as [...]]]></description>
			<content:encoded><![CDATA[<p>However great LVM is in Linux, allowing one to span single &#8220;partition&#8221; over several hard drives, if the underlying &#8220;drives&#8221; are real hard drives and not RAID volumes, You can get pretty fucked when one of those disks fails.</p>

<p>It took me several hours of googling around and trials to find out how to recover as much data as is possible (meaning: all the data that is on remaining disks, the data on failed drive is obviously lost). So let&#8217;s try to add a short and working recipe to Google.</p>

<ol>
    <li>You do NOT have to pvcreate any bogus empty PVs with fake UUIDs to replace the failed drive. LVM2 can be used in &#8220;partial&#8221; mode without all the drives.</li>
    <li>To use partial mode, You need to create /dev/ioerror device like this (I use Ubuntu, in other distros it might be different):
    <ul>
        <li><code>nano filename</code> to create a text file where a single line &#8220;0 9999999999 error&#8221; sans quotes should be placed</li>
        <li><code>dmsetup create ioerror filename</code> to create a device LVM will read instead of missing PV</li>
        <li><code>ln -s /dev/mapper/ioerror /dev/ioerror</code> so it&#8217;s just where LVM will look for it</li>
    </ul></li>
    <li>After ioerror is created, just activate your volume group in partial mode using <code>vgchange -P -ay VOLNAME</code></li>
    <li>Mount it (it will mount in read only mode) and copy your precious data</li>
</ol>

<p>Cheers to <a href="http://e2salvage.sourceforge.net/florian2.html" onclick="javascript:pageTracker._trackPageview('/outbound/article/e2salvage.sourceforge.net');">these guys</a> who finally written something I could use instead of pvcreate and bogus hard drives discussions.</p>
]]></content:encoded>
			<wfw:commentRss>http://acogitosis.krop.pl/2009-03-29-en-how-to-mount-lvm-vg-and-restore-data-from-it-when-one-of-its-pv-drives-has-failed/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Virtualmin on Ubuntu 8.04 Server</title>
		<link>http://acogitosis.krop.pl/2009-02-15-virtualmin-on-ubuntu-804-server/</link>
		<comments>http://acogitosis.krop.pl/2009-02-15-virtualmin-on-ubuntu-804-server/#comments</comments>
		<pubDate>Sun, 15 Feb 2009 00:56:10 +0000</pubDate>
		<dc:creator>Grzegorz</dc:creator>
		
		<category><![CDATA[English]]></category>

		<category><![CDATA[Informatyka]]></category>

		<category><![CDATA[Porady]]></category>

		<guid isPermaLink="false">http://acogitosis.krop.pl/2009-02-15-virtualmin-on-ubuntu-804-server/</guid>
		<description><![CDATA[Notes to myself and Googlers on installing a virtual hosting control panel Virtualmin (a great add-on to Webmin) on Ubuntu server:


    
    wget http://software.virtualmin.com/gpl/scripts/install.sh
    chmod 755 install.sh
    ./install.sh
 &#8212; installs Virtualmin automatically with all dependencies, with a nice skin which is also used [...]]]></description>
			<content:encoded><![CDATA[<p>Notes to myself and Googlers on installing a virtual hosting control panel Virtualmin (a great add-on to Webmin) on Ubuntu server:</p>

<ul>
    <li><code>
    wget http://software.virtualmin.com/gpl/scripts/install.sh<br/>
    chmod 755 install.sh<br/>
    ./install.sh<br/>
</code> &#8212; installs Virtualmin automatically with all dependencies, with a nice skin which is also used by Webmin (which I remember used to be quite ugly by default)
    <li><code>
    chmod 711 /var/spool/postfix/var/run/saslauthd
</code> &#8212; fixes login failure when trying to send mail through virtual server</li>
    <li>it seems apache vhost, ftp, e-mail and DNS is properly configured automatically, will add more info here as I move on with my hosting migration to Virtualmin probably</li>

</ul>
]]></content:encoded>
			<wfw:commentRss>http://acogitosis.krop.pl/2009-02-15-virtualmin-on-ubuntu-804-server/feed/</wfw:commentRss>
		</item>
		<item>
		<title> dostaje automatycznie &#8220;display: none&#8221; w Firefoksie?</title>
		<link>http://acogitosis.krop.pl/2008-11-29-dostaje-automatycznie-display-none-w-firefoksie/</link>
		<comments>http://acogitosis.krop.pl/2008-11-29-dostaje-automatycznie-display-none-w-firefoksie/#comments</comments>
		<pubDate>Sat, 29 Nov 2008 13:49:59 +0000</pubDate>
		<dc:creator>Grzegorz</dc:creator>
		
		<category><![CDATA[Informatyka]]></category>

		<category><![CDATA[Krótkie]]></category>

		<category><![CDATA[Porady]]></category>

		<guid isPermaLink="false">http://acogitosis.krop.pl/2008-11-29-dostaje-automatycznie-display-none-w-firefoksie/</guid>
		<description><![CDATA[Straciłem nad tym więcej czasu niż chcę się przyznać; miałem dodać mały element graficzny o nazwie pliku zspon.png do strony jednego z Klientów i jakimś cudem nie pojawiał się on nigdy na stronie, a Firebug pokazywał że ma on &#8220;display: none&#8221;, choć żadnego CSSa nie przypisywałem.

Okazało się, że Adblock z filtrami Filterset.g wycina mi obrazki [...]]]></description>
			<content:encoded><![CDATA[<p>Straciłem nad tym więcej czasu niż chcę się przyznać; miałem dodać mały element graficzny o nazwie pliku zspon.png do strony jednego z Klientów i jakimś cudem nie pojawiał się on nigdy na stronie, a Firebug pokazywał że ma on &#8220;display: none&#8221;, choć żadnego CSSa nie przypisywałem.</p>

<p>Okazało się, że Adblock z filtrami Filterset.g wycina mi obrazki które mają w nazwie &#8220;spon&#8221; :> Wyłączenie Adblocka na czas developmentu to dobry pomysł, choć ja zostawiam włączony - jak ktoś będzie go używał to wolę zawczasu wiedzieć co mu zniknie i zmienić nazwę pliku <img src='http://acogitosis.krop.pl/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> zs-pon.png się wyświetla <img src='http://acogitosis.krop.pl/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://acogitosis.krop.pl/2008-11-29-dostaje-automatycznie-display-none-w-firefoksie/feed/</wfw:commentRss>
		</item>
		<item>
		<title>[en] How to word wrap text in Graphics2D.drawString in Java</title>
		<link>http://acogitosis.krop.pl/2008-11-27-en-how-to-word-wrap-text-in-graphics2ddrawstring-in-java/</link>
		<comments>http://acogitosis.krop.pl/2008-11-27-en-how-to-word-wrap-text-in-graphics2ddrawstring-in-java/#comments</comments>
		<pubDate>Thu, 27 Nov 2008 19:04:36 +0000</pubDate>
		<dc:creator>Grzegorz</dc:creator>
		
		<category><![CDATA[English]]></category>

		<category><![CDATA[Informatyka]]></category>

		<category><![CDATA[Krótkie]]></category>

		<category><![CDATA[Porady]]></category>

		<guid isPermaLink="false">http://acogitosis.krop.pl/2008-11-27-en-how-to-word-wrap-text-in-graphics2ddrawstring-in-java/</guid>
		<description><![CDATA[Google wasn&#8217;t awfully helpful while I was searching for solution to word wrapping a text when drawing in Java, so let&#8217;s teach Google this:  




    private void drawStringRect(Graphics2D graphics, int x1, int y1, int x2, int y2, 
        float interline, String txt) {
  [...]]]></description>
			<content:encoded><![CDATA[<p>Google wasn&#8217;t awfully helpful while I was searching for solution to word wrapping a text when drawing in Java, so let&#8217;s teach Google this: <img src='http://acogitosis.krop.pl/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>

<p><code></p>

<pre>
    private void drawStringRect(Graphics2D graphics, int x1, int y1, int x2, int y2, 
        float interline, String txt) {
        AttributedString as = new AttributedString(txt);
        as.addAttribute(TextAttribute.FOREGROUND, graphics.getPaint());
        as.addAttribute(TextAttribute.FONT, graphics.getFont());
        AttributedCharacterIterator aci = as.getIterator();
        FontRenderContext frc = new FontRenderContext(null, true, false);
        LineBreakMeasurer lbm = new LineBreakMeasurer(aci, frc);
        float width = x2 - x1;

        while (lbm.getPosition() < txt.length()) {
            TextLayout tl = lbm.nextLayout(width);
            y1 += tl.getAscent();
            tl.draw(graphics, x1, y1);
            y1 += tl.getDescent() + tl.getLeading() + (interline - 1.0f) * tl.getAscent();
            if (y1 > y2) {
                break;
            }
        }
    }
</pre>

<p></code></p>
]]></content:encoded>
			<wfw:commentRss>http://acogitosis.krop.pl/2008-11-27-en-how-to-word-wrap-text-in-graphics2ddrawstring-in-java/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
