<?xml version="1.0" encoding="utf-8" ?>

<rdf:RDF 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
   xmlns="http://my.netscape.com/rdf/simple/0.9/">
<channel>
    <title>PHP, the universe and all the rest</title>
    <link>http://www.php-groupies.de/blogs/</link>
    <description>PHP Groupie since 1999 </description>
    <dc:language>en</dc:language>

    <image rdf:resource="http://www.php-groupies.de/blogs/templates/default/img/s9y_banner_small.png" />

    <items>
      <rdf:Seq>
        <rdf:li resource="http://www.php-groupies.de/blogs/archives/55-guid.html" />
        <rdf:li resource="http://www.php-groupies.de/blogs/archives/54-guid.html" />
        <rdf:li resource="http://www.php-groupies.de/blogs/archives/53-guid.html" />
        <rdf:li resource="http://www.php-groupies.de/blogs/archives/52-guid.html" />
        <rdf:li resource="http://www.php-groupies.de/blogs/archives/51-guid.html" />
        <rdf:li resource="http://www.php-groupies.de/blogs/archives/50-guid.html" />
        <rdf:li resource="http://www.php-groupies.de/blogs/archives/47-guid.html" />
        <rdf:li resource="http://www.php-groupies.de/blogs/archives/48-guid.html" />
        <rdf:li resource="http://www.php-groupies.de/blogs/archives/46-guid.html" />
        <rdf:li resource="http://www.php-groupies.de/blogs/archives/44-guid.html" />
        <rdf:li resource="http://www.php-groupies.de/blogs/archives/43-guid.html" />
        <rdf:li resource="http://www.php-groupies.de/blogs/archives/42-guid.html" />
        <rdf:li resource="http://www.php-groupies.de/blogs/archives/41-guid.html" />
        <rdf:li resource="http://www.php-groupies.de/blogs/archives/40-guid.html" />
        <rdf:li resource="http://www.php-groupies.de/blogs/archives/39-guid.html" />
      </rdf:Seq>
    </items>
</channel>

<image rdf:about="http://www.php-groupies.de/blogs/templates/default/img/s9y_banner_small.png">
        <url>http://www.php-groupies.de/blogs/templates/default/img/s9y_banner_small.png</url>
        <title>RSS: PHP, the universe and all the rest - PHP Groupie since 1999 </title>
        <link>http://www.php-groupies.de/blogs/</link>
        <width>100</width>
        <height>21</height>
    </image>


<item rdf:about="http://www.php-groupies.de/blogs/archives/55-guid.html">
    <title>One remote button to rule them all ...</title>
    <link>http://www.php-groupies.de/blogs/archives/55-One-remote-button-to-rule-them-all-....html</link>
    <description>
    &lt;h2 id=&quot;toc0&quot;&gt;The Setup&lt;/h2&gt;
&lt;p&gt;We don&#039;t have a regular TV set in the living room anymore, we either use our SAT receiver / recorder as a media streamer and watch TV and recordings anywhere in the house, or we watch using our projector and the big screen that nicely covers the living rooms window front when down for viewing and hides itself just above the windows when not in use.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://www.php-groupies.de/blogs/uploads/screen.jpg&quot; width=&quot;400&quot; height=&quot;300&quot; alt=&quot;screen.jpg&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;toc1&quot;&gt;The Problem&lt;/h2&gt;
&lt;p&gt;Now the problem with the receiver / projector / screen setup is that switching it on or off requires three different remotes. It also takes about 45 seconds for the screen to come down to the desired position - time long enough to be boring but not long enough to do anything else meanwhile ...&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://www.php-groupies.de/blogs/uploads/remotes.jpg&quot; width=&quot;300&quot; height=&quot;225&quot; alt=&quot;remotes.jpg&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;toc2&quot;&gt;The Solution&lt;/h3&gt;
&lt;p&gt;Both the projector and the screen have infrared remotes. The receiver is a Vu+ Duo, so it runs on Linux and uses the same Enigma2 software as the DreamBox machines. So the original plan was to have the receiver send the right IR codes to the projector and screen whenever it enters or leaves standby mode via a small additional Python &lt;span title=&quot;Something that plugs in&quot; class=&quot;serendipity_glossaryMarkup&quot;&gt;plugin&lt;/span&gt; and a minimal IR sending circuit attached to the receivers serial interface.&lt;/p&gt;

&lt;p&gt;This turned out to be a bit too challenging due to the IR timing requirements, so &amp;quot;Plan B&amp;quot; came into action: offload the actual IR signal generation to a small Arduino board powered by USB and controlled by sending simple commands via usb2serial&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://www.php-groupies.de/blogs/uploads/arduino-ir.jpg&quot; width=&quot;300&quot; height=&quot;225&quot; alt=&quot;arduino-ir.jpg&quot; /&gt;&lt;/p&gt;

&lt;p&gt;The controller is an Arduino Nano, perfect for little breadboard projects like this. The extra components are:&lt;/p&gt;


&lt;ul&gt;
    &lt;li&gt;two IR-LEDs, one sending to the front towards the screen, the other facing up to the projector above&lt;/li&gt;
    &lt;li&gt;a small NPN transistor to provide the IR leds with enough current (the Arduino output pins only provide about 10mA which was only good for a range of about 2m, now the two IR LEDs together get almost the full 500mA provided by the USB interface) &lt;/li&gt;
    &lt;li&gt;a regular green LED between the Arduinos output pin and the transistor base, acting as &amp;quot;sending&amp;quot; indicator &lt;/li&gt;
    &lt;li&gt;a small capacitor between 5V and ground, just in case &lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;toc3&quot;&gt;Future plans&lt;/h2&gt;

