<?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/categories/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>How to merge Windows 10 &#8220;system reserved&#8221; and Recovery partitions</title><link>https://bogdan.org.ua/2017/09/03/how-to-merge-windows-10-system-reserved-and-recovery-partitions.html</link> <comments>https://bogdan.org.ua/2017/09/03/how-to-merge-windows-10-system-reserved-and-recovery-partitions.html#comments</comments> <pubDate>Sun, 03 Sep 2017 10:06:07 +0000</pubDate> <dc:creator><![CDATA[Bogdan]]></dc:creator> <category><![CDATA[how-to]]></category> <category><![CDATA[merge]]></category> <category><![CDATA[recovery]]></category> <category><![CDATA[system reserved]]></category> <category><![CDATA[windows]]></category> <category><![CDATA[Windows 10]]></category> <guid
isPermaLink="false">http://bogdan.org.ua/?p=2499</guid> <description><![CDATA[My initial reason for merging these two partitions was the need to have two more partitions on the disk &#8211; and with 3 primary partitions already in place (system reserved, windows 10 itself, and recovery) on the MBR disk that was only possible by adding an extended partition and then adding both new partitions to [&#8230;]]]></description> <content:encoded><![CDATA[<p>My initial reason for merging these two partitions was the need to have two more partitions on the disk &#8211; and with 3 primary partitions already in place (system reserved, windows 10 itself, and recovery) on the MBR disk that was only possible by adding an extended partition and then adding both new partitions to it &#8211; which is not what I wanted.</p><p>An additional reason appeared when I started researching the topic.<br
/> Apparently, Windows 10 no longer even creates the recovery partition during installation!<br
/> The entire <abbr
title="Windows Recovery Environment">WinRE</abbr> is now stored on that same <strong>system reserved</strong> partition, which contains your window&#8217;s <abbr
title="Boot Configuration Data">BCD</abbr>!<br
/> The recovery partitions should only be present on Windows 10 installations which were either upgrades from a previous Windows version, or (as in my case) were installed within about 6 months after Windows 10 became available.</p><p>These instructions are also useful if you wish to increase the size of your system reserved partition &#8211; for example, if Windows 10 updates are failing because of that partition&#8217;s lack of free space.</p><blockquote><p> <strong>WARNING</strong>: changing partition tables on your hard/solid-state disk may easily result in complete data loss!<br
/> Instructions below are provided as-is, to be used at your own risk. See full disclaimer on the About page.</p></blockquote><blockquote><p><strong>WARNING</strong>: although it is also possible to merge the system reserved partition and windows 10 partition (so that the entire Windows 10 uses only 1 primary partition), I do not (and will not) offer instructions to do so. In fact, I recommend that you <strong>don&#8217;t</strong> merge the system reserved and windows 10 partitions.</p></blockquote><p>Merging <strong>system reserved</strong> and <strong>recovery</strong> partitions, step by step.<br
/> <span
id="more-2499"></span></p><ol><li>First, we need a convenient partition manager; I have used a free <em>MiniTool Partition Wizard</em>, but other great free partition managers (like <em>AOMEI Partition Assistant</em> and I guess a few others) should be sufficient for us. Download and install one of those. It is impossible to use Window&#8217;s own Disk Manager for the steps below.</li><li>My starting state is this: <strong><pre>[ 189MB free space ] [ system reserved, 100MB ] [ windows 10, 100GB ] [ recovery, 450MB ] [ free space ]</pre><p></strong></li><li>Your starting state may look a bit simpler, like this: <strong><pre>[ system reserved, 100MB ] [ windows 10, 100GB ] [ recovery, 450MB ]</pre><p></strong> Presence or absence of free space at the beginning or end of the disk should not make any difference (unless your windows partition has very little free space).</li><li>Our goal state is: <strong><pre>[ system reserved, 900 MB ] [ windows, 100 GB ] [ free space ]</pre><p></strong></li><li><strong>Create a full disk backup!</strong> Yes, I really did that. I can highly recommend booting into Clonezilla (or your Linux, if you dual-boot), and performing a full disk-to-image backup. If anything at all goes wrong &#8211; you should be able to completely restore your system to the previous functional state.</li><li><strong>Verify that your full-disk backup can be restored</strong> (is readable/decompressible/whatever). Clonezilla has an option (enabled by default) to perform this check after disk imaging is complete &#8211; this was sufficient for me.</li><li><strong>Verify that you have a functional WinRE</strong>: start Administrator CMD (or PowerShell), and run <strong>reagentc /info</strong> &#8211; it should tell you that WinRE is enabled, and also tell you that it&#8217;s using partition 3. I&#8217;d also strongly suggest that you <strong>create a separate bootable USB with WinRE</strong> &#8211; Windows 10 has its own tool to do so.</li><li>(optional) If you, like me, had some free space at the beginning of the disk, before the system reserved partition &#8211; then it makes sense to first extend the system reserved partition there. Use your partition manager to do so &#8211; either as a one-click <strong>Extend partition</strong> operation (and then select the free space upstream, all of it), or as a <strong>Resize partition</strong> to move the left edge of system reserved to disk&#8217;s beginning. <strong>Reboot</strong>. This worked flawlessly for me. If your Windows 10 does not boot anymore &#8211; try fixing boot using your bootable WinRE, or the WinRE on your disk. If that fails &#8211; restore your disk backup, and look for a different solution&#8230;</li><li>When merging system reserved and recovery partitions, one has to keep in mind the <em>free space</em> requirements of these two partitions (for <a
href="https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/configure-uefigpt-based-hard-drive-partitions">UEFI</a>, for <a
href="https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/configure-biosmbr-based-hard-drive-partitions">MBR</a>). They are a bit weird, so I picked <strong>900 MB as the target size</strong> for <em>system reserved</em>; with this size, at least 320 MB have to be free on that partition after we are done. After merging the free space (189 MB) and the sysres partition (100 MB) I already had 289 MB, and needed to add (900-289=) 611 MB. Start your partition manager again, <strong>Extend</strong> system reserved partition using your Windows 10 partition, and reboot again. If there is no option to extend: first shrink the windows partition from the left edge by the calculated number of MB (611 in my case), then extended sysres partition into the freed space &#8211; and reboot. After this step, the disk should look like this: <strong><pre>[ system reserved, 900 MB ] [ windows 10, ~100GB ] [ recovery, 450 MB ] [ free space]</pre><p></strong></li><li>Now we are going to <strong>move the WinRE from a dedicated partition to a sysres partition</strong>, in a few easy commands. Start Administrator CMD or PowerShell, check that your WinRE is still active: <strong>reagentc /info</strong>. Now disable it: <strong>reagentc /disable</strong>. Verify with another <strong>reagentc /info</strong>. <strong>If disabling failed</strong>, and you wish to have the WinRE functionality &#8211; <strong>do not proceed</strong>! I have no idea if proceeding after failure here would result in a functional WinRE. <strong>Do not reboot, keep the CMD/PowerShell open</strong>!</li><li>Delete the recovery partition, apply changes, do not reboot! (although it should actually be safe to&#8230;)</li><li>(possibly optional) Create an unformatted placeholder partition where your recovery partition used to be, to prevent Windows from creating it again when you re-enable WinRE. In my case, disk layout after this step is: <strong><pre>[ system reserved, 900 MB ] [ windows 10, about 100 GB ] [ Unformatted primary partition ]</pre><p></strong> Do not reboot.</li><li>Back to your elevated privileges CMD/PowerShell window: simply run <strong>reagentc /enable</strong>, and confirm with <strong>reagentc /info</strong>. As there is no other place to put WinRE now, <strong>reagentc</strong> should save it to the (now big enough) system reserved partition.</li><li>Delete the placeholder partition. Your final state should be similar to: <strong><pre>[ system reserved, 900 MB ] [ Windows 10, ~100 GB ] [ free space ]</pre><p></strong></li></ol><p>Congratulations, you have just successfully merged the <em>system reserved</em> and <em>recovery</em> partitions of <em>Windows 10</em>!</p><p><a
class="a2a_button_citeulike" href="https://www.addtoany.com/add_to/citeulike?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2017%2F09%2F03%2Fhow-to-merge-windows-10-system-reserved-and-recovery-partitions.html&amp;linkname=How%20to%20merge%20Windows%2010%20%E2%80%9Csystem%20reserved%E2%80%9D%20and%20Recovery%20partitions" 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%2F2017%2F09%2F03%2Fhow-to-merge-windows-10-system-reserved-and-recovery-partitions.html&amp;linkname=How%20to%20merge%20Windows%2010%20%E2%80%9Csystem%20reserved%E2%80%9D%20and%20Recovery%20partitions" 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%2F2017%2F09%2F03%2Fhow-to-merge-windows-10-system-reserved-and-recovery-partitions.html&amp;linkname=How%20to%20merge%20Windows%2010%20%E2%80%9Csystem%20reserved%E2%80%9D%20and%20Recovery%20partitions" 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%2F2017%2F09%2F03%2Fhow-to-merge-windows-10-system-reserved-and-recovery-partitions.html&amp;linkname=How%20to%20merge%20Windows%2010%20%E2%80%9Csystem%20reserved%E2%80%9D%20and%20Recovery%20partitions" 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%2F2017%2F09%2F03%2Fhow-to-merge-windows-10-system-reserved-and-recovery-partitions.html&amp;linkname=How%20to%20merge%20Windows%2010%20%E2%80%9Csystem%20reserved%E2%80%9D%20and%20Recovery%20partitions" 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%2F2017%2F09%2F03%2Fhow-to-merge-windows-10-system-reserved-and-recovery-partitions.html&#038;title=How%20to%20merge%20Windows%2010%20%E2%80%9Csystem%20reserved%E2%80%9D%20and%20Recovery%20partitions" data-a2a-url="https://bogdan.org.ua/2017/09/03/how-to-merge-windows-10-system-reserved-and-recovery-partitions.html" data-a2a-title="How to merge Windows 10 “system reserved” and Recovery partitions"><img
src="https://static.addtoany.com/buttons/share_save_120_16.png" alt="Share"></a></p>]]></content:encoded> <wfw:commentRss>https://bogdan.org.ua/2017/09/03/how-to-merge-windows-10-system-reserved-and-recovery-partitions.html/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>How to: enable metadata duplication on an existing btrfs filesystem</title><link>https://bogdan.org.ua/2016/12/30/how-to-add-enable-metadata-duplication-existing-btrfs-filesystem.html</link> <comments>https://bogdan.org.ua/2016/12/30/how-to-add-enable-metadata-duplication-existing-btrfs-filesystem.html#comments</comments> <pubDate>Fri, 30 Dec 2016 19:43:51 +0000</pubDate> <dc:creator><![CDATA[Bogdan]]></dc:creator> <category><![CDATA[*nix]]></category> <category><![CDATA[how-to]]></category> <category><![CDATA[Notepad]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[btrfs]]></category> <guid
isPermaLink="false">http://bogdan.org.ua/?p=2474</guid> <description><![CDATA[Just one command: sudo btrfs balance start -v -mconvert=dup /toplevel/ where /toplevel/ is your mountpoint of the btrfs root, -v is there for verbosity (not too verbose, don&#8217;t worry), and -mconvert=dup literally says act on metadata only, convert data profile to DUP. This will duplicate both metadata and btrfs system data. Verify with: sudo btrfs [&#8230;]]]></description> <content:encoded><![CDATA[<p>Just one command: <code>sudo btrfs balance start -v -mconvert=dup  /toplevel/</code><br
/> where <code>/toplevel/</code> is your <a
href="http://bogdan.org.ua/2016/02/15/how-to-convert-your-vps-root-filesystem-to-btrfs-using-rescue-boot.html">mountpoint of the btrfs root</a>, <code>-v</code> is there for verbosity (not too verbose, don&#8217;t worry), and <code>-mconvert=dup</code> literally says <em>act on metadata only, convert data profile to DUP</em>.</p><p>This will duplicate both metadata and btrfs system data.<br
/> Verify with: <code>sudo btrfs fi df /toplevel</code>:</p><blockquote><p>Data, single: total=10.00GiB, used=3.88GiB<br
/> System, DUP: total=64.00MiB, used=4.00KiB<br
/> Metadata, DUP: total=512.00MiB, used=286.18MiB<br
/> GlobalReserve, single: total=96.00MiB, used=0.00B</p></blockquote><p>Explanation: on SSDs, mkfs.btrfs creates metadata in <em>single</em> mode (because of widely spread SSD deduplication algorithms negating duplicate entries). However, second copy of metadata increases recovery chances, especially so if your SSD does not deduplicate writes. Hence the desire to add metadata/systemdata duplication after the filesystem is created.</p><p><a
class="a2a_button_citeulike" href="https://www.addtoany.com/add_to/citeulike?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2016%2F12%2F30%2Fhow-to-add-enable-metadata-duplication-existing-btrfs-filesystem.html&amp;linkname=How%20to%3A%20enable%20metadata%20duplication%20on%20an%20existing%20btrfs%20filesystem" 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%2F12%2F30%2Fhow-to-add-enable-metadata-duplication-existing-btrfs-filesystem.html&amp;linkname=How%20to%3A%20enable%20metadata%20duplication%20on%20an%20existing%20btrfs%20filesystem" 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%2F12%2F30%2Fhow-to-add-enable-metadata-duplication-existing-btrfs-filesystem.html&amp;linkname=How%20to%3A%20enable%20metadata%20duplication%20on%20an%20existing%20btrfs%20filesystem" 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%2F12%2F30%2Fhow-to-add-enable-metadata-duplication-existing-btrfs-filesystem.html&amp;linkname=How%20to%3A%20enable%20metadata%20duplication%20on%20an%20existing%20btrfs%20filesystem" 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%2F12%2F30%2Fhow-to-add-enable-metadata-duplication-existing-btrfs-filesystem.html&amp;linkname=How%20to%3A%20enable%20metadata%20duplication%20on%20an%20existing%20btrfs%20filesystem" 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%2F12%2F30%2Fhow-to-add-enable-metadata-duplication-existing-btrfs-filesystem.html&#038;title=How%20to%3A%20enable%20metadata%20duplication%20on%20an%20existing%20btrfs%20filesystem" data-a2a-url="https://bogdan.org.ua/2016/12/30/how-to-add-enable-metadata-duplication-existing-btrfs-filesystem.html" data-a2a-title="How to: enable metadata duplication on an existing btrfs filesystem"><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/12/30/how-to-add-enable-metadata-duplication-existing-btrfs-filesystem.html/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>How to: install Windows 7 on a recent laptop/PC from a bootable USB drive</title><link>https://bogdan.org.ua/2016/06/12/how-to-install-windows-7-on-a-recent-laptop-pc-from-a-bootable-usb-drive.html</link> <comments>https://bogdan.org.ua/2016/06/12/how-to-install-windows-7-on-a-recent-laptop-pc-from-a-bootable-usb-drive.html#comments</comments> <pubDate>Sun, 12 Jun 2016 11:06:42 +0000</pubDate> <dc:creator><![CDATA[Bogdan]]></dc:creator> <category><![CDATA[how-to]]></category> <category><![CDATA[bootable]]></category> <category><![CDATA[SSD]]></category> <category><![CDATA[USB3]]></category> <category><![CDATA[windows]]></category> <category><![CDATA[Windows 7]]></category> <guid
isPermaLink="false">http://bogdan.org.ua/?p=2440</guid> <description><![CDATA[If you had ever seen the not-so-descriptive error message A required CD/DVD drive device driver is missing, then you have been trying to install Windows 7 (possibly using a bootable flash drive) on a recent laptop or desktop. There are two major obstacles for a somewhat-dated Windows 7 when it sees modern hardware: USB 3.0 [&#8230;]]]></description> <content:encoded><![CDATA[<p>If you had ever seen the not-so-descriptive error message<br
/> <strong>A required CD/DVD drive device driver is missing</strong>,<br
/> then you have been trying to install Windows 7 (possibly using a bootable flash drive) on a recent laptop or desktop.</p><p>There are two major obstacles for a somewhat-dated Windows 7 when it sees modern hardware:</p><ul><li>USB 3.0</li><li>SSDs and newer disk drives in general</li></ul><p>Fortunately, both problems are easy to fix.<br
/> Just follow the steps below; skip steps 1 and 2 if you already have a bootable Win7 flash drive.<br
/> <span
id="more-2440"></span></p><ol><li>Obtain/buy/create the Windows 7 ISO image.<br
/> On Linux, creating an ISO image is as easy as <code>dd if=/dev/sr0 of=/path/to/image.iso</code> &#8211; assuming that <code>/dev/sr0</code> is your DVD reader.</li><li>Create a bootable Windows 7 installation flash drive.<br
/> On Linux, WinUSB can handle this; on Windows, you can use Rufus, or Microsoft&#8217;s own tool for this.</li><li>To add USB 3.0 drivers to the Win7 on your flash drive, download and use this: <a
href="https://downloadcenter.intel.com/download/25476/Windows-7-USB-3-0-Creator-Utility" class="broken_link" rel="nofollow">Windows 7 USB 3.0 Creator Utility</a>:<ol><li>Run the utility as Administrator.</li><li>Depending on the speed of your USB stick, this may take up to 15 minutes.</li><li>Wait for a message along the lines of <em>Creation finished!</em> or <em>Upgrade finished</em>.</li></ol></li><li>The steps above fix the first obstacle: lack of USB 3.0 drivers in the Windows 7 installation image.<br
/> Now we are going to preemptively fix the second obstacle: not recognizing modern HDDs/SSDs.</li><li>Go to your hardware manufacturer&#8217;s website and locate the (model-specific) SATA/storage driver.<br
/> Using Dell&#8217;s hardware as an example:<ol><li>go to <a
href="http://downloads.dell.com/">downloads.dell.com</a></li><li>there, click Laptops (or Desktops), then find and click your hardware model</li><li>you will see a list of drivers for that model; search for &#8220;serial-ata&#8221; or &#8220;storage&#8221;</li><li>download the latest version of the driver that you have found (it would be <em>intel storage technology</em> in Dell&#8217;s example case)</li></ol></li><li>Depending on the manufacturer, drivers may need to be extracted from the (self-extracting) archive. In the case of Dell&#8217;s drivers,<ol><li>launch the downloaded executable file</li><li>it will usually present 2 options: Install and Extract; you should extract</li></ol></li><li>In the downloaded (and, possibly, extracted) drivers folder locate Windows7-specific drivers folder, and simply copy that folder to the USB stick with your Win7 installation.</li><li>Be sure to remember what is the driver&#8217;s folder name &#8211; if Windows fails to see your SSD, you will need to manually browse for these drivers during installation.</li></ol><p>That&#8217;s it!</p><p>Sources used:</p><ul><li>this <a
href="https://www.youtube.com/watch?v=yd37BJwTxiM">video</a> &#8211; or rather <a
href="https://www.youtube.com/watch?v=_PNmHnce5xY&#038;index=2&#038;list=PL1RkaknDn7v-Dn67p5RYuEyfVp28ElpGF">this one</a>;</li><li><a
href="https://downloadmirror.intel.com/25476/eng/Install-Win7-to-USB3.0-Computers-Readme.pdf" class="broken_link" rel="nofollow">Install Win7 to USB3.0 Computers Readme</a> &#8211; also has information on other methods of injecting USB 3.0 drivers into windows USB stick.</li></ul><p><a
class="a2a_button_citeulike" href="https://www.addtoany.com/add_to/citeulike?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2016%2F06%2F12%2Fhow-to-install-windows-7-on-a-recent-laptop-pc-from-a-bootable-usb-drive.html&amp;linkname=How%20to%3A%20install%20Windows%207%20on%20a%20recent%20laptop%2FPC%20from%20a%20bootable%20USB%20drive" 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%2F06%2F12%2Fhow-to-install-windows-7-on-a-recent-laptop-pc-from-a-bootable-usb-drive.html&amp;linkname=How%20to%3A%20install%20Windows%207%20on%20a%20recent%20laptop%2FPC%20from%20a%20bootable%20USB%20drive" 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%2F06%2F12%2Fhow-to-install-windows-7-on-a-recent-laptop-pc-from-a-bootable-usb-drive.html&amp;linkname=How%20to%3A%20install%20Windows%207%20on%20a%20recent%20laptop%2FPC%20from%20a%20bootable%20USB%20drive" 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%2F06%2F12%2Fhow-to-install-windows-7-on-a-recent-laptop-pc-from-a-bootable-usb-drive.html&amp;linkname=How%20to%3A%20install%20Windows%207%20on%20a%20recent%20laptop%2FPC%20from%20a%20bootable%20USB%20drive" 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%2F06%2F12%2Fhow-to-install-windows-7-on-a-recent-laptop-pc-from-a-bootable-usb-drive.html&amp;linkname=How%20to%3A%20install%20Windows%207%20on%20a%20recent%20laptop%2FPC%20from%20a%20bootable%20USB%20drive" 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%2F06%2F12%2Fhow-to-install-windows-7-on-a-recent-laptop-pc-from-a-bootable-usb-drive.html&#038;title=How%20to%3A%20install%20Windows%207%20on%20a%20recent%20laptop%2FPC%20from%20a%20bootable%20USB%20drive" data-a2a-url="https://bogdan.org.ua/2016/06/12/how-to-install-windows-7-on-a-recent-laptop-pc-from-a-bootable-usb-drive.html" data-a2a-title="How to: install Windows 7 on a recent laptop/PC from a bootable USB drive"><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/06/12/how-to-install-windows-7-on-a-recent-laptop-pc-from-a-bootable-usb-drive.html/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <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: easily add swap partition to a live system on btrfs</title><link>https://bogdan.org.ua/2016/04/14/how-to-easily-add-swap-partition-to-a-live-system-on-btrfs.html</link> <comments>https://bogdan.org.ua/2016/04/14/how-to-easily-add-swap-partition-to-a-live-system-on-btrfs.html#comments</comments> <pubDate>Thu, 14 Apr 2016 13:09:23 +0000</pubDate> <dc:creator><![CDATA[Bogdan]]></dc:creator> <category><![CDATA[*nix]]></category> <category><![CDATA[how-to]]></category> <category><![CDATA[btrfs]]></category> <category><![CDATA[filesystem]]></category> <category><![CDATA[partition]]></category> <category><![CDATA[resize]]></category> <category><![CDATA[swap]]></category> <guid
isPermaLink="false">http://bogdan.org.ua/?p=2397</guid> <description><![CDATA[Recently I had a need to add a swap file to my Debian installation. However, I am now using btrfs, and &#8211; as with any other COW filesystem &#8211; it is not possible to simply create a swap file and use it. There are workarounds (creating a file with a COW attribute removed, and then [&#8230;]]]></description> <content:encoded><![CDATA[<p>Recently I had a need to <a
href="http://bogdan.org.ua/2010/07/16/linux-how-to-label-swap-partition-without-losing-swap-uuid.html">add a swap file</a> to my Debian installation.<br
/> However, I am now using btrfs, and &#8211; as with any other <abbr
title="Copy On Write">COW</abbr> filesystem &#8211; it is not possible to simply create a swap file and use it.<br
/> There are workarounds (creating a file with a COW attribute removed, and then loop-mounting it), but I just did not like them.</p><p>So I have decided to add a swap partition.<br
/> It worked amazingly (and very easily), there was even no need to reboot &#8211; at all.<br
/> I still did restart, just to make sure the system is bootable &#8211; and all was perfectly fine.</p><p>My initial setup is very simple: a single /dev/sda1 partition on the /dev/sda disk, fully used by btrfs.<br
/> Different important paths/mountpoints are btrfs subvolumes, using <a
href="http://bogdan.org.ua/2016/02/15/how-to-convert-your-vps-root-filesystem-to-btrfs-using-rescue-boot.html">flat hierarchy</a>.<br
/> For this example, let us assume that /dev/sda (and /dev/sda1) is 25GB large, and that I want to add a 2GB swap /dev/sda2 after /dev/sda1.</p><p>Brief explanation before we start:</p><ol><li>shrink btrfs <em>filesystem</em> by more than 2GB;</li><li>shrink btrfs <em>partition</em> by 2GB;</li><li>create new 2GB partition for the swap;</li><li>resize btrfs <em>filesystem</em> to full size of its new-size <em>partition</em>;</li><li>initialize swap and turn it on.</li></ol><p>Here are the very easy steps! Just make sure you do not make mistakes anywhere <img
src="https://bogdan.org.ua/wp-includes/images/smilies/icon_wink.gif" alt=";)" class="wp-smiley" /><br
/> <span
id="more-2397"></span></p><ol><li>If your btrfs volume with ID 5 (top level) is a separate mountpoint: mount it now, e.g. <code>sudo mount /toplevel</code>.</li><li>Take note of your current partition label and UUID: <code>sudo blkid</code>.</li><li>Resize btrfs filesystem <strong>down</strong> (shrink) with a <strong>good</strong> margin; for example, if I want to add a 2 GB swap, then I can <code>sudo btrfs fi resize -3g /toplevel</code> &#8211; here, I&#8217;m shrinking btrfs <em>filesystem</em> by about a gigabyte more than necessary. The process is very quick if you have free space, so you can even use a larger margin &#8211; say, <code>sudo btrfs fi resize -5g /toplevel</code>.</li><li><code>sudo parted</code>, then <code>print</code> to make sure what is the number of your btrfs <em>partition</em>, then <code>resizepart 1</code> (where <strong>1</strong> is the partition number), and answer a few questions: <code>yes</code>, <code>new_size_here</code> (in our example: 23.0GB), <code>yes</code>. You can also create a swap partition from parted, then quit parted with <code>q</code> and Enter.</li><li><code>sudo partprobe</code> to let the OS know that partitions have changed.</li><li>I have used <strong>cfdisk</strong> to create a 2GB swap partition: it has a very simple ncurses UI, and is very intuitive. After creating swap partition, do run <code>sudo partprobe</code> again.</li><li>Resize btrfs <em>filesystem</em> back up to take all of the <em>partition</em>: <code>sudo btrfs fi resize max /toplevel</code>.</li><li>Simply to be sure, run a scrub: <code>sudo btrfs scrub start -B -r /toplevel</code>.</li><li>Initialize swap; you can specify uuid and/or label which you may already have in your fstab: <code>mkswap --label=swap --uuid=your1234-your-uuid-1234-youruuid1234 /dev/sda2</code>.</li><li><code>sudo blkid</code> to make sure your /dev/sda1 UUID stayed the same (or to get swap uuid/label if you haven&#8217;t specified any).</li><li>Optionally, add the swap line to your /etc/fstab. Then turn on swap with <code>swapon -a</code>.</li></ol><p>That&#8217;s it! Amazing, isn&#8217;t it? On-the-fly filesystem and partition resizing!</p><p><a
class="a2a_button_citeulike" href="https://www.addtoany.com/add_to/citeulike?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2016%2F04%2F14%2Fhow-to-easily-add-swap-partition-to-a-live-system-on-btrfs.html&amp;linkname=How%20to%3A%20easily%20add%20swap%20partition%20to%20a%20live%20system%20on%20btrfs" 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%2F04%2F14%2Fhow-to-easily-add-swap-partition-to-a-live-system-on-btrfs.html&amp;linkname=How%20to%3A%20easily%20add%20swap%20partition%20to%20a%20live%20system%20on%20btrfs" 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%2F04%2F14%2Fhow-to-easily-add-swap-partition-to-a-live-system-on-btrfs.html&amp;linkname=How%20to%3A%20easily%20add%20swap%20partition%20to%20a%20live%20system%20on%20btrfs" 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%2F04%2F14%2Fhow-to-easily-add-swap-partition-to-a-live-system-on-btrfs.html&amp;linkname=How%20to%3A%20easily%20add%20swap%20partition%20to%20a%20live%20system%20on%20btrfs" 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%2F04%2F14%2Fhow-to-easily-add-swap-partition-to-a-live-system-on-btrfs.html&amp;linkname=How%20to%3A%20easily%20add%20swap%20partition%20to%20a%20live%20system%20on%20btrfs" 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%2F04%2F14%2Fhow-to-easily-add-swap-partition-to-a-live-system-on-btrfs.html&#038;title=How%20to%3A%20easily%20add%20swap%20partition%20to%20a%20live%20system%20on%20btrfs" data-a2a-url="https://bogdan.org.ua/2016/04/14/how-to-easily-add-swap-partition-to-a-live-system-on-btrfs.html" data-a2a-title="How to: easily add swap partition to a live system on btrfs"><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/04/14/how-to-easily-add-swap-partition-to-a-live-system-on-btrfs.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: convert your VPS root filesystem to btrfs (using rescue boot)</title><link>https://bogdan.org.ua/2016/02/15/how-to-convert-your-vps-root-filesystem-to-btrfs-using-rescue-boot.html</link> <comments>https://bogdan.org.ua/2016/02/15/how-to-convert-your-vps-root-filesystem-to-btrfs-using-rescue-boot.html#comments</comments> <pubDate>Mon, 15 Feb 2016 17:04:25 +0000</pubDate> <dc:creator><![CDATA[Bogdan]]></dc:creator> <category><![CDATA[*nix]]></category> <category><![CDATA[how-to]]></category> <category><![CDATA[btrfs]]></category> <category><![CDATA[convert]]></category> <category><![CDATA[Debian]]></category> <category><![CDATA[filesystem]]></category> <category><![CDATA[VPS]]></category> <guid
isPermaLink="false">http://bogdan.org.ua/?p=2349</guid> <description><![CDATA[I&#8217;m moving from (a kind of&#8230;) a dedicated server to a VPS, to decrease my frightful anticipation of hardware failures. Honestly though, that server had been freezing up and restarting spontaneously for several months now, causing sometimes really long down-times&#8230; That server is now about 6-7 years old, built with off-the-shelf components, some of which [&#8230;]]]></description> <content:encoded><![CDATA[<p>I&#8217;m moving from (a kind of&#8230;) a dedicated server to a VPS, to decrease my frightful anticipation of hardware failures.<br
/> <em>Honestly though, that server had been freezing up and restarting spontaneously for several months now, causing sometimes really long down-times&#8230;</em><br
/> That server is now about 6-7 years old, built with off-the-shelf components, some of which (the HDD <img
src="https://bogdan.org.ua/wp-includes/images/smilies/icon_smile.gif" alt=":)" class="wp-smiley" /> ) had weird noises from the very start.<br
/> Definitely time to move!</p><p>I&#8217;ve purchased a fairly cheap VPS with an easy, one-click upgrade option for after I&#8217;m done configuring it.<br
/> It comes with a wide selection of OSes to pre-install; I&#8217;ve chosen <strong>Debian Jessie</strong>, version 8.3 as of this writing.</p><p>I wanted to use <strong>btrfs</strong> from the beginning, so could have installed Debian myself, but&#8230; VPS provider does some initial configuration (like their Debian mirror and some other things), so I&#8217;ve felt that converting to btrfs <em>after the fact</em> would be easier. Now that I&#8217;ve done this &#8211; I guess it was fairly easy, although preparation did take some time.</p><p>Below, I&#8217;m providing step-by-step instructions on how to convert your root filesystem from (most likely) <strong>ext4 to btrfs</strong>.<br
/> <span
id="more-2349"></span><br
/> I&#8217;ll be using my provider&#8217;s <em>rescue boot</em> mode: this is a live Debian system which is network-booted on my own VPS, and thus has access to the SSD/HDD of my VPS. Hopefully, your provider has a similar feature.</p><p>Preparing for this conversion, I had mostly used two sources:</p><ul><li>an older <a
href="https://www.howtoforge.com/how-to-convert-an-ext3-ext4-root-file-system-to-btrfs-on-ubuntu-12.10-p2">howtoforge conversion tutorial</a>, and</li><li><a
href="https://btrfs.wiki.kernel.org/index.php/SysadminGuide">Sysadmin Guide</a></li></ul><p>Before we begin with actual conversion, here is a</p><h3>List of hints and useful practices/commands for a future btrfs user</h3><ul><li>Changing the default subvolume with <code>btrfs subvolume set-default</code> will make the top level of the filesystem inaccessible, except by use of the <code>subvol=/</code> or <code>subvolid=5</code> mount options.</li><li>If top level is no longer your default subvolume, it is useful to have an <strong>fstab</strong> entry for the top level (note the <strong>noauto</strong> option!):<br
/> <code>LABEL=toplevel   /root/btrfs-top-lvl   btrfs  subvol=/,defaults,noauto,noatime   0  0</code></li><li><a
href="http://marc.merlins.org/perso/btrfs/post_2014-03-19_Btrfs-Tips_-Btrfs-Scrub-and-Btrfs-Filesystem-Repair.html">scurbbing and repairing btrfs</a>; most of the hints below originate from Marc&#8217;s <a
href="http://events.linuxfoundation.org/sites/events/files/slides/Btrfs_1.pdf">2014 btrfs presentation</a></li><li>scrub script: <a
href="http://marc.merlins.org/linux/scripts/btrfs-scrub">http://marc.merlins.org/linux/scripts/btrfs-scrub</a></li><li><code>mount -o compress=lzo</code> is fast and best for SSDs; <code>mount -o compress=zlib</code> compresses better but is slower</li><li>you can turn off COW (copy-on-write) for specific files and directories with <code>chattr Â­-C /path</code> (new files will inherit this)</li><li>for a highly fragmented VM, <code>btrfs filesystem defragment vbox.vdi</code> could take hours; <code>cp -reflink=never vbox.vdi vbox.vdi.new; rm vbox.vdi</code> is much faster</li><li><code>cp -reflink=always</code> copies within and between subvolumes without duplicating data</li><li>run scrub nightly or weekly on all btrfs filesystems</li><li><strong>noatime</strong> is the best fstab mount option for btrfs <em>IF USING SNAPSHOTS</em>, because <strong>relatime</strong> still causes at least 1 write every 24h</li><li>if you have <strong>errors=remount-ro</strong> in your <strong>fstab</strong> for extX-filesystem, you should remove it after converting to <strong>btrfs</strong> as it does not understand the option.</li></ul><h3>We are almost ready to start! Just one last thing: partitioning!</h3><p>On my previous server, I did have a certain partition scheme, with separate <strong>/boot</strong>, <strong>/home</strong>, <strong>/var</strong>, <strong>/usr</strong>, and everything else under <strong>/</strong> partition.<br
/> It worked very well for me, never ran into problems (although this is more like a Debian&#8217;s feature, not that of my partition scheme <img
src="https://bogdan.org.ua/wp-includes/images/smilies/icon_smile.gif" alt=":)" class="wp-smiley" /> ).<br
/> However&#8230; With the current VPS, it started initially with just everything under <strong>/</strong>, in a single partition.<br
/> I could have re-partitioned everything from the rescue system while converting to <strong>btrfs</strong>, but what for? What would be the benefits?</p><p>Let&#8217;s have a look and evaluate</p><h3>Advantages/disadvantages of keeping specific partitions separate.</h3><ul><li><strong>/boot</strong> comes the first. Normally I format it with ext2, and set aside just 100-200 megabytes for this small partition.<br
/> This improves boot-reliability of the system. With <strong>btrfs</strong>, it was also the case that grub could not use <strong>/boot</strong> on a btrfs volume.<br
/> However,</p><blockquote><p> Newer GRUBs can handle a /boot partition which is btrfs, so you need not have a separate /boot partition formatted as ext3/4.</p></blockquote><p>So this time I&#8217;m going without a separate /boot.<br
/> I will not even create a separate subvolume for it: for snapshotting purposes, <strong>/boot</strong> fits perfectly under the <strong>/</strong> snapshots.</li><li>Next comes <strong>/home</strong>.<br
/> The reason to separate it is to safeguard user data when upgrading/reinstalling the OS.<br
/> This, however, can be achieved with <strong>btrfs subvolumes</strong> &#8211; no need for partitions!<br
/> I&#8217;m going with a &#8220;subvolume for home&#8221; here, then.</li><li>Next comes <strong>/var</strong>, or more precisely <strong>/var/log</strong>.<br
/> One of the reasons to keep <strong>/var/log</strong> separate is to prevent filesystem overfill if logs suddenly start growing too fast.<br
/> This, however, can be achieved with <strong>subvolume quotas</strong>. No need for a partition!</li><li>There is also <strong>/var/lib/<databasename></strong> (and also <strong>/var/lib/lxc/&#8230;</strong>), which hold fairly big data files, often with random write access patterns.<br
/> There are two reasons to make them subvolumes:</p><ol><li>for data-only snapshots</li><li>to enable <code>nocow</code>/<code>nodatacow</code> at mount time, to avoid high fragmentation with random writes</li></ol><p>However, this can be done later, when these databases/LXC get installed &#8211; in just a few commands, without rebooting.</li><li>Finally, <strong>/</strong> itself should be a separate subvolume &#8211; mostly for snapshot and reinstall/upgrade reasons.</li></ul><p>Ok, now we are <strong>really</strong> going to</p><h3>Convert the filesystem</h3><ol><li>Enable rescue system, write down access credentials. You may need to restart your VPS to boot into rescue system, but check with your VPS provider first.</li><li>Connect to and log in to the rescue system.</li><li>Install <strong>btrfs-tools</strong> in the rescue system, if not there yet. We&#8217;ll need <strong>btrfs-convert</strong>, which should be included in <strong>btrfs-tools</strong>.</li><li>I&#8217;m assuming that your SSD/HDD is device <strong>/dev/sda</strong>, and that the only (root) partition there is <strong>/dev/sda1</strong>; adjust the next steps if your setup is different. <em>Only proceed with commands if you understand what they are doing!</em></li><li>It never hurts to <code>fsck /dev/sda1</code> before doing filesystem conversion <img
src="https://bogdan.org.ua/wp-includes/images/smilies/icon_smile.gif" alt=":)" class="wp-smiley" /> You should see something like <em>/dev/sda1: clean, 27282/1564672 files, 351853/6249472 blocks</em>.</li><li><code>btrfs-convert -l toplevel /dev/sda1</code>; note that I&#8217;m adding a &#8220;toplevel&#8221; <em>LABEL</em> to the top level of btrfs, for easier mounting it later. The output should look like this:<br
/><blockquote><p> creating btrfs metadata.<br
/> creating ext2fs image file.<br
/> cleaning up system chunk.<br
/> conversion complete.</p></blockquote><p> At this point the system is already btrfs! <img
src="https://bogdan.org.ua/wp-includes/images/smilies/icon_smile.gif" alt=":)" class="wp-smiley" /></li><li>If you forgot to set btrfs label, or decide to do it later: list the filesystems with <code>btrfs filesystem show</code>, or just look for the label with <code>btrfs filesystem label /dev/sda1</code> (which will produce an empty line if there is no label), then simply <code>btrfs filesystem label /dev/sda1 toplevel</code>; it will produce no output on success.</li><li>Let&#8217;s change into the new system, and start configuring it:<br
/> <code>mount /dev/sda1 /mnt<br
/> for fs in proc sys dev dev/pts; do mount --bind /$fs /mnt/$fs; done<br
/> chroot /mnt</code></li><li><code>ls</code> now should show your root filesystem files and directories, plus the <strong>ext2_saved</strong> &#8220;directory&#8221; (which is a subvolume, actually):<br
/><blockquote><p> bin   dev  ext2_saved  initrd.img         installimage.debug  lib64       media  opt   root  sbin  sys  usr  vmlinuz<br
/> boot  etc  home        installimage.conf  lib                 lost+found  mnt    proc  run   srv   tmp  var</p></blockquote></li><li>Run <code>blkid /dev/sda1</code> to find out the UUID of the new btrfs top-level volume. You can also see it with <code>btrfs filesystem show</code>:<br
/><blockquote><p> /dev/sda1: LABEL=&#8221;toplevel&#8221; UUID=&#8221;3124c827-c3bd-4a62-843f-1d5a552f1858&#8243; UUID_SUB=&#8221;ffad5668-2ac7-4ea4-83ad-e6ccba7ccf96&#8243; TYPE=&#8221;btrfs&#8221; PARTUUID=&#8221;750b31a7-01&#8243;</p></blockquote></li><li>Edit <strong>/etc/fstab</strong> (with e.g. <code>nano /etc/fstab</code>):<ul><li>change <strong>UUID</strong> of <strong>/</strong> to the new one</li><li>change the filesystem type from ext3/ext4 to <strong>btrfs</strong></li><li>change the options to <strong>subvol=root,defaults,noatime,compress=lzo,ssd,discard</strong> (yes, <strong>subvol=root</strong> does not exist yet&#8230; also, <strong>ssd,discard</strong> are for SSDs only, and instead of adding <strong>discard</strong> here it might be better to setup an <strong>fstrim</strong> cronjob. Finally, <strong>noatime</strong> can be left out if you are not going to make snapshots.)</li><li>change the last number in the line from 1 to 0 (the fsck passes &#8211; btrfs does not want boot-time filesystem checking)</li></ul></li><li>Some guides mention editing /etc/grub.d/00_header in a specific way, running <em>grub-mkconfig | grep &#8221; ro &#8220;</em> to see if it adds the proper <em>rootflags=subvol=root</em>, then even run <em>update-grub</em> and <em>grub-install /dev/sda</em> here&#8230; But all of this seems redundant or plain unnecessary. First of all, the <em>root</em> subvolume simply does not exist yet, so <em>grub-mkconfig</em> will <strong>not</strong> produce correct <em>rootflags</em>. Secondly, we are not yet done with setting up subvolumes, and we are not going to reboot right now, so running <em>update-grub</em>/<em>grub-install</em> is a bit premature at this stage <img
src="https://bogdan.org.ua/wp-includes/images/smilies/icon_smile.gif" alt=":)" class="wp-smiley" /></li><li>Now we are going to create some subvolumes. As I want to name the <strong>root</strong> subvolume simply <em>root</em>, I should first move the root user&#8217;s home files somewhere else (otherwise <code>btrfs snapshot</code> complains &#8220;ERROR: incorrect snapshot name &#8216;/&#8217;&#8221;):<br
/> <code>mv /root /root_orig<br
/> btrfs subvolume snapshot / /root</code></li><li>The same <em>problem</em> with <strong>/home</strong>, need to move it as well: <code>mv /home /home_orig</code></li><li>I can NOT snapshot <strong>/home</strong> like I did with <strong>/</strong>, because it is just a directory, not a volume like <strong>/</strong>, so:<br
/> <code>btrfs subvolume create /home</code><br
/> Note: my <strong>/home</strong> (/home_orig) is still empty, as this is a brand-new installation with only the root user, so double-check steps below, as I haven&#8217;t really run them.<br
/> <code>rsync --progress -aHAX /home_orig/* /home<br
/> ls -la /home/<br
/> ls -la /home_orig/<br
/> rm -fr /home_orig/*<br
/> ls -la /root/home/<br
/> rm -fr /root/home/*</code> # be sure to leave the empty /root/home/ in place: it will be the mount point.</li><li><code>nano /etc/fstab</code> to add the <strong>/home</strong> mount line, using <strong>the same UUID as earlier for the / partition</strong>, but a different <strong>subvol</strong> option:<br
/> <strong>UUID=3124c827-c3bd-4a62-843f-1d5a552f1858 /home               btrfs   subvol=home,defaults 0       0</strong><br
/> Feel free to add more mount options, similar to those for root subvolume. While we are editing /etc/fstab, it also makes sense to add a <strong>non-automount /toplevel</strong> entry (<strong>UUID=3124c827-c3bd-4a62-843f-1d5a552f1858 /toplevel               btrfs   subvol=/,defaults,noauto 0       0</strong>) and create mountpoint for it: <code>mkdir /root/toplevel</code></li><li>Follow the same procedure to create the <strong>/var/log</strong> subvolume. I&#8217;m using <em>flat subvolumes</em> layout here:<br
/> <code>btrfs subvolume create /log<br
/> rsync --progress -aHAX /var/log/* /log<br
/> ls -la /log/<br
/> ls -la /var/log/<br
/> rm -fr /var/log/*<br
/> ls -la /root/var/log/<br
/> rm -fr /root/var/log/*<br
/> </code></li><li>Add <strong>/var/log</strong> entry to <strong>fstab</strong>:<br
/> <strong>UUID=&#8221;3124c827-c3bd-4a62-843f-1d5a552f1858&#8243; /var/log   btrfs   subvol=log,defaults,ssd,discard,compress=lzo,noatime   0   0</strong></li><li>/var/lib/<name> &#8211; databases, LXC, nodatacow/nocow &#8211; can be created later, not doing it here and now.</li><li><code>cp /etc/fstab /root/etc/fstab</code></li><li><code>exit</code> # chroot</li><li> <code>for fs in proc sys dev/pts dev; do umount /mnt/$fs; done<br
/> umount /mnt</code></li><li>Let&#8217;s enter the new root subvolume!<br
/> <code>mount -o subvol=root /dev/sda1 /mnt<br
/> for fs in proc sys dev dev/pts; do mount --bind /$fs /mnt/$fs; done<br
/> chroot /mnt</code></li><li>Oh, we forgot to move back root_orig into /root! That&#8217;s easy: <code>mv root_orig root</code>. If you want your root&#8217;s aliases/profile to load, then just <code>exit</code> and <code>chroot /mnt</code> again (I had to do that for the nice pre-configured prompt colours <img
src="https://bogdan.org.ua/wp-includes/images/smilies/icon_biggrin.gif" alt=":D" class="wp-smiley" /> )</li><li><code>btrfs subvolume list /</code> to see our new and shiny subvolumes:<br
/><blockquote><p> ID 256 gen 8 top level 5 path ext2_saved<br
/> ID 260 gen 49 top level 5 path root<br
/> ID 261 gen 35 top level 5 path home<br
/> ID 262 gen 42 top level 5 path log</p></blockquote></li><li>Let&#8217;s make <strong>root</strong> the default subvolume! If suddenly <em>rootflags</em> get lost during grub configuration, then the system should still be able to boot. Subvol ID comes from the output of the command above (260 in my case):<br
/> <code>btrfs subvolume set-default 260 /</code> # no output<br
/> <code>btrfs subvolume get-default /</code> # to verify</p><blockquote><p>ID 260 gen 49 top level 5 path root</p></blockquote></li><li>Now let&#8217;s check grub-mkconfig output: <code>grub-mkconfig | grep " ro "</code>. Now that the subvolume exists, it does show all the desired <em>rootflags=subvol=root</em>.</li><li>Let&#8217;s make sure our system will be bootable:<br
/> <code>update-grub<br
/> grub-install /dev/sda</code></li><li>Leave the chroot:<br
/> <code>exit<br
/> for fs in proc sys dev/pts dev; do umount /mnt/$fs; done<br
/> umount /mnt</code></li><li>Now let&#8217;s mount top-level again, for cleanup. If you remember, we had all the <strong>/</strong> files there &#8211; which are now in the <strong>root</strong> subvolume:<br
/> <code>mount -o subvol=/ /dev/sda1 /mnt</code></li><li>Navigate to /mnt (<code>cd /mnt</code>, yes <img
src="https://bogdan.org.ua/wp-includes/images/smilies/icon_smile.gif" alt=":)" class="wp-smiley" /> ) and delete from here everything that is <strong>NOT</strong> a subvolume.<br
/> The command which supposedly does this is <code>find /mnt -xdev -delete</code> (<strong>-xdev</strong> is supposed to not descend into mounts of other filesystems), but I haven&#8217;t used it &#8211; was a bit tired and did not want to screw up the so-far-successful conversion, so I just did <code>rm -rf bin boot dev etc initrd.img lib lib64 lost+found media mnt opt proc run sbin srv sys tmp usr vmlinuz var root_orig</code> &#8211; basically, deleted everything except for ext2_saved, home, root, and log &#8211; which are all subvolumes.</li><li>Confirm that only subvolumes are left now:<br
/> <code>ls -la</code>:</p><blockquote><p> drwxr-xr-x 1 root root  10 Feb 13 21:30 ext2_saved<br
/> drwxr-xr-x 1 root root   0 Feb 13 22:04 home<br
/> drwxr-xr-x 1 root root 510 Feb 13 22:13 log<br
/> drwxr-xr-x 1 root root 318 Feb 13 22:18 root</p></blockquote><p><code>btrfs subvolume list /mnt</code>:</p><blockquote><p> ID 256 gen 8 top level 5 path ext2_saved<br
/> ID 260 gen 52 top level 5 path root<br
/> ID 261 gen 35 top level 5 path home<br
/> ID 262 gen 42 top level 5 path log</p></blockquote><p><code>btrfs subvolume get-default /mnt</code>:</p><blockquote><p>ID 260 gen 52 top level 5 path root</p></blockquote></li><li>We can leave now: <code>cd / &#038;&#038; umount /mnt</code></li><li>Reboot into the new system. If this fails: can boot rescue again, chroot and check what went wrong&#8230;</li><li>In my case, conversion seemed to have succeeded, BUT: a) for some reason <strong>/toplevel</strong> was mounted at boot and full of root-like files which should not have been there anymore; b) I could not delete <strong>ext2_saved</strong>, at all, neither from <strong>/</strong> nor from <strong>/toplevel</strong>. The problem was with the <strong>toplevel</strong> mount line in <strong>/etc/fstab</strong> (initially, I forgot to specify the filesystem type). After fixing this and rebooting once more, everything was perfect: <strong>/toplevel</strong> not mounted, and when mounted it only had subvolumes in it. And of course the system booted without any problems. Now I could delete the previous filesystem snapshot: <code>mount /toplevel; btrfs subvolume delete /toplevel/ext2_saved; umount /toplevel</code>. Note that there was also another, different <strong>ext2_saved</strong> in the <strong>root</strong> subvolume: it is NOT a subvolume, which was not carried over when we created the <strong>/</strong> snapshot &#8211; only the empty directory was left in place. (Yes, snapshots do not descend into subvolumes.)</li></ol><p>The last 2 commands to issue (after <code>mount /toplevel</code>) are <code>btrfs filesystem defragment -r /toplevel</code> and <code>btrfs balance start /toplevel</code>.<br
/> I&#8217;m not including them in the instructions above: they are not strictly required, and if your filesystem had some heavy use before conversion, you may want to run these 2 commands more intelligently, in phases (metadata first, then big files, then smaller, etc). Another reason is that it may produce significant system load. On my fresh system both finished very quickly.</p><p>&#8230;And we are done!</p><p><a
class="a2a_button_citeulike" href="https://www.addtoany.com/add_to/citeulike?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2016%2F02%2F15%2Fhow-to-convert-your-vps-root-filesystem-to-btrfs-using-rescue-boot.html&amp;linkname=How%20to%3A%20convert%20your%20VPS%20root%20filesystem%20to%20btrfs%20%28using%20rescue%20boot%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%2F2016%2F02%2F15%2Fhow-to-convert-your-vps-root-filesystem-to-btrfs-using-rescue-boot.html&amp;linkname=How%20to%3A%20convert%20your%20VPS%20root%20filesystem%20to%20btrfs%20%28using%20rescue%20boot%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%2F2016%2F02%2F15%2Fhow-to-convert-your-vps-root-filesystem-to-btrfs-using-rescue-boot.html&amp;linkname=How%20to%3A%20convert%20your%20VPS%20root%20filesystem%20to%20btrfs%20%28using%20rescue%20boot%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%2F2016%2F02%2F15%2Fhow-to-convert-your-vps-root-filesystem-to-btrfs-using-rescue-boot.html&amp;linkname=How%20to%3A%20convert%20your%20VPS%20root%20filesystem%20to%20btrfs%20%28using%20rescue%20boot%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%2F2016%2F02%2F15%2Fhow-to-convert-your-vps-root-filesystem-to-btrfs-using-rescue-boot.html&amp;linkname=How%20to%3A%20convert%20your%20VPS%20root%20filesystem%20to%20btrfs%20%28using%20rescue%20boot%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%2F2016%2F02%2F15%2Fhow-to-convert-your-vps-root-filesystem-to-btrfs-using-rescue-boot.html&#038;title=How%20to%3A%20convert%20your%20VPS%20root%20filesystem%20to%20btrfs%20%28using%20rescue%20boot%29" data-a2a-url="https://bogdan.org.ua/2016/02/15/how-to-convert-your-vps-root-filesystem-to-btrfs-using-rescue-boot.html" data-a2a-title="How to: convert your VPS root filesystem to btrfs (using rescue boot)"><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/15/how-to-convert-your-vps-root-filesystem-to-btrfs-using-rescue-boot.html/feed</wfw:commentRss> <slash:comments>1</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>Midnight Commander (mc): convenient hard links creation from user menu</title><link>https://bogdan.org.ua/2015/12/03/midnight-commander-mc-convenient-hard-links-creation-from-user-menu.html</link> <comments>https://bogdan.org.ua/2015/12/03/midnight-commander-mc-convenient-hard-links-creation-from-user-menu.html#comments</comments> <pubDate>Thu, 03 Dec 2015 13:51:28 +0000</pubDate> <dc:creator><![CDATA[Bogdan]]></dc:creator> <category><![CDATA[*nix]]></category> <category><![CDATA[how-to]]></category> <category><![CDATA[Notepad]]></category> <guid
isPermaLink="false">http://bogdan.org.ua/?p=2315</guid> <description><![CDATA[Midnight Commander is a convenient two-panel file manager with tons of features. You can create hard links and symbolic links using C-x l and C-x s keyboard shortcuts. However, these two shortcuts invoke two completely different dialogs. While for C-x s you get 2 pre-populated fields (path to the existing file, and path to the [&#8230;]]]></description> <content:encoded><![CDATA[<p><a
href="https://www.midnight-commander.org/" title="project website">Midnight Commander</a> is a <a
href="https://en.wikipedia.org/wiki/Midnight_Commander" title="wikipedia article about mc">convenient two-panel file manager</a> with tons of features.</p><p>You can create hard links and symbolic links using <strong>C-x l</strong> and <strong>C-x s</strong> keyboard shortcuts. However, these two shortcuts invoke two completely different dialogs.</p><p>While for <strong>C-x s</strong> you get 2 pre-populated fields (path to the existing file, and path to the link &#8211; which is pre-populated with your opposite file panel path plus the name of the file under cursor; simply try it to see what I mean), for <strong>C-x l</strong> you only get 1 empty field: path of the hard link to create for a file under cursor. Symlink&#8217;s behaviour would be much more convenient&#8230;</p><p>Fortunately, a good man called <em>Wiseman1024</em> created a <a
href="https://www.midnight-commander.org/ticket/2092" title="Better hard link creation, support for directories">feature request in the MC&#8217;s bug tracker</a> 6 years ago. Not only had he done so, but he had also uploaded a sample <a
href="https://www.midnight-commander.org/attachment/ticket/2092/mc.menu.hardlink-example" title="mc user menu script" class="broken_link" rel="nofollow">mc user menu script</a> (<a
href="http://bogdan.org.ua/wp-content/uploads/2015/12/mc.menu_.hardlink.txt">local copy</a>), which works wonderfully! You can select multiple files, then <strong>F2 l</strong> (lower-case L), and hard-links to your selected files (or a file under cursor) will be created in the opposite file panel. Great, thank you <em>Wiseman1024</em>!</p><p>Word of warning: you must know what <a
href="https://en.wikipedia.org/wiki/Hard_link" title="wikipedia article about hard links">hard links</a> are and what their limitations are before using this menu script. You also must check and understand the user menu code before adding it to your mc (by <strong>F9 C m u</strong>, and then pasting the script from the file).</p><p>Word of hope: 4 years ago Wiseman&#8217;s feature request was assigned to <em>Future Releases</em> version, so a more convenient <strong>C-x l</strong> will (sooner or later) become the part of mc. Hopefully.</p><p><a
class="a2a_button_citeulike" href="https://www.addtoany.com/add_to/citeulike?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2015%2F12%2F03%2Fmidnight-commander-mc-convenient-hard-links-creation-from-user-menu.html&amp;linkname=Midnight%20Commander%20%28mc%29%3A%20convenient%20hard%20links%20creation%20from%20user%20menu" 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%2F12%2F03%2Fmidnight-commander-mc-convenient-hard-links-creation-from-user-menu.html&amp;linkname=Midnight%20Commander%20%28mc%29%3A%20convenient%20hard%20links%20creation%20from%20user%20menu" 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%2F12%2F03%2Fmidnight-commander-mc-convenient-hard-links-creation-from-user-menu.html&amp;linkname=Midnight%20Commander%20%28mc%29%3A%20convenient%20hard%20links%20creation%20from%20user%20menu" 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%2F12%2F03%2Fmidnight-commander-mc-convenient-hard-links-creation-from-user-menu.html&amp;linkname=Midnight%20Commander%20%28mc%29%3A%20convenient%20hard%20links%20creation%20from%20user%20menu" 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%2F12%2F03%2Fmidnight-commander-mc-convenient-hard-links-creation-from-user-menu.html&amp;linkname=Midnight%20Commander%20%28mc%29%3A%20convenient%20hard%20links%20creation%20from%20user%20menu" 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%2F12%2F03%2Fmidnight-commander-mc-convenient-hard-links-creation-from-user-menu.html&#038;title=Midnight%20Commander%20%28mc%29%3A%20convenient%20hard%20links%20creation%20from%20user%20menu" data-a2a-url="https://bogdan.org.ua/2015/12/03/midnight-commander-mc-convenient-hard-links-creation-from-user-menu.html" data-a2a-title="Midnight Commander (mc): convenient hard links creation from user menu"><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/12/03/midnight-commander-mc-convenient-hard-links-creation-from-user-menu.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>My smartd.conf, explained</title><link>https://bogdan.org.ua/2015/02/28/my-smartd-conf-explained.html</link> <comments>https://bogdan.org.ua/2015/02/28/my-smartd-conf-explained.html#comments</comments> <pubDate>Fri, 27 Feb 2015 23:01:11 +0000</pubDate> <dc:creator><![CDATA[Bogdan]]></dc:creator> <category><![CDATA[*nix]]></category> <category><![CDATA[how-to]]></category> <category><![CDATA[Notepad]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[SMART]]></category> <category><![CDATA[smartd]]></category> <category><![CDATA[smartd.conf]]></category> <category><![CDATA[smartmontools]]></category> <guid
isPermaLink="false">http://bogdan.org.ua/?p=2216</guid> <description><![CDATA[After fixing offline uncorrectable sector warning email, I have taken a closer look at my /etc/smartd.conf, and now it looks like this: DEFAULT -d sat -H -f -p -t -W 0,40,45 -n standby -S on -m example@example.com # Attributes 1, 230, and 231 are very important (-r 1! -r 230! -R 230! -r 231! -R [&#8230;]]]></description> <content:encoded><![CDATA[<p>After <a
href="http://bogdan.org.ua/2015/02/26/how-to-fix-offline-uncorrectable-sector-outside-of-a-partition.html">fixing offline uncorrectable sector warning email</a>, I have taken a closer look at my /etc/<strong>smartd.conf</strong>, and now it looks like this:</p><blockquote><p> DEFAULT -d sat -H -f -p -t -W 0,40,45 -n standby       -S on -m example@example.com<br
/> # Attributes 1, 230, and 231 are very important (-r 1! -r 230! -R 230! -r 231! -R 231!), but likely covered by -t.<br
/> /dev/sda -s (S/../../6/01|L/../(01|02|03|04|05|06|07)/7/00) -C 0 -I 189 -I 194<br
/> # -a implies -f and -p (through -t)<br
/> DEFAULT -d sat -a -I 194   -W 0,40,45 -n standby -o on -S on -m example@example.com<br
/> /dev/sdb -s (S/../../6/02|L/../(01|02|03|04|05|06|07)/7/02)<br
/> # This drive does not decrement Offline_Uncorrectable (198) after re-allocation,<br
/> # so only monitoring for increase, not for non-zero value.<br
/> /dev/sdc -s (S/../../6/03|L/../(01|02|03|04|05|06|07)/7/04) -U 198+<br
/> # This drive has 40 &#8220;normally&#8221;.<br
/> /dev/sdd -s (S/../../6/04|L/../(01|02|03|04|05|06|07)/7/06) -W 0,42,45</p></blockquote><p><em>Note: explanations below are intentionally simplified; please consult <strong>man smartd.conf</strong> for more precise, complete, and up-to-date information.</em></p><p>Ok, so what do these settings mean, and how is this different from default settings?<br
/> <span
id="more-2216"></span></p><p>By default, <strong>smartd</strong> assumes a <code>DEVICESCAN</code> directive, which auto-detects all HDDs, and enables reasonable default monitoring of SMART attributes.<br
/> However, there are several benefits to individually specifying your disks:</p><ul><li>less verbose smartd startup log messages (no messages about auto-detection and missing attributes)</li><li>ability to run scheduled offline, short, and long SMART self-tests</li><li>ability to monitor or exclude attributes individually for each drive (including temperature)</li></ul><p><em>Reasonable default</em> mentioned above is the <strong>-a</strong> option, equivalent to the following individual options:</p><blockquote><p>-H -f -t -l error -l selftest -C 197 -U 198</p></blockquote><p>This is important to know, because my only SSD has no attribute 197, no self-test log, no error log, and no automatic offline testing.<br
/> But I still want to start with quasi-default settings, and that is why the first configuration line includes all the options from <strong>-a</strong>, except those that my SSD does not support:</p><blockquote><p>DEFAULT -d sat -H -f -p -t -W 0,40,45 -n standby       -S on -m example@example.com</p></blockquote><p>Here and in the <strong>-a</strong> options above,</p><ul><li><strong>-H</strong>: monitor overall health status (passed/failed)</li><li><strong>-d sat</strong>: HDD type is SATA</li><li><strong>-f</strong>: check if any of the Usage attributes (those not marked as Pre-fail) are below the manufacturer-set thresholds</li><li><strong>-p</strong>: report changes in Pre-fail attributes (implied by <strong>-t</strong> below, so can be omitted)</li><li><strong>-t</strong>: same as <strong>-p</strong> (above) with <strong>-u</strong> (report changes in Usage attributes)</li><li><strong>-W 0,40,45</strong>: log a message if drive&#8217;s temperature goes above 40 degrees Celsius; log a critical messages if above 45</li><li><strong>-n standby</strong>: do not wake-up (spin-up) the HDD if it is in sleep or standby mode (in which platters do not spin)</li><li><strong>-S on</strong>: enable attributes auto-saving</li><li><strong>-m example@example.com</strong>: address (or several comma-separated addresses) to receive warnings from smartd</li></ul><p>The <code>DEFAULT</code> directive is for convenience: options set by this directive apply to all the individual disk configuration lines below, until a different <code>DEFAULT</code> line is encountered.<br
/> Here, I had used it to separate all /dev/sda options into 2 logical groups: supported defaults, and drive-specific configuration.<br
/> SSD&#8217;s configuration is</p><blockquote><p>/dev/sda -s (S/../../6/01|L/../(01|02|03|04|05|06|07)/7/00) -C 0 -I 189 -I 194</p></blockquote><p>Here,</p><ul><li><strong>-C 0</strong>: explicitly disable attribute 197 monitoring (which is not present in this SSD)</li><li><strong>-I 189</strong> and <strong>-I 194</strong>: ignore attributes 189 and 194 (they both show temperature in this SSD)</li><li><strong>-s (S/../../6/01|L/../(01|02|03|04|05|06|07)/7/00)</strong>: schedule for short and long tests</li></ul><p>As for the tests&#8230;<br
/> I want short self-tests every Saturday night, between 1 AM and 5 AM (shifted by 1H for every disk).<br
/> I want long self-tests on the 1st Sunday of every month, between midnight and 8 AM (shifted by 2H for every disk).<br
/> This is exactly what is encoded in my configuration for all drives. The easiest way to figure out the format is to read the relevant section of <strong>man smartd.conf</strong>.</p><p>The remaining 3 drives are all HDDs, so I had defined a different common <code>DEFAULT</code> for them.<br
/> The only new option that we see is <strong>-U 198+</strong>, which instructs smartd to only report increases of the Offline_Uncorrectable (198) attribute.<br
/> This is necessary because my /dev/sdc <a
href="http://bogdan.org.ua/2015/02/26/how-to-fix-offline-uncorrectable-sector-outside-of-a-partition.html">does not decrement this attribute after sector re-allocation</a>.</p><p>I hope you found this post helpful.</p><p><a
class="a2a_button_citeulike" href="https://www.addtoany.com/add_to/citeulike?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2015%2F02%2F28%2Fmy-smartd-conf-explained.html&amp;linkname=My%20smartd.conf%2C%20explained" 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%2F02%2F28%2Fmy-smartd-conf-explained.html&amp;linkname=My%20smartd.conf%2C%20explained" 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%2F02%2F28%2Fmy-smartd-conf-explained.html&amp;linkname=My%20smartd.conf%2C%20explained" 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%2F02%2F28%2Fmy-smartd-conf-explained.html&amp;linkname=My%20smartd.conf%2C%20explained" 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%2F02%2F28%2Fmy-smartd-conf-explained.html&amp;linkname=My%20smartd.conf%2C%20explained" 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%2F02%2F28%2Fmy-smartd-conf-explained.html&#038;title=My%20smartd.conf%2C%20explained" data-a2a-url="https://bogdan.org.ua/2015/02/28/my-smartd-conf-explained.html" data-a2a-title="My smartd.conf, explained"><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/02/28/my-smartd-conf-explained.html/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>How to fix Offline Uncorrectable sector outside of a partition</title><link>https://bogdan.org.ua/2015/02/26/how-to-fix-offline-uncorrectable-sector-outside-of-a-partition.html</link> <comments>https://bogdan.org.ua/2015/02/26/how-to-fix-offline-uncorrectable-sector-outside-of-a-partition.html#comments</comments> <pubDate>Wed, 25 Feb 2015 22:20:09 +0000</pubDate> <dc:creator><![CDATA[Bogdan]]></dc:creator> <category><![CDATA[*nix]]></category> <category><![CDATA[how-to]]></category> <category><![CDATA[Software]]></category> <guid
isPermaLink="false">http://bogdan.org.ua/?p=2210</guid> <description><![CDATA[A few days ago my smartd daemon (from the smartmontools package) notified me about a +1 increase in Current_Pending_Sector (197) and Offline_Uncorrectable (198) SMART attributes. The 2.5&#8243; Fujitsu laptop hard-drive these appeared on is very old, and it also has been working 24/365 since a little over a year. Running a short SMART self-test (sudo [&#8230;]]]></description> <content:encoded><![CDATA[<p>A few days ago my smartd daemon (from the smartmontools package) notified me about a +1 increase in Current_Pending_Sector (197) and Offline_Uncorrectable (198) SMART attributes. The 2.5&#8243; Fujitsu laptop hard-drive these appeared on is very old, and it also has been working 24/365 since a little over a year.</p><p>Running a short SMART self-test (<code>sudo smartctl -t short /dev/sdc</code>) produced a read error at sector 1289:</p><blockquote><p> Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error<br
/> 1 Short offline Completed: read failure 80% 22339 <strong>1289</strong></p></blockquote><p>Looking at the partition table of /dev/sdc, we see that this sector is outside of the only RAID partition on the disk, which starts at sector 2048:</p><blockquote><p> Device Boot Start End Blocks Id System<br
/> /dev/sdc1 <strong>2048</strong> 117209087 58605088 fd Lnx RAID auto</p></blockquote><p><span
id="more-2210"></span></p><p>To make sure that sector 1289 is re-allocated, some data needs to be written to it, e.g. with <code>sudo dd if=/dev/zero of=/dev/sdc count=1 seek=1289</code>.<br
/> You may also try to read the sector first, then &#8211; if successful &#8211; write it back to the disk:<br
/> <code>i=1289 ; sudo dd if=/dev/sdc of=/tmp/sector count=1 skip=$i &#038;&#038; sleep 1 &#038;&#038; sudo dd if=/tmp/sector of=/dev/sdc count=1 seek=$i</code></p><p>Another solution (<strong>untested!</strong>) would be to read/write a bunch of sectors around the problematic one (this is similar to what <code>badblocks -n</code> does):<br
/> <code><br
/> export i=1280<br
/> while [ $i -lt 1300 ]<br
/> do echo $i<br
/> # read once (count=1) 512 bytes (default ibs/obs values of dd) to a temporary file, skipping first $i ibs-sized blocks (skip=$i);<br
/> # if successful, then (wait a bit and) write the same data back to disk, skipping $i obs-sized blocks (seek=$i)<br
/> dd if=/dev/sdc of=/tmp/sector count=1 skip=$i &#038;&#038; sleep 1 &#038;&#038; dd if=/tmp/sector of=/dev/sdc count=1 seek=$i<br
/> let i+=1<br
/> done<br
/> </code></p><p>After sector re-allocation both Reallocated_Sector_Ct (5) and Reallocated_Event_Count (196) SMART attributes increased from 0 to 1, while Current_Pending_Sector (197) decreased from 1 to 0. In addition, running <code>badblocks /dev/sdc</code> and <code>diskscan --output diskscan-sdc-out-25-02-2015.json /dev/sdc</code> (both in read-only mode, of course) has not shown any read errors, and another short SMART self-test also finished successfully. So, is the problem solved?</p><p>Unfortunately, Offline_Uncorrectable (198) stayed at 1, and I kept getting warning emails. Apparently, my HDD simply does not decrease the Offline_Uncorrectable (198) attribute after sector re-allocation.</p><p>In this case the proper solution is to edit <code>/etc/smartd.conf</code> so that it only sends emails if Offline_Uncorrectable (198) attribute increases, and not if it is non-zero. Just add this option to your HDD scan line in <code>smartd.conf</code>: <strong><code>-U 198+</code></strong>.</p><p><a
class="a2a_button_citeulike" href="https://www.addtoany.com/add_to/citeulike?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2015%2F02%2F26%2Fhow-to-fix-offline-uncorrectable-sector-outside-of-a-partition.html&amp;linkname=How%20to%20fix%20Offline%20Uncorrectable%20sector%20outside%20of%20a%20partition" 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%2F02%2F26%2Fhow-to-fix-offline-uncorrectable-sector-outside-of-a-partition.html&amp;linkname=How%20to%20fix%20Offline%20Uncorrectable%20sector%20outside%20of%20a%20partition" 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%2F02%2F26%2Fhow-to-fix-offline-uncorrectable-sector-outside-of-a-partition.html&amp;linkname=How%20to%20fix%20Offline%20Uncorrectable%20sector%20outside%20of%20a%20partition" 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%2F02%2F26%2Fhow-to-fix-offline-uncorrectable-sector-outside-of-a-partition.html&amp;linkname=How%20to%20fix%20Offline%20Uncorrectable%20sector%20outside%20of%20a%20partition" 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%2F02%2F26%2Fhow-to-fix-offline-uncorrectable-sector-outside-of-a-partition.html&amp;linkname=How%20to%20fix%20Offline%20Uncorrectable%20sector%20outside%20of%20a%20partition" 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%2F02%2F26%2Fhow-to-fix-offline-uncorrectable-sector-outside-of-a-partition.html&#038;title=How%20to%20fix%20Offline%20Uncorrectable%20sector%20outside%20of%20a%20partition" data-a2a-url="https://bogdan.org.ua/2015/02/26/how-to-fix-offline-uncorrectable-sector-outside-of-a-partition.html" data-a2a-title="How to fix Offline Uncorrectable sector outside of a partition"><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/02/26/how-to-fix-offline-uncorrectable-sector-outside-of-a-partition.html/feed</wfw:commentRss> <slash:comments>1</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>Saving and restoring the list of packages installed on a Debian system using aptitude or deborphan</title><link>https://bogdan.org.ua/2013/10/18/saving-restoring-list-of-packages-installed-on-debian-using-aptitude-deborphan.html</link> <comments>https://bogdan.org.ua/2013/10/18/saving-restoring-list-of-packages-installed-on-debian-using-aptitude-deborphan.html#comments</comments> <pubDate>Fri, 18 Oct 2013 00:08:13 +0000</pubDate> <dc:creator><![CDATA[Bogdan]]></dc:creator> <category><![CDATA[*nix]]></category> <category><![CDATA[how-to]]></category> <category><![CDATA[Notepad]]></category> <category><![CDATA[aptitude]]></category> <category><![CDATA[Debian]]></category> <category><![CDATA[deborphan]]></category> <category><![CDATA[dpkg]]></category> <category><![CDATA[package]]></category> <guid
isPermaLink="false">http://bogdan.org.ua/?p=2011</guid> <description><![CDATA[The usual, or even classical way is to create the list of installed packages with sudo dpkg --get-selections > package_list, and then restore when/if necessary with cat package_list &#124; xargs sudo apt-get -y install. As VihangD points out in his serverfault answer, the same can be achieved with aptitude, while also excluding dependent, automatically installed [&#8230;]]]></description> <content:encoded><![CDATA[<p>The usual, or even <em>classical</em> way is to create the list of installed packages with <strong><code>sudo dpkg --get-selections > package_list</code></strong>, and then restore when/if necessary with <strong><code>cat package_list | xargs sudo apt-get -y install</code></strong>.</p><p>As VihangD points out in his <a
href="http://serverfault.com/a/61472/25852">serverfault answer</a>, the same can be achieved with aptitude, while also excluding dependent, automatically installed packages (which are included by the <em>classical</em> method). To create the list of packages, run <strong><code>aptitude search -F '%p' '~i!~M' > package_list</code></strong>. Here, <strong><code>-F '%p'</code></strong> asks aptitude to only print package names (instead of the default output, which also contains package state and description); search term <strong>&#8216;~i!~M&#8217;</strong> asks for all non-automatically installed packages.</p><p>To install packages using the created list, run <strong><code>xargs aptitude --schedule-only install < package_list; aptitude install</code></strong>. The first of these two commands instructs aptitude to mark all the packages from the list as scheduled for installation. The second command actually performs the installation.</p><p>Hamish Downer <a
href="http://serverfault.com/a/1333/25852">suggests</a> an alternative way of getting the initial package_list: using the deborphan utility, <strong><code>deborphan -a --no-show-section > package_list</code></strong>. This command asks deborphan to show a list of packages, which have no dependencies on them. Sounds very similar to what we did with aptitude above, but using deborphan will most likely result in a much shorter list of packages (on my system, deborphan printed 291 package names, aptitude printed 847, and dpkg printed 3650 package names). One more potentially important difference between aptitude- and deborphan-produced package lists is that aptitude only specifies package architecture when it is different from native (e.g. 'googleearth:i386' on a 64-bit system), while deborphan specifies architectures for all the packages (resulting in e.g. 'google-talkplugin:amd64' and 'googleearth-package:all' on a 64-bit system).</p><p><a
class="a2a_button_citeulike" href="https://www.addtoany.com/add_to/citeulike?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2013%2F10%2F18%2Fsaving-restoring-list-of-packages-installed-on-debian-using-aptitude-deborphan.html&amp;linkname=Saving%20and%20restoring%20the%20list%20of%20packages%20installed%20on%20a%20Debian%20system%20using%20aptitude%20or%20deborphan" 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%2F10%2F18%2Fsaving-restoring-list-of-packages-installed-on-debian-using-aptitude-deborphan.html&amp;linkname=Saving%20and%20restoring%20the%20list%20of%20packages%20installed%20on%20a%20Debian%20system%20using%20aptitude%20or%20deborphan" 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%2F10%2F18%2Fsaving-restoring-list-of-packages-installed-on-debian-using-aptitude-deborphan.html&amp;linkname=Saving%20and%20restoring%20the%20list%20of%20packages%20installed%20on%20a%20Debian%20system%20using%20aptitude%20or%20deborphan" 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%2F10%2F18%2Fsaving-restoring-list-of-packages-installed-on-debian-using-aptitude-deborphan.html&amp;linkname=Saving%20and%20restoring%20the%20list%20of%20packages%20installed%20on%20a%20Debian%20system%20using%20aptitude%20or%20deborphan" 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%2F10%2F18%2Fsaving-restoring-list-of-packages-installed-on-debian-using-aptitude-deborphan.html&amp;linkname=Saving%20and%20restoring%20the%20list%20of%20packages%20installed%20on%20a%20Debian%20system%20using%20aptitude%20or%20deborphan" 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%2F10%2F18%2Fsaving-restoring-list-of-packages-installed-on-debian-using-aptitude-deborphan.html&#038;title=Saving%20and%20restoring%20the%20list%20of%20packages%20installed%20on%20a%20Debian%20system%20using%20aptitude%20or%20deborphan" data-a2a-url="https://bogdan.org.ua/2013/10/18/saving-restoring-list-of-packages-installed-on-debian-using-aptitude-deborphan.html" data-a2a-title="Saving and restoring the list of packages installed on a Debian system using aptitude or deborphan"><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/10/18/saving-restoring-list-of-packages-installed-on-debian-using-aptitude-deborphan.html/feed</wfw:commentRss> <slash:comments>2</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 fix: Nokia Ovi Suite could not connect to the Nokia account server</title><link>https://bogdan.org.ua/2011/03/10/how-to-fix-nokia-ovi-suite-could-not-connect-nokia-account-server.html</link> <comments>https://bogdan.org.ua/2011/03/10/how-to-fix-nokia-ovi-suite-could-not-connect-nokia-account-server.html#comments</comments> <pubDate>Thu, 10 Mar 2011 19:18:05 +0000</pubDate> <dc:creator><![CDATA[Bogdan]]></dc:creator> <category><![CDATA[how-to]]></category> <category><![CDATA[Misc]]></category> <category><![CDATA[account]]></category> <category><![CDATA[nokia]]></category> <category><![CDATA[ovi]]></category> <guid
isPermaLink="false">http://bogdan.org.ua/?p=1470</guid> <description><![CDATA[I&#8217;ve been getting this message for a long while, when trying to log into Ovi from within my Ovi Suite: Nokia Ovi Suite could not connect to the Nokia account server. Make sure the internet connection is working properly and try again. However, both my internet connection, and logging into ovi.com using a browser work [&#8230;]]]></description> <content:encoded><![CDATA[<p>I&#8217;ve been getting this message for a long while, when trying to log into Ovi from within my Ovi Suite:</p><blockquote><p>Nokia Ovi Suite could not connect to the Nokia account server. Make sure the internet connection is working properly and try again.</p></blockquote><p>However, both my internet connection, and logging into ovi.com using a browser work fine. Even looking for updates from within Ovi Suite works fine!</p><p>Here&#8217;s the solution (tested on Nokia Ovi Suite 3.0.0.290):<br
/> <span
id="more-1470"></span></p><p><strong>Important</strong>: before trying the solution below, try downloading and running <a
href="http://www.download.windowsupdate.com/msdownload/update/v3/static/trustedr/en/rootsupd.exe" class="broken_link" rel="nofollow">root certificates update program from Microsoft</a>, then restarting Ovi Suite to see if the problem is gone. (Thanks <a
href="http://bogdan.org.ua/2011/03/10/how-to-fix-nokia-ovi-suite-could-not-connect-nokia-account-server.html#comment-134937">Finn</a> for sharing this one.)</p><ul><li>Navigate to <em>Start &#8211; Control panel &#8211; Internet options</em> (or: start Internet Explorer &#8211; <em>Tools &#8211; Internet options</em>). It doesn&#8217;t matter that your default browser is not IE.</li><li>Select <em>Content</em> tab.<br
/> <img
src="http://bogdan.org.ua/wp-content/uploads/2011/03/content-tab.png" alt="" title="Content tab" width="413" height="528" class="size-full wp-image-1471" /></li><li>Click <em>Certificates</em>, select <em>Trusted root certification authorities</em> tab, and sort ascending by expiration date.<br
/> <img
src="http://bogdan.org.ua/wp-content/uploads/2011/03/root-certificates.png" alt="" title="root certificates" width="509" height="464" class="size-full wp-image-1472" /></li><li>Now delete all <em>GTE CyberTrust</em> certificates whose expiration date has passed.</li><li>Click <em>Close</em>, then <em>OK</em></li><li>Restart Ovi suite.</li></ul><p>If that didn&#8217;t help: try removing <strong>all</strong> expired certificates:<br
/> <img
src="http://bogdan.org.ua/wp-content/uploads/2011/03/all-expired.png" alt="" title="all expired" width="509" height="464" class="size-full wp-image-1473" /></p><p><strong>A word of warning</strong></p><blockquote><p>Deleting all expired trusted root certs is not a good idea. You could end up with vital parts of the system not working, or unable to access some documents (especially if you have encryption turned on). Thing is, expired certs can still be valid for anything signed or encrypted before they expired.</p></blockquote><p>Sources used:</p><ul><li><a
href="http://discussions.europe.nokia.com/t5/Nokia-Ovi-Suite/NOKIA-OVI-Suite-could-not-connect-to-the-nokia-account-server/m-p/878427#M8356" class="broken_link" rel="nofollow">http://discussions.europe.nokia.com/t5/Nokia-Ovi-Suite/NOKIA-OVI-Suite-could-not-connect-to-the-nokia-account-server/m-p/878427</a></li><li><a
href="http://betalabs.nokia.com/apps/nokia-ovi-suite-3-0-beta/bugreport/19143/ovi-sign-in-failed#comment-53041" class="broken_link" rel="nofollow">http://betalabs.nokia.com/apps/nokia-ovi-suite-3-0-beta/bugreport/19143/ovi-sign-in-failed</a></li><li><a
href="http://betalabs.nokia.com/node/5251" class="broken_link" rel="nofollow">http://betalabs.nokia.com/node/5251</a></li></ul><p><a
class="a2a_button_citeulike" href="https://www.addtoany.com/add_to/citeulike?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2011%2F03%2F10%2Fhow-to-fix-nokia-ovi-suite-could-not-connect-nokia-account-server.html&amp;linkname=How%20to%20fix%3A%20Nokia%20Ovi%20Suite%20could%20not%20connect%20to%20the%20Nokia%20account%20server" 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%2F10%2Fhow-to-fix-nokia-ovi-suite-could-not-connect-nokia-account-server.html&amp;linkname=How%20to%20fix%3A%20Nokia%20Ovi%20Suite%20could%20not%20connect%20to%20the%20Nokia%20account%20server" 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%2F10%2Fhow-to-fix-nokia-ovi-suite-could-not-connect-nokia-account-server.html&amp;linkname=How%20to%20fix%3A%20Nokia%20Ovi%20Suite%20could%20not%20connect%20to%20the%20Nokia%20account%20server" 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%2F10%2Fhow-to-fix-nokia-ovi-suite-could-not-connect-nokia-account-server.html&amp;linkname=How%20to%20fix%3A%20Nokia%20Ovi%20Suite%20could%20not%20connect%20to%20the%20Nokia%20account%20server" 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%2F10%2Fhow-to-fix-nokia-ovi-suite-could-not-connect-nokia-account-server.html&amp;linkname=How%20to%20fix%3A%20Nokia%20Ovi%20Suite%20could%20not%20connect%20to%20the%20Nokia%20account%20server" 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%2F10%2Fhow-to-fix-nokia-ovi-suite-could-not-connect-nokia-account-server.html&#038;title=How%20to%20fix%3A%20Nokia%20Ovi%20Suite%20could%20not%20connect%20to%20the%20Nokia%20account%20server" data-a2a-url="https://bogdan.org.ua/2011/03/10/how-to-fix-nokia-ovi-suite-could-not-connect-nokia-account-server.html" data-a2a-title="How to fix: Nokia Ovi Suite could not connect to the Nokia account server"><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/10/how-to-fix-nokia-ovi-suite-could-not-connect-nokia-account-server.html/feed</wfw:commentRss> <slash:comments>21</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 relay outgoing postfix emails via another mail server (e.g. your ISP)</title><link>https://bogdan.org.ua/2010/12/04/how-to-relay-outgoing-postfix-emails-via-another-mail-server-isp-gmail.html</link> <comments>https://bogdan.org.ua/2010/12/04/how-to-relay-outgoing-postfix-emails-via-another-mail-server-isp-gmail.html#comments</comments> <pubDate>Sat, 04 Dec 2010 18:01:37 +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[Software]]></category> <category><![CDATA[Debian]]></category> <category><![CDATA[linux]]></category> <category><![CDATA[postfix]]></category> <category><![CDATA[relay]]></category> <guid
isPermaLink="false">http://bogdan.org.ua/?p=1218</guid> <description><![CDATA[Here&#8217;s a simple and clear guide for gmail, which also definitely works with other relay hosts. I&#8217;ve used it to configure my ISP&#8217;s mail relay (they block outgoing port 25) on a Debian Squeeze laptop.]]></description> <content:encoded><![CDATA[<p>Here&#8217;s a <a
href="http://ubuntu-tutorials.com/2008/11/11/relaying-postfix-smtp-via-smtpgmailcom/">simple and clear guide for gmail</a>, which also definitely works with other relay hosts. I&#8217;ve used it to configure my ISP&#8217;s mail relay (they block outgoing port 25) on a Debian Squeeze laptop.</p><p><a
class="a2a_button_citeulike" href="https://www.addtoany.com/add_to/citeulike?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2010%2F12%2F04%2Fhow-to-relay-outgoing-postfix-emails-via-another-mail-server-isp-gmail.html&amp;linkname=How%20to%20relay%20outgoing%20postfix%20emails%20via%20another%20mail%20server%20%28e.g.%20your%20ISP%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%2F12%2F04%2Fhow-to-relay-outgoing-postfix-emails-via-another-mail-server-isp-gmail.html&amp;linkname=How%20to%20relay%20outgoing%20postfix%20emails%20via%20another%20mail%20server%20%28e.g.%20your%20ISP%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%2F12%2F04%2Fhow-to-relay-outgoing-postfix-emails-via-another-mail-server-isp-gmail.html&amp;linkname=How%20to%20relay%20outgoing%20postfix%20emails%20via%20another%20mail%20server%20%28e.g.%20your%20ISP%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%2F12%2F04%2Fhow-to-relay-outgoing-postfix-emails-via-another-mail-server-isp-gmail.html&amp;linkname=How%20to%20relay%20outgoing%20postfix%20emails%20via%20another%20mail%20server%20%28e.g.%20your%20ISP%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%2F12%2F04%2Fhow-to-relay-outgoing-postfix-emails-via-another-mail-server-isp-gmail.html&amp;linkname=How%20to%20relay%20outgoing%20postfix%20emails%20via%20another%20mail%20server%20%28e.g.%20your%20ISP%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%2F12%2F04%2Fhow-to-relay-outgoing-postfix-emails-via-another-mail-server-isp-gmail.html&#038;title=How%20to%20relay%20outgoing%20postfix%20emails%20via%20another%20mail%20server%20%28e.g.%20your%20ISP%29" data-a2a-url="https://bogdan.org.ua/2010/12/04/how-to-relay-outgoing-postfix-emails-via-another-mail-server-isp-gmail.html" data-a2a-title="How to relay outgoing postfix emails via another mail server (e.g. your ISP)"><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/12/04/how-to-relay-outgoing-postfix-emails-via-another-mail-server-isp-gmail.html/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>