<?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 Cave &#187; how-to</title> <atom:link href="https://bogdan.org.ua/tags/how-to/feed" rel="self" type="application/rss+xml" /><link>https://bogdan.org.ua</link> <description>Tiny bits of bioinformatics, [web-]programming etc</description> <lastBuildDate>Wed, 28 Dec 2022 16:09:04 +0000</lastBuildDate> <language>en-US</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>https://wordpress.org/?v=3.8.27</generator> <item><title>Evernote web-interface beta: how to fix: saved searches are crossed out and do not work</title><link>https://bogdan.org.ua/2016/05/09/evernote-web-interface-beta-how-to-fix-saved-searches-are-crossed-out-and-do-not-work.html</link> <comments>https://bogdan.org.ua/2016/05/09/evernote-web-interface-beta-how-to-fix-saved-searches-are-crossed-out-and-do-not-work.html#comments</comments> <pubDate>Mon, 09 May 2016 10:30:10 +0000</pubDate> <dc:creator><![CDATA[Bogdan]]></dc:creator> <category><![CDATA[how-to]]></category> <category><![CDATA[Notepad]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[Web]]></category> <category><![CDATA[evernote]]></category> <category><![CDATA[fix]]></category> <category><![CDATA[problem]]></category> <guid
isPermaLink="false">http://bogdan.org.ua/?p=2403</guid> <description><![CDATA[Another symptom is a message along the lines of the notebook you are searching in has been moved or renamed since the saved search was created (which is not true). I had this problem, and found a solution. Go to your Evernote on a client where you can edit saved searches (Windows for me), edit [&#8230;]]]></description> <content:encoded><![CDATA[<p>Another symptom is a message along the lines of</p><blockquote><p>the notebook you are searching in has been moved or renamed since the saved search was created</p></blockquote><p>(which is not true).</p><p>I had this problem, and found a <strong>solution</strong>.</p><p>Go to your Evernote on a client where you can <strong>edit saved searches</strong> (Windows for me),<br
/> edit all the searches, and make sure that <strong>notebook name is quoted</strong> in the search (and also, possibly, with all <strong>proper letter cases</strong>).</p><p>I found this solution by first creating a search from the web-beta interface, it looked like this: <code>notebook:"Mynotebook" tag:1-now</code><br
/> All the crossed-out searches (despite working totally fine on Windows) looked like this: <code>notebook:Mynotebook tag:1-now</code><br
/> or even like this (note the lower-case 1stÂ letter of the notebook name): <code>notebook:mynotebook tag:1-now</code>.</p><p>After editing saved searches and synchronizing, they all appear (and work) just fine in the beta web-interface.</p><p>If you cannot edit your searches right now, there is <strong>another workaround</strong>: all the saved searches <strong>work fine</strong> for me <strong>from the ShortcutsÂ menu</strong> (a star in the left panel).</p><p>Hope this helps!</p><p><a
class="a2a_button_citeulike" href="https://www.addtoany.com/add_to/citeulike?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2016%2F05%2F09%2Fevernote-web-interface-beta-how-to-fix-saved-searches-are-crossed-out-and-do-not-work.html&amp;linkname=Evernote%20web-interface%20beta%3A%20how%20to%20fix%3A%20saved%20searches%20are%20crossed%20out%20and%20do%20not%20work" title="CiteULike" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2016%2F05%2F09%2Fevernote-web-interface-beta-how-to-fix-saved-searches-are-crossed-out-and-do-not-work.html&amp;linkname=Evernote%20web-interface%20beta%3A%20how%20to%20fix%3A%20saved%20searches%20are%20crossed%20out%20and%20do%20not%20work" title="Pocket" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_kindle_it" href="https://www.addtoany.com/add_to/kindle_it?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2016%2F05%2F09%2Fevernote-web-interface-beta-how-to-fix-saved-searches-are-crossed-out-and-do-not-work.html&amp;linkname=Evernote%20web-interface%20beta%3A%20how%20to%20fix%3A%20saved%20searches%20are%20crossed%20out%20and%20do%20not%20work" title="Kindle It" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_evernote" href="https://www.addtoany.com/add_to/evernote?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2016%2F05%2F09%2Fevernote-web-interface-beta-how-to-fix-saved-searches-are-crossed-out-and-do-not-work.html&amp;linkname=Evernote%20web-interface%20beta%3A%20how%20to%20fix%3A%20saved%20searches%20are%20crossed%20out%20and%20do%20not%20work" title="Evernote" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2016%2F05%2F09%2Fevernote-web-interface-beta-how-to-fix-saved-searches-are-crossed-out-and-do-not-work.html&amp;linkname=Evernote%20web-interface%20beta%3A%20how%20to%20fix%3A%20saved%20searches%20are%20crossed%20out%20and%20do%20not%20work" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a
class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fbogdan.org.ua%2F2016%2F05%2F09%2Fevernote-web-interface-beta-how-to-fix-saved-searches-are-crossed-out-and-do-not-work.html&#038;title=Evernote%20web-interface%20beta%3A%20how%20to%20fix%3A%20saved%20searches%20are%20crossed%20out%20and%20do%20not%20work" data-a2a-url="https://bogdan.org.ua/2016/05/09/evernote-web-interface-beta-how-to-fix-saved-searches-are-crossed-out-and-do-not-work.html" data-a2a-title="Evernote web-interface beta: how to fix: saved searches are crossed out and do not work"><img
src="https://static.addtoany.com/buttons/share_save_120_16.png" alt="Share"></a></p>]]></content:encoded> <wfw:commentRss>https://bogdan.org.ua/2016/05/09/evernote-web-interface-beta-how-to-fix-saved-searches-are-crossed-out-and-do-not-work.html/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>How to: export only notes to PDF from LibreOffice Impress 5</title><link>https://bogdan.org.ua/2016/02/28/how-to-export-only-notes-to-pdf-from-libreoffice-impress-5.html</link> <comments>https://bogdan.org.ua/2016/02/28/how-to-export-only-notes-to-pdf-from-libreoffice-impress-5.html#comments</comments> <pubDate>Sun, 28 Feb 2016 19:44:32 +0000</pubDate> <dc:creator><![CDATA[Bogdan]]></dc:creator> <category><![CDATA[how-to]]></category> <category><![CDATA[Notepad]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[export]]></category> <category><![CDATA[impress]]></category> <category><![CDATA[LibreOffice]]></category> <category><![CDATA[PDF]]></category> <guid
isPermaLink="false">http://bogdan.org.ua/?p=2368</guid> <description><![CDATA[If you want to export Notes to a PDF from LibreOffice Impress 5, and dutifully set the appropriate checkbox in PDF export dialog, then you will get all slides twice: first just all the slides as with usual PDF export, and then all the Notes pages. There is an easy solution to get Notes-only without [&#8230;]]]></description> <content:encoded><![CDATA[<p>If you want to export Notes to a PDF from LibreOffice Impress 5,<br
/> and dutifully set the appropriate checkbox in PDF export dialog,<br
/> then you will get all slides twice: first just all the slides as with usual PDF export, and then all the Notes pages.</p><p>There is an easy solution to get Notes-only without editing the PDF.</p><p>If you have a PDf printer installed (most Linux distributions, and Windows 10), just do <strong>File -> Print</strong> from Impress,<br
/> then under the <strong>Print</strong> sub-header choose <strong>Notes</strong> from the <strong>Document</strong> drop-down (see picture).<br
/> Make sure to set the proper paper format for the PDF printer (A4 in my case).<br
/> Then <em>print</em>, and save the resulting PDF.<br
/> <span
id="more-2368"></span><br
/> <img
src="http://bogdan.org.ua/wp-content/uploads/2016/02/print_notes.jpg" alt="print dialog" width="722" height="483" class="aligncenter size-full wp-image-2369" /></p><p>Sources:</p><ul><li>question on <a
href="https://ask.libreoffice.org/en/question/13188/how-to-export-impress-notes-only/">ask.libreoffice.org</a></li><li>LibreOffice <a
href="https://bugs.documentfoundation.org/show_bug.cgi?id=39271&#038;redirected_from=fdo">bug report</a></li></ul><p><a
class="a2a_button_citeulike" href="https://www.addtoany.com/add_to/citeulike?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2016%2F02%2F28%2Fhow-to-export-only-notes-to-pdf-from-libreoffice-impress-5.html&amp;linkname=How%20to%3A%20export%20only%20notes%20to%20PDF%20from%20LibreOffice%20Impress%205" title="CiteULike" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2016%2F02%2F28%2Fhow-to-export-only-notes-to-pdf-from-libreoffice-impress-5.html&amp;linkname=How%20to%3A%20export%20only%20notes%20to%20PDF%20from%20LibreOffice%20Impress%205" title="Pocket" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_kindle_it" href="https://www.addtoany.com/add_to/kindle_it?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2016%2F02%2F28%2Fhow-to-export-only-notes-to-pdf-from-libreoffice-impress-5.html&amp;linkname=How%20to%3A%20export%20only%20notes%20to%20PDF%20from%20LibreOffice%20Impress%205" title="Kindle It" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_evernote" href="https://www.addtoany.com/add_to/evernote?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2016%2F02%2F28%2Fhow-to-export-only-notes-to-pdf-from-libreoffice-impress-5.html&amp;linkname=How%20to%3A%20export%20only%20notes%20to%20PDF%20from%20LibreOffice%20Impress%205" title="Evernote" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2016%2F02%2F28%2Fhow-to-export-only-notes-to-pdf-from-libreoffice-impress-5.html&amp;linkname=How%20to%3A%20export%20only%20notes%20to%20PDF%20from%20LibreOffice%20Impress%205" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a
class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fbogdan.org.ua%2F2016%2F02%2F28%2Fhow-to-export-only-notes-to-pdf-from-libreoffice-impress-5.html&#038;title=How%20to%3A%20export%20only%20notes%20to%20PDF%20from%20LibreOffice%20Impress%205" data-a2a-url="https://bogdan.org.ua/2016/02/28/how-to-export-only-notes-to-pdf-from-libreoffice-impress-5.html" data-a2a-title="How to: export only notes to PDF from LibreOffice Impress 5"><img
src="https://static.addtoany.com/buttons/share_save_120_16.png" alt="Share"></a></p>]]></content:encoded> <wfw:commentRss>https://bogdan.org.ua/2016/02/28/how-to-export-only-notes-to-pdf-from-libreoffice-impress-5.html/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>How to fix: mod_proxy&#8217;s ProxyPass directive does not work</title><link>https://bogdan.org.ua/2016/02/10/how-to-fix-mod_proxy-proxypass-directive-does-not-work.html</link> <comments>https://bogdan.org.ua/2016/02/10/how-to-fix-mod_proxy-proxypass-directive-does-not-work.html#comments</comments> <pubDate>Wed, 10 Feb 2016 19:37:24 +0000</pubDate> <dc:creator><![CDATA[Bogdan]]></dc:creator> <category><![CDATA[*nix]]></category> <category><![CDATA[how-to]]></category> <category><![CDATA[Web]]></category> <category><![CDATA[Apache]]></category> <category><![CDATA[Debian]]></category> <category><![CDATA[mod_proxy]]></category> <category><![CDATA[ProxyPass]]></category> <category><![CDATA[proxy_http]]></category> <guid
isPermaLink="false">http://bogdan.org.ua/?p=2341</guid> <description><![CDATA[So&#8230; You had finally built a nice LXC container for your web-facing application, and even configured Apache (Debian package version 2.14.18-1 in my case) to serve some static/web-only components. From your client-side JavaScript UI you talk (in JSON) to the API, which is implemented as a separate node.js/Python/etc server &#8211; say, on port 8000 in [&#8230;]]]></description> <content:encoded><![CDATA[<p>So&#8230; You had finally built a nice LXC container for your web-facing application, and even configured Apache (Debian package version 2.14.18-1 in my case) to serve some static/web-only components.<br
/> From your client-side JavaScript UI you talk (in JSON) to the API, which is implemented as a separate node.js/Python/etc server &#8211; say, on port 8000 in the same LXC container.</p><p>The simplest solution to forward requests from the web-frontend to your API is by using <strong>mod_proxy</strong>.<br
/> If you want to forward any requests to /api/* to your custom back-end server on port 8000, you just add the following lines to your VirtualHost configuration:</p><blockquote><p> ProxyPass               &#8220;/api&#8221;  &#8220;http://localhost:8000&#8243;<br
/> ProxyPassReverse        &#8220;/api&#8221;  &#8220;http://localhost:8000&#8243;</p></blockquote><p>I&#8217;d suggest <em>not</em> wrapping this fragment with the classical <strong>IfModule</strong>: as your application will not really work without its API back-end, you actually <em>want</em> Apache to fail as soon as possible if <strong>mod_proxy</strong> is missing.</p><p>That was easy, right? What, it doesn&#8217;t work? Can&#8217;t be! It&#8217;s dead simple! No way you could make a mistake in 2 lines of configuration!!! :mad_rage: <img
src="https://bogdan.org.ua/wp-includes/images/smilies/icon_smile.gif" alt=":)" class="wp-smiley" /></p><p>Oh wait&#8230; I remember I had this problem before&#8230;<span
id="more-2341"></span></p><p>Let&#8217;s check:</p><ol><li><strong>Step 1.</strong> Did you disable (using <code>a2dissite default</code> or <code>a2dissite 000-default</code>, depending on your Debian-based GNU/Linux) the default website? If your application and the default website are configured in a similar way, then it might be the <em>default</em> site which is serving your app&#8217;s pages. The most sure way is to just disable it.</li><li><strong>Step 2.</strong> Did you enable also the <strong>proxy_http</strong> sub-module? (Using <code>a2enmod proxy_http</code>, followed by <code>service apache2 restart</code>) <strong>mod_proxy</strong> is only the core module, actual per-protocol work is done by these sub-modules.</li></ol><p>Your requests to /api should now be passed on to your API server. If not &#8211; please write in the comments what was the problem in your case and how you solved it. HTH!</p><p><a
class="a2a_button_citeulike" href="https://www.addtoany.com/add_to/citeulike?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2016%2F02%2F10%2Fhow-to-fix-mod_proxy-proxypass-directive-does-not-work.html&amp;linkname=How%20to%20fix%3A%20mod_proxy%E2%80%99s%20ProxyPass%20directive%20does%20not%20work" title="CiteULike" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2016%2F02%2F10%2Fhow-to-fix-mod_proxy-proxypass-directive-does-not-work.html&amp;linkname=How%20to%20fix%3A%20mod_proxy%E2%80%99s%20ProxyPass%20directive%20does%20not%20work" title="Pocket" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_kindle_it" href="https://www.addtoany.com/add_to/kindle_it?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2016%2F02%2F10%2Fhow-to-fix-mod_proxy-proxypass-directive-does-not-work.html&amp;linkname=How%20to%20fix%3A%20mod_proxy%E2%80%99s%20ProxyPass%20directive%20does%20not%20work" title="Kindle It" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_evernote" href="https://www.addtoany.com/add_to/evernote?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2016%2F02%2F10%2Fhow-to-fix-mod_proxy-proxypass-directive-does-not-work.html&amp;linkname=How%20to%20fix%3A%20mod_proxy%E2%80%99s%20ProxyPass%20directive%20does%20not%20work" title="Evernote" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2016%2F02%2F10%2Fhow-to-fix-mod_proxy-proxypass-directive-does-not-work.html&amp;linkname=How%20to%20fix%3A%20mod_proxy%E2%80%99s%20ProxyPass%20directive%20does%20not%20work" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a
class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fbogdan.org.ua%2F2016%2F02%2F10%2Fhow-to-fix-mod_proxy-proxypass-directive-does-not-work.html&#038;title=How%20to%20fix%3A%20mod_proxy%E2%80%99s%20ProxyPass%20directive%20does%20not%20work" data-a2a-url="https://bogdan.org.ua/2016/02/10/how-to-fix-mod_proxy-proxypass-directive-does-not-work.html" data-a2a-title="How to fix: mod_proxy’s ProxyPass directive does not work"><img
src="https://static.addtoany.com/buttons/share_save_120_16.png" alt="Share"></a></p>]]></content:encoded> <wfw:commentRss>https://bogdan.org.ua/2016/02/10/how-to-fix-mod_proxy-proxypass-directive-does-not-work.html/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>How to fix: Xiaomi Mi Band stopped tracking steps and sleep</title><link>https://bogdan.org.ua/2015/07/26/how-to-fix-xiaomi-mi-band-stopped-tracking-steps-and-sleep.html</link> <comments>https://bogdan.org.ua/2015/07/26/how-to-fix-xiaomi-mi-band-stopped-tracking-steps-and-sleep.html#comments</comments> <pubDate>Sun, 26 Jul 2015 15:01:43 +0000</pubDate> <dc:creator><![CDATA[Bogdan]]></dc:creator> <category><![CDATA[Hardware]]></category> <category><![CDATA[how-to]]></category> <category><![CDATA[fitness]]></category> <category><![CDATA[fitness band]]></category> <category><![CDATA[fix]]></category> <category><![CDATA[gadget]]></category> <category><![CDATA[Mi Band]]></category> <category><![CDATA[quantified self]]></category> <category><![CDATA[Xiaomi]]></category> <guid
isPermaLink="false">http://bogdan.org.ua/?p=2301</guid> <description><![CDATA[A few days ago, my Mi Band (version 1) stopped properly tracking sleep and counting steps. Here is a full list of symptoms: synchronization appears to work correctly; total count of steps is updated, but when you click it &#8211; there are no per-hour details; in the older app version: after sync completes, there is [&#8230;]]]></description> <content:encoded><![CDATA[<p><img
src="http://bogdan.org.ua/wp-content/uploads/2015/07/mi_band-154x200.jpg" alt="Mi Band" width="154" height="200" class="alignright size-thumbnail wp-image-2303" />A few days ago, my Mi Band (<strong>version 1</strong>) stopped properly tracking sleep and counting steps. Here is a full list of symptoms:</p><ul><li>synchronization appears to work correctly;</li><li>total count of steps is updated, but when you click it &#8211; there are no per-hour details;</li><li>in the older app version: after sync completes, there is no green message &#8220;Updated X items&#8221;;</li><li>night sleep tracker does not update at all: neither total hours slept, nor per-hour details;</li><li>the band is otherwise functional, e.g. &#8220;Find the band&#8221; works &#8211; it vibrates and flashes diodes.</li></ul><p><a
href="http://en.miui.com/forum.php?mod=viewthread&#038;tid=69223&#038;page=17#pid2283207">Warangelo00</a> found a solution, which worked for me (and no, you do not need to <em>hard reset</em> the device):<br
/> <em>note: the fix below will most probably not work for Mi Band 2, see <a
href="/2015/07/26/how-to-fix-xiaomi-mi-band-stopped-tracking-steps-and-sleep.html#comment-435696">comments</a>; iPhone owners may try <a
href="#comment-477940">switching iPhone from AM/PM (12-hour clock) to 24-hour clock</a> to fix the non-synchronization problems with MiBand2 &#8211; please write in the comments if this method works for you.</em></p><ol><li>enable Bluetooth, if it is disabled;</li><li>start Mi Fit, go to <strong>Play â€“> Incoming call</strong> (or, in older app version, <strong>Settings</strong> &#8211; <strong>Incoming calls</strong>);</li><li>enable it &#8211; set to On;</li><li>now call your mobile phone from a different one &#8211; wait for the band to vibrate and flash lights;</li><li>you should now be able to refresh Mi Fit main page, and see both current day and previous night per-hour details; in the older app version, it should also show the green &#8220;Updated X items&#8221; message after syncing;</li><li>you can now disable incoming calls notification if you don&#8217;t need it.</li></ol><p>According to Holly, the trick <a
href="http://bogdan.org.ua/2015/07/26/how-to-fix-xiaomi-mi-band-stopped-tracking-steps-and-sleep.html#comment-439453">may also work for Mi Pulse</a>.</p><p>Not sure if this fix will last, but it did help me &#8211; thanks, Warangelo00!</p><p><a
class="a2a_button_citeulike" href="https://www.addtoany.com/add_to/citeulike?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2015%2F07%2F26%2Fhow-to-fix-xiaomi-mi-band-stopped-tracking-steps-and-sleep.html&amp;linkname=How%20to%20fix%3A%20Xiaomi%20Mi%20Band%20stopped%20tracking%20steps%20and%20sleep" title="CiteULike" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2015%2F07%2F26%2Fhow-to-fix-xiaomi-mi-band-stopped-tracking-steps-and-sleep.html&amp;linkname=How%20to%20fix%3A%20Xiaomi%20Mi%20Band%20stopped%20tracking%20steps%20and%20sleep" title="Pocket" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_kindle_it" href="https://www.addtoany.com/add_to/kindle_it?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2015%2F07%2F26%2Fhow-to-fix-xiaomi-mi-band-stopped-tracking-steps-and-sleep.html&amp;linkname=How%20to%20fix%3A%20Xiaomi%20Mi%20Band%20stopped%20tracking%20steps%20and%20sleep" title="Kindle It" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_evernote" href="https://www.addtoany.com/add_to/evernote?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2015%2F07%2F26%2Fhow-to-fix-xiaomi-mi-band-stopped-tracking-steps-and-sleep.html&amp;linkname=How%20to%20fix%3A%20Xiaomi%20Mi%20Band%20stopped%20tracking%20steps%20and%20sleep" title="Evernote" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2015%2F07%2F26%2Fhow-to-fix-xiaomi-mi-band-stopped-tracking-steps-and-sleep.html&amp;linkname=How%20to%20fix%3A%20Xiaomi%20Mi%20Band%20stopped%20tracking%20steps%20and%20sleep" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a
class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fbogdan.org.ua%2F2015%2F07%2F26%2Fhow-to-fix-xiaomi-mi-band-stopped-tracking-steps-and-sleep.html&#038;title=How%20to%20fix%3A%20Xiaomi%20Mi%20Band%20stopped%20tracking%20steps%20and%20sleep" data-a2a-url="https://bogdan.org.ua/2015/07/26/how-to-fix-xiaomi-mi-band-stopped-tracking-steps-and-sleep.html" data-a2a-title="How to fix: Xiaomi Mi Band stopped tracking steps and sleep"><img
src="https://static.addtoany.com/buttons/share_save_120_16.png" alt="Share"></a></p>]]></content:encoded> <wfw:commentRss>https://bogdan.org.ua/2015/07/26/how-to-fix-xiaomi-mi-band-stopped-tracking-steps-and-sleep.html/feed</wfw:commentRss> <slash:comments>51</slash:comments> </item> <item><title>How to update a multisite Drupal 6/7 installation using Drush</title><link>https://bogdan.org.ua/2014/08/25/how-to-update-a-multisite-drupal-6-7-installation-using-drush.html</link> <comments>https://bogdan.org.ua/2014/08/25/how-to-update-a-multisite-drupal-6-7-installation-using-drush.html#comments</comments> <pubDate>Mon, 25 Aug 2014 15:35:27 +0000</pubDate> <dc:creator><![CDATA[Bogdan]]></dc:creator> <category><![CDATA[*nix]]></category> <category><![CDATA[Drupal]]></category> <category><![CDATA[how-to]]></category> <category><![CDATA[Notepad]]></category> <category><![CDATA[PHP]]></category> <category><![CDATA[Programming]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[Web]]></category> <category><![CDATA[D6]]></category> <category><![CDATA[D7]]></category> <category><![CDATA[drupal]]></category> <category><![CDATA[drush]]></category> <category><![CDATA[update]]></category> <category><![CDATA[upgrade]]></category> <guid
isPermaLink="false">http://bogdan.org.ua/?p=2167</guid> <description><![CDATA[There are quite a lot of posts on how to do this, but my differs a tiny little bit, so I&#8217;m saving it for my own future reference, and also for the benefits of the wider audience. I am updating a multisite Drupal 6 installation. To the best of my knowledge, the only difference for [&#8230;]]]></description> <content:encoded><![CDATA[<p>There are quite a lot of posts on how to do this, but my differs a tiny little bit, so I&#8217;m saving it for my own future reference, and also for the benefits of the wider audience.</p><p>I am updating a multisite Drupal 6 installation. To the best of my knowledge, the only difference for Drupal 7 is that instead of the <strong>site_offline</strong> D6 variable the <strong>maintenance_mode</strong> variable is used in D7.</p><p>On Debian stable and later, you can <code>sudo aptitude install drush</code> and then just use it immediately after that.</p><p>Note: I recommend <code>su webuser</code> (or <code>sudo -s</code> followed by <code>sudo -s -u webuser</code>) before you run any non-testing <a
href="http://drush.ws/">drush</a> commands, where <em>webuser</em> is the user which owns your web-exposed files (e.g. Debian&#8217;s default is, I think, <strong>www-data</strong>). I&#8217;ve seen a lot of recommendations to run drush as a super-user, but that does not make sense, and may actually cause problems with file ownership.</p><p>One last thing before we start: if your <a
href="http://bogdan.org.ua/2014/08/25/drush-pm-update-fails-tar-hangs-when-extracting-tar-gz-module-archives-from-drupal-org.html">drush seems to work fine but hangs when untarring modules &#8211; check this solution</a>.</p><p><span
id="more-2167"></span></p><ol><li>Run some innocent command in drush to see if it produces any PHP warnings/errors you may want to fix before running actual update: <code>drush @sites core-status</code>. In my case, all the sites had the <a
href="https://www.drupal.org/project/cacherouter" class="broken_link" rel="nofollow">CacheRouter</a> module for in-RAM caching with a server daemon back-end, which was not initialized properly when drush bootstrapped Drupal from the command line. In my case, the only working solution was to edit <code>settings.php</code> files of every site to comment out the CacheRouter configuration for the period of update. If you get no warnings/errors, proceed to the next step. <em>Note: I was running drush from the Drupal&#8217;s root (directory which has top-level <code>index.php</code> and <code>.htaccess</code> files), but this should also work if you run from <code>sites/</code> or even <code>sites/sitename</code>.</em></li><li>Here would be several more steps &#8211; copying your production website(s) to a dev-server (if you do not have one already), performing an update on the dev-server first to see if anything breaks and needs fixes, then migrating updated website(s) from the dev-server to production server. Drush actually has tools to simplify all of these procedures. However, the websites I was updating were not critical, and short downtime was not a problem, so I was updating <strong>live</strong> websites. Modify these steps as you see fit to make the process more reliable.</li><li>Backup databases of all your sites. With drush: <code>drush @sites sql-dump --result-file --gzip</code>. This puts backups somewhere into the home directory of your <em>webuser</em>. Backups are named with a human-readable timestamp. Of course, you can also create a manual <a
href="https://www.drupal.org/project/backup_migrate" class="broken_link" rel="nofollow">Backup and Migrate</a> backup, or use phpMyAdmin, or just <code>mysqldump</code>.</li><li>Backup your site&#8217;s files. This step might be unnecessary, as drush seems to backup modules it is upgrading. I would still recommend making a backup, e.g. with <code>tar -acf multidrupal.tar.bz2 html</code>, where <em>html</em> is the directory containing your multisite Drupal&#8217;s root <code>index.php</code>.</li><li>Put the websites into maintenance mode and clear all caches; see the D7-specific note above: <code>drush @sites variable-set site_offline 1 ; drush @sites cache-clear all</code>.</li><li>The actual update! The easiest way would probably be to <code>drush @sites pm-update</code>, but I haven&#8217;t tested that and used a process which I understand better, and which seems more reliable to me (if anything goes wrong). If in your drupal root you have <strong>sites/site1</strong> and <strong>sites/site2</strong>, then run:<br
/> <code><br
/> drush site1 pm-updatecode<br
/> drush @sites updatedb<br
/> drush site2 pm-updatecode<br
/> drush @sites updatedb<br
/> </code><br
/> The <code>pm-updatecode</code> command only updates files, and does not run database update. So with these commands I am first updating modules from site1, then running database update on all sites, then update modules of site2, and run database update on all sites again. Running <code>drush @sites updatedb</code> multiple times, even when there are no updates, should be safe. Take note of any warnings/errors reported, you will want to fix them later, for example:</p><blockquote><p>WARNING:  Updating core will discard any modifications made to Drupal core files, most noteworthy among these are .htaccess and robots.txt.  If you have made any modifications to these files, please back them up before updating so that you can re-create your modifications in the updated version of the file.</p></blockquote></li><li>Disable maintenance mode. Cleaning the cache seems unnecessary, as <code>updatedb</code> command does that. <code>drush @sites variable-set site_offline 0</code>.</li><li>Finalize: re-enable anything disabled before the updates, fix warnings/errors you noted during the update.</li></ol><p>This worked well for me, and I hope it works well for you.</p><p><a
class="a2a_button_citeulike" href="https://www.addtoany.com/add_to/citeulike?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2014%2F08%2F25%2Fhow-to-update-a-multisite-drupal-6-7-installation-using-drush.html&amp;linkname=How%20to%20update%20a%20multisite%20Drupal%206%2F7%20installation%20using%20Drush" title="CiteULike" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2014%2F08%2F25%2Fhow-to-update-a-multisite-drupal-6-7-installation-using-drush.html&amp;linkname=How%20to%20update%20a%20multisite%20Drupal%206%2F7%20installation%20using%20Drush" title="Pocket" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_kindle_it" href="https://www.addtoany.com/add_to/kindle_it?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2014%2F08%2F25%2Fhow-to-update-a-multisite-drupal-6-7-installation-using-drush.html&amp;linkname=How%20to%20update%20a%20multisite%20Drupal%206%2F7%20installation%20using%20Drush" title="Kindle It" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_evernote" href="https://www.addtoany.com/add_to/evernote?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2014%2F08%2F25%2Fhow-to-update-a-multisite-drupal-6-7-installation-using-drush.html&amp;linkname=How%20to%20update%20a%20multisite%20Drupal%206%2F7%20installation%20using%20Drush" title="Evernote" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2014%2F08%2F25%2Fhow-to-update-a-multisite-drupal-6-7-installation-using-drush.html&amp;linkname=How%20to%20update%20a%20multisite%20Drupal%206%2F7%20installation%20using%20Drush" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a
class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fbogdan.org.ua%2F2014%2F08%2F25%2Fhow-to-update-a-multisite-drupal-6-7-installation-using-drush.html&#038;title=How%20to%20update%20a%20multisite%20Drupal%206%2F7%20installation%20using%20Drush" data-a2a-url="https://bogdan.org.ua/2014/08/25/how-to-update-a-multisite-drupal-6-7-installation-using-drush.html" data-a2a-title="How to update a multisite Drupal 6/7 installation using Drush"><img
src="https://static.addtoany.com/buttons/share_save_120_16.png" alt="Share"></a></p>]]></content:encoded> <wfw:commentRss>https://bogdan.org.ua/2014/08/25/how-to-update-a-multisite-drupal-6-7-installation-using-drush.html/feed</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Debian: how to whitelist IP addresses in tumgrey-SPF</title><link>https://bogdan.org.ua/2013/08/07/debian-how-to-whitelist-ip-address-in-tumgrey-spf.html</link> <comments>https://bogdan.org.ua/2013/08/07/debian-how-to-whitelist-ip-address-in-tumgrey-spf.html#comments</comments> <pubDate>Wed, 07 Aug 2013 12:13:38 +0000</pubDate> <dc:creator><![CDATA[Bogdan]]></dc:creator> <category><![CDATA[*nix]]></category> <category><![CDATA[how-to]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[Debian]]></category> <category><![CDATA[mxguarddog]]></category> <category><![CDATA[spam]]></category> <category><![CDATA[SPF]]></category> <category><![CDATA[tumgreyspf]]></category> <guid
isPermaLink="false">http://bogdan.org.ua/?p=1970</guid> <description><![CDATA[SPF is nice for protecting your mail server from spam, but sometimes there is a need to bypass SPF checking. For example, if you rely on 3rd party servers to do spam protection for you Current setup: MX records point to the spam protection mail servers, which then connect to my server and deliver (hopefully [&#8230;]]]></description> <content:encoded><![CDATA[<p><a
href="http://en.wikipedia.org/wiki/Sender_Policy_Framework">SPF</a> is nice for protecting your mail server from spam, but sometimes there is a need to bypass SPF checking. For example, if you rely on 3rd party servers to do spam protection for you <img
src="https://bogdan.org.ua/wp-includes/images/smilies/icon_smile.gif" alt=":)" class="wp-smiley" /></p><p>Current setup:</p><ul><li>MX records point to the spam protection mail servers, which then</li><li>connect to my server and deliver (hopefully spam-free) mail.</li></ul><p>Problem: some senders (like last.fm) do have proper, strict SPF records. <a
href="http://packages.debian.org/squeeze/tumgreyspf">Tumgreyspf</a> on my server then rejects emails relayed through the spam-protection service.</p><p>If these spam protection relay servers are the only which send mail to your server, then it makes sense to fully disable/uninstall tumgreyspf. Putting tumgreyspf into the permanent &#8220;learning mode&#8221; (set <code>defaultSeedOnly = 1</code> in <code>/etc/tumgreyspf/tumgreyspf.conf</code>) may not fix the SPF problem described above, as SeedOnly seems to only affect greylisting, and not rejecting unauthorized senders.</p><p>Solution: whitelist relay server IPs.<br
/> <span
id="more-1970"></span></p><p>I will use MXGuardDog <a
href="http://mxguarddog.com">spam blocker</a> as an example. This solution is a slightly extended version of <a
href="http://noe.wikidot.com/tumgreyspf-whitelist">this one</a>, and used <a
href="https://github.com/linsomniac/tumgreyspf/blob/master/README">tumgreyspf README</a> as the reference.</p><ul><li>For each of the IPs you want to whitelist, create a directory tree under <code>/var/lib/tumgreyspf/config/client_address</code>. Here is a copy-pasteable example for MXGuardDog, based on their <a
href="http://www.mxguarddog.com/faq.ip_list/">list of server IPs</a>, valid as of August 2013:<br
/> <code><br
/> mkdir -p /var/lib/tumgreyspf/config/client_address/108/166/117<br
/> mkdir -p /var/lib/tumgreyspf/config/client_address/174/129/28<br
/> mkdir -p /var/lib/tumgreyspf/config/client_address/216/58/39<br
/> mkdir -p /var/lib/tumgreyspf/config/client_address/222/229/219<br
/> mkdir -p /var/lib/tumgreyspf/config/client_address/64/15/147<br
/> mkdir -p /var/lib/tumgreyspf/config/client_address/66/85/178<br
/> </code></li><li>Into each of these IP range-specific directories, put a config file, which disables checks (or symlink one). First, create <code>/etc/tumgreyspf/disable.conf</code> with the following lines in it:<br
/> <code><br
/> SPFSEEDONLY = 0<br
/> GREYLISTTIME = 600<br
/> CHECKERS =<br
/> OTHERCONFIGS =<br
/> </code><br
/> It is just like the <code>default.conf</code>, but has empty <code>CHECKERS</code> and <code>OTHERCONFIGS</code> lines.<br
/> Now, symlink it into each of the IP range directories:<br
/> <code><br
/> ln -s /etc/tumgreyspf/disable.conf /var/lib/tumgreyspf/config/client_address/108/166/117/__default__<br
/> ln -s /etc/tumgreyspf/disable.conf /var/lib/tumgreyspf/config/client_address/174/129/28/__default__<br
/> ln -s /etc/tumgreyspf/disable.conf /var/lib/tumgreyspf/config/client_address/216/58/39/__default__<br
/> ln -s /etc/tumgreyspf/disable.conf /var/lib/tumgreyspf/config/client_address/222/229/219/__default__<br
/> ln -s /etc/tumgreyspf/disable.conf /var/lib/tumgreyspf/config/client_address/64/15/147/__default__<br
/> ln -s /etc/tumgreyspf/disable.conf /var/lib/tumgreyspf/config/client_address/66/85/178/__default__<br
/> </code></li></ul><p>Note the double-underscores to the left and right of <code>default</code>.</p><p>That&#8217;s it.</p><p><a
class="a2a_button_citeulike" href="https://www.addtoany.com/add_to/citeulike?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2013%2F08%2F07%2Fdebian-how-to-whitelist-ip-address-in-tumgrey-spf.html&amp;linkname=Debian%3A%20how%20to%20whitelist%20IP%20addresses%20in%20tumgrey-SPF" title="CiteULike" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2013%2F08%2F07%2Fdebian-how-to-whitelist-ip-address-in-tumgrey-spf.html&amp;linkname=Debian%3A%20how%20to%20whitelist%20IP%20addresses%20in%20tumgrey-SPF" title="Pocket" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_kindle_it" href="https://www.addtoany.com/add_to/kindle_it?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2013%2F08%2F07%2Fdebian-how-to-whitelist-ip-address-in-tumgrey-spf.html&amp;linkname=Debian%3A%20how%20to%20whitelist%20IP%20addresses%20in%20tumgrey-SPF" title="Kindle It" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_evernote" href="https://www.addtoany.com/add_to/evernote?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2013%2F08%2F07%2Fdebian-how-to-whitelist-ip-address-in-tumgrey-spf.html&amp;linkname=Debian%3A%20how%20to%20whitelist%20IP%20addresses%20in%20tumgrey-SPF" title="Evernote" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2013%2F08%2F07%2Fdebian-how-to-whitelist-ip-address-in-tumgrey-spf.html&amp;linkname=Debian%3A%20how%20to%20whitelist%20IP%20addresses%20in%20tumgrey-SPF" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a
class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fbogdan.org.ua%2F2013%2F08%2F07%2Fdebian-how-to-whitelist-ip-address-in-tumgrey-spf.html&#038;title=Debian%3A%20how%20to%20whitelist%20IP%20addresses%20in%20tumgrey-SPF" data-a2a-url="https://bogdan.org.ua/2013/08/07/debian-how-to-whitelist-ip-address-in-tumgrey-spf.html" data-a2a-title="Debian: how to whitelist IP addresses in tumgrey-SPF"><img
src="https://static.addtoany.com/buttons/share_save_120_16.png" alt="Share"></a></p>]]></content:encoded> <wfw:commentRss>https://bogdan.org.ua/2013/08/07/debian-how-to-whitelist-ip-address-in-tumgrey-spf.html/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>How to remotely convert live 1xHDD/LVM Linux server to 2xHDD RAID1/LVM (GRUB2, GPT)</title><link>https://bogdan.org.ua/2011/05/17/how-to-remotely-convert-live-hdd-lvm-linux-server-to-raid1-grub2-gpt.html</link> <comments>https://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><![CDATA[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 [&#8230;]]]></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" class="broken_link" rel="nofollow">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 something like <strong>dd -if /dev/sda2 -of /dev/md0</strong> 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>mkfs.ext4 /dev/md0</strong> (one can also use other filesystems here, e.g. mkfs.ext3 or even mkfs.ext2)<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;&#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><p><a
class="a2a_button_citeulike" href="https://www.addtoany.com/add_to/citeulike?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2011%2F05%2F17%2Fhow-to-remotely-convert-live-hdd-lvm-linux-server-to-raid1-grub2-gpt.html&amp;linkname=How%20to%20remotely%20convert%20live%201xHDD%2FLVM%20Linux%20server%20to%202xHDD%20RAID1%2FLVM%20%28GRUB2%2C%20GPT%29" title="CiteULike" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2011%2F05%2F17%2Fhow-to-remotely-convert-live-hdd-lvm-linux-server-to-raid1-grub2-gpt.html&amp;linkname=How%20to%20remotely%20convert%20live%201xHDD%2FLVM%20Linux%20server%20to%202xHDD%20RAID1%2FLVM%20%28GRUB2%2C%20GPT%29" title="Pocket" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_kindle_it" href="https://www.addtoany.com/add_to/kindle_it?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2011%2F05%2F17%2Fhow-to-remotely-convert-live-hdd-lvm-linux-server-to-raid1-grub2-gpt.html&amp;linkname=How%20to%20remotely%20convert%20live%201xHDD%2FLVM%20Linux%20server%20to%202xHDD%20RAID1%2FLVM%20%28GRUB2%2C%20GPT%29" title="Kindle It" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_evernote" href="https://www.addtoany.com/add_to/evernote?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2011%2F05%2F17%2Fhow-to-remotely-convert-live-hdd-lvm-linux-server-to-raid1-grub2-gpt.html&amp;linkname=How%20to%20remotely%20convert%20live%201xHDD%2FLVM%20Linux%20server%20to%202xHDD%20RAID1%2FLVM%20%28GRUB2%2C%20GPT%29" title="Evernote" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2011%2F05%2F17%2Fhow-to-remotely-convert-live-hdd-lvm-linux-server-to-raid1-grub2-gpt.html&amp;linkname=How%20to%20remotely%20convert%20live%201xHDD%2FLVM%20Linux%20server%20to%202xHDD%20RAID1%2FLVM%20%28GRUB2%2C%20GPT%29" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a
class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fbogdan.org.ua%2F2011%2F05%2F17%2Fhow-to-remotely-convert-live-hdd-lvm-linux-server-to-raid1-grub2-gpt.html&#038;title=How%20to%20remotely%20convert%20live%201xHDD%2FLVM%20Linux%20server%20to%202xHDD%20RAID1%2FLVM%20%28GRUB2%2C%20GPT%29" data-a2a-url="https://bogdan.org.ua/2011/05/17/how-to-remotely-convert-live-hdd-lvm-linux-server-to-raid1-grub2-gpt.html" data-a2a-title="How to remotely convert live 1xHDD/LVM Linux server to 2xHDD RAID1/LVM (GRUB2, GPT)"><img
src="https://static.addtoany.com/buttons/share_save_120_16.png" alt="Share"></a></p>]]></content:encoded> <wfw:commentRss>https://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>6</slash:comments> </item> <item><title>How to truncate git history (sample script included)</title><link>https://bogdan.org.ua/2011/03/28/how-to-truncate-git-history-sample-script-included.html</link> <comments>https://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><![CDATA[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 &#8211; 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&#8217;s a sample script (call it e.g. git-truncate and put into your ~/bin or whichever location you have in PATH). #!/bin/bash git checkout --orphan temp $1 [&#8230;]]]></description> <content:encoded><![CDATA[<p>Under a few assumptions (most importantly &#8211; 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&#8217;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><p><code><br
/> #!/bin/bash<br
/> git checkout --orphan temp $1<br
/> git commit -m "Truncated history"<br
/> git rebase --onto temp $1 master<br
/> git branch -D temp<br
/> # The following 2 commands are optional - they keep your git repo in good shape.<br
/> git prune --progress # delete all the objects w/o references<br
/> git gc --aggressive # aggressively collect garbage; may take a lot of time on large repos<br
/> </code></p><p>Invocation: cd to your repository, then <strong>git-truncate <em>refspec</em></strong>, where <em>refspec</em> is either a commit&#8217;s SHA1 hash-id, or a tag.</p><p>Expected result: a git repository starting with &#8220;Truncated history&#8221; 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 &#8211; 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" class="broken_link" rel="nofollow">Tekkub&#8217;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&#8217;s commits</a>.</p><p><a
class="a2a_button_citeulike" href="https://www.addtoany.com/add_to/citeulike?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2011%2F03%2F28%2Fhow-to-truncate-git-history-sample-script-included.html&amp;linkname=How%20to%20truncate%20git%20history%20%28sample%20script%20included%29" title="CiteULike" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2011%2F03%2F28%2Fhow-to-truncate-git-history-sample-script-included.html&amp;linkname=How%20to%20truncate%20git%20history%20%28sample%20script%20included%29" title="Pocket" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_kindle_it" href="https://www.addtoany.com/add_to/kindle_it?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2011%2F03%2F28%2Fhow-to-truncate-git-history-sample-script-included.html&amp;linkname=How%20to%20truncate%20git%20history%20%28sample%20script%20included%29" title="Kindle It" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_evernote" href="https://www.addtoany.com/add_to/evernote?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2011%2F03%2F28%2Fhow-to-truncate-git-history-sample-script-included.html&amp;linkname=How%20to%20truncate%20git%20history%20%28sample%20script%20included%29" title="Evernote" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2011%2F03%2F28%2Fhow-to-truncate-git-history-sample-script-included.html&amp;linkname=How%20to%20truncate%20git%20history%20%28sample%20script%20included%29" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a
class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fbogdan.org.ua%2F2011%2F03%2F28%2Fhow-to-truncate-git-history-sample-script-included.html&#038;title=How%20to%20truncate%20git%20history%20%28sample%20script%20included%29" data-a2a-url="https://bogdan.org.ua/2011/03/28/how-to-truncate-git-history-sample-script-included.html" data-a2a-title="How to truncate git history (sample script included)"><img
src="https://static.addtoany.com/buttons/share_save_120_16.png" alt="Share"></a></p>]]></content:encoded> <wfw:commentRss>https://bogdan.org.ua/2011/03/28/how-to-truncate-git-history-sample-script-included.html/feed</wfw:commentRss> <slash:comments>12</slash:comments> </item> <item><title>How to easily install any PyPi/easy_install python module on Debian</title><link>https://bogdan.org.ua/2011/02/16/how-to-easily-install-any-pypi-easy_install-python-module-on-debian.html</link> <comments>https://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><![CDATA[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&#8217;t have the python-stdeb package: sudo aptitude install python-stdeb pypi-install pycassa That&#8217;s it. Refer to stdeb readme for more information. You will need that if [&#8230;]]]></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&#8217;t have the python-stdeb package: <strong>sudo aptitude install python-stdeb</strong></li><li><strong>pypi-install pycassa</strong></li></ul><p>That&#8217;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 &#8211; which might not be resolved automatically by stdeb.</p><p>Before stdeb, it wasn&#8217;t exactly trivial to <a
href="http://showmedo.com/videotutorials/video?name=linuxJensMakingDeb">make a .deb from python module</a>.</p><p><a
class="a2a_button_citeulike" href="https://www.addtoany.com/add_to/citeulike?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2011%2F02%2F16%2Fhow-to-easily-install-any-pypi-easy_install-python-module-on-debian.html&amp;linkname=How%20to%20easily%20install%20any%20PyPi%2Feasy_install%20python%20module%20on%20Debian" title="CiteULike" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2011%2F02%2F16%2Fhow-to-easily-install-any-pypi-easy_install-python-module-on-debian.html&amp;linkname=How%20to%20easily%20install%20any%20PyPi%2Feasy_install%20python%20module%20on%20Debian" title="Pocket" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_kindle_it" href="https://www.addtoany.com/add_to/kindle_it?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2011%2F02%2F16%2Fhow-to-easily-install-any-pypi-easy_install-python-module-on-debian.html&amp;linkname=How%20to%20easily%20install%20any%20PyPi%2Feasy_install%20python%20module%20on%20Debian" title="Kindle It" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_evernote" href="https://www.addtoany.com/add_to/evernote?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2011%2F02%2F16%2Fhow-to-easily-install-any-pypi-easy_install-python-module-on-debian.html&amp;linkname=How%20to%20easily%20install%20any%20PyPi%2Feasy_install%20python%20module%20on%20Debian" title="Evernote" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2011%2F02%2F16%2Fhow-to-easily-install-any-pypi-easy_install-python-module-on-debian.html&amp;linkname=How%20to%20easily%20install%20any%20PyPi%2Feasy_install%20python%20module%20on%20Debian" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a
class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fbogdan.org.ua%2F2011%2F02%2F16%2Fhow-to-easily-install-any-pypi-easy_install-python-module-on-debian.html&#038;title=How%20to%20easily%20install%20any%20PyPi%2Feasy_install%20python%20module%20on%20Debian" data-a2a-url="https://bogdan.org.ua/2011/02/16/how-to-easily-install-any-pypi-easy_install-python-module-on-debian.html" data-a2a-title="How to easily install any PyPi/easy_install python module on Debian"><img
src="https://static.addtoany.com/buttons/share_save_120_16.png" alt="Share"></a></p>]]></content:encoded> <wfw:commentRss>https://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>https://bogdan.org.ua/2010/11/16/how-to-replace-newlines-with-commas-tabs-etc-merge-lines.html</link> <comments>https://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><![CDATA[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 &#8217;25353&#8242;, which does not have corresponding [&#8230;]]]></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 &#8217;25353&#8242;, which does not have corresponding affy_probeset_id in the 2nd column.</p><p>It is clear how to do that:</p><div
id="ig-sh-1" class="syntax_hilite"><div
class="code"><ol
class="code" style="font-family:monospace;"><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">sort -u *_affy_ensembl.txt | grep -v '_at' | awk '{print $2}'</div></li></ol></div></div><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
id="ig-sh-2" class="syntax_hilite"><div
class="code"><ol
class="code" style="font-family:monospace;"><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">sort -u *_affy_ensembl.txt | grep -v '_at' | awk '{print $2}' | gawk '$1=$1' ORS=', '</div></li></ol></div></div><div
id="ig-sh-3" class="syntax_hilite"><div
class="code"><ol
class="code" style="font-family:monospace;"><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">sort -u *_affy_ensembl.txt | grep -v '_at' | awk '{print $2}' | tr '\n' ','</div></li></ol></div></div><div
id="ig-sh-4" class="syntax_hilite"><div
class="code"><ol
class="code" style="font-family:monospace;"><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">sort -u *_affy_ensembl.txt | grep -v '_at' | awk '{print $2}' | sed ':a;N;$!ba;s/\n/, /g'</div></li></ol></div></div><div
id="ig-sh-5" class="syntax_hilite"><div
class="code"><ol
class="code" style="font-family:monospace;"><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">sort -u *_affy_ensembl.txt | grep -v '_at' | awk '{print $2}' | sed ':q;N;s/\n/, /g;t q'</div></li></ol></div></div><div
id="ig-sh-6" class="syntax_hilite"><div
class="code"><ol
class="code" style="font-family:monospace;"><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">sort -u *_affy_ensembl.txt | grep -v '_at' | awk '{print $2}' | paste -s -d &quot;,&quot;</div></li></ol></div></div><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&#8217;t tested that. <strong>paste</strong> will re-use delimiters, so you cannot really get comma-space &#8220;, &#8221; 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/" class="broken_link" rel="nofollow">linuxquestions 1 (explains used sed commands)</a>, <a
href="http://www.linuxquestions.org/questions/programming-9/merge-lines-in-a-file-using-sed-191121/" class="broken_link" rel="nofollow">linuxquestions 2</a>, <a
href="http://www.cyberciti.biz/faq/linux-unix-sed-replace-newline/">nixcraft</a>.</p><p><a
class="a2a_button_citeulike" href="https://www.addtoany.com/add_to/citeulike?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2010%2F11%2F16%2Fhow-to-replace-newlines-with-commas-tabs-etc-merge-lines.html&amp;linkname=How%20to%20replace%20newlines%20with%20commas%2C%20tabs%20etc%20%28merge%20lines%29" title="CiteULike" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2010%2F11%2F16%2Fhow-to-replace-newlines-with-commas-tabs-etc-merge-lines.html&amp;linkname=How%20to%20replace%20newlines%20with%20commas%2C%20tabs%20etc%20%28merge%20lines%29" title="Pocket" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_kindle_it" href="https://www.addtoany.com/add_to/kindle_it?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2010%2F11%2F16%2Fhow-to-replace-newlines-with-commas-tabs-etc-merge-lines.html&amp;linkname=How%20to%20replace%20newlines%20with%20commas%2C%20tabs%20etc%20%28merge%20lines%29" title="Kindle It" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_evernote" href="https://www.addtoany.com/add_to/evernote?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2010%2F11%2F16%2Fhow-to-replace-newlines-with-commas-tabs-etc-merge-lines.html&amp;linkname=How%20to%20replace%20newlines%20with%20commas%2C%20tabs%20etc%20%28merge%20lines%29" title="Evernote" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2010%2F11%2F16%2Fhow-to-replace-newlines-with-commas-tabs-etc-merge-lines.html&amp;linkname=How%20to%20replace%20newlines%20with%20commas%2C%20tabs%20etc%20%28merge%20lines%29" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a
class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fbogdan.org.ua%2F2010%2F11%2F16%2Fhow-to-replace-newlines-with-commas-tabs-etc-merge-lines.html&#038;title=How%20to%20replace%20newlines%20with%20commas%2C%20tabs%20etc%20%28merge%20lines%29" data-a2a-url="https://bogdan.org.ua/2010/11/16/how-to-replace-newlines-with-commas-tabs-etc-merge-lines.html" data-a2a-title="How to replace newlines with commas, tabs etc (merge lines)"><img
src="https://static.addtoany.com/buttons/share_save_120_16.png" alt="Share"></a></p>]]></content:encoded> <wfw:commentRss>https://bogdan.org.ua/2010/11/16/how-to-replace-newlines-with-commas-tabs-etc-merge-lines.html/feed</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>Linux: how to label swap partition w/o losing swap UUID</title><link>https://bogdan.org.ua/2010/07/16/linux-how-to-label-swap-partition-without-losing-swap-uuid.html</link> <comments>https://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><![CDATA[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&#8217;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&#8230; &#8211; note that UUID; let us assume our UUID is b4e6e5d8-8854-4a3e-8edb-f423ded31e2a Identify swap partition device. If [&#8230;]]]></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&#8217;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&#8230; &#8211; 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=&#8230;. with LABEL=your_new_swap_label, leaving all other spaces and values in that line untouched.</p><p><a
class="a2a_button_citeulike" href="https://www.addtoany.com/add_to/citeulike?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2010%2F07%2F16%2Flinux-how-to-label-swap-partition-without-losing-swap-uuid.html&amp;linkname=Linux%3A%20how%20to%20label%20swap%20partition%20w%2Fo%20losing%20swap%20UUID" title="CiteULike" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2010%2F07%2F16%2Flinux-how-to-label-swap-partition-without-losing-swap-uuid.html&amp;linkname=Linux%3A%20how%20to%20label%20swap%20partition%20w%2Fo%20losing%20swap%20UUID" title="Pocket" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_kindle_it" href="https://www.addtoany.com/add_to/kindle_it?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2010%2F07%2F16%2Flinux-how-to-label-swap-partition-without-losing-swap-uuid.html&amp;linkname=Linux%3A%20how%20to%20label%20swap%20partition%20w%2Fo%20losing%20swap%20UUID" title="Kindle It" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_evernote" href="https://www.addtoany.com/add_to/evernote?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2010%2F07%2F16%2Flinux-how-to-label-swap-partition-without-losing-swap-uuid.html&amp;linkname=Linux%3A%20how%20to%20label%20swap%20partition%20w%2Fo%20losing%20swap%20UUID" title="Evernote" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2010%2F07%2F16%2Flinux-how-to-label-swap-partition-without-losing-swap-uuid.html&amp;linkname=Linux%3A%20how%20to%20label%20swap%20partition%20w%2Fo%20losing%20swap%20UUID" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a
class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fbogdan.org.ua%2F2010%2F07%2F16%2Flinux-how-to-label-swap-partition-without-losing-swap-uuid.html&#038;title=Linux%3A%20how%20to%20label%20swap%20partition%20w%2Fo%20losing%20swap%20UUID" data-a2a-url="https://bogdan.org.ua/2010/07/16/linux-how-to-label-swap-partition-without-losing-swap-uuid.html" data-a2a-title="Linux: how to label swap partition w/o losing swap UUID"><img
src="https://static.addtoany.com/buttons/share_save_120_16.png" alt="Share"></a></p>]]></content:encoded> <wfw:commentRss>https://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>https://bogdan.org.ua/2009/10/27/search-and-replace-in-a-mysql-table.html</link> <comments>https://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><![CDATA[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`,&#8217;string to search for and replace&#8217;,'replacement string&#8217;); If you need a database-wide search-and-replace, you could try this script (I haven&#8217;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! [&#8230;]]]></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`,&#8217;string to search for and replace&#8217;,'replacement string&#8217;);</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" class="broken_link" rel="nofollow">this script</a> (I haven&#8217;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 &#8220;search-for&#8221; 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&#8217;t replace <em>Minivans</em>. However, I believe there exists a case-insensitive version of REPLACE function</li></ol><p><a
class="a2a_button_citeulike" href="https://www.addtoany.com/add_to/citeulike?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2009%2F10%2F27%2Fsearch-and-replace-in-a-mysql-table.html&amp;linkname=Search%20and%20replace%20in%20a%20MySQL%20table" title="CiteULike" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2009%2F10%2F27%2Fsearch-and-replace-in-a-mysql-table.html&amp;linkname=Search%20and%20replace%20in%20a%20MySQL%20table" title="Pocket" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_kindle_it" href="https://www.addtoany.com/add_to/kindle_it?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2009%2F10%2F27%2Fsearch-and-replace-in-a-mysql-table.html&amp;linkname=Search%20and%20replace%20in%20a%20MySQL%20table" title="Kindle It" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_evernote" href="https://www.addtoany.com/add_to/evernote?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2009%2F10%2F27%2Fsearch-and-replace-in-a-mysql-table.html&amp;linkname=Search%20and%20replace%20in%20a%20MySQL%20table" title="Evernote" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2009%2F10%2F27%2Fsearch-and-replace-in-a-mysql-table.html&amp;linkname=Search%20and%20replace%20in%20a%20MySQL%20table" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a
class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fbogdan.org.ua%2F2009%2F10%2F27%2Fsearch-and-replace-in-a-mysql-table.html&#038;title=Search%20and%20replace%20in%20a%20MySQL%20table" data-a2a-url="https://bogdan.org.ua/2009/10/27/search-and-replace-in-a-mysql-table.html" data-a2a-title="Search and replace in a MySQL table"><img
src="https://static.addtoany.com/buttons/share_save_120_16.png" alt="Share"></a></p>]]></content:encoded> <wfw:commentRss>https://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>https://bogdan.org.ua/2009/10/25/configuring-web-server-for-production-and-for-development.html</link> <comments>https://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><![CDATA[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 &#8211; 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. [&#8230;]]]></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> &#8211; 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 &#8211; in which case necessary actions could be partially scripted.</p><p><a
class="a2a_button_citeulike" href="https://www.addtoany.com/add_to/citeulike?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2009%2F10%2F25%2Fconfiguring-web-server-for-production-and-for-development.html&amp;linkname=Configuring%20web-server%3A%20for%20production%20and%20for%20development" title="CiteULike" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2009%2F10%2F25%2Fconfiguring-web-server-for-production-and-for-development.html&amp;linkname=Configuring%20web-server%3A%20for%20production%20and%20for%20development" title="Pocket" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_kindle_it" href="https://www.addtoany.com/add_to/kindle_it?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2009%2F10%2F25%2Fconfiguring-web-server-for-production-and-for-development.html&amp;linkname=Configuring%20web-server%3A%20for%20production%20and%20for%20development" title="Kindle It" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_evernote" href="https://www.addtoany.com/add_to/evernote?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2009%2F10%2F25%2Fconfiguring-web-server-for-production-and-for-development.html&amp;linkname=Configuring%20web-server%3A%20for%20production%20and%20for%20development" title="Evernote" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2009%2F10%2F25%2Fconfiguring-web-server-for-production-and-for-development.html&amp;linkname=Configuring%20web-server%3A%20for%20production%20and%20for%20development" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a
class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fbogdan.org.ua%2F2009%2F10%2F25%2Fconfiguring-web-server-for-production-and-for-development.html&#038;title=Configuring%20web-server%3A%20for%20production%20and%20for%20development" data-a2a-url="https://bogdan.org.ua/2009/10/25/configuring-web-server-for-production-and-for-development.html" data-a2a-title="Configuring web-server: for production and for development"><img
src="https://static.addtoany.com/buttons/share_save_120_16.png" alt="Share"></a></p>]]></content:encoded> <wfw:commentRss>https://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>https://bogdan.org.ua/2009/06/11/c-how-to-specify-comparison-operators-floating-precision.html</link> <comments>https://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><![CDATA[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&#8217;m aware of to do what the title says. However&#8230; I&#8217;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 &#8211; there will always [&#8230;]]]></description> <content:encoded><![CDATA[<p>There is no way I&#8217;m aware of to do what the title says. However&#8230;</p><p>I&#8217;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 &#8211; 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:<br
/> [C] if ( result.score  >= input->raw_cut_off ) [/C]</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 &#8211; 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 &#8220;invent&#8221; precision specification; e.g. if I wanted to test for equality only, I could write<br
/> [C] if ( fabsf( result.score &#8211; input->raw_cut_off ) <  0.000001 )[/C]
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="https://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<br
/> [C] if ( result.score  > ( input->raw_cut_off &#8211; precision) ) [/C]<br
/> 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><p><a
class="a2a_button_citeulike" href="https://www.addtoany.com/add_to/citeulike?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2009%2F06%2F11%2Fc-how-to-specify-comparison-operators-floating-precision.html&amp;linkname=C%3A%20how%20to%20specify%20comparison%20operators%20floating%20precision" title="CiteULike" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2009%2F06%2F11%2Fc-how-to-specify-comparison-operators-floating-precision.html&amp;linkname=C%3A%20how%20to%20specify%20comparison%20operators%20floating%20precision" title="Pocket" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_kindle_it" href="https://www.addtoany.com/add_to/kindle_it?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2009%2F06%2F11%2Fc-how-to-specify-comparison-operators-floating-precision.html&amp;linkname=C%3A%20how%20to%20specify%20comparison%20operators%20floating%20precision" title="Kindle It" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_evernote" href="https://www.addtoany.com/add_to/evernote?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2009%2F06%2F11%2Fc-how-to-specify-comparison-operators-floating-precision.html&amp;linkname=C%3A%20how%20to%20specify%20comparison%20operators%20floating%20precision" title="Evernote" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2009%2F06%2F11%2Fc-how-to-specify-comparison-operators-floating-precision.html&amp;linkname=C%3A%20how%20to%20specify%20comparison%20operators%20floating%20precision" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a
class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fbogdan.org.ua%2F2009%2F06%2F11%2Fc-how-to-specify-comparison-operators-floating-precision.html&#038;title=C%3A%20how%20to%20specify%20comparison%20operators%20floating%20precision" data-a2a-url="https://bogdan.org.ua/2009/06/11/c-how-to-specify-comparison-operators-floating-precision.html" data-a2a-title="C: how to specify comparison operators floating precision"><img
src="https://static.addtoany.com/buttons/share_save_120_16.png" alt="Share"></a></p>]]></content:encoded> <wfw:commentRss>https://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>https://bogdan.org.ua/2009/06/08/best-method-to-recursively-chmodprocess-files-or-directories.html</link> <comments>https://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><![CDATA[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 &#8220;*.php&#8221; -exec /home/user/dos2unix.sh {} [&#8230;]]]></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 &#8220;*.php&#8221; -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><p><a
class="a2a_button_citeulike" href="https://www.addtoany.com/add_to/citeulike?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2009%2F06%2F08%2Fbest-method-to-recursively-chmodprocess-files-or-directories.html&amp;linkname=Best%20method%20to%20recursively%20chmod%2Fprocess%20files%20or%20directories" title="CiteULike" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2009%2F06%2F08%2Fbest-method-to-recursively-chmodprocess-files-or-directories.html&amp;linkname=Best%20method%20to%20recursively%20chmod%2Fprocess%20files%20or%20directories" title="Pocket" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_kindle_it" href="https://www.addtoany.com/add_to/kindle_it?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2009%2F06%2F08%2Fbest-method-to-recursively-chmodprocess-files-or-directories.html&amp;linkname=Best%20method%20to%20recursively%20chmod%2Fprocess%20files%20or%20directories" title="Kindle It" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_evernote" href="https://www.addtoany.com/add_to/evernote?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2009%2F06%2F08%2Fbest-method-to-recursively-chmodprocess-files-or-directories.html&amp;linkname=Best%20method%20to%20recursively%20chmod%2Fprocess%20files%20or%20directories" title="Evernote" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2009%2F06%2F08%2Fbest-method-to-recursively-chmodprocess-files-or-directories.html&amp;linkname=Best%20method%20to%20recursively%20chmod%2Fprocess%20files%20or%20directories" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a
class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fbogdan.org.ua%2F2009%2F06%2F08%2Fbest-method-to-recursively-chmodprocess-files-or-directories.html&#038;title=Best%20method%20to%20recursively%20chmod%2Fprocess%20files%20or%20directories" data-a2a-url="https://bogdan.org.ua/2009/06/08/best-method-to-recursively-chmodprocess-files-or-directories.html" data-a2a-title="Best method to recursively chmod/process files or directories"><img
src="https://static.addtoany.com/buttons/share_save_120_16.png" alt="Share"></a></p>]]></content:encoded> <wfw:commentRss>https://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>https://bogdan.org.ua/2009/05/04/drupal-views-how-to-display-random-nodes-content-block-page.html</link> <comments>https://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><![CDATA[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 [&#8230;]]]></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&#8217;t be simpler than that.</p><p><a
class="a2a_button_citeulike" href="https://www.addtoany.com/add_to/citeulike?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2009%2F05%2F04%2Fdrupal-views-how-to-display-random-nodes-content-block-page.html&amp;linkname=Drupal%20Views%3A%20how%20to%20display%20random%20nodes%2Fcontent" title="CiteULike" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2009%2F05%2F04%2Fdrupal-views-how-to-display-random-nodes-content-block-page.html&amp;linkname=Drupal%20Views%3A%20how%20to%20display%20random%20nodes%2Fcontent" title="Pocket" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_kindle_it" href="https://www.addtoany.com/add_to/kindle_it?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2009%2F05%2F04%2Fdrupal-views-how-to-display-random-nodes-content-block-page.html&amp;linkname=Drupal%20Views%3A%20how%20to%20display%20random%20nodes%2Fcontent" title="Kindle It" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_evernote" href="https://www.addtoany.com/add_to/evernote?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2009%2F05%2F04%2Fdrupal-views-how-to-display-random-nodes-content-block-page.html&amp;linkname=Drupal%20Views%3A%20how%20to%20display%20random%20nodes%2Fcontent" title="Evernote" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2009%2F05%2F04%2Fdrupal-views-how-to-display-random-nodes-content-block-page.html&amp;linkname=Drupal%20Views%3A%20how%20to%20display%20random%20nodes%2Fcontent" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a
class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fbogdan.org.ua%2F2009%2F05%2F04%2Fdrupal-views-how-to-display-random-nodes-content-block-page.html&#038;title=Drupal%20Views%3A%20how%20to%20display%20random%20nodes%2Fcontent" data-a2a-url="https://bogdan.org.ua/2009/05/04/drupal-views-how-to-display-random-nodes-content-block-page.html" data-a2a-title="Drupal Views: how to display random nodes/content"><img
src="https://static.addtoany.com/buttons/share_save_120_16.png" alt="Share"></a></p>]]></content:encoded> <wfw:commentRss>https://bogdan.org.ua/2009/05/04/drupal-views-how-to-display-random-nodes-content-block-page.html/feed</wfw:commentRss> <slash:comments>13</slash:comments> </item> <item><title>Linux: how to remove trailing ^M (carriage return)</title><link>https://bogdan.org.ua/2009/03/30/linux-how-to-remove-trailing-control-m-carriage-return.html</link> <comments>https://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><![CDATA[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&#8217;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 [&#8230;]]]></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&#8217;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><p><a
class="a2a_button_citeulike" href="https://www.addtoany.com/add_to/citeulike?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2009%2F03%2F30%2Flinux-how-to-remove-trailing-control-m-carriage-return.html&amp;linkname=Linux%3A%20how%20to%20remove%20trailing%20%5EM%20%28carriage%20return%29" title="CiteULike" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2009%2F03%2F30%2Flinux-how-to-remove-trailing-control-m-carriage-return.html&amp;linkname=Linux%3A%20how%20to%20remove%20trailing%20%5EM%20%28carriage%20return%29" title="Pocket" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_kindle_it" href="https://www.addtoany.com/add_to/kindle_it?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2009%2F03%2F30%2Flinux-how-to-remove-trailing-control-m-carriage-return.html&amp;linkname=Linux%3A%20how%20to%20remove%20trailing%20%5EM%20%28carriage%20return%29" title="Kindle It" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_evernote" href="https://www.addtoany.com/add_to/evernote?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2009%2F03%2F30%2Flinux-how-to-remove-trailing-control-m-carriage-return.html&amp;linkname=Linux%3A%20how%20to%20remove%20trailing%20%5EM%20%28carriage%20return%29" title="Evernote" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2009%2F03%2F30%2Flinux-how-to-remove-trailing-control-m-carriage-return.html&amp;linkname=Linux%3A%20how%20to%20remove%20trailing%20%5EM%20%28carriage%20return%29" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a
class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fbogdan.org.ua%2F2009%2F03%2F30%2Flinux-how-to-remove-trailing-control-m-carriage-return.html&#038;title=Linux%3A%20how%20to%20remove%20trailing%20%5EM%20%28carriage%20return%29" data-a2a-url="https://bogdan.org.ua/2009/03/30/linux-how-to-remove-trailing-control-m-carriage-return.html" data-a2a-title="Linux: how to remove trailing ^M (carriage return)"><img
src="https://static.addtoany.com/buttons/share_save_120_16.png" alt="Share"></a></p>]]></content:encoded> <wfw:commentRss>https://bogdan.org.ua/2009/03/30/linux-how-to-remove-trailing-control-m-carriage-return.html/feed</wfw:commentRss> <slash:comments>3</slash:comments> </item> <item><title>Intel i915 integrated graphics under Debian: how to get rid of sluggish 2D performance</title><link>https://bogdan.org.ua/2009/03/02/intel-i915-integrated-graphics-under-debian-how-to-get-rid-of-sluggish-2d-performance.html</link> <comments>https://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><![CDATA[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, [&#8230;]]]></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&#8217;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&#8217;ve added these lines to section &#8220;module&#8221;:<br
/><blockquote><p> Load &#8220;dbe&#8221;<br
/> Load &#8220;xtrap&#8221;<br
/> Load &#8220;record&#8221;<br
/> Load &#8220;GLcore&#8221;</p></blockquote><p>These are <strong>not</strong> really <strong>performance-related</strong> and could be skipped; I&#8217;m giving them here, because they were suggested as default entries by dexconf or some other xorg.conf-generator utility. Again &#8211; they are not supposed to improve performance, so you can skip these.</li><li>my &#8220;Device&#8221; section is now:<br
/><blockquote><p> Section &#8220;Device&#8221;<br
/> Identifier	&#8220;Intel Corporation 82915G/GV/910GL Integrated Graphics Controller&#8221;<br
/> BoardName	&#8220;82915G/GV/910GL Integrated Graphics Controller&#8221;<br
/> Vendorname	&#8220;Intel Corporation&#8221;<br
/> #Driver		&#8220;i810&#8243;<br
/> Driver		&#8220;intel&#8221;<br
/> BusID		&#8220;PCI:0:2:0&#8243;<br
/> Option	&#8220;DRI&#8221;	&#8220;true&#8221;<br
/> Option	&#8220;AccelMethod&#8221;	&#8220;exa&#8221;<br
/> Option	&#8220;MigrationHeuristic&#8221;	&#8220;greedy&#8221;<br
/> Option	&#8220;ExaNoComposite&#8221;	&#8220;false&#8221;<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&#8217;t make a difference for me, and <strong>Option DRI true</strong> might be redundant (didn&#8217;t bother trying to remove it).</li><li>at the end of xorg.conf I have two more sections:<br
/><blockquote><p> Section &#8220;DRI&#8221;<br
/> Mode	0666<br
/> EndSection</p><p>Section &#8220;Extensions&#8221;<br
/> Option	&#8220;Composite&#8221;	&#8220;enable&#8221;<br
/> Option	&#8220;MIT-SHM&#8221;	&#8220;Yes&#8221;<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 &#8211; 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><p><a
class="a2a_button_citeulike" href="https://www.addtoany.com/add_to/citeulike?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2009%2F03%2F02%2Fintel-i915-integrated-graphics-under-debian-how-to-get-rid-of-sluggish-2d-performance.html&amp;linkname=Intel%20i915%20integrated%20graphics%20under%20Debian%3A%20how%20to%20get%20rid%20of%20sluggish%202D%20performance" title="CiteULike" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2009%2F03%2F02%2Fintel-i915-integrated-graphics-under-debian-how-to-get-rid-of-sluggish-2d-performance.html&amp;linkname=Intel%20i915%20integrated%20graphics%20under%20Debian%3A%20how%20to%20get%20rid%20of%20sluggish%202D%20performance" title="Pocket" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_kindle_it" href="https://www.addtoany.com/add_to/kindle_it?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2009%2F03%2F02%2Fintel-i915-integrated-graphics-under-debian-how-to-get-rid-of-sluggish-2d-performance.html&amp;linkname=Intel%20i915%20integrated%20graphics%20under%20Debian%3A%20how%20to%20get%20rid%20of%20sluggish%202D%20performance" title="Kindle It" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_evernote" href="https://www.addtoany.com/add_to/evernote?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2009%2F03%2F02%2Fintel-i915-integrated-graphics-under-debian-how-to-get-rid-of-sluggish-2d-performance.html&amp;linkname=Intel%20i915%20integrated%20graphics%20under%20Debian%3A%20how%20to%20get%20rid%20of%20sluggish%202D%20performance" title="Evernote" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2009%2F03%2F02%2Fintel-i915-integrated-graphics-under-debian-how-to-get-rid-of-sluggish-2d-performance.html&amp;linkname=Intel%20i915%20integrated%20graphics%20under%20Debian%3A%20how%20to%20get%20rid%20of%20sluggish%202D%20performance" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a
class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fbogdan.org.ua%2F2009%2F03%2F02%2Fintel-i915-integrated-graphics-under-debian-how-to-get-rid-of-sluggish-2d-performance.html&#038;title=Intel%20i915%20integrated%20graphics%20under%20Debian%3A%20how%20to%20get%20rid%20of%20sluggish%202D%20performance" data-a2a-url="https://bogdan.org.ua/2009/03/02/intel-i915-integrated-graphics-under-debian-how-to-get-rid-of-sluggish-2d-performance.html" data-a2a-title="Intel i915 integrated graphics under Debian: how to get rid of sluggish 2D performance"><img
src="https://static.addtoany.com/buttons/share_save_120_16.png" alt="Share"></a></p>]]></content:encoded> <wfw:commentRss>https://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>https://bogdan.org.ua/2009/02/20/gitosis-how-to-add-new-repository.html</link> <comments>https://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><![CDATA[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 &#8211; 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 [&#8230;]]]></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;&#038; git pull</strong> &#8211; 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 &#8211; copy your user&#8217;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 &#8216;new repository: newreponame&#8217;</strong>; <strong>git push</strong>;</li><li>now that you have the new repo permissions configured, let&#8217;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> &#8211; this initializes empty git repository, and then adds all the files to it. If you have no files &#8211; you can skip the &#8216;git add .&#8217; command, as it will do nothing for you.</li><li><strong>git commit -m &#8216;initial commit&#8217;</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 &#8216;initial commit&#8217;</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;&#038; git config &ndash;&ndash;add branch.master.merge refs/heads/master</strong>; alternatively, <strong>cd .git &#038;&#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&#8217;t be able to <em>git pull</em>.</ol><p><a
class="a2a_button_citeulike" href="https://www.addtoany.com/add_to/citeulike?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2009%2F02%2F20%2Fgitosis-how-to-add-new-repository.html&amp;linkname=gitosis%3A%20how%20to%20add%20new%20repository" title="CiteULike" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2009%2F02%2F20%2Fgitosis-how-to-add-new-repository.html&amp;linkname=gitosis%3A%20how%20to%20add%20new%20repository" title="Pocket" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_kindle_it" href="https://www.addtoany.com/add_to/kindle_it?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2009%2F02%2F20%2Fgitosis-how-to-add-new-repository.html&amp;linkname=gitosis%3A%20how%20to%20add%20new%20repository" title="Kindle It" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_evernote" href="https://www.addtoany.com/add_to/evernote?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2009%2F02%2F20%2Fgitosis-how-to-add-new-repository.html&amp;linkname=gitosis%3A%20how%20to%20add%20new%20repository" title="Evernote" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2009%2F02%2F20%2Fgitosis-how-to-add-new-repository.html&amp;linkname=gitosis%3A%20how%20to%20add%20new%20repository" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a
class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fbogdan.org.ua%2F2009%2F02%2F20%2Fgitosis-how-to-add-new-repository.html&#038;title=gitosis%3A%20how%20to%20add%20new%20repository" data-a2a-url="https://bogdan.org.ua/2009/02/20/gitosis-how-to-add-new-repository.html" data-a2a-title="gitosis: how to add new repository"><img
src="https://static.addtoany.com/buttons/share_save_120_16.png" alt="Share"></a></p>]]></content:encoded> <wfw:commentRss>https://bogdan.org.ua/2009/02/20/gitosis-how-to-add-new-repository.html/feed</wfw:commentRss> <slash:comments>16</slash:comments> </item> <item><title>WordPress and Google Analytics external nofollow problem in comment links</title><link>https://bogdan.org.ua/2009/02/13/wordpress-and-google-analytics-external-nofollow-problem-in-comment-links.html</link> <comments>https://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><![CDATA[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&#8217;s link in comments is broken &#8211; it has &#8216; external nofollow&#8217; attached straight to the href attribute (which breaks the link). I assume that the problem is caused by Google Analytics, namely the &#8220;track outgoing clicks&#8221; feature (as recalled, might be inaccurate feature name). &#8220;Track outgoing links&#8221; adds [&#8230;]]]></description> <content:encoded><![CDATA[<p>Since some WP release, the comment author&#8217;s link in comments is broken &#8211; it has &#8216; external nofollow&#8217; attached straight to the href attribute (which breaks the link).</p><p>I assume that the problem is caused by Google Analytics, namely the &#8220;track outgoing clicks&#8221; feature (as recalled, might be inaccurate feature name). &#8220;Track outgoing links&#8221; adds some JavaScript code to all outgoing links, and that script has tick characters like this one &#8216; 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
id="ig-sh-7" class="syntax_hilite"><div
class="code"><ol
class="php" style="font-family:monospace;"><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">$return = &quot;&lt;a href='$url' rel='external nofollow' class='url'&gt;$author&lt;/a&gt;&quot;;</div></li></ol></div></div><p>with</p><div
id="ig-sh-8" class="syntax_hilite"><div
class="code"><ol
class="php" style="font-family:monospace;"><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">$return = '&lt;a href=&quot;'.$url.'&quot; rel=&quot;external nofollow&quot; class=&quot;url&quot;&gt;'.$author.'&lt;/a&gt;';</div></li></ol></div></div></li></ol><p>This helped me and might help you.</p><p><a
class="a2a_button_citeulike" href="https://www.addtoany.com/add_to/citeulike?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2009%2F02%2F13%2Fwordpress-and-google-analytics-external-nofollow-problem-in-comment-links.html&amp;linkname=WordPress%20and%20Google%20Analytics%20external%20nofollow%20problem%20in%20comment%20links" title="CiteULike" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2009%2F02%2F13%2Fwordpress-and-google-analytics-external-nofollow-problem-in-comment-links.html&amp;linkname=WordPress%20and%20Google%20Analytics%20external%20nofollow%20problem%20in%20comment%20links" title="Pocket" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_kindle_it" href="https://www.addtoany.com/add_to/kindle_it?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2009%2F02%2F13%2Fwordpress-and-google-analytics-external-nofollow-problem-in-comment-links.html&amp;linkname=WordPress%20and%20Google%20Analytics%20external%20nofollow%20problem%20in%20comment%20links" title="Kindle It" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_evernote" href="https://www.addtoany.com/add_to/evernote?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2009%2F02%2F13%2Fwordpress-and-google-analytics-external-nofollow-problem-in-comment-links.html&amp;linkname=WordPress%20and%20Google%20Analytics%20external%20nofollow%20problem%20in%20comment%20links" title="Evernote" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2009%2F02%2F13%2Fwordpress-and-google-analytics-external-nofollow-problem-in-comment-links.html&amp;linkname=WordPress%20and%20Google%20Analytics%20external%20nofollow%20problem%20in%20comment%20links" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a
class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fbogdan.org.ua%2F2009%2F02%2F13%2Fwordpress-and-google-analytics-external-nofollow-problem-in-comment-links.html&#038;title=WordPress%20and%20Google%20Analytics%20external%20nofollow%20problem%20in%20comment%20links" data-a2a-url="https://bogdan.org.ua/2009/02/13/wordpress-and-google-analytics-external-nofollow-problem-in-comment-links.html" data-a2a-title="WordPress and Google Analytics external nofollow problem in comment links"><img
src="https://static.addtoany.com/buttons/share_save_120_16.png" alt="Share"></a></p>]]></content:encoded> <wfw:commentRss>https://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> </channel> </rss>