<?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>zeyaLabs &#187; Techy Articles</title>
	<atom:link href="http://www.zeyalabs.ch/categories/quill-drive/techy-art/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.zeyalabs.ch</link>
	<description>Binary and Plain Stuff... and more</description>
	<lastBuildDate>Tue, 30 Nov 2010 14:27:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>External USB Hard Drive under Linux</title>
		<link>http://www.zeyalabs.ch/posts/external-usb-hard-drive-under-linux/</link>
		<comments>http://www.zeyalabs.ch/posts/external-usb-hard-drive-under-linux/#comments</comments>
		<pubDate>Sun, 23 May 2010 22:27:39 +0000</pubDate>
		<dc:creator>Oldie</dc:creator>
				<category><![CDATA[Techy Articles]]></category>
		<category><![CDATA[drives]]></category>
		<category><![CDATA[gear]]></category>
		<category><![CDATA[howtos]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[usb]]></category>

		<guid isPermaLink="false">http://www.zeyalabs.ch/?p=312</guid>
		<description><![CDATA[&#8220;640 kilobytes ought to be enough for anybody.&#8221; — unknown source (often misattributed to Bill Gates) Yesterday, I had to replace a one-terabyte external USB hard drive attached to my home file server with a larger one&#8230; Oh, I wasn&#8217;t going to ramble about these days&#8217; lack of disk space, I just wanted to document&#160;<a class="more" href="http://www.zeyalabs.ch/posts/external-usb-hard-drive-under-linux/" title="read whole article">[...]</a>]]></description>
			<content:encoded><![CDATA[<p class="epigraph">
&#8220;640 kilobytes ought to be enough for anybody.&#8221;<br />
— unknown source (often misattributed to Bill Gates)
</p>
<p>Yesterday, I had to replace a one-terabyte external <acronym title="Universal Serial Bus">USB</acronym> hard drive attached to my home file server with a larger one&#8230;</p>
<p>Oh, I wasn&#8217;t going to ramble about these days&#8217; lack of disk space, I just wanted to document what I did to get the drive up and running: maybe someone could use this article as a quick start for their own configuration. (Mine was a two-terabyte Hitachi SimpleDrive under Fedora Core Linux.)</p>
<p>Please note that this is not a complete newbie manual on all aspects of the procedure, so don&#8217;t expect to find detailed explanations on things like which shell command does what or why this filesystem is better than that one or why I am <code>sudo</code>-ing when switching to <code>root</code> seems to be much easier an approach.</p>
<p>Here we go now. (Skip steps marked with <code>**</code> if you are not replacing a drive but installing a new one.)</p>
<ul>
<li>First of all, connect the <acronym title="Universal Serial Bus">USB</acronym> drive to your running Linux machine and power the former up.</li>
</ul>
<ul>
<li>Find out if and how the system recognized it.</li>
</ul>
<pre class="brush: plain; title: ; notranslate">
$&gt; sudo dmesg | tail
usb 4-6: new high speed <acronym title="Universal Serial Bus">USB</acronym> device using ehci_hcd and address 3
usb 4-6: configuration #1 chosen from 1 choice
scsi3 : <acronym title="Small Computer System Interface">SCSI</acronym> emulation for <acronym title="Universal Serial Bus">USB</acronym> Mass Storage devices
usb-storage: device found at 3
usb-storage: waiting for device to settle before scanning
usb-storage: device scan complete
scsi 3:0:0:0: Direct-Access     Hitachi  HDS722020ALA330       PQ: 0 ANSI: 2 CCS
sd 3:0:0:0: [sdc] 3907029168 512-byte hardware sectors (2000399 <acronym title="Megabyte">MB</acronym>)
sd 3:0:0:0: [sdc] Write Protect is off
sd 3:0:0:0: [sdc] Mode Sense: 34 00 00 00
sd 3:0:0:0: [sdc] Assuming drive cache: write through
sd 3:0:0:0: [sdc] 3907029168 512-byte hardware sectors (2000399 <acronym title="Megabyte">MB</acronym>)
sd 3:0:0:0: [sdc] Write Protect is off
sd 3:0:0:0: [sdc] Mode Sense: 34 00 00 00
sd 3:0:0:0: [sdc] Assuming drive cache: write through sdc: sdc1
sd 3:0:0:0: [sdc] Attached <acronym title="Small Computer System Interface">SCSI</acronym> disk
sd 3:0:0:0: Attached scsi generic sg3 type 0
VFS: Can't find ext3 filesystem on dev sdc1.
</pre>
<p>From this output you can see that the drive was recognized as device <code>/dev/sdc</code> with a single partition <code>/dev/sdc1</code>.</p>
<p>The partition&#8217;s filesystem is not ext3. (Factory-preformatted FAT32, most likely.) Since the drive will remain attached to a Linux machine, it would make sense to reformat it into something native.</p>
<ul>
<li>Partition the drive.</li>
</ul>
<pre class="brush: bash; title: ; notranslate">
$&gt; sudo /sbin/fdisk /dev/sdc
</pre>
<p>Choose the appropriate options from the menu. I went this way:<br />
<code>p</code> — print current partition table;<br />
<code>l</code> — list known partition types (filesystems);<br />
<code>d</code> — delete current partition;<br />
<code>n</code> — create new partition.</p>
<p>For this new partition, specify:<br />
<code>p</code> — primary partition;<br />
<code>1</code> — partition number;<br />
default values for first/last cylinder;<br />
<code>Linux</code> — partition type (which is <code>etx3</code> on this system; ID 83 in the list of known partition types mentioned above).</p>
<p>And finally:<br />
<code>w</code> — write table to disk and exit.</p>
<ul>
<li>Create filesystem (format partition).</li>
</ul>
<pre class="brush: bash; title: ; notranslate">
$&gt; sudo /sbin/mkfs.ext3 -j /dev/sdc1
</pre>
<ul>
<li>Create mount point.</li>
</ul>
<pre class="brush: bash; title: ; notranslate">
$&gt; sudo mkdir /mnt/mynewdrive
</pre>
<ul>
<li>Mount the new drive&#8217;s partition for file transfer.**</li>
</ul>
<pre class="brush: bash; title: ; notranslate">
$&gt; sudo mount -t ext3 /dev/sdc1 /mnt/mynewdrive
</pre>
<ul>
<li>Transfer files from the old drive.**</li>
</ul>
<pre class="brush: bash; title: ; notranslate">
$&gt; sudo cp -Rvp /mnt/myolddrive/ /mnt/mynewdrive
</pre>
<p>Don&#8217;t forget the <code>-p</code> option to preserve file ownership and permissions. Mind the slash after <code>myolddrive/</code>.</p>
<p>This will take some time. (14 hours for approximately 800 <acronym title="Gigabyte">GB</acronym> in my case.)</p>
<ul>
<li>Unmount both drives.**</li>
</ul>
<p>Prior to that, stop any processes/services which might still be using the drives. (In my case, for instance, it was a Samba fileserver daemon holding shared folders on the old drive.)</p>
<pre class="brush: bash; title: ; notranslate">
$&gt; sudo umount /mnt/mynewdrive
$&gt; sudo umount /mnt/myolddrive
</pre>
<p>Notice that the command is <code>umount</code>, not <code>u<del>n</del>mount</code>.</p>
<ul>
<li>Disconnect the old drive. Reposition and/or reconnect the new one, if necessary.**</li>
</ul>
<ul>
<li>Check if the new drive is still recognized under its original name.**</li>
</ul>
<p>In my case, it wasn&#8217;t: it took place of the old one, which went under <code>/dev/sdb</code> (with partition <code>/dev/sdb1</code>).</p>
<p>For this check, look through latest system messages like you did in the beginning:</p>
<pre class="brush: bash; title: ; notranslate">
$&gt; sudo dmesg | tail
</pre>
<ul>
<li>Adjust <code>fstab</code>.</li>
</ul>
<p>Open <code>fstab</code> for editing:</p>
<pre class="brush: bash; title: ; notranslate">
$&gt; sudo vi /etc/fstab
</pre>
<p>Remove old drive&#8217;s mapping**:</p>
<pre class="brush: bash; title: ; notranslate">
/dev/sdb1     /mnt/myolddrive     ext3     defaults     0 0
</pre>
<p>Add new drive&#8217;s mount options:</p>
<pre class="brush: bash; title: ; notranslate">
/dev/sdb1     /mnt/mynewdrive     ext3     defaults     0 0
</pre>
<p>Make sure to specify the correct partition name.</p>
<p>Save changes.</p>
<ul>
<li>Re-mount the new drive.</li>
</ul>
<pre class="brush: bash; title: ; notranslate">
$&gt; sudo mount /dev/sdc1
</pre>
<ul>
<li>Enjoy your new large-capacity storage.</li>
</ul>
<p>Two terabytes ought to be enough for anybody, right?</p><p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.zeyalabs.ch%2Fposts%2Fexternal-usb-hard-drive-under-linux%2F&amp;title=External%20USB%20Hard%20Drive%20under%20Linux" id="wpa2a_2"><img src="http://www.zeyalabs.ch/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.zeyalabs.ch/posts/external-usb-hard-drive-under-linux/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Ох уж эти професюбители&#8230;</title>
		<link>http://www.zeyalabs.ch/posts/wedding-photography-quick-start/</link>
		<comments>http://www.zeyalabs.ch/posts/wedding-photography-quick-start/#comments</comments>
		<pubDate>Thu, 20 May 2010 21:29:23 +0000</pubDate>
		<dc:creator>Oldie</dc:creator>
				<category><![CDATA[Techy Articles]]></category>
		<category><![CDATA[gear]]></category>
		<category><![CDATA[howtos]]></category>
		<category><![CDATA[photography]]></category>

		<guid isPermaLink="false">http://www.zeyalabs.ch/?p=277</guid>
		<description><![CDATA[Перепост, боян, &#8220;было&#8221;, классика, &#8220;скокаможна&#8221;? Ну&#8230; да. Но можно ли более наглядно и красноречиво пояснить ситуацию? Ой, вряд ли. Итак&#8230; Вопрос начинающего фотографа на одном из форумов: &#8220;Недавно приобрел себе камеру Canon EOS 450D. За месяц успел отфоткать кучу фоток, снимал преимущественно знакомых, кошку и просто людей на улице, а теперь подумываю совместить приятное с&#160;<a class="more" href="http://www.zeyalabs.ch/posts/wedding-photography-quick-start/" title="read whole article">[...]</a>]]></description>
			<content:encoded><![CDATA[<p>Перепост, боян, &#8220;было&#8221;, классика, &#8220;скокаможна&#8221;? Ну&#8230; да. Но можно ли более наглядно и красноречиво пояснить ситуацию? Ой, вряд ли. Итак&#8230;</p>
<p>Вопрос начинающего фотографа на одном из форумов:</p>
<blockquote><p>&#8220;Недавно приобрел себе камеру Canon EOS 450D. За месяц успел отфоткать кучу фоток, снимал преимущественно знакомых, кошку и просто людей на улице, а теперь подумываю совместить приятное с полезным. А именно: стать свадебным фотографом. С практикой фотосъёмки знаком не понаслышке &#8212; имел опыт фотосъёмки с &#8220;Зенитом&#8221;. Вот сижу и прикидываю, что нужно для свадебной фотосъемки. У меня пока только китовый объектив, что нужен лучше, но сейчас не потяну. Реально ли только с китовым? Нужна внешняя вспышка, по деньгам прикидываю баксов за 100-150, порекомендуйте, какую лучше взять. Дополнительную карту памяти и аккумулятор куплю. Что ещё нужно? Штатив с &#8220;тросиком&#8221;? Не знаю&#8230; по-моему, не обязательно иметь.&#8221;</p></blockquote>
<p><img src="http://www.zeyalabs.ch/wp-content/uploads/bride-500x351.jpg" alt="" title="Newbie Wedding Shot" width="500" height="351" class="aligncenter size-large wp-image-284" /></p>
<p>Ответ на том же форуме:</p>
<blockquote><p>&#8220;Недавно приобрел себе в магазине &#8220;Медтехника&#8221; скальпель. За месяц успел изрезать кожаный диван, ковер и едва не прирезал свою кошку, а теперь подумываю совместить приятное с полезным. А именно: поработать кардиохирургом. С практикой хирургии знаком не понаслышке, имел опыт работы с консервным ножом. Вот сижу и прикидываю, что для этого нужно. Скальпель пока не заточен и только один, понимаю, что нужен другой, но сейчас не потяну. Реально ли только одним скальпелем сделать аорто-коронарное шунтирование? Нужен еще кровоостанавливающий зажим, по деньгам прикидываю баксов за 10-15, порекомендуйте, какой лучше взять. Вату и тампоны куплю сам. Что еще нужно для хирургической операции на сердце? Троакар полостной и пинцет тканевый? Не знаю&#8230; по-моему, не обязательно иметь.&#8221;</p></blockquote>
<p>Увы, ни названия форума, ни имен авторов назвать не могу: натыкался только на перепосты. За сам факт существования оригинала тоже не ручаюсь: история больше смахивает на легенду.</p>
<p>Но это не столь важно. Главное &#8212; мораль той басни. (Какова?)</p><p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.zeyalabs.ch%2Fposts%2Fwedding-photography-quick-start%2F&amp;title=%D0%9E%D1%85%20%D1%83%D0%B6%20%D1%8D%D1%82%D0%B8%20%D0%BF%D1%80%D0%BE%D1%84%D0%B5%D1%81%D1%8E%D0%B1%D0%B8%D1%82%D0%B5%D0%BB%D0%B8%26%238230%3B" id="wpa2a_4"><img src="http://www.zeyalabs.ch/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.zeyalabs.ch/posts/wedding-photography-quick-start/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Спам &#8220;руками&#8221; сервера рассылок</title>
		<link>http://www.zeyalabs.ch/posts/spam-through-subscription-trials/</link>
		<comments>http://www.zeyalabs.ch/posts/spam-through-subscription-trials/#comments</comments>
		<pubDate>Wed, 21 Apr 2010 20:25:08 +0000</pubDate>
		<dc:creator>Oldie</dc:creator>
				<category><![CDATA[Techy Articles]]></category>
		<category><![CDATA[cunning]]></category>
		<category><![CDATA[newsletters]]></category>
		<category><![CDATA[scam]]></category>

		<guid isPermaLink="false">http://www.zeyalabs.ch/?p=252</guid>
		<description><![CDATA[Когда ко мне в специально отведенный для рассылок почтовый ящик начали пачками сыпаться пробные выпуски различных рассылок-новичков, я несколько насторожился. Наверное, на любом крупном рассылочном сервере есть опция &#8220;подписаться на пробные выпуски раздела каталога&#8221;. Щелк &#8212; да, хочу! &#8212; и к твоему обычному набору новостей, обзоров, анонсов, советов, уроков и наставлений добавляются три первых выпуска&#160;<a class="more" href="http://www.zeyalabs.ch/posts/spam-through-subscription-trials/" title="read whole article">[...]</a>]]></description>
			<content:encoded><![CDATA[<p>Когда ко мне в специально отведенный для рассылок почтовый ящик начали пачками сыпаться пробные выпуски различных рассылок-новичков, я несколько насторожился. Наверное, на любом крупном рассылочном сервере есть опция &#8220;подписаться на пробные выпуски раздела каталога&#8221;. Щелк &#8212; да, хочу! &#8212; и к твоему обычному набору новостей, обзоров, анонсов, советов, уроков и наставлений добавляются три первых выпуска всякой вновь зарегистрированной рассылки на заданную тему. Чтобы, значит, почитать да поразмышлять, стоит ли на нее подписаться или ну ее лесом.</p>
<p>&#8220;Фича&#8221; сама по себе полезная и безболезненная. Только вот в данном случае&#8230;</p>
<p>&#8230;все &#8220;новички&#8221; были зарегистрированы в одной и той же ветви каталога. Выпуски были одинаково оформлены (а-ля минимум), содержали кратенькую статью на заданную тему (ни на шаг не отступающую от предусмотренной правилами, надо заметить) и, что самое интересное, никоим образом не намекали на то, кому же, собственно, принадлежит авторство &#8212; ни имени, ни &#8220;мыла&#8221;, ни &#8220;аськи&#8221;, ни сайта&#8230; Заложив крутой вираж, кусочек &#8220;докторской&#8221; вылетел из-за угла и приземлился у лап голодной дворняжки&#8230;</p>
<p><img src="http://www.zeyalabs.ch/wp-content/uploads/pathway02.jpg" alt="" title="Promised Pathway" width="320" height="212" class="alignright size-medium wp-image-257" /></p>
<p>Есть такой хитрый рекламный трюк: сначала компания публикует серию плакатов или роликов с одним лишь изображением или &#8220;речевкой&#8221;, без дальнейших указаний или объяснений. Народ, само собой, начинает нервничать и париться: &#8220;да шо ж енто за такоя&#8221;. И разумеется, продолжение не заставляет себя слишком долго ждать: через некоторое время в свет выходит &#8220;вторая серия&#8221;, подробно объясняющая, что купить, где купить, и почему нельзя не купить.</p>
<p>Но вернемся к нашим&#8230; всадникам без головы.</p>
<p>Наверное, уже не стоит объяснять, почему такое количество НХО (неопознанных халявных объектов) меня насторожило. Ну не может же этот таинственный Некто быть настолько добрым, чтобы публиковать такие объемы всяческих полезностей и не желать в обмен ни денег, ни славы, ни даже доброго словца?</p>
<p>Оставалось лишь ждать, что день грядущий нам готовит&#8230;</p>
<p>Примерно неделю спустя мой почтовый ящик начал принимать &#8220;вторую серию картины&#8221;. Ну?  Ну?! Продолжения статей, опубликованных в предыдущих выпусках? Новая порция полезностей? Посильный вклад в посев разумного, доброго, вечного? Ага&#8230; Щас, как говорится.</p>
<p>Все пробные выпуски второго потока содержали адрес сайта, сопровождаемый примерно следующим текстом: &#8220;&#8230;я тут пока на перекурчике, а мне вот прислали очень интересную ссылочку &#8212; ну просто замечательный проект, там пока все бесплатно, но скоро будет очень дорого, налетай, торопись, покупай живопись&#8230;&#8221; И знаете что? Почему-то очень захотелось щелкнуть по предложенной ссылке, чтобы хотя бы &#8220;одним глазком&#8221;&#8230; Но сила воли пересилила минутную слабость.</p>
<p>Логично было предположить, что &#8220;третья серия&#8221; сообщит потенциальной аудитории подписчиков о том, что &#8220;данная рассылка вливается в стройные ряды уже упомянутого нами замечательного проекта&#8221;, так как существовать вне его &#8212; грех, глупость, преступление и трагедия. И что &#8220;в дальнейшем здесь будут публиковаться новости сайта&#8221;.</p>
<p>Через неделю предположение полностью подтвердилось. Фи, как неоригинально.</p>
<p>Такой вот элегантный &#8220;развод&#8221;. (Не то что я со своим ненавязчивым обменом ссылками и наивными просьбами типа &#8220;отправь этот выпуск другу и соседке&#8221;.)</p>
<p>Зачем такие вывихи, спросите вы? Так целевая аудитория ж! Бесплатно! Легально! Мимо спам-фильтров! Давайте прикинем все это дело в цифрах. Допустим, в категории &#8220;Ё-моё&#8221; 50 тысяч подписчиков, желающих получать пробные выпуски. Регистрируем дюжину рассылок и начинаем &#8220;бомбить&#8221; &#8212; три серии по 12 писем (то есть где-то по письму в день) <em>каждому</em> из 50 тысяч! С практически стопроцентной гарантией, что все письма будут прочитаны.</p>
<p>А когда закончится пробный период, то можно а) продолжать регистрировать новые рассылки, и б) параллельно донимать тех читателей, кто уже &#8220;повелся&#8221; и подписался (а таких ведь наберется пара троек тысяч), так называемыми &#8220;новостями проекта&#8221;&#8230; пока &#8220;стражники&#8221; сервера рассылок не настучат по голове за нарушение правил &#8212; например, за несоответствие содержания выпусков заявленной тематике оных. Или не придумают какое-нибудь хитрое системное ограничение для особо веселых и находчивых.</p>
<p>А я пока займусь более тонкой настройкой моего спамопожирателя.</p>
<p>Название сервера, раздела каталога и тем паче &#8220;самодинамящегося&#8221; проекта я, пожалуй, разглашать не буду. И еще (для тех, кто в танке): данная статья &#8212; ни в коем случае не призыв к действию, а основанное на реальных фактах сочинение на тему &#8220;Так дьелать не есть карашо&#8221;.</p><p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.zeyalabs.ch%2Fposts%2Fspam-through-subscription-trials%2F&amp;title=%D0%A1%D0%BF%D0%B0%D0%BC%20%26%238220%3B%D1%80%D1%83%D0%BA%D0%B0%D0%BC%D0%B8%26%238221%3B%20%D1%81%D0%B5%D1%80%D0%B2%D0%B5%D1%80%D0%B0%20%D1%80%D0%B0%D1%81%D1%81%D1%8B%D0%BB%D0%BE%D0%BA" id="wpa2a_6"><img src="http://www.zeyalabs.ch/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.zeyalabs.ch/posts/spam-through-subscription-trials/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Echoing Parentheses in Windows Batch Files</title>
		<link>http://www.zeyalabs.ch/posts/echoing-parentheses-in-batch-files/</link>
		<comments>http://www.zeyalabs.ch/posts/echoing-parentheses-in-batch-files/#comments</comments>
		<pubDate>Tue, 13 Apr 2010 21:33:08 +0000</pubDate>
		<dc:creator>Oldie</dc:creator>
				<category><![CDATA[Techy Articles]]></category>
		<category><![CDATA[batch]]></category>
		<category><![CDATA[howtos]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.zeyalabs.ch/?p=235</guid>
		<description><![CDATA[It&#8217;s not just about parentheses, really. It&#8217;s about almost anything that a script engine will ruthlessly interpret before executing a command: variable markers (percent signs), redirection symbols, parentheses, double quotes, ampersands&#8230; My most common&#8230; let&#8217;s say, case, is this: Put this in a BATch file, run it, and you&#8217;ll end up with a message saying&#160;<a class="more" href="http://www.zeyalabs.ch/posts/echoing-parentheses-in-batch-files/" title="read whole article">[...]</a>]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s not just about parentheses, really. It&#8217;s about almost anything that a script engine will ruthlessly interpret before executing a command: variable markers (percent signs), redirection symbols, parentheses, double quotes, ampersands&#8230;</p>
<p>My most common&#8230; let&#8217;s say, <em>case</em>, is this:</p>
<pre class="brush: bash; title: ; notranslate">
@echo off

echo Doing something (very important)...
</pre>
<p>Put this in a BATch file, run it, and you&#8217;ll end up with a message saying</p>
<pre class="brush: bash; light: true; title: ; notranslate">
... was unexpected at this time.
</pre>
<p>No, seriously? It&#8217;s great that the engine is trying to evaluate an expression within an <code>echo</code>, but this time I need something much more simple: round brackets embedded into a text message. Just that. Please.</p>
<p>Thank heavens there is a &#8220;cure&#8221;: parentheses can be escaped with a caret character.</p>
<pre class="brush: bash; title: ; notranslate">
@echo off

echo Doing something ^(very important^)...
</pre>
<p>Now we&#8217;re good:</p>
<pre class="brush: bash; light: true; title: ; notranslate">
Doing something (very important)...
</pre>
<p>Carets can be used to escape almost any special character, even a newline &#8212; to break a single command in several lines.</p><p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.zeyalabs.ch%2Fposts%2Fechoing-parentheses-in-batch-files%2F&amp;title=Echoing%20Parentheses%20in%20Windows%20Batch%20Files" id="wpa2a_8"><img src="http://www.zeyalabs.ch/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.zeyalabs.ch/posts/echoing-parentheses-in-batch-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MacBook Forgetting Wireless Network</title>
		<link>http://www.zeyalabs.ch/posts/macbook-forgetting-wireless-network/</link>
		<comments>http://www.zeyalabs.ch/posts/macbook-forgetting-wireless-network/#comments</comments>
		<pubDate>Sat, 27 Mar 2010 08:26:03 +0000</pubDate>
		<dc:creator>Oldie</dc:creator>
				<category><![CDATA[Techy Articles]]></category>
		<category><![CDATA[howtos]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[networks]]></category>
		<category><![CDATA[troubleshooting]]></category>
		<category><![CDATA[wireless]]></category>

		<guid isPermaLink="false">http://www.zeyalabs.ch/?p=224</guid>
		<description><![CDATA[Everything had worked just fine until my wireless router waved everyone goodbye and I had to replace it. The model of the new device was slightly different, though, but it did &#8220;understand&#8221; the settings loaded from backup configuration and &#8212; voilà, my mobile devices were back online within minutes. The only thing I adjusted in&#160;<a class="more" href="http://www.zeyalabs.ch/posts/macbook-forgetting-wireless-network/" title="read whole article">[...]</a>]]></description>
			<content:encoded><![CDATA[<p>Everything had worked just fine until my wireless router waved everyone goodbye and I had to replace it. The model of the new device was slightly different, though, but it did &#8220;understand&#8221; the settings loaded from backup configuration and &#8212; voilà, my mobile devices were back online within minutes. The only thing I adjusted in the settings was disabling the <acronym title="Service Set Identifier">SSID</acronym> broadcast.</p>
<p>An unpleasant surprise waited for me when I turned on my MacBook Pro: it said, &#8220;None of your preferred wireless networks are available.&#8221; I didn&#8217;t believe it, of course. Every other device was proving the opposite. I tried to enter the <acronym title="Service Set Identifier">SSID</acronym> and password anew&#8230; aha! It worked! Temporary memory loss, I thought. Yawn. Total shutdown and good night.</p>
<p>Next morning, however, I was greeted with the same phrase again: no wireless network found. Which made me choke on my coffee. A perspective of typing rather long and complex <acronym title="Service Set Identifier">SSID</acronym> and password every time the laptop is turned on or woken up did not exactly make me happy.</p>
<p>In the next days, I tried to fix the problem by rebooting (all over again) all involved devices, restoring the original configuration, changing the <acronym title="Service Set Identifier">SSID</acronym> and then the password, enabling/disabling the <acronym title="Service Set Identifier">SSID</acronym> broadcast, poking a finger at LEDs, swearing and, finally, &#8220;killing&#8221; the keychain file in the laptop&#8217;s system&#8230; Nada.</p>
<p>Yesterday, I finally performed a long-planned upgrade of Mac <acronym title="Operating System">OS</acronym> X from 10.5.something to Snow Leopard (10.6.latest). And guess what? That&#8217;s right, this turned out to be the cure.</p>
<pre class="brush: bash; light: true; title: ; notranslate">
$ tribaldance -v -n 100 -c &quot;:-)&quot;
</pre>
<p>I&#8217;m still trying not to breathe while opening the lid of my MacBook Pro, but it works now, every time, it does. Don&#8217;t ask me why.</p><p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.zeyalabs.ch%2Fposts%2Fmacbook-forgetting-wireless-network%2F&amp;title=MacBook%20Forgetting%20Wireless%20Network" id="wpa2a_10"><img src="http://www.zeyalabs.ch/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.zeyalabs.ch/posts/macbook-forgetting-wireless-network/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Unwanted Escaping Backslashes in WordPress 2.9</title>
		<link>http://www.zeyalabs.ch/posts/unwanted-escaping-backslashes-in-wordpress-2-9/</link>
		<comments>http://www.zeyalabs.ch/posts/unwanted-escaping-backslashes-in-wordpress-2-9/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 14:05:51 +0000</pubDate>
		<dc:creator>Oldie</dc:creator>
				<category><![CDATA[Techy Articles]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[weird]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.zeyalabs.ch/?p=161</guid>
		<description><![CDATA[After an update of a WordPress installation (2.8.5 to 2.9.1), I noticed that one of the plugins, Stray Random Quotes, stopped working properly: each time I submitted or updated a quote containing apostrophes or quotation marks, it came with escaping backslashes in front of these characters. A couple of teacups later I figured out what&#160;<a class="more" href="http://www.zeyalabs.ch/posts/unwanted-escaping-backslashes-in-wordpress-2-9/" title="read whole article">[...]</a>]]></description>
			<content:encoded><![CDATA[<p>After an update of a WordPress installation (2.8.5 to 2.9.1), I noticed that one of the plugins, <a href="http://wordpress.org/extend/plugins/stray-quotes/" target="_blank" class="extlink">Stray Random Quotes</a>, stopped working properly: each time I submitted or updated a quote containing apostrophes or quotation marks, it came with escaping backslashes in front of these characters.</p>
<p>A couple of teacups later I figured out what was causing the issue. In the old <code>wp-settings.php</code> file there was this line of code forcing <code>$_REQUEST</code> to be <code>$_GET</code> + <code>$_POST</code>:</p>
<pre class="brush: php; light: true; title: ; notranslate">
$_REQUEST = array_merge($_GET, $_POST);
</pre>
<p>In the old version it was closer to the beginning of the file, on line 51, but somewhere between versions 2.8.5 and 2.9.1 it was moved to line 637. Right <em>after</em> this part:</p>
<pre class="brush: php; light: true; title: ; notranslate">
$_GET    = add_magic_quotes($_GET   );
$_POST   = add_magic_quotes($_POST  );
$_COOKIE = add_magic_quotes($_COOKIE);
$_SERVER = add_magic_quotes($_SERVER);
</pre>
<p>Stray Quotes uses <code>$_REQUEST</code> to process submitted data. There we go.</p>
<p>I&#8217;m sure the folks at WordPress had their reasons for such a change (that&#8217;s why I&#8217;m calling it an &#8220;issue&#8221; and not a &#8220;problem&#8221;), it&#8217;s just that I can&#8217;t help wondering how many plugins (or even parts of the core) were affected by it. Last week, I was setting up a <a href="http://wordpress.org/extend/plugins/nextgen-gallery/" target="_blank" class="extlink">NextGEN Gallery</a> on another — fresh — installation of WordPress 2.9.1, and watched the same behavior when filling in photo captions. I admit I didn&#8217;t look into it then, but today I got suspicious all right.</p>
<p>Now, I reckon you want a solution&#8230; Sorry to disappoint you, but I can&#8217;t give you one. Not a <em>quick</em> one, at least.</p>
<p>What about writing to support guys, you&#8217;re probably asking yourself now? Don&#8217;t. I really doubt that this change can (or should, for that matter) be reversed in future versions of WordPress. Like I said, there must have been a reason for it.</p>
<p>So I&#8217;d say the best thing you can do is to figure out which plugins among those installed on your system(s) are affected, and contact their developers with either the information on the issue or, if you can, an implementation of the fix. And wait for updates.</p>
<p>Just please don&#8217;t go hack the core!</p><p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.zeyalabs.ch%2Fposts%2Funwanted-escaping-backslashes-in-wordpress-2-9%2F&amp;title=Unwanted%20Escaping%20Backslashes%20in%20WordPress%202.9" id="wpa2a_12"><img src="http://www.zeyalabs.ch/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.zeyalabs.ch/posts/unwanted-escaping-backslashes-in-wordpress-2-9/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Shoot Yourself in the Foot</title>
		<link>http://www.zeyalabs.ch/posts/shoot-yourself-in-the-foot/</link>
		<comments>http://www.zeyalabs.ch/posts/shoot-yourself-in-the-foot/#comments</comments>
		<pubDate>Thu, 12 Nov 2009 09:12:52 +0000</pubDate>
		<dc:creator>Oldie</dc:creator>
				<category><![CDATA[Techy Articles]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.zeyalabs.ch/?p=145</guid>
		<description><![CDATA[Maybe you&#8217;ve seen one of those funny quick guides to programming languages based on Bjarne Stroustrup&#8217;s &#8220;foot shooting&#8221;, like the one I found on Michael Thompson&#8217;s blog (this is the most complete list of languages I&#8217;ve seen so far). Read it first if you haven&#8217;t. Here&#8217;s my two cents. PHP: You shoot yourself in the&#160;<a class="more" href="http://www.zeyalabs.ch/posts/shoot-yourself-in-the-foot/" title="read whole article">[...]</a>]]></description>
			<content:encoded><![CDATA[<p>Maybe you&#8217;ve seen one of those funny quick guides to programming languages based on <a href="http://www.research.att.com/~bs/" target="_blank" class="extlink">Bjarne Stroustrup&#8217;s</a> <a href="http://www.research.att.com/~bs/bs_faq.html#really-say-that" target="_blank" class="extlink">&#8220;foot shooting&#8221;</a>, like the one I found on <a href="http://michaelthompson.org/weblog/pages/THE_PROGRAMMERS_QUICK_GUIDE_TO_THE_LANGUAGES.html" target="_blank" class="extlink">Michael Thompson&#8217;s blog</a> (this is the most complete list of languages I&#8217;ve seen so far). Read it first if you haven&#8217;t.</p>
<p>Here&#8217;s my two cents.</p>
<p><strong>PHP:</strong> You shoot yourself in the foot and spend the rest of the week making sure that nobody else can pull the trigger of your gun which is now stuck between your belt and your belly. That involves both gun, belt, and room tweaking.</p>
<p><strong>Java:</strong> You find that the standard implementation of RFC NNN-1 (Gun) lacks the trigging mechanism, so you check Apache Commons if they have an alternative. They do, bit it doesn&#8217;t fit the standard implementation of RFC NNN-2 (Bullet), and there is no Commons&#8217; alternative to that one. You are in the middle of implementing your own Bullet when someone says there is already a project for that. You download a shareware version which turns out to be a blank shot. You pay for the armed one but they never send it to you. In the end, you take the standard implementation of RFC XXX (Axe) and chop your foot off.</p><p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.zeyalabs.ch%2Fposts%2Fshoot-yourself-in-the-foot%2F&amp;title=Shoot%20Yourself%20in%20the%20Foot" id="wpa2a_14"><img src="http://www.zeyalabs.ch/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.zeyalabs.ch/posts/shoot-yourself-in-the-foot/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