&lt;ul&gt;
    &lt;li&gt;Document and publish the sources for the Arduino and Enigma2 Plugin side&lt;/li&gt;
    &lt;li&gt;Solder a small real board and put it in a case (not for now as the transistor and IR LEDs are running a bit above their specs ... if this really turns out to be a problem they are easily replaceable in the current bread board version)&lt;/li&gt;
    &lt;li&gt;Maybe control the projector via its RS-232 instead of IR as this would allow for double checking its actual state while IR is a &amp;quot;best guess&amp;quot; one way communication only&lt;/li&gt;
    &lt;li&gt;make the screen motor &amp;quot;on&amp;quot; time configurable via a GUI front end to the Enigma2 plugin (the projector is sitting on a wooden shelf mounted to an outside wall which makes the picture position go up and down by a few centimeters over the year along with temperature and humidity changes)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;toc4&quot;&gt;Why not use something like a Logitech Harmony?&lt;/h2&gt;

&lt;ul&gt;
    &lt;li&gt;I&#039;m actually quite happy with the Vu+ remote and don&#039;t want to replace it with something else&lt;/li&gt;
    &lt;li&gt;Price: ~25EUR in parts total&lt;/li&gt;
    &lt;li&gt;Control: access to all sources&lt;/li&gt;
    &lt;li&gt;Interfaces: in the long run a can not only send commands to other devices via IR but also via RS232 or TCP/IP&lt;/li&gt;
    &lt;li&gt;It also works when switching on the receiver via its web interface, its various Android / iOS control apps or via an internal timer&lt;/li&gt;
&lt;/ul&gt;

 
    </description>

    <dc:publisher>PHP, the universe and all the rest</dc:publisher>
    <dc:creator>nospam@example.com (Hartmut Holzgraefe)</dc:creator>
    <dc:subject>
    Arduino, </dc:subject>
    <dc:date>2012-12-24T12:31:16Z</dc:date>
    <wfw:comment>http://www.php-groupies.de/blogs/wfwcomment.php?cid=55</wfw:comment>
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://www.php-groupies.de/blogs/rss.php?version=1.0&amp;type=comments&amp;cid=55</wfw:commentRss>
    
    
</item>
<item rdf:about="http://www.php-groupies.de/blogs/archives/54-guid.html">
    <title>Happy Birthday Bug# 30994, here is a present for you ...</title>
    <link>http://www.php-groupies.de/blogs/archives/54-Happy-Birthday-Bug-30994,-here-is-a-present-for-you-....html</link>
    <description>
    &lt;p&gt;One of the MySQL bugs having &lt;a href=&quot;http://php-groupies.de/mysql-bugs/2012-09-13.html&quot; onclick=&quot;window.open(this.href, &#039;_blank&#039;); return false;&quot;&gt;birthday&lt;/a&gt; today is &lt;a href=&quot;http://bugs.mysql.com/30994&quot; onclick=&quot;window.open(this.href, &#039;_blank&#039;); return false;&quot;&gt;Bug #30994&lt;/a&gt; which i filed five years ago.&lt;/p&gt;

&lt;p&gt;So i decided to give it a little birthday present by finally writing a patch for it myself:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://code.launchpad.net/~hartmut-php/maria/5.5-bug30994&quot; onclick=&quot;window.open(this.href, &#039;_blank&#039;); return false;&quot;&gt;https://code.launchpad.net/~hartmut-php/maria/5.5-bug30994&lt;/a&gt;&lt;/p&gt;

 
    </description>

    <dc:publisher>PHP, the universe and all the rest</dc:publisher>
    <dc:creator>nospam@example.com (Hartmut Holzgraefe)</dc:creator>
    <dc:subject>
    MySQL, </dc:subject>
    <dc:date>2012-09-13T19:01:05Z</dc:date>
    <wfw:comment>http://www.php-groupies.de/blogs/wfwcomment.php?cid=54</wfw:comment>
        <slash:comments>2</slash:comments>
        <wfw:commentRss>http://www.php-groupies.de/blogs/rss.php?version=1.0&amp;type=comments&amp;cid=54</wfw:commentRss>
    
    
</item>
<item rdf:about="http://www.php-groupies.de/blogs/archives/53-guid.html">
    <title>MySQL Bug Anniversaries</title>
    <link>http://www.php-groupies.de/blogs/archives/53-MySQL-Bug-Anniversaries.html</link>
    <description>
    &lt;p&gt;Ten years ago today the first public bug was filed on bugs.mysql.com.&lt;/p&gt;

&lt;p&gt;As we also stumbled across an unfixed bug today that was reported almost exactly two years ago i came up with the idea of writing a little script that would report all bugs filed on exactly the same day one or more years ago that are still in an &amp;quot;active&amp;quot; state (open, verified, etc.).&lt;/p&gt;

&lt;p&gt;The list for today can be found at&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://php-groupies.de/mysql-bugs/2012-09-12.html&quot; onclick=&quot;window.open(this.href, &#039;_blank&#039;); return false;&quot;&gt;http://php-groupies.de/mysql-bugs/2012-09-12.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And as i was already on it i also created a RSS feed for this at&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://php-groupies.de/mysql-bugs/bugs.rss&quot; onclick=&quot;window.open(this.href, &#039;_blank&#039;); return false;&quot;&gt;http://php-groupies.de/mysql-bugs/bugs.rss&lt;/a&gt;&lt;/p&gt;

 
    </description>

    <dc:publisher>PHP, the universe and all the rest</dc:publisher>
    <dc:creator>nospam@example.com (Hartmut Holzgraefe)</dc:creator>
    <dc:subject>
    MySQL, </dc:subject>
    <dc:date>2012-09-12T18:14:28Z</dc:date>
    <wfw:comment>http://www.php-groupies.de/blogs/wfwcomment.php?cid=53</wfw:comment>
        <slash:comments>1</slash:comments>
        <wfw:commentRss>http://www.php-groupies.de/blogs/rss.php?version=1.0&amp;type=comments&amp;cid=53</wfw:commentRss>
    
    
</item>
<item rdf:about="http://www.php-groupies.de/blogs/archives/52-guid.html">
    <title>Getting confused by Mosh ...</title>
    <link>http://www.php-groupies.de/blogs/archives/52-Getting-confused-by-Mosh-....html</link>
    <description>
    &lt;p&gt;Still in love with &lt;b&gt;mosh&lt;/b&gt;, but there is one thing that causes a lot of confusion right now:&lt;/p&gt;

