<?xml version="1.0" encoding="UTF-8"?> <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/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
> <channel><title>Autarchy of the Private Cavehow-to &#187;</title> <atom:link href="http://bogdan.org.ua/tags/how-to/feed" rel="self" type="application/rss+xml" /><link>http://bogdan.org.ua</link> <description>Tiny bits of bioinformatics, [web-]programming etc</description> <lastBuildDate>Fri, 03 Feb 2012 22:51:18 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <item><title>How to remotely convert live 1xHDD/LVM Linux server to 2xHDD RAID1/LVM (GRUB2, GPT)</title><link>http://bogdan.org.ua/2011/05/17/how-to-remotely-convert-live-hdd-lvm-linux-server-to-raid1-grub2-gpt.html</link> <comments>http://bogdan.org.ua/2011/05/17/how-to-remotely-convert-live-hdd-lvm-linux-server-to-raid1-grub2-gpt.html#comments</comments> <pubDate>Tue, 17 May 2011 13:23:05 +0000</pubDate> <dc:creator>Bogdan</dc:creator> <category><![CDATA[*nix]]></category> <category><![CDATA[how-to]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[Debian]]></category> <category><![CDATA[GPT]]></category> <category><![CDATA[grub2]]></category> <category><![CDATA[LVM]]></category> <category><![CDATA[mdadm]]></category> <category><![CDATA[RAID]]></category> <guid
isPermaLink="false">http://bogdan.org.ua/?p=1593</guid> <description><![CDATA[Assumptions: current HDD is /dev/sda, it has a GPT (with bios_grub being /dev/sda1), separate /boot partition (/dev/sda2), and a physical LVM volume (/dev/sda3), where LVM holds all the remaining partitions (root, /home, /srv, &#8230;); LVM is properly configured, and system reboots with no problems your new drive is /dev/sdb, it is identical to /dev/sda, and [...]]]></description> <content:encoded><![CDATA[<p>Assumptions:</p><ul><li>current HDD is /dev/sda, it has a GPT (with bios_grub being /dev/sda1), separate /boot partition (/dev/sda2), and a physical LVM volume (/dev/sda3), where LVM holds all the remaining partitions (root, /home, /srv, &#8230;); LVM is properly configured, and system reboots with no problems</li><li>your new drive is /dev/sdb, it is identical to /dev/sda, and it comes empty from the manufacturer (this is important! wipe the drive if it is not empty, especially if it used to be a part of another RAID)</li><li>your system is Debian or Debian-based; in this exact example I&#8217;ve been using Ubuntu Server 10.04</li><li>your LVM volume group is named vg0</li><li>make sure you understand what each command does before executing it</li><li>you do have an external backup of all your important data, and you do understand that the following operations are potentially dangerous to your data integrity</li></ul><p>Inspired by: <a
href="http://www200.pair.com/mecham/raid/raid1-degraded-etch.html">Debian Etch RAID guide</a>, <a
href="http://serverfault.com/questions/267819/convert-1x2tb-hdd-with-lvm-into-2x2tb-hdd-with-raid1lvm-or-with-lvm-mirroring">serverfault question</a>.<br
/> <span
id="more-1593"></span></p><ol><li>Create the GPT on the new drive:<br
/> <strong>parted /dev/sdb mklabel gpt</strong></li><li>Get the list of partitions on /dev/sda:<br
/> <strong>parted -m /dev/sda print</strong></li><li>Create /dev/sdb partitions similarly to what you have on /dev/sda (my example numbers follow, use your numbers here):<br
/> <strong>parted /dev/sdb mkpart bios_grub 1049kB 2097kB</strong><br
/> <strong>parted /dev/sdb mkpart boot 2097kB 258MB</strong><br
/> <strong>parted /dev/sdb mkpart lvm 258MB 2000GB</strong></li><li>Set proper flags on partitions:<br
/> <strong>parted /dev/sdb set 1 bios_grub on</strong> (GPT doesn&#8217;t have MBR, so you create a 1-MB partition instead to hold grub2&#8242;s boot code)<br
/> <em>(possibly optional)</em> <strong>parted /dev/sdb set 2 raid on</strong><br
/> <em>(possibly optional)</em> <strong>parted /dev/sdb set 3 raid on</strong></li><li><em>(possibly optional)</em> To make sure /dev/sdb1 (the bios_grub) indeed contains grub&#8217;s boot code, I did <strong>dd if=/dev/sda1 of=/dev/sdb1</strong></li><li><strong>apt-get install mdadm</strong></li><li>Note: at this point, older tutorials suggest adding a bunch of raid* kernel modules to /etc/modules and to grub&#8217;s list of modules to load. I&#8217;m not sure this is really necessary, but do see the tutorials mentioned at the top for more information. If you do modify the lists of modules &#8211; don&#8217;t forget to run <strong>update-initramfs -u</strong>.</li><li>Create two initially-degraded RAID1 devices (one for /boot, another for LVM):<br
/> <strong>mdadm &ndash;&ndash;create /dev/md0 &ndash;&ndash;level=1 &ndash;&ndash;raid-devices=2 /dev/sdb2 missing</strong><br
/> <strong>mdadm &ndash;&ndash;create /dev/md1 &ndash;&ndash;level=1 &ndash;&ndash;raid-devices=2 /dev/sdb3 missing</strong></li><li>Store the configuration of your RAID1 to the mdadm.conf file (important! this is not done automatically!)<br
/> <strong>mdadm -Es >> /etc/mdadm/mdadm.conf</strong></li><li>Verify the contents of your mdadm.conf:<br
/> <strong>cat /etc/mdadm/mdadm.conf</strong><br
/> <strong>dpkg-reconfigure mdadm</strong>, and enable booting in degraded mode</li><li>Copy your current /boot (/dev/sda2) to the new /dev/md0 /boot partition:<br
/> (one can use dd here as well, but for some reason my attempt at dd failed writing 1 last byte of data)<br
/> <strong>mkdir /mnt/md0</strong><br
/> <strong>mount /dev/md0 /mnt/md0</strong><br
/> <strong>cp -a /boot/* /mnt/md0/</strong><br
/> <strong>umount /dev/md0</strong><br
/> <strong>rmdir /mnt/md0</strong></li><li>Now extend your existing volume group to include the newly-created /dev/md1:<br
/> <strong>pvcreate /dev/md1</strong><br
/> <strong>vgextend vg0 /dev/md1</strong></li><li>Verify the list of logical volumes you curently have: enter <strong>lvm</strong> shell, and type <strong>lvs</strong>. Here&#8217;s what I had:<br
/> LV   VG    Attr   LSize   Origin Snap%  Move Log Copy%  Convert<br
/> home vg0   -wi-ao   1.70t<br
/> logs vg0   -wi-ao   4.66g<br
/> root vg0   -wi-ao  10.24g<br
/> srv  vg0   -wc-ao 100.00g<br
/> swap vg0   -wi-ao   1.86g<br
/> tmp  vg0   -wi-ao   4.66g</li><li>Now, you can move all the logical volumes to new physical volume in one command: <strong>pvmove /dev/sda3 /dev/md1</strong>. Personally, remembering the problem I had with dd from /dev/sda2 to /dev/md0, I decided to move all logical volumes one-by-one; as this takes time, you may consider joining these operations with <strong>;</strong> or <strong>&#038;&</strong>, and putting the /tmp last (as the easiest one to re-create if it fails to move):<br
/> <strong>pvmove &ndash;&ndash;name home /dev/sda3 /dev/md1</strong><br
/> <strong>pvmove &ndash;&ndash;name srv /dev/sda3 /dev/md1</strong><br
/> <strong>pvmove &ndash;&ndash;name logs /dev/sda3 /dev/md1</strong><br
/> <strong>pvmove &ndash;&ndash;name swap /dev/sda3 /dev/md1</strong><br
/> <strong>pvmove &ndash;&ndash;name root /dev/sda3 /dev/md1</strong><br
/> <strong>pvmove &ndash;&ndash;name tmp /dev/sda3 /dev/md1</strong></li><li>To be safer, I ran FS check on a few volumes I could umount:<br
/> <strong>umount /dev/mapper/vg0-srv</strong><br
/> <strong>fsck -f /dev/mapper/vg0-srv</strong><br
/> <strong>mount /dev/mapper/vg0-srv</strong><br
/> <strong>umount /dev/mapper/vg0-tmp</strong><br
/> <strong>fsck -f /dev/mapper/vg0-tmp</strong><br
/> <strong>mount /dev/mapper/vg0-tmp</strong></li><li>Remove /dev/sda3 from the physical space available to your volume group:<br
/> <strong>vgreduce vg0 /dev/sda3</strong></li><li>Install grub2 to both drives, so as to make them both bootable in case of failure:<br
/> <strong>grub-install &#8216;(hd0)&#8217;</strong><br
/> <strong>grub-install &#8216;(hd1)&#8217;</strong></li><li>Edit <strong>/etc/fstab</strong>, pointing /boot to /dev/md0. You may use UUIDs here, but please do not use UUIDs from mdadm.conf &#8211; those are different from FS-UUIDs, instead do <strong>ls -l /dev/disk/by-uuid</strong> to find the UUID of /dev/md0. Personally, I had no problems just using /dev/md0.</li><li>Now is the time to add your original /dev/sda to the RAID1; be absolutely sure you have moved all the data off that drive, because these commands will destroy it:<br
/> <strong>mdadm &ndash;&ndash;manage &ndash;&ndash;add /dev/md0 /dev/sda2</strong><br
/> <strong>mdadm &ndash;&ndash;manage &ndash;&ndash;add /dev/md1 /dev/sda3</strong><br
/> Re-syncing array will take some time.</li><li>To be on the safe side, you may want to run again <strong>update-initramfs -u</strong> and <strong>update-grub</strong>; I have also edited /etc/grub.d/40_custom, adding there 2 more boot options: from /dev/sda2 and /dev/sdb2 (/boot on both drives) &#8211; have no idea if that will work, but having more boot options didn&#8217;t hurt</li><li>Reboot into your new system. Actually, at this point reboot is only necessary to verify that your system is bootable &#8211; you may delay this reboot as long as you want to.</li><li>Many tutorials also suggest testing your RAID1 by manually &#8220;degrading&#8221; it, trying to boot, and then rebuilding it back. I haven&#8217;t done that, but you may want to.</li></ol><p>Improvement suggestions, criticism and thank-you are welcome in the comments.</p> ]]></content:encoded> <wfw:commentRss>http://bogdan.org.ua/2011/05/17/how-to-remotely-convert-live-hdd-lvm-linux-server-to-raid1-grub2-gpt.html/feed</wfw:commentRss> <slash:comments>3</slash:comments> </item> <item><title>How to truncate git history (sample script included)</title><link>http://bogdan.org.ua/2011/03/28/how-to-truncate-git-history-sample-script-included.html</link> <comments>http://bogdan.org.ua/2011/03/28/how-to-truncate-git-history-sample-script-included.html#comments</comments> <pubDate>Mon, 28 Mar 2011 18:17:21 +0000</pubDate> <dc:creator>Bogdan</dc:creator> <category><![CDATA[how-to]]></category> <category><![CDATA[Notepad]]></category> <category><![CDATA[git]]></category> <category><![CDATA[history]]></category> <category><![CDATA[truncate]]></category> <guid
isPermaLink="false">http://bogdan.org.ua/?p=1481</guid> <description><![CDATA[Under a few assumptions (most importantly - you do not have any non-merged branches,), it is very easy to throw away git repository commits older than an arbitrarily-chosen commit. Here's a sample script (call it e.g. git-truncate and put into your ~/bin or whichever location you have in PATH). PLAIN TEXT CODE: #!/bin/bash git checkout [...]]]></description> <content:encoded><![CDATA[<p>Under a few assumptions (most importantly - you do not have any non-merged branches,), it is very easy to throw away git repository commits older than an arbitrarily-chosen commit.</p><p>Here's a sample script (call it e.g. <strong>git-truncate</strong> and put into your ~/bin or whichever location you have in PATH).</p><div
class="igBar"><span
id="lcode-2"><a
href="#" onclick="javascript:showPlainTxt('code-2'); return false;">PLAIN TEXT</a></span></div><div
class="syntax_hilite"><span
class="langName">CODE:</span><div
id="code-2"><div
class="code"><ol><li
style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div
style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">#!/bin/bash</div></li><li
style="font-weight: bold;color:#26536A;"><div
style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">git checkout --orphan temp $<span
style="color:#800000;color:#800000;">1</span></div></li><li
style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div
style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">git commit -m <span
style="color:#CC0000;">"Truncated history"</span></div></li><li
style="font-weight: bold;color:#26536A;"><div
style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">git rebase --onto temp $<span
style="color:#800000;color:#800000;">1</span> master</div></li><li
style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div
style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">git branch -D temp</div></li></ol></div></div></div><p></p><p>Invocation: cd to your repository, then <strong>git-truncate <em>refspec</em></strong>, where <em>refspec</em> is either a commit's SHA1 hash-id, or a tag.</p><p>Expected result: a git repository starting with "Truncated history" initial commit, and continuing to the tip of the branch you were on when calling the script.</p><p>If you truncate repositories often, then consider adding an optional 2nd argument (truncate-commit message) and also some safeguards against improper use - currently, even if refspec is wrong, the script will <strong>not</strong> abort after a failed checkout.</p><p>Thanks for posting any improvements you may have.</p><p>Source: <a
href="http://support.github.com/discussions/repos/5751-how-to-truncate-the-history-of-a-repository">Tekkub's post on github discussions</a>.<br
/> See also: <a
href="http://bogdan.org.ua/2009/02/13/git-how-to-remove-file-commit-from-history.html">how to remove a single file from all of git's commits</a>.</p> ]]></content:encoded> <wfw:commentRss>http://bogdan.org.ua/2011/03/28/how-to-truncate-git-history-sample-script-included.html/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>How to easily install any PyPi/easy_install python module on Debian</title><link>http://bogdan.org.ua/2011/02/16/how-to-easily-install-any-pypi-easy_install-python-module-on-debian.html</link> <comments>http://bogdan.org.ua/2011/02/16/how-to-easily-install-any-pypi-easy_install-python-module-on-debian.html#comments</comments> <pubDate>Wed, 16 Feb 2011 17:22:20 +0000</pubDate> <dc:creator>Bogdan</dc:creator> <category><![CDATA[*nix]]></category> <category><![CDATA[how-to]]></category> <category><![CDATA[Notepad]]></category> <category><![CDATA[Python]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[Debian]]></category> <category><![CDATA[debianize]]></category> <category><![CDATA[easy_install]]></category> <category><![CDATA[pycassa]]></category> <category><![CDATA[PyPi]]></category> <guid
isPermaLink="false">http://bogdan.org.ua/?p=1430</guid> <description><![CDATA[Imagine you need to install pycassa (which uses easy_install). Here are the 2 (at maximum) very simple steps to have it properly debianized and installed on your Debian/Ubuntu: if you don't have the python-stdeb package: sudo aptitude install python-stdeb pypi-install pycassa That's it. Refer to stdeb readme for more information. You will need that if [...]]]></description> <content:encoded><![CDATA[<p>Imagine you need to install <a
href="https://github.com/pycassa/pycassa">pycassa</a> (which uses easy_install). Here are the 2 (at maximum) very simple steps to have it properly debianized and installed on your Debian/Ubuntu:</p><ul><li>if you don't have the python-stdeb package: <strong>sudo aptitude install python-stdeb</strong></li><li><strong>pypi-install pycassa</strong></li></ul><p>That's it.</p><p>Refer to <a
href="https://github.com/astraw/stdeb#readme">stdeb readme</a> for more information. You will need that if there are dependencies - which might not be resolved automatically by stdeb.</p><p>Before stdeb, it wasn't exactly trivial to <a
href="http://showmedo.com/videotutorials/video?name=linuxJensMakingDeb">make a .deb from python module</a>.</p> ]]></content:encoded> <wfw:commentRss>http://bogdan.org.ua/2011/02/16/how-to-easily-install-any-pypi-easy_install-python-module-on-debian.html/feed</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>How to replace newlines with commas, tabs etc (merge lines)</title><link>http://bogdan.org.ua/2010/11/16/how-to-replace-newlines-with-commas-tabs-etc-merge-lines.html</link> <comments>http://bogdan.org.ua/2010/11/16/how-to-replace-newlines-with-commas-tabs-etc-merge-lines.html#comments</comments> <pubDate>Tue, 16 Nov 2010 08:20:45 +0000</pubDate> <dc:creator>Bogdan</dc:creator> <category><![CDATA[*nix]]></category> <category><![CDATA[Bioinformatics]]></category> <category><![CDATA[how-to]]></category> <category><![CDATA[Notepad]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[awk]]></category> <category><![CDATA[grep]]></category> <category><![CDATA[linux]]></category> <category><![CDATA[paste]]></category> <category><![CDATA[sed]]></category> <category><![CDATA[sort]]></category> <category><![CDATA[tr]]></category> <guid
isPermaLink="false">http://bogdan.org.ua/?p=1208</guid> <description><![CDATA[Imagine you need to get a few lines from a group of files with missing identifier mappings. I have a bunch of files with content similar to this one: ENSRNOG00000018677 1368832_at 25233 ENSRNOG00000002079 1369102_at 25272 ENSRNOG00000043451 25353 ENSRNOG00000001527 1388013_at 25408 ENSRNOG00000007390 1389538_at 25493 In the example above I need '25353', which does not have corresponding [...]]]></description> <content:encoded><![CDATA[<p>Imagine you need to get a few lines from a group of files with missing identifier mappings. I have a bunch of files with content similar to this one:</p><blockquote><p> ENSRNOG00000018677      1368832_at      25233<br
/> ENSRNOG00000002079      1369102_at      25272<br
/> ENSRNOG00000043451                            25353<br
/> ENSRNOG00000001527      1388013_at      25408<br
/> ENSRNOG00000007390      1389538_at      25493</p></blockquote><p>In the example above I need '25353', which does not have corresponding affy_probeset_id in the 2nd column.</p><p>It is clear how to do that:</p><div
class="igBar"><span
id="lcode-9"><a
href="#" onclick="javascript:showPlainTxt('code-9'); return false;">PLAIN TEXT</a></span></div><div
class="syntax_hilite"><span
class="langName">CODE:</span><div
id="code-9"><div
class="code"><ol><li
style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div
style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">sort -u *_affy_ensembl.<span
style="">txt</span> | grep -v <span
style="color:#CC0000;">'_at'</span> | awk <span
style="color:#CC0000;">'{print $2}'</span></div></li></ol></div></div></div><p></p><p>This outputs a column of required IDs (EntrezGene in this example):</p><blockquote><p> 116720<br
/> 679845<br
/> 309295<br
/> 364867<br
/> 298220<br
/> 298221<br
/> 25353</p></blockquote><p>However, I need these IDs as a comma-separated list, not as newline-separated list.</p><p>There are several ways to achieve the desired result (only the last pipe commands differ):</p><div
class="igBar"><span
id="lcode-10"><a
href="#" onclick="javascript:showPlainTxt('code-10'); return false;">PLAIN TEXT</a></span></div><div
class="syntax_hilite"><span
class="langName">CODE:</span><div
id="code-10"><div
class="code"><ol><li
style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div
style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">sort -u *_affy_ensembl.<span
style="">txt</span> | grep -v <span
style="color:#CC0000;">'_at'</span> | awk <span
style="color:#CC0000;">'{print $2}'</span> | gawk <span
style="color:#CC0000;">'$1=$1'</span> ORS=<span
style="color:#CC0000;">', '</span></div></li></ol></div></div></div><p></p><div
class="igBar"><span
id="lcode-11"><a
href="#" onclick="javascript:showPlainTxt('code-11'); return false;">PLAIN TEXT</a></span></div><div
class="syntax_hilite"><span
class="langName">CODE:</span><div
id="code-11"><div
class="code"><ol><li
style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div
style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">sort -u *_affy_ensembl.<span
style="">txt</span> | grep -v <span
style="color:#CC0000;">'_at'</span> | awk <span
style="color:#CC0000;">'{print $2}'</span> | tr <span
style="color:#CC0000;">'<span
style="color:#000099; font-weight:bold;">\n</span>'</span> <span
style="color:#CC0000;">','</span></div></li></ol></div></div></div><p></p><div
class="igBar"><span
id="lcode-12"><a
href="#" onclick="javascript:showPlainTxt('code-12'); return false;">PLAIN TEXT</a></span></div><div
class="syntax_hilite"><span
class="langName">CODE:</span><div
id="code-12"><div
class="code"><ol><li
style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div
style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">sort -u *_affy_ensembl.<span
style="">txt</span> | grep -v <span
style="color:#CC0000;">'_at'</span> | awk <span
style="color:#CC0000;">'{print $2}'</span> | sed <span
style="color:#CC0000;">':a;N;$!ba;s/<span
style="color:#000099; font-weight:bold;">\n</span>/, /g'</span></div></li></ol></div></div></div><p></p><div
class="igBar"><span
id="lcode-13"><a
href="#" onclick="javascript:showPlainTxt('code-13'); return false;">PLAIN TEXT</a></span></div><div
class="syntax_hilite"><span
class="langName">CODE:</span><div
id="code-13"><div
class="code"><ol><li
style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div
style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">sort -u *_affy_ensembl.<span
style="">txt</span> | grep -v <span
style="color:#CC0000;">'_at'</span> | awk <span
style="color:#CC0000;">'{print $2}'</span> | sed <span
style="color:#CC0000;">':q;N;s/<span
style="color:#000099; font-weight:bold;">\n</span>/, /g;t q'</span></div></li></ol></div></div></div><p></p><div
class="igBar"><span
id="lcode-14"><a
href="#" onclick="javascript:showPlainTxt('code-14'); return false;">PLAIN TEXT</a></span></div><div
class="syntax_hilite"><span
class="langName">CODE:</span><div
id="code-14"><div
class="code"><ol><li
style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div
style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">sort -u *_affy_ensembl.<span
style="">txt</span> | grep -v <span
style="color:#CC0000;">'_at'</span> | awk <span
style="color:#CC0000;">'{print $2}'</span> | paste -s -d <span
style="color:#CC0000;">","</span></div></li></ol></div></div></div><p></p><p>These solutions differ in efficiency and (slightly) in output. <strong>sed</strong> will read all the input into its buffer to replace newlines with other separators, so it might not be best for large files. <strong>tr</strong> might be the most efficient, but I haven't tested that. <strong>paste</strong> will re-use delimiters, so you cannot really get comma-space ", " separation with it.</p><p>Sources: <a
href="http://www.linuxquestions.org/questions/programming-9/sed-how-do-you-replace-end-of-line-with-a-space-637013/">linuxquestions 1 (explains used sed commands)</a>, <a
href="http://www.linuxquestions.org/questions/programming-9/merge-lines-in-a-file-using-sed-191121/">linuxquestions 2</a>, <a
href="http://www.cyberciti.biz/faq/linux-unix-sed-replace-newline/">nixcraft</a>.</p> ]]></content:encoded> <wfw:commentRss>http://bogdan.org.ua/2010/11/16/how-to-replace-newlines-with-commas-tabs-etc-merge-lines.html/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Linux: how to label swap partition w/o losing swap UUID</title><link>http://bogdan.org.ua/2010/07/16/linux-how-to-label-swap-partition-without-losing-swap-uuid.html</link> <comments>http://bogdan.org.ua/2010/07/16/linux-how-to-label-swap-partition-without-losing-swap-uuid.html#comments</comments> <pubDate>Fri, 16 Jul 2010 12:41:13 +0000</pubDate> <dc:creator>Bogdan</dc:creator> <category><![CDATA[*nix]]></category> <category><![CDATA[how-to]]></category> <category><![CDATA[linux]]></category> <category><![CDATA[partition]]></category> <category><![CDATA[swap]]></category> <guid
isPermaLink="false">http://bogdan.org.ua/?p=1082</guid> <description><![CDATA[In short: sudo mkswap -L new_swap_label -U old_swap_UUID /dev/sd_swap_device. If you don't care about the UUID: just sudo mkswap -L new_swap_label /dev/sd_swap_device. Step-by-step: Identify current swap UUID: grep swap /etc/fstab ; you should see a line starting with UUID=b4e6e... - note that UUID; let us assume our UUID is b4e6e5d8-8854-4a3e-8edb-f423ded31e2a Identify swap partition device. If [...]]]></description> <content:encoded><![CDATA[<p>In short: <strong>sudo mkswap -L new_swap_label -U old_swap_UUID /dev/sd_swap_device</strong>.<br
/> If you don't care about the UUID: just <strong>sudo mkswap -L new_swap_label /dev/sd_swap_device</strong>.</p><p>Step-by-step:<br
/> <span
id="more-1082"></span></p><ol><li>Identify current swap UUID: <strong>grep swap /etc/fstab</strong> ; you should see a line starting with <strong>UUID=</strong>b4e6e... - note that UUID; let us assume our UUID is <em>b4e6e5d8-8854-4a3e-8edb-f423ded31e2a</em></li><li>Identify swap partition device. If you are using Debian or Ubuntu, device might have been shown to you when running command #1 as a comment of the form<br
/><blockquote># /dev/sdX4       none            swap    sw              0       0</p></blockquote><p> Just to be sure, run <strong>cat /proc/swaps</strong> (or <strong>sudo swapon -s</strong>), to be shown something like this:</p><p><code>Filename                                Type            Size    Used    Priority<br
/> /dev/sdX4                               partition       2104504 0       -1<br
/> </code><br
/> You can also use partition managers to identify swap device, e.g. <strong>sudo fdisk -l</strong>. Let us assume our partition device is <em>sdX4</em>.</li><li>If that swap partition is in use, you need to disable it first: <strong>sudo swapoff /dev/sdX4</strong></li><li>Now that you have both the UUID and the device, run<br
/> <strong>sudo mkswap -L new_swap_label -U b4e6e5d8-8854-4a3e-8edb-f423ded31e2a /dev/sdX4</strong><br
/> Do not forget replacing sample values above (label, UUID and device) with your actual values.</li><li>Enable swap: <strong>sudo swapon /dev/sdX4</strong></li></ol><p>Now, if you wish so, you may proceed to edit /etc/fstab and replace UUID=.... with LABEL=your_new_swap_label, leaving all other spaces and values in that line untouched.</p> ]]></content:encoded> <wfw:commentRss>http://bogdan.org.ua/2010/07/16/linux-how-to-label-swap-partition-without-losing-swap-uuid.html/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Search and replace in a MySQL table</title><link>http://bogdan.org.ua/2009/10/27/search-and-replace-in-a-mysql-table.html</link> <comments>http://bogdan.org.ua/2009/10/27/search-and-replace-in-a-mysql-table.html#comments</comments> <pubDate>Tue, 27 Oct 2009 07:37:34 +0000</pubDate> <dc:creator>Bogdan</dc:creator> <category><![CDATA[how-to]]></category> <category><![CDATA[Notepad]]></category> <category><![CDATA[mysql]]></category> <category><![CDATA[replace]]></category> <category><![CDATA[search]]></category> <category><![CDATA[snippet]]></category> <guid
isPermaLink="false">http://bogdan.org.ua/?p=917</guid> <description><![CDATA[This query performs a table-wide search-and-repalce: UPDATE `table_name` SET `table_field` = REPLACE(`table_field`,'string to search for and replace','replacement string'); If you need a database-wide search-and-replace, you could try this script (I haven't tested/used it myself). Beware of the following gotchas: wrong query syntax may ruin the field you are performing replace on, so always backup first! [...]]]></description> <content:encoded><![CDATA[<p>This query performs a table-wide search-and-repalce:</p><blockquote><p>UPDATE `table_name` SET `table_field` = REPLACE(`table_field`,'string to search for and replace','replacement string');</p></blockquote><p>If you need a database-wide search-and-replace, you could try <a
href="http://blog.irmsgeekwork.com/phpmysql-full-database-search-and-replace">this script</a> (I haven't tested/used it myself).</p><p>Beware of the following gotchas:</p><ol><li>wrong query syntax may ruin the field you are performing replace on, so <strong>always backup first!</strong></li><li>be sure to provide "search-for" string as specific as possible, or you will get<strong> unexpected replacements</strong> (e.g. replacing <em>mini</em> with <em>little</em> will also convert all <em>minivans</em> into <em>littlevans</em>); also, do use WHERE clause when necessary to limit the number of rows modified</li><li>the function in the example is <strong>case-sensitive</strong>, so replacing all <em>minivans</em> with <em>vehicles</em> won't replace <em>Minivans</em>. However, I believe there exists a case-insensitive version of REPLACE function</li></ol> ]]></content:encoded> <wfw:commentRss>http://bogdan.org.ua/2009/10/27/search-and-replace-in-a-mysql-table.html/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Configuring web-server: for production and for development</title><link>http://bogdan.org.ua/2009/10/25/configuring-web-server-for-production-and-for-development.html</link> <comments>http://bogdan.org.ua/2009/10/25/configuring-web-server-for-production-and-for-development.html#comments</comments> <pubDate>Sun, 25 Oct 2009 15:16:10 +0000</pubDate> <dc:creator>Bogdan</dc:creator> <category><![CDATA[Links]]></category> <category><![CDATA[Notepad]]></category> <category><![CDATA[PHP]]></category> <category><![CDATA[Programming]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[development]]></category> <category><![CDATA[how-to]]></category> <category><![CDATA[production]]></category> <category><![CDATA[web-server]]></category> <guid
isPermaLink="false">http://bogdan.org.ua/?p=680</guid> <description><![CDATA[Production: see http://www.howtoforge.com/how-to-set-up-apache2-with-mod_fcgid-and-php5-on-debian-etch - it is for Debian Etch (which is old-stable), but many of the steps apply equally well to Debian Lenny (current-stable). Also, this is a very basic guide, as if you are going to host multiple sites from multiple clients, you most definitely will need some hosting control panel. Development: see http://www.ruzee.com/blog/2009/01/apache-virtual-hosts-a-clean-setup-for-php-developers. [...]]]></description> <content:encoded><![CDATA[<p><strong>Production</strong>: see <a
href="http://www.howtoforge.com/how-to-set-up-apache2-with-mod_fcgid-and-php5-on-debian-etch">http://www.howtoforge.com/how-to-set-up-apache2-with-mod_fcgid-and-php5-on-debian-etch</a> - it is for Debian Etch (which is old-stable), but many of the steps apply equally well to Debian Lenny (current-stable). Also, this is a very basic guide, as if you are going to host multiple sites from multiple clients, you most definitely will need some <a
href="http://bogdan.org.ua/2008/09/27/which-hosting-control-panel-to-use-for-a-debian-server.html">hosting control panel</a>.</p><p><strong>Development</strong>: see <a
href="http://www.ruzee.com/blog/2009/01/apache-virtual-hosts-a-clean-setup-for-php-developers">http://www.ruzee.com/blog/2009/01/apache-virtual-hosts-a-clean-setup-for-php-developers</a>. This setup works very well, unless you need to create several virtual hosts every day - in which case necessary actions could be partially scripted.</p> ]]></content:encoded> <wfw:commentRss>http://bogdan.org.ua/2009/10/25/configuring-web-server-for-production-and-for-development.html/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>C: how to specify comparison operators floating precision</title><link>http://bogdan.org.ua/2009/06/11/c-how-to-specify-comparison-operators-floating-precision.html</link> <comments>http://bogdan.org.ua/2009/06/11/c-how-to-specify-comparison-operators-floating-precision.html#comments</comments> <pubDate>Thu, 11 Jun 2009 17:47:37 +0000</pubDate> <dc:creator>Bogdan</dc:creator> <category><![CDATA[how-to]]></category> <category><![CDATA[Programming]]></category> <category><![CDATA[C]]></category> <category><![CDATA[comparison]]></category> <category><![CDATA[double]]></category> <category><![CDATA[example]]></category> <category><![CDATA[float]]></category> <category><![CDATA[floating]]></category> <category><![CDATA[operator]]></category> <category><![CDATA[precision]]></category> <guid
isPermaLink="false">http://bogdan.org.ua/?p=774</guid> <description><![CDATA[There is no way I'm aware of to do what the title says. However... I'm sure that you are aware of the fact that floats representation in any programming language is limited by the precision of the internal binary representations. In other words, you can never have an exact float representation - there will always [...]]]></description> <content:encoded><![CDATA[<p>There is no way I'm aware of to do what the title says. However...</p><p>I'm sure that you are aware of the fact that floats representation in any programming language is limited by the precision of the internal binary representations. In other words, you can never have an <strong>exact</strong> float representation - there will always be some precision associated with the float you are working with. The simplest example is the difference in precision between the <em>float</em> and <em>double</em> types in <strong>C</strong>.</p><p>Suppose I have the following code fragment:</p><div
class="igBar"><span
id="lc-18"><a
href="#" onclick="javascript:showPlainTxt('c-18'); return false;">PLAIN TEXT</a></span></div><div
class="syntax_hilite"><span
class="langName">C:</span><div
id="c-18"><div
class="c"><ol><li
style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div
style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span
style="color: #b1b100;">if</span> <span
style="color: #66cc66;">&#40;</span> result.<span
style="color: #202020;">score</span> &gt;= input-&gt;raw_cut_off <span
style="color: #66cc66;">&#41;</span></div></li></ol></div></div></div><p></p><p>Both <em>result.score</em> and <em>input->raw_cut_off</em> are of type <strong>float</strong>, and can have positive and negative values. When compared with the greater than or equal ( >= ) operator, it is not always that condition is true - for the precision reasons shortly mentioned above.</p><p>As I already said, there is no precision specification for equality operators in <strong>C</strong>. But it is quite simple to "invent" precision specification; e.g. if I wanted to test for equality only, I could write</p><div
class="igBar"><span
id="lc-19"><a
href="#" onclick="javascript:showPlainTxt('c-19'); return false;">PLAIN TEXT</a></span></div><div
class="syntax_hilite"><span
class="langName">C:</span><div
id="c-19"><div
class="c"><ol><li
style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div
style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span
style="color: #b1b100;">if</span> <span
style="color: #66cc66;">&#40;</span> fabsf<span
style="color: #66cc66;">&#40;</span> result.<span
style="color: #202020;">score</span> - input-&gt;raw_cut_off <span
style="color: #66cc66;">&#41;</span> &lt; <span
style="color: #cc66cc;color:#800000;">0</span>.<span
style="color: #cc66cc;color:#800000;">000001</span> <span
style="color: #66cc66;">&#41;</span></div></li></ol></div></div></div><p></p><p>In this example, I'm effectively asking for 6-digit precision for the equality comparison of floating-point values. Note, that if you replace that 0.000001 with the actual precision limit of the floating type you are using, you will be "exactly" comparing floating-point numbers - up to that type's precision, of course <img
src='http://bogdan.org.ua/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p><p>The first-most example with the >= operator can be rewritten as</p><div
class="igBar"><span
id="lc-20"><a
href="#" onclick="javascript:showPlainTxt('c-20'); return false;">PLAIN TEXT</a></span></div><div
class="syntax_hilite"><span
class="langName">C:</span><div
id="c-20"><div
class="c"><ol><li
style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div
style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span
style="color: #b1b100;">if</span> <span
style="color: #66cc66;">&#40;</span> result.<span
style="color: #202020;">score</span> &gt; <span
style="color: #66cc66;">&#40;</span> input-&gt;raw_cut_off - precision<span
style="color: #66cc66;">&#41;</span> <span
style="color: #66cc66;">&#41;</span></div></li></ol></div></div></div><p> where <em>precision</em> is exactly what it is named, e.g. <em>precision</em> = 0.000001.</p><p>Sources used:</p><ul><li>comment by <a
href="http://bytes.com/topic/c-sharp/answers/233215-float-double-arithmetic-precision-error#post953273">Randy A. Ynchausti</a></li><li><a
href="http://www.shokhirev.com/nikolai/abc/sciprog/sciprognum.html">scientific programming</a></li></ul> ]]></content:encoded> <wfw:commentRss>http://bogdan.org.ua/2009/06/11/c-how-to-specify-comparison-operators-floating-precision.html/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Best method to recursively chmod/process files or directories</title><link>http://bogdan.org.ua/2009/06/08/best-method-to-recursively-chmodprocess-files-or-directories.html</link> <comments>http://bogdan.org.ua/2009/06/08/best-method-to-recursively-chmodprocess-files-or-directories.html#comments</comments> <pubDate>Mon, 08 Jun 2009 14:33:51 +0000</pubDate> <dc:creator>Bogdan</dc:creator> <category><![CDATA[*nix]]></category> <category><![CDATA[how-to]]></category> <category><![CDATA[Links]]></category> <category><![CDATA[Notepad]]></category> <category><![CDATA[chmod]]></category> <category><![CDATA[find]]></category> <category><![CDATA[linux]]></category> <category><![CDATA[recursive]]></category> <guid
isPermaLink="false">http://bogdan.org.ua/?p=746</guid> <description><![CDATA[Found here. Recursively set directories only to drwx-rx-rx (755): find . -type d -exec chmod 755 {} \; Recursively set files only to rwx-r-r (644): find . -type f -exec chmod 644 {} \; Recursively remove carriage returns (^M) from the end of all *.php files: find . -type f -name "*.php" -exec /home/user/dos2unix.sh {} [...]]]></description> <content:encoded><![CDATA[<p>Found <a
href="http://movabletripe.com/archive/recursively-chmod-directories-only/#comment-50718">here</a>.</p><p>Recursively set directories only to drwx-rx-rx (755):</p><blockquote><p>find . -type d -exec chmod 755 {} \;</p></blockquote><p>Recursively set files only to rwx-r-r (644):</p><blockquote><p>find . -type f -exec chmod 644 {} \;</p></blockquote><p>Recursively remove carriage returns (^M) from the end of all *.php files:</p><blockquote><p>find . -type f -name "*.php" -exec /home/user/<a
href="http://bogdan.org.ua/2009/03/30/linux-how-to-remove-trailing-control-m-carriage-return.html">dos2unix.sh</a> {} \;</p></blockquote><p>In all these cases, <strong>{}</strong> is replaced with the filename/directory <strong>find</strong> has found matching your parameters; <strong>\;</strong> at the end just stops <strong>exec</strong> processing.</p> ]]></content:encoded> <wfw:commentRss>http://bogdan.org.ua/2009/06/08/best-method-to-recursively-chmodprocess-files-or-directories.html/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Drupal Views: how to display random nodes/content</title><link>http://bogdan.org.ua/2009/05/04/drupal-views-how-to-display-random-nodes-content-block-page.html</link> <comments>http://bogdan.org.ua/2009/05/04/drupal-views-how-to-display-random-nodes-content-block-page.html#comments</comments> <pubDate>Mon, 04 May 2009 11:19:19 +0000</pubDate> <dc:creator>Bogdan</dc:creator> <category><![CDATA[Drupal]]></category> <category><![CDATA[Notepad]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[drupal]]></category> <category><![CDATA[how-to]]></category> <category><![CDATA[random]]></category> <category><![CDATA[views]]></category> <guid
isPermaLink="false">http://bogdan.org.ua/?p=686</guid> <description><![CDATA[Today I had a task of displaying random node in a Views-generated sidebar block. This is how to do that in Drupal 7 (Views 3): edit the view which makes the block available (follow http://your.site/admin/build/views/viewname/edit) in the Sort Criteria section (under Filter), look for and add Global:Random. This is how to do that in Drupal [...]]]></description> <content:encoded><![CDATA[<p>Today I had a task of displaying random node in a Views-generated sidebar block.</p><p>This is how to do that in Drupal 7 (Views 3):</p><ol><li>edit the view which makes the block available (follow http://<strong>your.sit</strong>e/admin/build/views/<strong>viewname</strong>/edit)</li><li>in the <strong>Sort Criteria</strong> section (under <strong>Filter</strong>), look for and add <strong>Global:Random</strong>.</li></ol><p>This is how to do that in Drupal 6 (Views 2):</p><ol><li>edit the view which makes the block available (follow http://<strong>your.sit</strong>e/admin/build/views/<strong>viewname</strong>/edit)</li><li>in the <strong>Sort Criteria</strong> section, add the <strong>Random</strong> criteria.</li></ol><p>It can't be simpler than that.</p> ]]></content:encoded> <wfw:commentRss>http://bogdan.org.ua/2009/05/04/drupal-views-how-to-display-random-nodes-content-block-page.html/feed</wfw:commentRss> <slash:comments>14</slash:comments> </item> <item><title>Linux: how to remove trailing ^M (carriage return)</title><link>http://bogdan.org.ua/2009/03/30/linux-how-to-remove-trailing-control-m-carriage-return.html</link> <comments>http://bogdan.org.ua/2009/03/30/linux-how-to-remove-trailing-control-m-carriage-return.html#comments</comments> <pubDate>Mon, 30 Mar 2009 09:43:11 +0000</pubDate> <dc:creator>Bogdan</dc:creator> <category><![CDATA[*nix]]></category> <category><![CDATA[how-to]]></category> <category><![CDATA[Notepad]]></category> <category><![CDATA[carriage return]]></category> <category><![CDATA[files]]></category> <category><![CDATA[linux]]></category> <category><![CDATA[multiple]]></category> <category><![CDATA[remove]]></category> <category><![CDATA[trailing space]]></category> <guid
isPermaLink="false">http://bogdan.org.ua/?p=640</guid> <description><![CDATA[Imagine you have some styles.css transferred from Win machine to Linux via FTP in binary mode instead of ASCII mode; then cat styles.css &#124; tr -d &#34;\r&#34; > styles-nocarriage.css will create styles-nocarriage.css with ^M's removed. Alternative syntax: tr -d &#34;\r&#34; < styles.css > styles-nocarriage.css Most editors have global replace features which allow to get rid [...]]]></description> <content:encoded><![CDATA[<p>Imagine you have some <strong>styles.css</strong> transferred from Win machine to Linux via FTP in binary mode instead of ASCII mode; then</p><blockquote><p>cat styles.css | tr -d &quot;\r&quot; > styles-nocarriage.css</p></blockquote><p>will create<strong> styles-nocarriage.css</strong> with ^M's removed.</p><p>Alternative syntax:</p><blockquote><p>tr -d &quot;\r&quot; < styles.css > styles-nocarriage.css</p></blockquote><p>Most editors have global replace features which allow to get rid of control characters using regular expressions (exact instructions are editor-specific).</p><p>For <strong>multiple files</strong>, try this:</p><blockquote><p> for f<br
/> do<br
/> mv $f ${f}~ &amp;&amp; tr -d &quot;\r&quot; <${f}~ >$f<br
/> rm ${f}~<br
/> done</p></blockquote><p>Save this shell script as a file (e.g. <strong>dos2unix.sh</strong>), then do <strong>./dos2unix.sh</strong> <em><filename(s)></em>. This script accepts wildcards (e.g. <strong>./dos2unix.sh *.php</strong>), so be careful!</p> ]]></content:encoded> <wfw:commentRss>http://bogdan.org.ua/2009/03/30/linux-how-to-remove-trailing-control-m-carriage-return.html/feed</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Intel i915 integrated graphics under Debian: how to get rid of sluggish 2D performance</title><link>http://bogdan.org.ua/2009/03/02/intel-i915-integrated-graphics-under-debian-how-to-get-rid-of-sluggish-2d-performance.html</link> <comments>http://bogdan.org.ua/2009/03/02/intel-i915-integrated-graphics-under-debian-how-to-get-rid-of-sluggish-2d-performance.html#comments</comments> <pubDate>Mon, 02 Mar 2009 20:41:03 +0000</pubDate> <dc:creator>Bogdan</dc:creator> <category><![CDATA[*nix]]></category> <category><![CDATA[Hardware]]></category> <category><![CDATA[how-to]]></category> <category><![CDATA[Debian]]></category> <category><![CDATA[driver]]></category> <category><![CDATA[i915]]></category> <category><![CDATA[performance]]></category> <category><![CDATA[slow]]></category> <category><![CDATA[video]]></category> <guid
isPermaLink="false">http://bogdan.org.ua/?p=623</guid> <description><![CDATA[I assume you already have configured and working desktop environment, but want to improve performance. First of all, sudo aptitude install mesa-utils. Then run in a Terminal/Konsole glxgears, and wait for ~15 seconds; if your FPS is ~400 or less, then you do have sluggish video performance (usually manifesting itself as slow scrolling in Firefox/Iceweasel, [...]]]></description> <content:encoded><![CDATA[<p>I assume you already have configured and working desktop environment, but want to improve performance.</p><p>First of all, <strong>sudo aptitude install mesa-utils</strong>. Then run in a Terminal/Konsole <strong>glxgears</strong>, and wait for ~15 seconds; if your FPS is ~400 or less, then you do have sluggish video performance (usually manifesting itself as slow scrolling in Firefox/Iceweasel, slow window switching/minimziing/maximizing etc).</p><p>After reading through several forums and bug reports and blog posts, I've ended with the following modifications to my <strong>/etc/X11/xorg.conf</strong>:<br
/> <span
id="more-623"></span></p><ol><li>backup your current xorg.conf: <strong>sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.before-exa</strong></li><li>open your /etc/X11/xorg.conf with a favourite editor; I've added these lines to section "module":<br
/><blockquote><p> Load "dbe"<br
/> Load "xtrap"<br
/> Load "record"<br
/> Load "GLcore"</p></blockquote><p>These are <strong>not</strong> really <strong>performance-related</strong> and could be skipped; I'm giving them here, because they were suggested as default entries by dexconf or some other xorg.conf-generator utility. Again - they are not supposed to improve performance, so you can skip these.</li><li>my "Device" section is now:<br
/><blockquote><p> Section "Device"<br
/> Identifier	"Intel Corporation 82915G/GV/910GL Integrated Graphics Controller"<br
/> BoardName	"82915G/GV/910GL Integrated Graphics Controller"<br
/> Vendorname	"Intel Corporation"<br
/> #Driver		"i810"<br
/> Driver		"intel"<br
/> BusID		"PCI:0:2:0"<br
/> Option	"DRI"	"true"<br
/> Option	"AccelMethod"	"exa"<br
/> Option	"MigrationHeuristic"	"greedy"<br
/> Option	"ExaNoComposite"	"false"<br
/> EndSection</p></blockquote><p><strong>Driver i810</strong> (xserver-xorg-video-i810 package) was about 10-20 FPS slower than <strong>Driver intel</strong> (xserver-xorg-video-intel package) for me. The most important lines here are <strong>Option AccelMethod exa</strong> (which enables EXA acceleration instead of the older XAA; if you run 2.6.28 or later kernel, you can try UXA instead of EXA) and <strong>Option MigrationHeuristic greedy</strong>. <strong>Option ExaNoComposite false</strong> doesn't make a difference for me, and <strong>Option DRI true</strong> might be redundant (didn't bother trying to remove it).</li><li>at the end of xorg.conf I have two more sections:<br
/><blockquote><p> Section "DRI"<br
/> Mode	0666<br
/> EndSection</p><p>Section "Extensions"<br
/> Option	"Composite"	"enable"<br
/> Option	"MIT-SHM"	"Yes"<br
/> EndSection</p></blockquote></li><li><strong>sudo nano /etc/environment</strong>, and add one line: <strong>INTEL_BATCH=1</strong> (if you have graphics stability issues or screen corruption - try removing this change first)</li><li>you can test if your xorg.conf is syntactically correct by running X -config /etc/X11/xorg.conf (provided that you edited this exact file)</ol><p>This is it. Before these modifications, my FPS in glxgears was around 430; after these modifications it is ~915.</p><p>As time permits, I might try the XAA configuration, suggested at <a
href="http://foolcontrol.org/?p=181">foolcontrol</a>.</p><p><ins
datetime="2009-04-13T09:53:47+00:00">Update</ins>: with compiz enabled, XAA configuration recommended at <a
href="http://foolcontrol.org/?p=181">foolcontrol</a> is definitely faster in 2D.</p><p>Improvements, suggestions, corrections are welcome.</p> ]]></content:encoded> <wfw:commentRss>http://bogdan.org.ua/2009/03/02/intel-i915-integrated-graphics-under-debian-how-to-get-rid-of-sluggish-2d-performance.html/feed</wfw:commentRss> <slash:comments>5</slash:comments> </item> <item><title>gitosis: how to add new repository</title><link>http://bogdan.org.ua/2009/02/20/gitosis-how-to-add-new-repository.html</link> <comments>http://bogdan.org.ua/2009/02/20/gitosis-how-to-add-new-repository.html#comments</comments> <pubDate>Fri, 20 Feb 2009 19:05:52 +0000</pubDate> <dc:creator>Bogdan</dc:creator> <category><![CDATA[*nix]]></category> <category><![CDATA[how-to]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[git]]></category> <category><![CDATA[gitosis]]></category> <category><![CDATA[project]]></category> <category><![CDATA[repository]]></category> <guid
isPermaLink="false">http://bogdan.org.ua/?p=606</guid> <description><![CDATA[I assume that you already have your gitosis-admin repository working (this is described elsewhere). cd gitosis-admin &#038;&#038; git pull - enter your gitosis administrative repository and ensure it is up-to-date $EDITOR gitosis.conf add [group newreponame] section (newreponame is the name of your new repository being added); add yourself with members = yourlogin@yourhost line; also add [...]]]></description> <content:encoded><![CDATA[<p>I assume that you already have your <strong>gitosis-admin</strong> repository working (this is described elsewhere).</p><ol><li><strong>cd gitosis-admin &#038;& git pull</strong> - enter your gitosis administrative repository and ensure it is up-to-date</li><li><strong>$EDITOR gitosis.conf</strong></li><li>add <strong>[group newreponame]</strong> section (<em>newreponame</em> is the name of your new repository being added); add yourself with <strong>members = yourlogin@yourhost</strong> line; also add <strong>writable = newreponame</strong> line:<br
/><blockquote><p>[group newreponame]<br
/> members = yourlogin@yourhost<br
/> writable = newreponame</p></blockquote></li><li>based on my assumption of a correctly setup <strong>gitosis-admin</strong> repository, you should already have the appropriate public key in the <strong>keydir</strong> directory, but if not - copy your user's ssh public key to <strong>keydir</strong> in the form of <strong>yourlogin@yourhostname.pub</strong>, then do <strong>git add keydir/yourlogin@yourhostname.pub</strong></li><li><strong>git commit -am 'new repository: newreponame'</strong>; <strong>git push</strong>;</li><li>now that you have the new repo permissions configured, let's actually create it. Navigate to the directory holding the files of your project (e.g. <strong>cd ~/newreponame</strong>), and do <strong>git init</strong>; <strong>git add .</strong> - this initializes empty git repository, and then adds all the files to it. If you have no files - you can skip the 'git add .' command, as it will do nothing for you.</li><li><strong>git commit -m 'initial commit'</strong>. If you had no files added to the commit, git will complain that it cannot create an empty commit. In this case use the command <strong>git commit &ndash;&ndash;allow-empty -m 'initial commit'</strong></li><li><strong>git remote add origin ssh://gitosis@yourGitosisServerName/newreponame.git</strong></li><li><strong>git push &ndash;&ndash;all</strong></li><li>final thing: <strong>git config &ndash;&ndash;add branch.master.remote origin &#038;& git config &ndash;&ndash;add branch.master.merge refs/heads/master</strong>; alternatively, <strong>cd .git &#038;& $EDITOR config</strong>, and then add these lines:<br
/><blockquote><p>[branch "master"]<br
/> remote = origin<br
/> merge = refs/heads/master</p></blockquote><p>Without these lines, you won't be able to <em>git pull</em>.</ol> ]]></content:encoded> <wfw:commentRss>http://bogdan.org.ua/2009/02/20/gitosis-how-to-add-new-repository.html/feed</wfw:commentRss> <slash:comments>13</slash:comments> </item> <item><title>WordPress and Google Analytics external nofollow problem in comment links</title><link>http://bogdan.org.ua/2009/02/13/wordpress-and-google-analytics-external-nofollow-problem-in-comment-links.html</link> <comments>http://bogdan.org.ua/2009/02/13/wordpress-and-google-analytics-external-nofollow-problem-in-comment-links.html#comments</comments> <pubDate>Fri, 13 Feb 2009 19:41:55 +0000</pubDate> <dc:creator>Bogdan</dc:creator> <category><![CDATA[CMS]]></category> <category><![CDATA[how-to]]></category> <category><![CDATA[PHP]]></category> <category><![CDATA[Programming]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[Web]]></category> <category><![CDATA[comment]]></category> <category><![CDATA[fix]]></category> <category><![CDATA[link]]></category> <category><![CDATA[problem]]></category> <category><![CDATA[wordpress]]></category> <guid
isPermaLink="false">http://bogdan.org.ua/?p=594</guid> <description><![CDATA[Since some WP release, the comment author's link in comments is broken - it has ' external nofollow' attached straight to the href attribute (which breaks the link). I assume that the problem is caused by Google Analytics, namely the "track outgoing clicks" feature (as recalled, might be inaccurate feature name). "Track outgoing links" adds [...]]]></description> <content:encoded><![CDATA[<p>Since some WP release, the comment author's link in comments is broken - it has ' external nofollow' attached straight to the href attribute (which breaks the link).</p><p>I assume that the problem is caused by Google Analytics, namely the "track outgoing clicks" feature (as recalled, might be inaccurate feature name). "Track outgoing links" adds some JavaScript code to all outgoing links, and that script has tick characters like this one ' which, incidentally, are also used for delimiting the values of comment anchor tags.</p><p>To fix:<br
/> <span
id="more-594"></span></p><ol><li>locate file <strong>wp-includes/comment-template.php</strong></li><li>in that file, find the <strong>get_comment_author_link</strong> function (lines 140-150 in WP 2.7.1)</li><li>replace the line<div
class="igBar"><span
id="lphp-23"><a
href="#" onclick="javascript:showPlainTxt('php-23'); return false;">PLAIN TEXT</a></span></div><div
class="syntax_hilite"><span
class="langName">PHP:</span><div
id="php-23"><div
class="php"><ol><li
style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div
style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span
style="color:#0000FF;">$return</span> = <span
style="color:#FF0000;">"&lt;a href='$url' rel='external nofollow' class='url'&gt;$author&lt;/a&gt;"</span>;</div></li></ol></div></div></div><p> with</p><div
class="igBar"><span
id="lphp-24"><a
href="#" onclick="javascript:showPlainTxt('php-24'); return false;">PLAIN TEXT</a></span></div><div
class="syntax_hilite"><span
class="langName">PHP:</span><div
id="php-24"><div
class="php"><ol><li
style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div
style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span
style="color:#0000FF;">$return</span> = <span
style="color:#FF0000;">'&lt;a href=&quot;'</span>.<span
style="color:#0000FF;">$url</span>.<span
style="color:#FF0000;">'&quot; rel=&quot;external nofollow&quot; class=&quot;url&quot;&gt;'</span>.<span
style="color:#0000FF;">$author</span>.<span
style="color:#FF0000;">'&lt;/a&gt;'</span>;</div></li></ol></div></div></div><p></li></ol><p>This helped me and might help you.</p> ]]></content:encoded> <wfw:commentRss>http://bogdan.org.ua/2009/02/13/wordpress-and-google-analytics-external-nofollow-problem-in-comment-links.html/feed</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>Git: how to remove file and commit from history</title><link>http://bogdan.org.ua/2009/02/13/git-how-to-remove-file-commit-from-history.html</link> <comments>http://bogdan.org.ua/2009/02/13/git-how-to-remove-file-commit-from-history.html#comments</comments> <pubDate>Fri, 13 Feb 2009 19:21:32 +0000</pubDate> <dc:creator>Bogdan</dc:creator> <category><![CDATA[how-to]]></category> <category><![CDATA[Links]]></category> <category><![CDATA[Programming]]></category> <category><![CDATA[file]]></category> <category><![CDATA[git]]></category> <category><![CDATA[history]]></category> <category><![CDATA[remove]]></category> <category><![CDATA[repository]]></category> <guid
isPermaLink="false">http://bogdan.org.ua/?p=590</guid> <description><![CDATA[Once I accidentally added circa 300 MiB of archive files to one of my git repositories (which was as small as 5 MiB). I removed those files as soon as I noticed them, but the .git directory still preserved commits with those files, and still occupied over 300 MiB. I have found the solution at [...]]]></description> <content:encoded><![CDATA[<p>Once I accidentally added circa 300 MiB of archive files to one of my git repositories (which was as small as 5 MiB). I removed those files as soon as I noticed them, but the .git directory still preserved commits with those files, and still occupied over 300 MiB.</p><p>I have found the <a
href="http://stackoverflow.com/questions/307828/git-remove-file-accidentally-added-to-the-repository">solution</a> at <a
href="http://stackoverflow.com/">stackoverflow</a> (see also this <a
href="http://stackoverflow.com/questions/250238/collapsing-a-git-repositorys-history">question</a>).</p><p>This method worked for me, but I couldn't push my rebased repository to the gitosis. I would need to re-init the gitosis repository from my rebased, but I'm not yet prepared to do that.</p><p>There is also a slightly different method (which relies on a temporary tag instead of a temporary branch), documented in Git online manual pages; I prefer the temporary branch method.</p><p>Below is a full copy-paste of the winning answer by Charles Bailey:</p><blockquote><p> # create and check out a temporary branch at the location of the bad merge<br
/> git checkout -b tmpfix <sha1-of-bad-merge-or-commit></p><p># remove the incorrectly added file<br
/> git rm somefile.orig</p><p># commit the amended merge<br
/> git commit --amend</p><p># go back to the master branch<br
/> git checkout master</p><p># replant the master branch onto the corrected merge<br
/> git rebase tmpfix</p><p># delete the temporary branch<br
/> git branch -d tmpfix</p></blockquote><p>Also, in my case <a
href="http://stackoverflow.com/questions/495345/git-removing-selected-commits-from-repository">this thread</a> at stackoverflow was highly useful. I start enjoying the concise and compact style of Charles Bailey <img
src='http://bogdan.org.ua/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> :<br
/> <span
id="more-590"></span></p><blockquote><p> # detach head and move to D commit<br
/> git checkout <SHA1-for-D></p><p># move HEAD to A, but leave the index and working tree as for D<br
/> git reset --soft <SHA1-for-A></p><p># Redo the D commit re-using the commit message, but now on top of A<br
/> git commit -C <SHA1-for-D></p><p># Re-apply everything from the old D onwards onto this new place<br
/> git rebase --onto HEAD <SHA1-for-D> master</p></blockquote><p>Note: this example is for a branch of commits R--A--B--C--D--E--HEAD, where commits B &#038; C should be removed from commit history.</p><p>Another option is to use git rebase --interactive (for the same example):</p><blockquote><p> git rebase -i HEAD~5</p></blockquote><p>Unfortunately, rebasing on a public (pushed out) branch has no effect for other users of the current gitosis repository.</p><p>An alternative to re-initializing gitosis repository from rebased scratch could be switching to a different (rebased) branch, and deleting the outdated master branch; but I haven't investigated if this works.</p> ]]></content:encoded> <wfw:commentRss>http://bogdan.org.ua/2009/02/13/git-how-to-remove-file-commit-from-history.html/feed</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>How to fix &#8220;MySQL server has gone away&#8221; (error 2006)</title><link>http://bogdan.org.ua/2008/12/25/how-to-fix-mysql-server-has-gone-away-error-2006.html</link> <comments>http://bogdan.org.ua/2008/12/25/how-to-fix-mysql-server-has-gone-away-error-2006.html#comments</comments> <pubDate>Thu, 25 Dec 2008 16:34:08 +0000</pubDate> <dc:creator>Bogdan</dc:creator> <category><![CDATA[*nix]]></category> <category><![CDATA[how-to]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[Debian]]></category> <category><![CDATA[error]]></category> <category><![CDATA[fix]]></category> <category><![CDATA[mysql]]></category> <guid
isPermaLink="false">http://bogdan.org.ua/?p=464</guid> <description><![CDATA[Source: George from vbulletin team. Two most common reasons (and fixes) for the MySQL server has gone away (error 2006) are: Server timed out and closed the connection. How to fix: check that wait_timeout variable in your mysqld's my.cnf configuration file is large enough. On Debian: sudo nano /etc/mysql/my.cnf, set wait_timeout = 600 seconds (you [...]]]></description> <content:encoded><![CDATA[<p>Source: <a
href="http://www.vbulletin.com/forum/member.php?u=245">George</a> from <a
href="http://www.vbulletin.com/forum/showthread.php?t=70410">vbulletin team</a>.</p><p>Two most common reasons (and fixes) for the <strong>MySQL server has gone away (error 2006)</strong> are:</p><ol><li>Server timed out and closed the connection. How to fix: check that <strong>wait_timeout</strong> variable in your mysqld's my.cnf configuration file is large enough. On Debian: <strong>sudo nano /etc/mysql/my.cnf</strong>, set <strong>wait_timeout = 600</strong> seconds (you can tweak/decrease this value when error 2006 is gone), then <strong>sudo /etc/init.d/mysql restart</strong>. I didn't check, but the default value for wait_timeout might be around 28800 seconds (8 hours).</li><li>Server dropped an incorrect or too large packet. If mysqld gets a packet that is too large or incorrect, it assumes that something has gone wrong with the client and closes the connection. You can increase the maximal packet size limit by increasing the value of <strong>max_allowed_packet</strong> in my.cnf file. On Debian: <strong>sudo nano /etc/mysql/my.cnf</strong>, set <strong>max_allowed_packet = 64M</strong> (you can tweak/decrease this value when error 2006 is gone), then <strong>sudo /etc/init.d/mysql restart</strong>.</li></ol><p>If you get <strong>MySQL server has gone away (error 2006)</strong> when using MySQL ODBC driver - give <a
href="http://bogdan.org.ua/2008/12/25/how-to-fix-mysql-server-has-gone-away-error-2006.html#comment-103489">this hint</a> a try.</p> ]]></content:encoded> <wfw:commentRss>http://bogdan.org.ua/2008/12/25/how-to-fix-mysql-server-has-gone-away-error-2006.html/feed</wfw:commentRss> <slash:comments>31</slash:comments> </item> <item><title>How to print a single page from PDF file using Linux command line interface (CLI)</title><link>http://bogdan.org.ua/2008/10/30/how-to-print-a-single-page-from-pdf-file-using-linux-command-line-interface-cli.html</link> <comments>http://bogdan.org.ua/2008/10/30/how-to-print-a-single-page-from-pdf-file-using-linux-command-line-interface-cli.html#comments</comments> <pubDate>Thu, 30 Oct 2008 10:42:28 +0000</pubDate> <dc:creator>Bogdan</dc:creator> <category><![CDATA[*nix]]></category> <category><![CDATA[how-to]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[acroread]]></category> <category><![CDATA[CLI]]></category> <category><![CDATA[command line]]></category> <category><![CDATA[linux]]></category> <category><![CDATA[PDF]]></category> <category><![CDATA[pdf2ps]]></category> <category><![CDATA[pdftops]]></category> <category><![CDATA[print]]></category> <category><![CDATA[PS]]></category> <category><![CDATA[single page]]></category> <guid
isPermaLink="false">http://bogdan.org.ua/?p=433</guid> <description><![CDATA[There are several ways to do that, I'll describe the one which worked for me. Please note, that printing from CLI has an advantage of being able to print out something at work from the comfort of your home and ssh (provided that the printer is on and is loaded with paper). To extract a [...]]]></description> <content:encoded><![CDATA[<p>There are several ways to do that, I'll describe the one which worked for me. Please note, that printing from CLI has an advantage of being able to print out something at work from the comfort of your home and ssh <img
src='http://bogdan.org.ua/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> (provided that the printer is on and is loaded with paper).</p><p>To extract a single page (or a range of pages), I used <strong>pdftops</strong>:<br
/> <span
id="more-433"></span></p><blockquote><p><strong>pdftops -f 187 -l 187 -paper A4 abstract_book.pdf page_187.ps</strong></p></blockquote><p>Here, <strong>-f</strong> is the <strong>f</strong>irst page, <strong>-l</strong> is the <strong>l</strong>ast, and <strong>-paper</strong> is paper size.</p><p>Alternatives include using <strong>pdf2ps</strong> (which relies on GhostScript and accepts the same options) and <strong>acroread -toPostScript</strong> (which uses non-free Adobe Reader in CLI mode to convert PDF to PS).</p><p>Now that I have a single-page PS file, I can print it:</p><blockquote><p><strong>cupsdoprint -P S200 -o Resolution=720dpi,Copies=2,PageSize=A4 page_187.ps</strong></p></blockquote><p>Printing options will vary depending on your printer model (use <strong>lpoptions -l -P PrinterName</strong> to find out possible options and their default values). In the sample line above, <strong>S200</strong> is the printer to use for printing, Resolution/Copies/PageSize are all self-explanatory printing options.</p><p>Alternative (and, actually, more standard) way to print is by using <strong>lpr</strong>, but if you run CUPS and KDE then <strong>cupsdoprint</strong> isn't any worse.</p><p>For more details this <a
href="http://www.faqs.org/docs/Linux-HOWTO/Printing-Usage-HOWTO.html">FAQ</a> might be helpful. Also, keep in mind that simple shell scripts can automate routine sequential tasks, and that piping helps.</p> ]]></content:encoded> <wfw:commentRss>http://bogdan.org.ua/2008/10/30/how-to-print-a-single-page-from-pdf-file-using-linux-command-line-interface-cli.html/feed</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>Debian, fgl_glxgears: Using GLX_SGIX_pbuffer&#8230; Segmentation fault</title><link>http://bogdan.org.ua/2008/10/01/debian-fgl_glxgears-using-glx_sgix_pbuffer-segmentation-fault.html</link> <comments>http://bogdan.org.ua/2008/10/01/debian-fgl_glxgears-using-glx_sgix_pbuffer-segmentation-fault.html#comments</comments> <pubDate>Wed, 01 Oct 2008 16:17:34 +0000</pubDate> <dc:creator>Bogdan</dc:creator> <category><![CDATA[*nix]]></category> <category><![CDATA[3D]]></category> <category><![CDATA[ATI]]></category> <category><![CDATA[Debian]]></category> <category><![CDATA[driver]]></category> <category><![CDATA[hardware acceleration]]></category> <category><![CDATA[how-to]]></category> <category><![CDATA[linux]]></category> <category><![CDATA[OpenGL]]></category> <guid
isPermaLink="false">http://bogdan.org.ua/?p=401</guid> <description><![CDATA[If you get Segmentation fault when trying to run fgl_glxgears in your Debian desktop environment, most often this would mean that 3D acceleration isn't enabled. For the case of ATI (and ATI Mobility) Radeon series, the easiest procedure would be (doing all as root, or prepending sudo to all commands): aptitude update, to ensure you've [...]]]></description> <content:encoded><![CDATA[<p>If you get Segmentation fault when trying to run <strong>fgl_glxgears</strong> in your Debian desktop environment, most often this would mean that 3D acceleration isn't enabled.</p><p>For the case of ATI (and ATI Mobility) Radeon series, the easiest procedure would be (doing all as <strong>root</strong>, or prepending <strong>sudo</strong> to all commands):</p><ol><li><strong>aptitude update</strong>, to ensure you've got the list of latest packages</li><li><strong>aptitude install fglrx-driver fglrx-control fglrx-kernel-src</strong>, for the actual driver; I also installed <strong>fglrx-atieventsd</strong> and <strong>fglrx-glx</strong> (these are driver-recommended packages)</li><li><strong>aptitude install module-assistant</strong>, required for building the kernel module</li><li><strong>module-assistant prepare</strong>, to verify that you have everything needed for the module build procedure</li><li><strong>module-assistant update</strong></li><li><strong>module-assistant auto-install fglrx</strong>, to build and install the fglrx kernel module</li><li><strong>depmod -a</strong></li><li><strong>modprobe fglrx</strong>, to load the fglrx kernel module</li><li><strong>aticonfig &ndash;&ndash;initial</strong>, to configure ATI's device section in /etc/X11/xorg.conf (for more options, see <strong>aticonfig &ndash;&ndash;help</strong>)</li><li><strong>reboot</strong></li></ol><p><span
id="more-401"></span><br
/> That should make your ATI hardware work as expected, and make <strong>fgl_glxgears</strong> show gears again.</p><p>If everything went fine, then your movies will play smoother <img
src='http://bogdan.org.ua/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> , and the output of <strong>fglrxinfo</strong> will look similar to</p><blockquote><p>display: :0.0  screen: 0<br
/> OpenGL vendor string: ATI Technologies Inc.<br
/> OpenGL renderer string: ATI MOBILITY RADEON X600<br
/> OpenGL version string: 2.1.7769 Release</p></blockquote><p>This procedure should be also possible for the latest ATI-provided installer-generated Debian packages (as described elsewhere), but I decided to stick to the repository version - this requires no extra tweaking.</p><p>For much more information, see the <a
href="http://wiki.cchtml.com/index.php/Debian_Installation_Guide">ATI Debian Installation Guide</a>.</p><p>This post is based on the <a
href="http://www.linuxforums.org/forum/617305-post2.html">iwanabeguru's response</a> at Linux Forums.</p> ]]></content:encoded> <wfw:commentRss>http://bogdan.org.ua/2008/10/01/debian-fgl_glxgears-using-glx_sgix_pbuffer-segmentation-fault.html/feed</wfw:commentRss> <slash:comments>5</slash:comments> </item> <item><title>Installing libsbml on Debian (to make iBioSim start)</title><link>http://bogdan.org.ua/2008/08/30/installing-libsbml-on-debian-to-make-ibiosim-start.html</link> <comments>http://bogdan.org.ua/2008/08/30/installing-libsbml-on-debian-to-make-ibiosim-start.html#comments</comments> <pubDate>Sat, 30 Aug 2008 21:38:26 +0000</pubDate> <dc:creator>Bogdan</dc:creator> <category><![CDATA[*nix]]></category> <category><![CDATA[Links]]></category> <category><![CDATA[Science]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[Systems Biology]]></category> <category><![CDATA[Debian]]></category> <category><![CDATA[how-to]]></category> <category><![CDATA[java]]></category> <category><![CDATA[libsbml]]></category> <guid
isPermaLink="false">http://bogdan.org.ua/?p=336</guid> <description><![CDATA[There's a troubleshooter for Ubuntu, which (expectedly) works quite the same for Debian (lenny in my case). I'm installing libsbml to make the iBioSim tool work under Debian GNU/Linux. First thing I had to do was to make Sun's java interpreter do all the java interpretation work instead of gcj: sudo update-java-alternatives -s java-6-sun (this [...]]]></description> <content:encoded><![CDATA[<p>There's a <a
href="http://xzhou82.blogspot.com/2008/06/install-libsbml-on-ubuntu.html">troubleshooter for Ubuntu</a>, which (expectedly) works quite the same for <a
href="http://www.debian.org/">Debian</a> (lenny in my case).</p><p>I'm installing <a
href="http://sbml.org/Software/libSBML">libsbml</a> to make the <a
href="http://www.async.ece.utah.edu/iBioSim/">iBioSim</a> tool work under Debian GNU/Linux. First thing I had to do was to make Sun's java interpreter do all the java interpretation work instead of gcj: <strong>sudo update-java-alternatives -s java-6-sun</strong> (this assumes you do have java-6-sun installed).</p><p>Installing libsbml moved me one step further, now I'm getting another error from iBioSim:</p><pre>
Exception in thread "main" java.lang.NoClassDefFoundError: biomodelsim/BioSim
Caused by: java.lang.ClassNotFoundException: biomodelsim.BioSim
        at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
</pre><p>This yet has to be fixed somehow.</p><p>If <a
href="http://xzhou82.blogspot.com/">Zhou Xin's blog</a> becomes for any reason inaccessible (or moves to his own domain), below is the extract of the instructions from his post on how to install libsbml on Debian/Ubuntu Linux:<br
/> <span
id="more-336"></span></p><blockquote><p> - first, install all the necessary packages:<br
/> <strong><a
href="http://bogdan.org.ua/2007/08/19/linux-package-management-use-aptitude-if-your-distro-has-it.html">aptitude</a> install build-essential libxml2 libxml2-dev python-dev</strong></p><p>- then configure, make and install libsbml:<br
/> <strong>./configure &ndash;&ndash;with-python</strong> (execute from the directory where the downloaded libsbml archive was extracted to)<br
/> <strong>make</strong><br
/> <strong>make install</strong><br
/> <strong>ldconfig</strong></p><p>- then check if installation was successful:<br
/> <strong>python</strong><br
/> and when the python prompt >>> appears, run <strong>from libsbml import *</strong> - if there are no warnings/errors, then you are done!</p></blockquote> ]]></content:encoded> <wfw:commentRss>http://bogdan.org.ua/2008/08/30/installing-libsbml-on-debian-to-make-ibiosim-start.html/feed</wfw:commentRss> <slash:comments>3</slash:comments> </item> <item><title>Iceweasel/Firefox 3: how to work-around random/erratic right-click action</title><link>http://bogdan.org.ua/2008/07/19/iceweasel-firefox-3-how-to-fix-random-erratic-right-click-action-bahaviour.html</link> <comments>http://bogdan.org.ua/2008/07/19/iceweasel-firefox-3-how-to-fix-random-erratic-right-click-action-bahaviour.html#comments</comments> <pubDate>Sat, 19 Jul 2008 15:42:34 +0000</pubDate> <dc:creator>Bogdan</dc:creator> <category><![CDATA[Misc]]></category> <category><![CDATA[Web]]></category> <category><![CDATA[action]]></category> <category><![CDATA[behavior]]></category> <category><![CDATA[behaviour]]></category> <category><![CDATA[erratic]]></category> <category><![CDATA[FireFox]]></category> <category><![CDATA[fix]]></category> <category><![CDATA[how-to]]></category> <category><![CDATA[IceWeasel]]></category> <category><![CDATA[random]]></category> <category><![CDATA[right click]]></category> <guid
isPermaLink="false">http://bogdan.org.ua/?p=316</guid> <description><![CDATA[Update: as of FireFox/IceWeasel 3.0.14, this bug appears to be fixed. When right-clicking many links in FF3/IW3, it quite often happens so that a random action is performed instead of opening the context menu (bug report). One of the solutions work-arounds (suggested by Andre Pirard) is to slow-right-click, that is to hold the right mouse [...]]]></description> <content:encoded><![CDATA[<p><ins
datetime="2009-10-16T07:35:54+00:00">Update:</ins> as of FireFox/IceWeasel 3.0.14, this bug appears to be fixed.</p><p>When right-clicking many links in FF3/IW3, it quite often happens so that a <strong>random</strong> action is performed instead of opening the context menu (<a
href="https://bugs.launchpad.net/firefox/+bug/187313">bug report</a>).</p><p>One of the <del
datetime="2008-08-02T18:04:52+00:00">solutions</del> <ins
datetime="2008-08-02T18:04:52+00:00">work-arounds</ins> (suggested by <a
href="https://launchpad.net/~a.pirard">Andre Pirard</a>) is to <strong>slow-right-click</strong>, that is to <em>hold the right mouse button down</em> until the <em>menu actually appears</em>, then - and only then - <em>release it</em>. Or, you can even <em>slow-right-click</em>, <em>move the pointer over the desired menu item</em>, and <em>then release</em> - that will perform the desired action in a single long right click (instead of more common single right click with a following single left click.)</p><p>Alternative workaround (found at the bug report page): install the <a
href="https://addons.mozilla.org/en-US/firefox/addon/mouse-gestures-redox/" class="broken_link" rel="nofollow">mouse gestures</a> add-on, and restart firefox. Tested: works for me.</p><p>This bug/behaviour is otherwise unsolved.</p> ]]></content:encoded> <wfw:commentRss>http://bogdan.org.ua/2008/07/19/iceweasel-firefox-3-how-to-fix-random-erratic-right-click-action-bahaviour.html/feed</wfw:commentRss> <slash:comments>8</slash:comments> </item> </channel> </rss>
