<?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>ma.tthi.eu</title>
	<atom:link href="http://ma.tthi.eu/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://ma.tthi.eu/blog</link>
	<description>pense-bête</description>
	<lastBuildDate>Sun, 15 Aug 2010 12:01:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>flash compilation problem : white screen</title>
		<link>http://ma.tthi.eu/blog/2010/06/27/flash-compilation-problem-white-screen/</link>
		<comments>http://ma.tthi.eu/blog/2010/06/27/flash-compilation-problem-white-screen/#comments</comments>
		<pubDate>Sun, 27 Jun 2010 16:31:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://ma.tthi.eu/blog/?p=48</guid>
		<description><![CDATA[if error &#8220;5005: Unknown error optimizing byte code&#8221; and white screen at compilation, we can increase the memory given to the compilator : create the file ~/.MacOSX/environment.plist and copy : &#60;?xml version="1.0" encoding="UTF-8"?&#62; &#60;!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&#62; &#60;plist version="1.0"&#62; &#60;dict&#62; &#60;key&#62;JAVA_TOOL_OPTIONS&#60;/key&#62; &#60;string&#62;-Xmx512m&#60;/string&#62; &#60;/dict&#62; &#60;/plist&#62; then log out for the change to take [...]]]></description>
			<content:encoded><![CDATA[<p>if error &#8220;5005: Unknown error optimizing byte code&#8221; and white screen at compilation, we can increase the memory given to the compilator :</p>
<p>create the file ~/.MacOSX/environment.plist and copy :<br />
<code><br />
&lt;?xml version="1.0" encoding="UTF-8"?&gt;<br />
&lt;!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;<br />
&lt;plist version="1.0"&gt;<br />
&lt;dict&gt;<br />
&lt;key&gt;JAVA_TOOL_OPTIONS&lt;/key&gt;<br />
&lt;string&gt;-Xmx512m&lt;/string&gt;<br />
&lt;/dict&gt;<br />
&lt;/plist&gt;<br />
</code></p>
<p>then log out for the change to take effect</p>
<p>with CS5 we also should modify this file : ~/Library/Application Support/Adobe/Flash CS5/en_US/Configuration/ActionScript3.0/jvm.ini<br />
and change -Xmx128m by -Xmx512m</p>
<p>restart flash and it should be ok</p>
]]></content:encoded>
			<wfw:commentRss>http://ma.tthi.eu/blog/2010/06/27/flash-compilation-problem-white-screen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using a Debian Virtual Machine as local server in OS X (2)</title>
		<link>http://ma.tthi.eu/blog/2010/06/20/using-a-debian-virtual-machine-as-local-server-in-os-x-2/</link>
		<comments>http://ma.tthi.eu/blog/2010/06/20/using-a-debian-virtual-machine-as-local-server-in-os-x-2/#comments</comments>
		<pubDate>Sun, 20 Jun 2010 13:00:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://ma.tthi.eu/blog/?p=41</guid>
		<description><![CDATA[install debian virtualbox preferences &#62; network &#62; adapter : 192.168.3.1 dhcp server : off settings &#62; network : adapter 1 : host-only adapter adapter 2 : NAT settings &#62; storage : CD/DVD : VBoxGuestAdditions restart virtualbox start vm nano /etc/network/interface auto eth0 iface eth0 inet static address 192.168.3.3 netmask 255.255.255.0 auto eth1 iface eth1 inet [...]]]></description>
			<content:encoded><![CDATA[<p>install debian</p>
<p>virtualbox preferences &gt; network &gt;<br />
adapter : 192.168.3.1<br />
dhcp server : off</p>
<p>settings &gt; network :<br />
adapter 1 : host-only adapter<br />
adapter 2 : NAT</p>
<p>settings &gt; storage :<br />
CD/DVD : VBoxGuestAdditions</p>
<p>restart virtualbox</p>
<p>start vm</p>
<p>nano /etc/network/interface<br />
<code>auto eth0<br />
iface eth0 inet static<br />
address 192.168.3.3<br />
netmask 255.255.255.0</code></p>
<p>auto eth1<br />
iface eth1 inet dhcp</p>
<p>(use ifconfig -a to get the right interface name : eth0, eth1, eth2, …)</p>
<p>aptitude install virtualbox-ose-guest-dkms</p>
<p>virtualbox : settings &gt; shared folders &gt; add</p>
<p>rm -f /var/www/*</p>
<p>nano /etc/fstab</p>
<p><code>Sites    /var/www/    vboxsf    defaults,uid=33,gid=33    0    0</code></p>
<p>uid=33, gid=33 -&gt; mount as user www-data so that apache can write to disk (file upload, etc ..)</p>
]]></content:encoded>
			<wfw:commentRss>http://ma.tthi.eu/blog/2010/06/20/using-a-debian-virtual-machine-as-local-server-in-os-x-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>GeekTool for Snow Leopard</title>
		<link>http://ma.tthi.eu/blog/2010/05/11/geektool-for-snow-leopard/</link>
		<comments>http://ma.tthi.eu/blog/2010/05/11/geektool-for-snow-leopard/#comments</comments>
		<pubDate>Tue, 11 May 2010 19:00:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://ma.tthi.eu/blog/?p=35</guid>
		<description><![CDATA[calendrier : cal &#124; sed "s/^/ /;s/$/ /;s/ $(date +%e) / $(date +%e &#124; sed 's/./#/g') /" date : date +'%A %d %B %H:%M:%S' OS : echo `sw_vers -productName` `sw_vers -productVersion` `sw_vers -buildVersion` IP externe : echo "External :" `curl --silent http://checkip.dyndns.org &#124; awk '{print $6}' &#124; cut -f 1 -d "&#60;"` IP ethernet : [...]]]></description>
			<content:encoded><![CDATA[<p>calendrier :<br />
<code>cal | sed "s/^/ /;s/$/ /;s/ $(date +%e) / $(date +%e | sed 's/./#/g') /"</code></p>
<p>date :<br />
<code>date +'%A %d %B %H:%M:%S'</code></p>
<p>OS :<br />
<code>echo `sw_vers -productName` `sw_vers -productVersion` `sw_vers -buildVersion`</code></p>
<p>IP externe :<br />
<code>echo "External :" `curl --silent http://checkip.dyndns.org | awk '{print $6}' | cut -f 1 -d "&lt;"`<br />
</code><br />
IP ethernet :<br />
<code>echo  Ethernet : `ifconfig en0 | grep "inet " | grep -v 127.0.0.1 | awk '{print $2}'`</code></p>
<p>IP airport :<br />
<code>echo  Airport : `ifconfig en1 | grep "inet " | grep -v 127.0.0.1 | awk '{print $2}'`<br />
</code><br />
Wifi :<br />
<code>echo wifi: `system_profiler SPAirPortDataType | grep -A 1 "Current Network Information:" | tail -1`</code></p>
<p>Top :<br />
<code>top -l1 -ocpu -F -R -l2 -n10 | tail -n 11 | cut -c 1-38</code></p>
]]></content:encoded>
			<wfw:commentRss>http://ma.tthi.eu/blog/2010/05/11/geektool-for-snow-leopard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using a Debian Virtual Machine as local server in OS X</title>
		<link>http://ma.tthi.eu/blog/2009/05/10/using-a-debian-virtual-machine-as-local-server-in-os-x/</link>
		<comments>http://ma.tthi.eu/blog/2009/05/10/using-a-debian-virtual-machine-as-local-server-in-os-x/#comments</comments>
		<pubDate>Sun, 10 May 2009 17:08:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[os x]]></category>

		<guid isPermaLink="false">http://ma.tthi.eu/blog/?p=8</guid>
		<description><![CDATA[old -&#62; updated version This post will explain how to use a Debian virtual machine as a local server in OS X instead of the LAMP packaged by Apple. If you&#8217;re like me and use OS X as your workstation but have a Debian production server, it could be very useful to be able to [...]]]></description>
			<content:encoded><![CDATA[<p><span style="color: #ff0000;"><strong>old -&gt; <a href="http://ma.tthi.eu/blog/2010/06/20/using-a-debian-virtual-machine-as-local-server-in-os-x-2/">updated version</a></strong></span></p>
<p>This post will explain how to use a Debian virtual machine as a local server in OS X instead of the LAMP packaged by Apple.</p>
<p>If you&#8217;re like me and use OS X as your workstation but have a Debian production server, it could be very useful to be able to test your websites locally directly into a Debian server similar to your production one. To achieve that, we are going to install a Debian virtual machine in OS X and make them communicate by NFS. That way we will be able to develop with our favorite tool (like <a href="http://macromates.com/">textmate</a>) in OS X with our websites in ~/Sites being read by the Debian VM</p>
<p>1) First we need to install a VM engine (like <a href="http://www.virtualbox.org/">VirtualBox</a>) and install a Debian Linux with Apache, PHP. etc &#8230;</p>
<p>[EDIT]<br />
By default the network adapter is in NAT mode and get its IP directly from your router, which means that you can&#8217;t access your VM if you&#8217;re not connected.<br />
By using the &#8220;host-only adapter&#8221; mode you can access your VM at 192.168.56.3 (default IP, you can change that in VirtualBox preferences) with or without being connected to a network<br />
-&gt; &#8220;Settings / Network / Adapter 1 / Attached To&#8221; select &#8220;host-only Adapter&#8221;<br />
[/EDIT]</p>
<p>[EDIT 2]<br />
you can set up a second adapter as NAT to give internet access to the VM<br />
-&gt; &#8220;Settings / Network / Adapter 2 / Attached To &#8220;NAT&#8221;</p>
<p>and configure /etc/network/interface according :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">auto eth0
iface eth0 inet dhcp
&nbsp;
auto eth1
iface eth1 inet dhcp</pre></div></div>

<p>(use ifconfig -a to get the right interface name : eth0, eth1, eth2, &#8230;)<br />
[/EDIT 2]</p>
<p>2) Setup NFS export on OS X (you will need to be root for that) to allow NFS connection for the OS X user.</p>
<p>You need to know your user uid and gid. You can get them by typing (as your user, not as root) :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">id</pre></div></div>

<p>and you should get something like that :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">uid=501(myusername) gid=20(staff)</pre></div></div>

<p>Now setup the NFS export :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">nano</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>exports</pre></div></div>

<p>and add this line :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">/Users/myusername/Sites -network=192.168.0.0 -mask=255.255.0.0 -rw,no_root_squash,anonuid=501, anongid=20</pre></div></div>

<p>then type</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">nfsd update</pre></div></div>

<p>and</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">showmount <span style="color: #660033;">-e</span></pre></div></div>

<p>if the NFS export is correct you should see :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">/Users/myusername/Sites              192.168.0.0</pre></div></div>

<p>3) Now on the Debian side we create the same user (myusername, uid=501, gid=20) :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">adduser myusername <span style="color: #660033;">--home</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>myusername <span style="color: #660033;">--shell</span> <span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">bash</span> <span style="color: #660033;">--uid</span> <span style="color: #000000;">501</span> <span style="color: #660033;">--gid</span> <span style="color: #000000;">20</span></pre></div></div>

<p>and we create a folder www in myusername home folder which will be the mount point for the NFS connection :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>myusername<span style="color: #000000; font-weight: bold;">/</span>www</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">chown</span> myusername: <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>myusername<span style="color: #000000; font-weight: bold;">/</span>www</pre></div></div>

<p>we install portmap and nfs-common:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">aptitude</span> <span style="color: #c20cb9; font-weight: bold;">install</span> portmap nfs-common</pre></div></div>

<p>and edit /etc/fstab to automatically mount the NFS connection at boot time :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">nano</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>fstab</pre></div></div>

<p>and add this line (machostname is the OS X hostname) :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">192.168.56.1:/Users/myusername/Sites /home/myusername/www nfs user,rw,exec 0 0</pre></div></div>

<p>reboot (the Debian VM)</p>
<p>after reboot is completed you should be able to access the /Users/myusername/Sites content from OS X in the /home/myusername/www in the Debian VM</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ssh</span> 192.168.56.3 - l myusername</pre></div></div>

<p>5) configure apache</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">nano</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>sites-available<span style="color: #000000; font-weight: bold;">/</span>default</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">NameVirtualHost *
&nbsp;
ServerAdmin webmaster@localhost
DocumentRoot /home/myusername/www</pre></div></div>

<p>and reload apache configuration :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d apache2 reload</pre></div></div>

<p>voila, you should be able to see the website in Sites by going to the url http://192.168.56.3</p>
]]></content:encoded>
			<wfw:commentRss>http://ma.tthi.eu/blog/2009/05/10/using-a-debian-virtual-machine-as-local-server-in-os-x/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>PageFlip with shadows</title>
		<link>http://ma.tthi.eu/blog/2009/05/07/pageflip-with-shadows/</link>
		<comments>http://ma.tthi.eu/blog/2009/05/07/pageflip-with-shadows/#comments</comments>
		<pubDate>Wed, 06 May 2009 23:25:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[flash]]></category>

		<guid isPermaLink="false">http://ma.tthi.eu/blog/?p=3</guid>
		<description><![CDATA[I took the very good PageFlip class from Didier Brun and added support for shadows. It adds 3 different shadows : one shadow on the fixed page side one shadow on the inside of the flipped page one shadow on the outside of the flipped page It doesn&#8217;t work with the vertical mode (!ish) but [...]]]></description>
			<content:encoded><![CDATA[<p>I took the very good <a href="http://www.bytearray.org/?p=77">PageFlip class from Didier Brun</a> and added support for shadows. It adds 3 different shadows :</p>
<ol>
<li>one shadow on the fixed page side</li>
<li>one shadow on the inside of the flipped page</li>
<li>one shadow on the outside of the flipped page</li>
</ol>
<p>It doesn&#8217;t work with the vertical mode (!ish) but works ok with the horizontal mode</p>
<p><a href="http://ma.tthi.eu/dev/pageflip/">demo</a></p>
<p><a href="http://ma.tthi.eu/dev/pageflip/PageFlip.as.zip">download source</a></p>
<p><a href="http://ma.tthi.eu/dev/pageflip/demo.src.zip">download demo source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://ma.tthi.eu/blog/2009/05/07/pageflip-with-shadows/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>