&lt;p&gt;When having something that produces more than a screen full of output, like the usual &lt;b&gt;--help&lt;/b&gt; output of non-trivial tools or typical &lt;b&gt;configure&lt;/b&gt; scripts i use to scroll back using the local terminals Shift-PageUp / -PageDown bindings.&lt;/p&gt;

&lt;p&gt;This doesn&#039;t work with mosh anymore as it actually transfers screen frames and not output streams, so output that scrolls by too fast is likely to not ever reach your local screen at all.&lt;/p&gt;

&lt;p&gt;Looks as if i need to use &lt;b&gt;less&lt;/b&gt; in quite a few places again were i previously haven&#039;t ...&lt;/p&gt;

 
    </description>

    <dc:publisher>PHP, the universe and all the rest</dc:publisher>
    <dc:creator>nospam@example.com (Hartmut Holzgraefe)</dc:creator>
    <dc:subject>
    </dc:subject>
    <dc:date>2012-06-08T07:53:39Z</dc:date>
    <wfw:comment>http://www.php-groupies.de/blogs/wfwcomment.php?cid=52</wfw:comment>
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://www.php-groupies.de/blogs/rss.php?version=1.0&amp;type=comments&amp;cid=52</wfw:commentRss>
    
    
</item>
<item rdf:about="http://www.php-groupies.de/blogs/archives/51-guid.html">
    <title>Falling in love with MOSH  (on top of SSH)</title>
    <link>http://www.php-groupies.de/blogs/archives/51-Falling-in-love-with-MOSH-on-top-of-SSH.html</link>
    <description>
    &lt;p&gt;If you&lt;/p&gt;


&lt;ul&gt;
    &lt;li&gt;use interactive &lt;b&gt;ssh&lt;/b&gt; sessions a lot&lt;/li&gt;
    &lt;li&gt;from a laptop&lt;/li&gt;
    &lt;li&gt;that you may put to suspend every once in a while&lt;/li&gt;
    &lt;li&gt;or even roam between different networks&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;then you should definitely have a look at &lt;a href=&quot;http://mosh.mit.edu/&quot; onclick=&quot;window.open(this.href, &#039;_blank&#039;); return false;&quot;&gt;Mosh: the mobile shell&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Mosh&lt;/b&gt; creates a remote terminal session on another machine similar to what &lt;b&gt;ssh&lt;/b&gt; does, but different.&lt;br /&gt;
Think of &lt;b&gt;ssh&lt;/b&gt; and &lt;b&gt;screen&lt;/b&gt; combined for persistent sessions, combined with automatic reconnects, even if your client IP address changes and you almost have it.&lt;/p&gt;

&lt;p&gt;E.g. previously i was using &lt;b&gt;ssh&lt;/b&gt;, &lt;b&gt;screen&lt;/b&gt; and &lt;b&gt;irssi&lt;/b&gt; to connect to our internal IRC server using the following steps:&lt;/p&gt;


&lt;ul&gt;
    &lt;li&gt;&lt;b&gt;ssh irc&lt;/b&gt; to connect to our login machine (&lt;b&gt;irc&lt;/b&gt; actually referring to a host entry in my &lt;b&gt;.ssh/config&lt;/b&gt; that has the full host name, user name and key information to use)&lt;/li&gt;
    &lt;li&gt;&lt;b&gt;screen -xr irc&lt;/b&gt; to reconnect to my screen session running irssi (always running so that i have full backlogs)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now with &lt;b&gt;mosh&lt;/b&gt; i can instead use the simpler one liner (or actually a small shell script containing it):&lt;/p&gt;


&lt;ul&gt;
    &lt;li&gt; mosh irc -- screen -xr irc&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Mosh then first uses &lt;b&gt;ssh&lt;/b&gt; to start a session server process on the remote site, so i can still use my host entry from my ssh config file. Next it starts to communicate with this remote server using an AES encrypted UDP protocol. So the session is not bound to a TCP stream as with SSH, and it will not break if that stream is lost as there isn&#039;t one to begin with. And instead of identifying the client by IP and port number the AES session is used for this, so the mosh server does not mind if the clients IP suddenly changes.&lt;/p&gt;

&lt;p&gt;So a mosh session survives even if you move the client device to a different network, and as UDP is connection-less the session will even survive extended amounts of client downtime.&lt;/p&gt;

&lt;p&gt;Now when e.g. moving from my home office to the coffee-shop-with-WLAN-down-the-street i simply put my laptop to sleep (suspend), and when i open it up again there it wakes up again and even though it had been disconnected for ~10min and now has a totally different IP from a different network i can continue to work with my open mosh sessions right away.&lt;/p&gt;

&lt;p&gt;Also when on the train with only a G3 connection that can go up and down by the minute i don&#039;t have to bother with remote session disconnects anymore.&lt;/p&gt;

&lt;p&gt;But there&#039;s even more to it that makes it a superior ssh for interactive sessions: Mosh does not simply stream through all output, it is more like VNC for text mode as it maintains a model of the screen states on the server and client sides and tries to keep these in sync. So if you e.g. start something that produces &lt;b&gt;a lot&lt;/b&gt; of output and then terminate it with CTRL-C you don&#039;t have to wait for all the output to stream by ... you&#039;ll get your shell prompt back almost immediately instead.&lt;/p&gt;

&lt;p&gt;And one last goodie: if you&#039;ve ever used ssh over a slow line or one with very high latencies you probably know the &amp;quot;can type faster than the characters appear on the screen&amp;quot; effect and how confusing that can be. Here mosh upon detecting a slow link will enter a mode where it tries to predict where the characters you just typed are going to end up on the screen (including a simple cursor key understanding) and will show them as underlined while waiting for the server response. Once that arrived it will replace its local prediction with the actual screen contents from the server session. It may not always guess right, but you&#039;ll at least see what you&#039;re typing right away &lt;img src=&quot;http://www.php-groupies.de/blogs/templates/default/img/emoticons/smile.png&quot; alt=&quot;:-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Now i&#039;m desperately waiting for an Android client for this .... &lt;img src=&quot;http://www.php-groupies.de/blogs/templates/default/img/emoticons/wink.png&quot; alt=&quot;;-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt;&lt;/p&gt;

 
    </description>

    <dc:publisher>PHP, the universe and all the rest</dc:publisher>
    <dc:creator>nospam@example.com (Hartmut Holzgraefe)</dc:creator>
    <dc:subject>
    tipstricks, </dc:subject>
    <dc:date>2012-06-04T03:52:02Z</dc:date>
    <wfw:comment>http://www.php-groupies.de/blogs/wfwcomment.php?cid=51</wfw:comment>
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://www.php-groupies.de/blogs/rss.php?version=1.0&amp;type=comments&amp;cid=51</wfw:commentRss>
    
    
</item>
<item rdf:about="http://www.php-groupies.de/blogs/archives/50-guid.html">
    <title>Fun with Cluster and Locking</title>
    <link>http://www.php-groupies.de/blogs/archives/50-Fun-with-Cluster-and-Locking.html</link>
    <description>
    &lt;p&gt;I&#039;ve been dealing with MySQL Cluster in one way or another since around 2005 or so (back in the MySQL 4.1 days) but it is still full of &amp;quot;funny&amp;quot; surprises. This post is a collection of different locking related issue i ran into during the previous weeks that i had not been aware of up to now (or simply may have forgotten over time)&lt;/p&gt;

&lt;p&gt;== Unique hash indexes lock exclusively ==&lt;/p&gt;

&lt;p&gt;This is the one that regular users are most likely to run into: in general row logs in MySQL Cluster distinguish between reads and writes so that writers can block other writers, but not readers and readers from other transactions always see the last committed row value (Cluster currently only supports the READ COMMITTED isolation level). As soon as you have a secondary unique index in addition to a primary key things are different though. Internally a unique index that is not the primary key is implemented as a unique hash index in Cluster (and optionally also as an additional ordered T-Tree), and for unique hash entries there only seems to be exclusive locking so that writers will block readers across transactions.&lt;/p&gt;

&lt;p&gt;See &lt;a href=&quot;http://bugs.mysql.com/65086&quot; onclick=&quot;window.open(this.href, &#039;_blank&#039;); return false;&quot;&gt;http://bugs.mysql.com/65086&lt;/a&gt; for actual examples.&lt;/p&gt;

&lt;p&gt;== Long running transactions can block starting nodes ==&lt;/p&gt;

&lt;p&gt;Less likely to happen, but very annoying if it happens and you don&#039;t know about it:&lt;/p&gt;

&lt;p&gt;A starting node needs to lock all rows for a very short period of time near the end of start phase 5. At this point it needs to wait for all current transaction to free the locks they are holding (by either COMMIT or ROLLBACK). This is usually not a problem as cluster transaction are not supposed to last very long anyway, but if there happens to be a long running transaction it can potentially block a node start forever. A stopping node will wait for pending transactions for 5 seconds and will then terminate these transactions the hard way, a starting node on the other hand will gracefully wait forever.&lt;/p&gt;

&lt;p&gt;This is bad in two ways:&lt;/p&gt;

&lt;p&gt;1) it is obviously bad availability wise as you may end up with a non-redundant configuration for extended periods of time and without any way to automatically identify and terminate the offending transaction(s)&lt;/p&gt;

&lt;p&gt;2) currently the blocked starting node does not even tell what it is waiting for, it just silently sits and waits. So unless you know what is going on you are faced with a node that is simply stuck without doing anything (CPU, disc and network load next to zero)&lt;/p&gt;

&lt;p&gt;The related bug report is &lt;a href=&quot;http://bugs.mysql.com/65037&quot; onclick=&quot;window.open(this.href, &#039;_blank&#039;); return false;&quot;&gt;http://bugs.mysql.com/65037&lt;/a&gt; , proposed solutions are meaningful log messages in the short term and killing active transactions after a grace period in the long run.&lt;/p&gt;

&lt;p&gt;== Weird error message on lock timeout ==&lt;/p&gt;

&lt;p&gt;This last item is related to the non-standard INSERT ... ON DUPLICATE KEY UPDATE construct. What can happen here is that the INSERT part fails with a lock wait timeout as the key is write locked by another transaction. The expected error message in this case would simply be &amp;quot;Lock wait timeout exceed&amp;quot; but what you&#039;ll actually get is &amp;quot;Transaction already aborted&amp;quot;. What seems to happen here is that the ON DUPLICATE KEY UPDATE part is triggered by any error in the INSERT phase and not only by duplicate key violation. So the INSERT part is tried tried, fails with &amp;quot;Lock wait timeout&amp;quot; (which implicitly rolls back the current transaction), next the UPDATE part is tried, fails with &amp;quot;Transaction already aborted&amp;quot; and overwrites the previous error ...&lt;/p&gt;

&lt;p&gt;The related bug report is &lt;a href=&quot;http://bugs.mysql.com/65130&quot; onclick=&quot;window.open(this.href, &#039;_blank&#039;); return false;&quot;&gt;http://bugs.mysql.com/65130&lt;/a&gt;&lt;/p&gt;

 
    </description>

    <dc:publisher>PHP, the universe and all the rest</dc:publisher>
    <dc:creator>nospam@example.com (Hartmut Holzgraefe)</dc:creator>
    <dc:subject>
    MySQL, </dc:subject>
    <dc:date>2012-04-27T17:22:44Z</dc:date>
    <wfw:comment>http://www.php-groupies.de/blogs/wfwcomment.php?cid=50</wfw:comment>
        <slash:comments>1</slash:comments>
        <wfw:commentRss>http://www.php-groupies.de/blogs/rss.php?version=1.0&amp;type=comments&amp;cid=50</wfw:commentRss>
    
    
</item>
<item rdf:about="http://www.php-groupies.de/blogs/archives/47-guid.html">
    <title>Partition fun again, today with ARCHIVE</title>
    <link>http://www.php-groupies.de/blogs/archives/47-Partition-fun-again,-today-with-ARCHIVE.html</link>
    <description>
    &lt;p&gt;After the fun with InnoDB and MyISAM and massive partitioning it&#039;s time to move on to some other storage engines. So for the next round of fun i chose ARCHIVE:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;  mysql&amp;gt; create table t1 (id int primary key auto_increment, val int) 
      engine=archive partition by hash(id) partitions 1023;
  Query OK, 0 rows affected (0.26 sec)

  mysql&amp;gt; insert into t1 values(NULL,1);
  ERROR 1194 (HY000): Table &#039;t1&#039; is marked as crashed 
      and should be repaired

  mysql&amp;gt; drop table t1; 
  ERROR 2013 (HY000): Lost connection to MySQL server 
      during query&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;PS: MariaDB does not seem to be affected ...&lt;/p&gt;

 
    </description>

    <dc:publisher>PHP, the universe and all the rest</dc:publisher>
    <dc:creator>nospam@example.com (Hartmut Holzgraefe)</dc:creator>
    <dc:subject>
    MySQL, </dc:subject>
    <dc:date>2012-04-06T16:50:00Z</dc:date>
    <wfw:comment>http://www.php-groupies.de/blogs/wfwcomment.php?cid=47</wfw:comment>
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://www.php-groupies.de/blogs/rss.php?version=1.0&amp;type=comments&amp;cid=47</wfw:commentRss>
    
    
</item>
<item rdf:about="http://www.php-groupies.de/blogs/archives/48-guid.html">
    <title>A different kind of static?</title>
    <link>http://www.php-groupies.de/blogs/archives/48-A-different-kind-of-static.html</link>
    <description>
    &lt;p&gt;While actually trying to check for something completely different (more on that later maybe)&lt;br /&gt;
i found that mysql, mysqladmin and other client binaries in my MySQL 5.5 install dir did&lt;br /&gt;
not list libmysqlclient.so as a dependency in ldd output anymore. Looks as if since the&lt;br /&gt;
switch to Cmake it gets statically linked into all the bundled client libraries and so&lt;br /&gt;
increases binary sizes by a factor of about 10x now, and i can&#039;t see any Cmake build&lt;br /&gt;
option that would produce the old behavior either.&lt;/p&gt;

&lt;p&gt;So my /usr/local/mysql-5.5.21/bin directory now uses 130MB instead of the 17MB that&lt;br /&gt;
the /usr/local/mysql-5.1.60/bin one used. Doesn&#039;t sound much by itself, but for &lt;br /&gt;
someone like me who tries to keep as many versions as possible installed in parallel&lt;br /&gt;
for testing purposes it sums up to several GB quickly, and it totally defies the&lt;br /&gt;
purpose of having a shared libmysqlclient.so in the first place ... &lt;img src=&quot;http://www.php-groupies.de/blogs/templates/default/img/emoticons/sad.png&quot; alt=&quot;:-(&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt;&lt;/p&gt;

 
    </description>

    <dc:publisher>PHP, the universe and all the rest</dc:publisher>
    <dc:creator>nospam@example.com (Hartmut Holzgraefe)</dc:creator>
    <dc:subject>
    MySQL, </dc:subject>
    <dc:date>2012-03-12T09:30:55Z</dc:date>
    <wfw:comment>http://www.php-groupies.de/blogs/wfwcomment.php?cid=48</wfw:comment>
        <slash:comments>1</slash:comments>
        <wfw:commentRss>http://www.php-groupies.de/blogs/rss.php?version=1.0&amp;type=comments&amp;cid=48</wfw:commentRss>
    
    
</item>
<item rdf:about="http://www.php-groupies.de/blogs/archives/46-guid.html">
    <title>Fun with partitions and MyISAM, part #2</title>
    <link>http://www.php-groupies.de/blogs/archives/46-Fun-with-partitions-and-MyISAM,-part-2.html</link>
    <description>
    &lt;p&gt;This is part of the reply i got on my &lt;a href=&quot;http://bugs.mysql.com/bug.php?id=64498&quot; onclick=&quot;window.open(this.href, &#039;_blank&#039;); return false;&quot;&gt;bug report&lt;/a&gt; on the ALTER TABLE issue with MyISAM and a large number of partitions from my &lt;a href=&quot;http://www.php-groupies.de/blogs/archives/44-More-fun-with-partitions,-this-time-with-MyISAM.html&quot; onclick=&quot;window.open(this.href, &#039;_blank&#039;); return false;&quot;&gt;previous post&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;This is a design limitation, MyISAM have one file handle open for the .MYI file shared by all instances of one table, and one file handle open for each table instance for the .MYD file. And the ha_partition generic partitioning engine  always open all partitions when opening a table/handler.&lt;/p&gt;

&lt;/blockquote&gt;
&lt;p&gt;So this should not only affect ALTER TABLE but all operations on MyISAM tables with large number of partitions should eventually run into this. Lets try and see what happens ...&lt;/p&gt;

 &lt;br /&gt;&lt;a href=&quot;http://www.php-groupies.de/blogs/archives/46-Fun-with-partitions-and-MyISAM,-part-2.html#extended&quot;&gt;Continue reading &quot;Fun with partitions and MyISAM, part #2&quot;&lt;/a&gt;
    </description>

    <dc:publisher>PHP, the universe and all the rest</dc:publisher>
    <dc:creator>nospam@example.com (Hartmut Holzgraefe)</dc:creator>
    <dc:subject>
    MySQL, </dc:subject>
    <dc:date>2012-03-07T04:29:36Z</dc:date>
    <wfw:comment>http://www.php-groupies.de/blogs/wfwcomment.php?cid=46</wfw:comment>
        <slash:comments>1</slash:comments>
        <wfw:commentRss>http://www.php-groupies.de/blogs/rss.php?version=1.0&amp;type=comments&amp;cid=46</wfw:commentRss>
    
    
</item>
<item rdf:about="http://www.php-groupies.de/blogs/archives/44-guid.html">
    <title>More fun with partitions, this time with MyISAM</title>
    <link>http://www.php-groupies.de/blogs/archives/44-More-fun-with-partitions,-this-time-with-MyISAM.html</link>
    <description>
    
&lt;pre&gt;&lt;code&gt;mysql&amp;gt; CREATE TABLE t1 (id INT PRIMARY KEY ) 
             engine=myisam PARTITION BY HASH(id) PARTITIONS 1000;
Query OK, 0 rows affected (0.18 sec)

mysql&amp;gt; alter table t1 add column v int;
ERROR 1016 (HY000): Can&#039;t open file: &#039;./test/t1.frm&#039; (errno: 24)

mysql&amp;gt; quit
Bye

$ perror 24
OS error code  24:  Too many open files&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Looks as if MyISAM tries to open all the 1000 partition .MYD/.MYI files at once and runs out of file handles during this operation ...&lt;/p&gt;

 
    </description>

    <dc:publisher>PHP, the universe and all the rest</dc:publisher>
    <dc:creator>nospam@example.com (Hartmut Holzgraefe)</dc:creator>
    <dc:subject>
    MySQL, </dc:subject>
    <dc:date>2012-02-29T13:22:59Z</dc:date>
    <wfw:comment>http://www.php-groupies.de/blogs/wfwcomment.php?cid=44</wfw:comment>
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://www.php-groupies.de/blogs/rss.php?version=1.0&amp;type=comments&amp;cid=44</wfw:commentRss>
    
    
</item>
<item rdf:about="http://www.php-groupies.de/blogs/archives/43-guid.html">
    <title>Some fun with partitions and InnoDB ...</title>
    <link>http://www.php-groupies.de/blogs/archives/43-Some-fun-with-partitions-and-InnoDB-....html</link>
    <description>
    &lt;p&gt;Creating or dropping a partitioned table on InnoDB can become a quite expensive operation, on my laptop i&#039;m seeing the following times for a simple table with 100 or 1000 partitions (using 5.1.58 right now as i&#039;m testing on stock Ubuntu 11.10):&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;  mysql&amp;gt; CREATE TABLE t1 (id INT PRIMARY KEY )
               engine=innodb PARTITION BY HASH(id) PARTITIONS 100;
  Query OK, 0 rows affected (5.21 sec)

  mysql&amp;gt; drop table t1;
  Query OK, 0 rows affected (5.11 sec)

  mysql&amp;gt; CREATE TABLE t1 (id INT PRIMARY KEY )
               engine=innodb PARTITION BY HASH(id) PARTITIONS 1000;
  Query OK, 0 rows affected (52.76 sec)&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;So the time to create a partitioned InnoDB table grows linearly with the number of partitions at a &#039;speed&#039; of about 20 partitions per second, and during that time the hard disk LED is always on. The rate for creating regular InnoDB tables on this machine is about 10 tables per second by the way.&lt;/p&gt;

&lt;p&gt;MyIsam on the other had can create around 17 tables per second, and creating a single partitioned MyISAM table only takes about a 10th of a second.&lt;/p&gt;

&lt;p&gt;So what is going on with InnoDB here? First of all from the engines point of view each partition of a partitioned table is an actual table, all the partitioning magic happens on a layer above the storage engine one, and the storage engine only receives handler requests for the actual partition tables involved. On the storage engine layer the actual engines are not aware that these tables are part of a larger partitioned table at all (with the exception of ndbcluster tables, but MySQL Cluster is a different story in this respect anyway).&lt;/p&gt;

&lt;p&gt;So when creating an InnoDB table with 1000 partitions the InnoDB storage engine actually receives 1000 individual requests to create a table. Now what seems to happen is that for each&lt;br /&gt;
created partition/table InnoDB flushes at least its internal data dictionary to disk. Given the constant disk activity and rather low internal table creation rate it may even do a full checkpoint for each table, i haven&#039;t checked the details on this yet. And when dropping a partitioned table the same thing happens in reverse.&lt;/p&gt;

&lt;p&gt;So this may be something to keep in mind when planning to use large numbers of partitions on InnoDB ...&lt;/p&gt;

 
    </description>

    <dc:publisher>PHP, the universe and all the rest</dc:publisher>
    <dc:creator>nospam@example.com (Hartmut Holzgraefe)</dc:creator>
    <dc:subject>
    MySQL, </dc:subject>
    <dc:date>2012-02-29T11:55:36Z</dc:date>
    <wfw:comment>http://www.php-groupies.de/blogs/wfwcomment.php?cid=43</wfw:comment>
        <slash:comments>1</slash:comments>
        <wfw:commentRss>http://www.php-groupies.de/blogs/rss.php?version=1.0&amp;type=comments&amp;cid=43</wfw:commentRss>
    
    
</item>
<item rdf:about="http://www.php-groupies.de/blogs/archives/42-guid.html">
    <title>MySQL features i forgot about #1 : slave_compressed_protocol</title>
    <link>http://www.php-groupies.de/blogs/archives/42-MySQL-features-i-forgot-about-1-slave_compressed_protocol.html</link>
    <description>
    &lt;p&gt;It is probably about time to re-read the MySQL manual end-to-end as i more and more find myself discovering features i either completely forgot about or which i never was aware of in the first place ...&lt;/p&gt;

&lt;p&gt;Todays guest is &lt;a href=&quot;http://dev.mysql.com/doc/refman/5.5/en/replication-options-slave.html#sysvar_slave_compressed_protocol&quot; onclick=&quot;window.open(this.href, &#039;_blank&#039;); return false;&quot;&gt;slave_compressed_protocol&lt;/a&gt;, an option that has probably been there ever since MySQL 3.23 at least (so that i can&#039;t claim that i seem to have missed the ChangeLog entry as i usually do &lt;img src=&quot;http://www.php-groupies.de/blogs/templates/default/img/emoticons/wink.png&quot; alt=&quot;;-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt;&lt;/p&gt;

&lt;p&gt;With slave_compressed_protocol enabled the communication between slave and master uses the MYSQL_OPT_COMPRESS option to compress the protocol stream if both sides support it (and it&#039;s very unlikely to find an installation that does *not* support it these days), so this can be a big savior if your master and slave are at different sites with only limited bandwidth between the two.&lt;/p&gt;

&lt;p&gt;Unfortunately this is a global server option though, IMHO this should be part of the options provided by the CHANGE MASTER command, similar to all the SSL encryption related stuff that is part of CHANGE MASTER.&lt;/p&gt;

&lt;p&gt;Looks as if it is about time for YAFR (Yet Another Feature Request) ...&lt;/p&gt;

 
    </description>

    <dc:publisher>PHP, the universe and all the rest</dc:publisher>
    <dc:creator>nospam@example.com (Hartmut Holzgraefe)</dc:creator>
    <dc:subject>
    MySQL, </dc:subject>
    <dc:date>2012-02-23T05:10:40Z</dc:date>
    <wfw:comment>http://www.php-groupies.de/blogs/wfwcomment.php?cid=42</wfw:comment>
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://www.php-groupies.de/blogs/rss.php?version=1.0&amp;type=comments&amp;cid=42</wfw:commentRss>
    
    
</item>
<item rdf:about="http://www.php-groupies.de/blogs/archives/41-guid.html">
    <title>PHPreboot braindump</title>
    <link>http://www.php-groupies.de/blogs/archives/41-PHPreboot-braindump.html</link>
    <description>
    &lt;p&gt;Looks as if we have the next member in the &amp;quot;I want to become Caliph instead of the Caliph&amp;quot; club: &lt;a href=&quot;http://code.google.com/p/phpreboot/&quot; onclick=&quot;window.open(this.href, &#039;_blank&#039;); return false;&quot;&gt;PHPreboot&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is just a braindump of thoughts on the various bullet points and examples on the projects home page (but i don&#039;t think it&#039;s worth any more time to analyze it and comment on it either):&lt;/p&gt;


&lt;ul&gt;
    &lt;li&gt;&lt;b&gt;less $, less &#039;;&#039; like in javascript&lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Not sure whether this is really an improvement, while $ and ; are not really necessary from a parsers (or lazy typers) point of view they &lt;b&gt;do&lt;/b&gt; carry some context information ... so this is breaking the &amp;quot;The burden shall be on the writer, not the readers&amp;quot; principle IMHO&lt;/p&gt;


&lt;ul&gt;
    &lt;li&gt;&lt;b&gt;secure by default: no eval, no magic quotes/string interpolation&lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Yes, that&#039;s all that needs to be disabled to guarantee secure code ... NOT&lt;/p&gt;

&lt;p&gt;Magic quotes were a bad idea, but for slightly different reasons. eval() by itself is not a bad idea either if used properly, same as with backticks, system(), popen(), ...&lt;/p&gt;

&lt;p&gt;And just by disabling magic quotes and eval() you do not make code secure by default, XSS and SQL injections can still happen without these, and i&#039;d bet that most malicious code injections in vulnerable PHP apps were not using eval() but include/require as attack vector to make PHP execute their own code ... want to forbid these, too?&lt;/p&gt;


&lt;ul&gt;
    &lt;li&gt;&lt;b&gt;full unicode support&lt;/b&gt; &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That&#039;s a good thing, we may just have different ideas of &amp;quot;full&amp;quot; ...&lt;/p&gt;


&lt;ul&gt;
    &lt;li&gt;&lt;b&gt;no from/to string auto-conversion&lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I do like the &amp;quot;to&amp;quot; part of it ... not really sure about the &amp;quot;from&amp;quot; part ...&lt;/p&gt;


&lt;ul&gt;
    &lt;li&gt;&lt;b&gt;a SQL compatible syntax&lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Which SQL dialect? And looking at the code: how would i handle queries against multiple database connections?&lt;/p&gt;


&lt;ul&gt;
    &lt;li&gt;&lt;b&gt;Perl 5 regex literal&lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I personally prefer to write preg_match() literally ... but that may be just me and my PERL allergy ...&lt;/p&gt;


&lt;ul&gt;
    &lt;li&gt;&lt;b&gt;URI/file literal&lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I don&#039;t see that much gain in that one over explicit fopen(), ... calls either&lt;/p&gt;


&lt;ul&gt;
    &lt;li&gt;&lt;b&gt;fast as Java thanks to a runtime profiler/optimizer and JSR 292 API&lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There&#039;s room for improvement in PHP optimizers and op code caches for sure ...&lt;/p&gt;

&lt;p&gt;In my personal use cases a JVM based PHP would actually be a loss though. Most stuff i&#039;m using PHP for these days is medium complex command line stuff (like my code generators), and for most of this my PHP scripts are already done with their job in a time that would not even be sufficient for a JVM to initialize and execute the very first byte code op of my user code&lt;/p&gt;

&lt;p&gt;There&#039;s also the more general issue that when going the way of the JVM you either go bytecode all the way and have to say goodbye to all the PHP extensions that are actually just thin wrappers around native C libraries, re-implement those libraries functionality in a language supported by the JVM or go the way of JNI ...&lt;/p&gt;


&lt;ul&gt;
    &lt;li&gt;&lt;b&gt;provide an embedded database derby and a standalone web server grizzly by default&lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;... instead of SQLite and ?forgot-the-name-of-the-upcoming-integrated-webserver-thingy? ...?&lt;/p&gt;


&lt;ul&gt;
    &lt;li&gt;&lt;b&gt;native XML syntax&lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Sorry, can&#039;t see how that&#039;s &amp;quot;native XML syntax&amp;quot;, PHP and its use of XML processing instruction syntax is as native as you can get, hiding executable code in DATA not so much&lt;/p&gt;


&lt;ul&gt;
    &lt;li&gt;&lt;b&gt;Language as close as possible to PHP&lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Sorry but even that simple example does not really look like PHP to me as all. Maybe part of that is due to the use of &amp;quot;elseif&amp;quot; instead of &amp;quot;else if&amp;quot;. I haven&#039;t seen any PHP code using &amp;quot;elseif&amp;quot; in years, i even had to double check that it works in this context and not just in the IF: ... ELSEIF: ... ENDIF; form.&lt;/p&gt;


&lt;ul&gt;
    &lt;li&gt;&lt;b&gt;native XQuery&lt;/b&gt; &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Again i&#039;m not sure whether i want to have that on the Syntax level ...&lt;/p&gt;


&lt;ul&gt;
    &lt;li&gt;[...]&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So to summarize:&lt;/p&gt;


&lt;ul&gt;
    &lt;li&gt;the language does hardly look like PHP anymore (actually looks more like a PERL/Python chimera to me personally)&lt;/li&gt;
    &lt;li&gt;the language will not be backwards compatible to PHP syntax wise (afaict)&lt;/li&gt;
    &lt;li&gt;the language will not have many of the functionality that PHP gets from native C libraries&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;=&amp;gt; so why should it have the letters PHP in its name at all?&lt;/p&gt;

 
    </description>

    <dc:publisher>PHP, the universe and all the rest</dc:publisher>
    <dc:creator>nospam@example.com (Hartmut Holzgraefe)</dc:creator>
    <dc:subject>
    PHP, </dc:subject>
    <dc:date>2011-10-10T15:22:12Z</dc:date>
    <wfw:comment>http://www.php-groupies.de/blogs/wfwcomment.php?cid=41</wfw:comment>
        <slash:comments>6</slash:comments>
        <wfw:commentRss>http://www.php-groupies.de/blogs/rss.php?version=1.0&amp;type=comments&amp;cid=41</wfw:commentRss>
    
    
</item>
<item rdf:about="http://www.php-groupies.de/blogs/archives/40-guid.html">
    <title>Overriding bind=... in included MySQL option files</title>
    <link>http://www.php-groupies.de/blogs/archives/40-Overriding-bind...-in-included-MySQL-option-files.html</link>
    <description>
    &lt;p&gt;Debian and Ubuntu make use of the &lt;b&gt;!includedir&lt;/b&gt; directive at the end of the packaged &lt;b&gt;my.cnf&lt;/b&gt; to allow for extending and overriding their default configuration without having to modify the distribution config file.&lt;/p&gt;

&lt;p&gt;This is especially nice in combination with configuration tools like &lt;b&gt;puppet&lt;/b&gt; as it is usually much easier to add a file to the system than to modify an existing file.&lt;/p&gt;

&lt;p&gt;I ran into a small gotcha with this though: the default my.cnf binds mysqld to the localhost TCP interface so that it listens IP 127.0.0.1 only. To make the mysql server reachable from other hosts the &lt;b&gt;bind=127.0.0.1&lt;/b&gt; setting needs to be overwritten.&lt;br /&gt;
How to change the binding to a different IP should be obvious, but how to disable an existing binding completely if you want your mysqld to listen on all available interfaces?&lt;/p&gt;

&lt;p&gt;The most obvious would be to simply say&lt;/p&gt;

&lt;p&gt;bind=&lt;/p&gt;

&lt;p&gt;, this does not have any effect though. What needs to be done instead is&lt;/p&gt;

&lt;p&gt;bind=0.0.0.0&lt;/p&gt;

&lt;p&gt;to make mysqld listen on all interfaces again.&lt;/p&gt;

&lt;p&gt;This is obviously a solution for IPv4 only, for allowing incoming connections from all v4 and v6 interfaces allowing &lt;b&gt;bind=&lt;/b&gt; without any argument to reset any existing bindings would probably be more clever?&lt;/p&gt;

 
    </description>

    <dc:publisher>PHP, the universe and all the rest</dc:publisher>
    <dc:creator>nospam@example.com (Hartmut Holzgraefe)</dc:creator>
    <dc:subject>
    MySQL, Puppet, </dc:subject>
    <dc:date>2011-10-04T06:29:10Z</dc:date>
    <wfw:comment>http://www.php-groupies.de/blogs/wfwcomment.php?cid=40</wfw:comment>
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://www.php-groupies.de/blogs/rss.php?version=1.0&amp;type=comments&amp;cid=40</wfw:commentRss>
    
    
</item>
<item rdf:about="http://www.php-groupies.de/blogs/archives/39-guid.html">
    <title>Multiple network adapters in Vagrant VMs</title>
    <link>http://www.php-groupies.de/blogs/archives/39-Multiple-network-adapters-in-Vagrant-VMs.html</link>
    <description>
    &lt;p&gt;For testing some stuff related to MySQL Cluster, port binding and having two network interfaces on the same subnet i needed a bit more than my usual &amp;quot;all nodes on localhost&amp;quot; setup. Looking for a reusable solution i this time did not just simply plug several of my old laptops into the same hup but tried to create a &lt;a href=&quot;http://vagrantup.com/&quot; onclick=&quot;window.open(this.href, &#039;_blank&#039;); return false;&quot;&gt;Vagrant&lt;/a&gt; setup for this.&lt;/p&gt;

&lt;p&gt;This quickly lead to the question how to define multiple network adapters per Vagrant VM. The manual is not too clear about this yet, and the key piece of information is not yet to be seen in the network section but is hiding in the section on port forwarding: the &lt;b&gt;:adapter&lt;/b&gt; option.&lt;/p&gt;

&lt;p&gt;So to define multiple adapters you need to add &lt;b&gt;:adapter =&amp;gt; $value&lt;/b&gt; options on each of the &lt;b&gt;vm.network&lt;/b&gt; lines, with &lt;b&gt;$value&lt;/b&gt; counting up from one, e.g.:&lt;/p&gt;

&lt;p&gt;config.vm.network(&amp;quot;33.33.33.10&amp;quot;, :adapter =&amp;gt; 1);&lt;br /&gt;
    config.vm.network(&amp;quot;33.33.33.20&amp;quot;, :adapter =&amp;gt; 2);&lt;/p&gt;

&lt;p&gt;In my case i need both adapters to be on the same IP subnet. Vagrant (or VirtualBox?) is not clever enough for this yet and will create two distinct host-only networks for this, routing and binding works as expected though as the kernels inside the VMs do not care about (and are not even aware of) this.&lt;/p&gt;

 
    </description>

    <dc:publisher>PHP, the universe and all the rest</dc:publisher>
    <dc:creator>nospam@example.com (Hartmut Holzgraefe)</dc:creator>
    <dc:subject>
    Vagrant, </dc:subject>
    <dc:date>2011-09-17T06:35:29Z</dc:date>
    <wfw:comment>http://www.php-groupies.de/blogs/wfwcomment.php?cid=39</wfw:comment>
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://www.php-groupies.de/blogs/rss.php?version=1.0&amp;type=comments&amp;cid=39</wfw:commentRss>
    
    
</item>

</rdf:RDF>
