<?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>diederickdevries.net &#187; cool stuff</title>
	<atom:link href="http://www.diederickdevries.net/blog/category/cool-stuff/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.diederickdevries.net/blog</link>
	<description>Of penguins and coffee (mostly).</description>
	<lastBuildDate>Fri, 03 Feb 2012 17:08:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Java 3d in a NetBeans Platform Application</title>
		<link>http://www.diederickdevries.net/blog/2011/11/12/java-3d-in-a-netbeans-platform-application/</link>
		<comments>http://www.diederickdevries.net/blog/2011/11/12/java-3d-in-a-netbeans-platform-application/#comments</comments>
		<pubDate>Sat, 12 Nov 2011 11:25:31 +0000</pubDate>
		<dc:creator>diederick</dc:creator>
				<category><![CDATA[cool stuff]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[j3d]]></category>
		<category><![CDATA[j3dcore]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[java3d]]></category>
		<category><![CDATA[netbeans]]></category>

		<guid isPermaLink="false">http://www.diederickdevries.net/blog/?p=1192</guid>
		<description><![CDATA[If you want an excellent introduction into Java 3D, look no further than here. I was following the tutorial I found there to get started with what looked to me as the perfect way of spending a Friday evening, when, somewhere at the end, it told me that: (&#8230;) it does not mix very well [...]]]></description>
			<content:encoded><![CDATA[<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.diederickdevries.net%2Fblog%2F2011%2F11%2F12%2Fjava-3d-in-a-netbeans-platform-application%2F&amp;title=Java%203d%20in%20a%20NetBeans%20Platform%20Application" id="wpa2a_2"><img src="http://www.diederickdevries.net/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><p>If you want an excellent introduction into Java 3D, look no further than <a href="http://www.java3d.org/tutorial.html">here</a>. I was following the tutorial I found there to get started with what looked to me as the perfect way of spending a Friday evening, when, somewhere at the end, it told me that:</p>
<blockquote><p>(&#8230;) <span style="font-family: TIMES; font-size: small;">it does not mix very well with Sun.s swing user interface components. These components are called &#8220;lightweight&#8221; Lightweight components can be hidden by a Canvas3D even if they are supposed to be at the front.</span></p></blockquote>
<p>Obviously, I had been planning on embedding hugely impressive 3D animations into a NetBeans Platform Application, and I was not going to be disappointed, so I fired up NetBeans and did it anyway. Here&#8217;s how.</p>
<p>Preconditions: The j3dcore JAR files are downloaded and unpacked.  You can find them <a href="http://java3d.java.net/binary-builds.html">here</a>. I never trust generic Linux installers, because I have no idea what distro those people had in mind when creating them. So I chose one from the zip binaries and ignored the installers. Select the appropriate one for your machine. Unpack the zip file. There&#8217;s a second zip file inside. Unpack it too. Put the JAR files and the <code>.so</code> file somewhere where you want to keep them.</p>
<p>There appears to exist a NetBeans <a href="http://plugins.netbeans.org/plugin/32144/java-3d">plugin</a> for java-3d, but my NetBeans (7.0.1) didn&#8217;t find it, and at least one user comment indicates massive issues, so I didn&#8217;t bother with it.</p>
<ol>
<li>Create a new Application: File -&gt; New Project. In the Wizard, under Choose Project, select NetBeans Modules -&gt; NetBeans Platform Application and click Next. Enter the name of the application. I called it Test3D. Click Finish.</li>
<li>The j3dcore JAR files have to be wrapped into a Module. Expand the Test3D project node, right click Modules and select Add New. Use j3dcore as your project name and click Next.  Use net.java.j3dcore as the Module&#8217;s code name base.</li>
<li>Right click the j3dcore module node and choose Properties. Under Libraries, click the Wrapped JARs tab and click Add JAR. Navigate to the j3dcore JAR files, select them all (hold shift or ctrl) and click OK.</li>
<li>You now have a library wrapper module, but you lack the shared object file that will allow them to use you graphics adapter. In Test3D, expand the Important Files node. Open the Project Properties file, and add the following line:
<p><code>run.args.extra=-J-Djava.library.path=&lt;the path to the location of your .so file&gt;</code></p>
<p>Do not include the name of the file itself. Be sure to add this to the Project Properties file of your main project, Test3D, and not the wrapper module. It has its own Project Properties file.</li>
<li>Add a new module that creates and displays your 3D scene. Right click Modules under Test3D and click Add New. Enter a name. I chose Universe. Enter your code name base and click Finish.</li>
<li>Add a new TopComponent. Right click the Universe node and click New -&gt; Other. In the New File wizard, select Module Development -&gt; Window. Select Editor as Window Placement and select Open on Application Start. Click Next. Enter UniverseTopComponent after Class Name Prefix and click Finish.</li>
<li>Open UniverseTopComponent. In the Design View, add a JPanel that fully covers the TopComponent. Right click it, select Change Variable Name and enter myUniverse. Right click it again, choose Set Layout -&gt; Border Layout.</li>
<li>Switch to the Source Editor, and change the constructor into this:</li>
</ol>
<blockquote><blockquote>
<pre class="brush: java">
    public UniverseTopComponent() {

        initComponents();
        setName(NbBundle.getMessage(UniverseTopComponent.class,
                &quot;CTL_UniverseTopComponent&quot;));
        setToolTipText(NbBundle.getMessage(UniverseTopComponent.class,
                &quot;HINT_UniverseTopComponent&quot;));

        GraphicsConfiguration config = SimpleUniverse.getPreferredConfiguration();
        Canvas3D canvas = new Canvas3D(config);
        myUniverse.add(canvas, BorderLayout.CENTER);        

        BranchGroup group = new BranchGroup();

        Sphere sphere = new Sphere(0.2f);
        group.addChild(sphere);

        Color3f lightColor = new Color3f(1.8f, 0.1f, 0.1f);
        BoundingSphere bounds =
                new BoundingSphere(new Point3d(0.0, 0.0, 0.0), 100.0);

        Vector3f lightDirection = new Vector3f(4.0f, -7.0f, -12.0f);
        DirectionalLight light = new DirectionalLight(lightColor, lightDirection);
        light.setInfluencingBounds(bounds);
        group.addChild(light);

        SimpleUniverse universe = new SimpleUniverse(canvas);
        universe.getViewingPlatform().setNominalViewingTransform();
        universe.addBranchGraph(group);

    }
</pre>
</blockquote>
</blockquote>
<ol start="9">
<li>Right click the editor window and select Fix Imports from the popup menu. Then build and run the project. Your output should look like this:</li>
</ol>
<div id="attachment_1200" class="wp-caption aligncenter" style="width: 548px"><a href="http://www.diederickdevries.net/blog/2011/11/12/java-3d-in-a-netbeans-platform-application/test3d/" rel="attachment wp-att-1200"><img class="size-full wp-image-1200" title="test3d" src="http://www.diederickdevries.net/blog/wp-content/uploads/2011/11/test3d.png" alt="Screenshot Test3d Example Application" width="538" height="495" /></a><p class="wp-caption-text">Test3D with Universe Window</p></div>
<p>Conclusion: it is possible to embed a Java 3D scene into a NetBeans Platform Application.</p>

]]></content:encoded>
			<wfw:commentRss>http://www.diederickdevries.net/blog/2011/11/12/java-3d-in-a-netbeans-platform-application/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Arch on an Asus U36JC Notebook</title>
		<link>http://www.diederickdevries.net/blog/2011/10/20/installing-arch-on-an-asus-u36jc-notebook/</link>
		<comments>http://www.diederickdevries.net/blog/2011/10/20/installing-arch-on-an-asus-u36jc-notebook/#comments</comments>
		<pubDate>Thu, 20 Oct 2011 16:29:05 +0000</pubDate>
		<dc:creator>diederick</dc:creator>
				<category><![CDATA[cool stuff]]></category>
		<category><![CDATA[gadgets]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[acpi]]></category>
		<category><![CDATA[arch]]></category>
		<category><![CDATA[asus]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[notebook]]></category>
		<category><![CDATA[nvidia]]></category>
		<category><![CDATA[suspend]]></category>
		<category><![CDATA[windows7]]></category>

		<guid isPermaLink="false">http://www.diederickdevries.net/blog/?p=1044</guid>
		<description><![CDATA[Last weekend, I bought an Asus Pro36s notebook, also known as a U36JC. It features a quad core 64 bit Intel Core i5-2410M CPU at 2.3 Ghz, 4 GB DDR3 RAM, a 500 GB hard drive and an Nvidia GeForce GT 520M video adaptor. It weighs less than 1.5 kilos (that&#8217;s including batteries) and is [...]]]></description>
			<content:encoded><![CDATA[<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.diederickdevries.net%2Fblog%2F2011%2F10%2F20%2Finstalling-arch-on-an-asus-u36jc-notebook%2F&amp;title=Installing%20Arch%20on%20an%20Asus%20U36JC%20Notebook" id="wpa2a_4"><img src="http://www.diederickdevries.net/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><p>Last weekend, I bought an <a href="http://www.asus.com/Notebooks/Superior_Mobility/U36JC/">Asus Pro36s</a> notebook, also known as a U36JC. It features a quad core 64 bit <a href="http://ark.intel.com/products/52224">Intel Core i5-2410M</a> CPU at 2.3 Ghz, 4 GB DDR3 RAM, a 500 GB hard drive and an Nvidia <a href="http://www.nvidia.com/object/product-geforce-gt-520m-us.html">GeForce GT 520M</a> video adaptor. It weighs less than 1.5 kilos (that&#8217;s including batteries) and is somewhat smaller than the Vaio, which is just what I wanted.</p>
<p><object width="640" height="360" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="src" value="http://www.youtube.com/v/FrKgrsPVkVo&amp;hl=zh_TW&amp;feature=player_embedded&amp;version=3" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><embed width="640" height="360" type="application/x-shockwave-flash" src="http://www.youtube.com/v/FrKgrsPVkVo&amp;hl=zh_TW&amp;feature=player_embedded&amp;version=3" allowFullScreen="true" allowScriptAccess="always" allowfullscreen="true" allowscriptaccess="always" /></object></p>
<p>The notebook came with Microsoft <a href="http://windows.microsoft.com/en-US/windows7/products/home">Windows 7</a> installed, but obviously I want to use it with my favourite Linux distro, <a href="http://www.archlinux.org/">Arch</a>. Still, since I had paid good money for the Windows installation and you never know when it comes in <a title="Tech support" href="http://www.diederickdevries.net/blog/2009/06/17/tomtom-home-wont-install-solution/">handy</a>, I decided to make it a dual boot machine.</p>
<p>Installing Linux on a notebook nowadays is not as hard as it <a href="http://www.diederickdevries.net/armada/">used to be</a>. After putting Arch on an Asus U36JC, most of it works out of the box, that means, without it needing any work at all beyond installing Arch and KDE. This includes:</p>
<ul>
<li>FN-keys F1 through F12</li>
<li>Media keys (FN with cursor keys)</li>
<li>USB 2 and USB 3 ports</li>
<li>VGA out (see below)</li>
<li>HDMI out (see below)</li>
<li>SD card slot (accepts SD-HC cards too)</li>
<li>Wired and wireless network (using <a href="https://wiki.archlinux.org/index.php/NetworkManager">networkmanager</a>)</li>
</ul>
<p>Some of these still need some configuring, but the way to do that is a matter of taste. For instance: I configured the multi media keys in <a href="http://qmmp.ylsoftware.com/index_en.php">qmmp</a>, my favourite music player, but you might use something else. So what follows is a description of those parts of the installation and configuration that needed some thinking before they worked. I explain what choices were made and how I came to them, and link to pages on the Arch wiki with step-by-step guides on how to implement them.</p>
<h3>Task 1: Installation from USB</h3>
<p>The notebook doesn&#8217;t have an optical drive, so I had to install Arch from a USB drive. Normally this shouldn&#8217;t be that hard. Still, after I had <a href="https://wiki.archlinux.org/index.php/USB_Installation_Media">created</a> a bootable USB disk with the Arch ISO image, it eluded me for a while how to actually boot the machine from it. The BIOS settings menu, entered by holding F2 during boot, has a option called Boot Option Priorities. However, before I actually inserted the USB drive, it only listed the hard drive as an option. And even then the machine kept booting Windows, ignoring the priority settings I had made.</p>
<p>I read in the eManual PDF that holding ESC while booting would allow me to select the boot device to boot from. That worked.</p>
<h3>Task 2: Installing a base Arch system</h3>
<p>Early in the Arch installation process, the hard drive must be partioned and mounted. Originally the hard drive had three partitions: 1 MB with unused space, 28 MB for Windows recovery purposes, 200 GB for Windows and the rest was formatted as VFAT and labeled DATA.</p>
<p>Since that last partition wasn&#8217;t actually used by Windows, I decided to use its space for Arch. I remove the DATA partition and created a primary boot partition of 100 MB and three logical partitions, 25 GB for root, 4 MB for swap and the rest, 244 GB, for home.</p>
<p>Installing grub on <code>/dev/sda</code> presented no problems. The Windows menu entry in <code>/boot/grub/menu.lst</code> looks like this:</p>
<pre class="brush: php">
# (2) Windows
title Windows
rootnoverify (hd0,1)
chainloader +1
</pre>
<p><code>hd0,1</code> is the second partition on drive 0, or <code>sda2</code>, which is the partition Windows is installed on. The <code>makeactive</code> directive that is in the file&#8217;s example has to be removed or commented out for Windows 7.</p>
<h3>Task 3: Graphics environment</h3>
<p>After booting into Arch I found that the wired network had been correctly configured. I created a user account for myself and set up <a href="https://wiki.archlinux.org/index.php/Secure_Shell#Installing_OpenSSH">ssh</a> and <a href="https://wiki.archlinux.org/index.php/Yaourt#Installation">yaourt</a>. I use yaourt because I find it very convenient to access binary and source packages using just one command.</p>
<p>The notebook has an Nvidia graphics adapter, but it is configured in a hybrid configuration with a much less power hungry Intel graphics chip. Nvidia appears to have no plans supporting this on Linux, so simply installing the Nvidia driver didn&#8217;t work. Instead, I needed the Intel drivers and <a href="https://wiki.archlinux.org/index.php/Bumblebee#About_Bumblebee">Bumblebee</a>.</p>
<p>After installing that I installed <a href="https://wiki.archlinux.org/index.php/KDE#Full_install">KDE</a>, Gimp, LibreOffice, Xine, Qmmp and a few more of my favourite applications.</p>
<div id="attachment_1057" class="wp-caption aligncenter" style="width: 398px"><a href="http://www.diederickdevries.net/blog/2011/10/20/installing-arch-on-an-asus-u36jc-notebook/asusu36jc/" rel="attachment wp-att-1057"><img class="size-medium wp-image-1057" title="asusU36JC" src="http://www.diederickdevries.net/blog/wp-content/uploads/2011/10/asusU36JC-300x249.jpg" alt="" width="388" height="322" /></a><p class="wp-caption-text">My Asus U36JC notebook running KDE4.</p></div>
<h3>Task 4: Suspend</h3>
<p>Suspend-to-RAM, letting the notebook fall asleep quickly and making it wake up quickly again, is very useful for conserving battery power. Unfortunately, it didn&#8217;t really work out of the box. Instead of suspending, the notebook froze, showing a non blinking cursor at the top left. I tried various approaches but the solution escaped me for <a href="https://bbs.archlinux.org/viewtopic.php?id=127925">days</a>.</p>
<p>I found an Ubuntu site that offered a solution that made sense, but didn&#8217;t appear to work. In the end, I found a line in my dmesg output warning me about the mei kernel module. It appeared that if I unloaded it and implemented the Ubuntu solution, suspend-to-RAM worked. Summarising:</p>
<ol>
<li>Ditch the mei module by <a href="https://wiki.archlinux.org/index.php/Kernel_modules#Blacklisting">blacklisting</a> it. According to my dmesg output it it not safe to use. <a href="http://comments.gmane.org/gmane.linux.kernel/1153959">This</a> thread seems to confirm that.</li>
<li>Put a file called <code>20_custom-ehci_hcd</code> inside <code>/etc/pm/sleep.d/</code>. To do that, follow the instructions <a href="http://thecodecentral.com/2011/01/18/fix-ubuntu-10-10-suspendhibernate-not-working-bug">here</a>.</li>
</ol>
<p>After I had sorted that out, I needed only two more things for suspend-to-disk:</p>
<ol>
<li>Add <code>resume=/dev/sdaX</code> to the kernel line of the first option in <code>/boot/grub/menu.lst</code>, where X stands for the partition number of your swap drive, 6 in my case. Instructions are <a href="https://wiki.archlinux.org/index.php/Pm-utils#Hibernation_.28suspend2disk.29">here</a>.</li>
<li>Add the resume hook to the <code>HOOKS</code> variable in <code>/etc/mkinitcpio.conf</code>. Instructions are <a href="https://wiki.archlinux.org/index.php/Pm-utils#Resume_Hook">here</a>.</li>
</ol>
<h3>Task 5: Ondemand governor</h3>
<p>The next thing to look into was CPU speed governing. Despite the fact that KDE is supposed to have the CPU always on &#8216;ondemand&#8217;, I noticed that the CPU was constantly on full speed, so I installed <a href="https://wiki.archlinux.org/index.php/CPU_Frequency_Scaling#cpufrequtils">cpufrequtils</a>. It appeared that after booting into KDE the CPU was indeed always in performance mode. To remedy this, I configured cpufreq as a daemon to always default to ondemand, by following <a href="https://wiki.archlinux.org/index.php/CPU_Frequency_Scaling#Daemon">these</a> instructions.</p>
<h3>Task 6: Fixing the camera orientation</h3>
<p>The notebook has a camera sitting at the top of the screen panel, centred just above the screen. It works out of the box, but it appears Asus has installed the camera upside down. Why they would do that is beyond me. <del datetime="2012-02-03T16:54:00+00:00"><a href="http://hansdegoede.livejournal.com/9761.html">v4l-utils</a> Is supposed to be able to handle this problem, but at least with this notebook it doesn&#8217;t appear to work.</del> I have sent an email to Gegror Jasny, who is maintaining v4l, a library that can fix this. He emailed me back with a versions 8.6 and 9.0 (testing) of the project, which included data I had sent him. It worked perfectly, so as soon as he makes a release and the Arch package is updated, this will be fixed.</p>
<p><del datetime="2012-02-03T16:54:00+00:00">It all depends on what you&#8217;re using the camera for. </del>If you&#8217;re using <a href="http://kopete.kde.org/">Kopete</a>, you can go to Settings -&gt; Video -&gt; Options and select vertical as well as horizontal mirroring to turn the image 180 degrees.</p>
<p>Or using <a href="http://www.mplayerhq.hu/">mplayer</a>:</p>
<pre># mplayer tv:// -tv driver=v4l2 -flip</pre>
<p>Obviously, all this costs CPU power. Using mplayer in full screen mode you can even see yourself blink. And to think that this is only needed because the Asus people installed the camera the wrong way. :rolleyes:</p>
<h3>Task 7: Synaptics touchpad</h3>
<p>I don&#8217;t have very special requirements for a touchpad, but I&#8217;d like to be able to drag stuff by double tapping and then dragging with only one finger and vertical scrolling by dragging a finger along the right edge. This didn&#8217;t work out of the box. Still, doing that is so easy that I only added it here for completion. First, I installed the driver:</p>
<p><code># yaourt -S xf86-input-synaptics</code></p>
<p>Then I added a single line to /etc/X11/xorg.conf.d/10-synaptics.conf:</p>
<pre class="brush: php">
Section &quot;InputClass&quot;
        Identifier &quot;touchpad catchall&quot;
        Driver &quot;synaptics&quot;
        MatchIsTouchpad &quot;on&quot;
        MatchDevicePath &quot;/dev/input/event*&quot;
        Option &quot;TapButton1&quot; &quot;1&quot;
        Option &quot;TapButton2&quot; &quot;3&quot;
        Option &quot;TapButton3&quot; &quot;2&quot;
        Option &quot;VertEdgeScroll&quot; &quot;on&quot;
EndSection
</pre>
<h3>Task 8: Hard drive spin down</h3>
<p>One of the more annoying habits of the notebook is that the default hard drive power saving setting is too aggressive. The hard drive keeps spinning down all the time, so that lots of times the notebook appears frozen for a second or two when the hard drive is needed. Also, some low level processes use the hard drive periodically, resulting in audible clicking sounds every few seconds.</p>
<p>To avoid this, I installed laptop mode tools and added it to my <code>/etc/rc.conf</code>:</p>
<pre># yaourt -S laptop-mode-tools
# sudo vim /etc/rc.conf</pre>
<pre class="brush: php">
DAEMONS=(hwclock syslog-ng dbus !hal laptop-mode avahi-daemon networkmanager sshd sensors @crond @bumblebee @cups @alsa @cpufreq @mysqld)
</pre>
<p>Then I changed the default spin down value in <code>/etc/laptop-mode/laptop-mode.conf</code> to 128. This is a good value between never spinning down at all and spinning down too often.</p>
<pre># sudo vim /etc/laptop-mode/laptop-mode.conf</pre>
<pre class="brush: php">
#
# Power management for HD (hdparm -B values)
#
BATT_HD_POWERMGMT=128
LM_AC_HD_POWERMGMT=254
NOLM_AC_HD_POWERMGMT=254
</pre>
<p>One thing that accesses my hard drive a lot is ext4&#8242;s journalling program. To prevent it from doing that, I added <code>commit=600</code> to my <code>/etc/fstab</code> entries for <code>/home</code> and <code>/</code>:</p>
<pre class="brush: php">
UUID=...       /       ext4    defaults,noatime,commit=600     0       1
UUID=...       /home   ext4    defaults,noatime,commit=600     0       1
</pre>
<p>The <code>noatime</code> attribute specifies that the last access time of every file is not recorded. This significantly speeds up hard drive performance.</p>
<h3>A note on the HDMI and VGA ports</h3>
<p>When the computer is booted while connected to a second monitor or TV, via either the VGA or HDMI ports, the screen&#8217;s contents will be duplicated on that screen. The second screen&#8217;s resolution appears to be leading. KDE&#8217;s control centre however will allow the user to configure this behaviour. Go to Hardware->Screen and monitor->Multiple Monitors. I am not sure if and how this works in other environments.</p>
<p>After updating to KDE 4.7.3 last weekend, I noticed that even when I connected the HDMI port to my TV after the notebook had already booted, a pop up came up that told me that a second monitor had been detected. It then took me to the KDE control centre section mentioned above. I didn&#8217;t find any reference to this in the KDE 4.7.3 release notes, so this could also work with previous releases.</p>
<p>VGA is <a href="http://www.techsupportforum.com/forums/f25/what-is-hot-swappable-8571.html">not</a> supposed to be hot pluggable, so I&#8217;m not going to look into that.</p>
<h3>Concluding remarks</h3>
<p>It took a few days of searching and trying out various solutions to get suspend-to-RAM to work, the hybrid graphics setup is not ideal, and the camera is upside-down. But most of the notebook works out of the box. FN-keys, networking, and also the camera.</p>
<p>Whatever notebook you&#8217;re going to put Linux on, there will probably always be a few drawbacks. Notebooks get smaller, faster, cool better and need less power every year, so I imagine that manufacturers will need more and more hacks to make all that work. When you&#8217;re using the proprietary OS that came pre-installed, you&#8217;ll probably never notice these things but if you want all the advantages of Linux, you will have to deal with them.</p>
<p>The Asus U36JC is in my opinion a pretty decent notebook to use with Linux, or at least with Arch. It is fast, light, subtle in appearance and with a few minor tweaks can be turned into a very powerful mobile Linux platform.</p>
<h5>Updates:</h5>
<ol>
<li>Oct 20, 2011: Initial publication.</li>
<li>Oct 21, 2011: Added Task 7.</li>
<li>Oct 29, 2011: Added Task 8.</li>
<li>Nov 17, 2011: Added a note on the HDMI and VGA ports.</li>
<li>Feb 3, 2012: Updated the entry about v4l entry in task 6.</li>
</ol>

]]></content:encoded>
			<wfw:commentRss>http://www.diederickdevries.net/blog/2011/10/20/installing-arch-on-an-asus-u36jc-notebook/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Boinc milestone</title>
		<link>http://www.diederickdevries.net/blog/2011/09/10/boinc-milestone/</link>
		<comments>http://www.diederickdevries.net/blog/2011/09/10/boinc-milestone/#comments</comments>
		<pubDate>Fri, 09 Sep 2011 22:24:39 +0000</pubDate>
		<dc:creator>diederick</dc:creator>
				<category><![CDATA[cool stuff]]></category>
		<category><![CDATA[science]]></category>
		<category><![CDATA[boinc]]></category>
		<category><![CDATA[boincstats]]></category>
		<category><![CDATA[docking@home]]></category>
		<category><![CDATA[hiv]]></category>

		<guid isPermaLink="false">http://www.diederickdevries.net/blog/?p=1002</guid>
		<description><![CDATA[Another Boinc milestone for me: 250.000 points. According to Boincstats, about half of that I got for calculations for the Docking@Home project. In the last week, this is even 93%: From their website: Docking@Home is a project which uses Internet-connected computers to perform scientific calculations that aid in the creation of new and improved medicines. [...]]]></description>
			<content:encoded><![CDATA[<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.diederickdevries.net%2Fblog%2F2011%2F09%2F10%2Fboinc-milestone%2F&amp;title=Boinc%20milestone" id="wpa2a_6"><img src="http://www.diederickdevries.net/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><p>Another <a title="Boinc milestone: 100.000 points" href="http://www.diederickdevries.net/blog/2010/11/14/boinc-milestone-100-000-points/">Boinc</a> milestone for me: 250.000 points. According to <a href="http://nl.boincstats.com/">Boincstats</a>, about half of that I got for calculations for the <a href="http://docking.cis.udel.edu/">Docking@Home</a> project. In the last week, this is even 93%:</p>
<div id="attachment_1003" class="wp-caption aligncenter" style="width: 662px"><a href="http://www.diederickdevries.net/blog/2011/09/10/boinc-milestone/chart_nl_bo_object_pie3dweekcredits_users_212435/" rel="attachment wp-att-1003"><img class="size-full wp-image-1003" title="chart_nl_bo_object_pie3dweekcredits_users_212435" src="http://www.diederickdevries.net/blog/wp-content/uploads/2011/09/chart_nl_bo_object_pie3dweekcredits_users_212435.gif" alt="" width="652" height="317" /></a><p class="wp-caption-text">Boinc credits for 2011W35</p></div>
<p>From their website:</p>
<blockquote><p>Docking@Home is a project which uses Internet-connected computers to perform scientific calculations that aid in the creation of new and improved medicines. The project aims to help cure diseases such as Human Immunodeficiency Virus (HIV).</p></blockquote>
<p>Next milestone will be around November 9th next year,  when I will reach 500.000 points.</p>

]]></content:encoded>
			<wfw:commentRss>http://www.diederickdevries.net/blog/2011/09/10/boinc-milestone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Horizons Ice Hunters</title>
		<link>http://www.diederickdevries.net/blog/2011/06/25/new-horizons-ice-hunters/</link>
		<comments>http://www.diederickdevries.net/blog/2011/06/25/new-horizons-ice-hunters/#comments</comments>
		<pubDate>Sat, 25 Jun 2011 11:49:27 +0000</pubDate>
		<dc:creator>diederick</dc:creator>
				<category><![CDATA[cool stuff]]></category>
		<category><![CDATA[science]]></category>
		<category><![CDATA[KBOs]]></category>
		<category><![CDATA[new horizons]]></category>

		<guid isPermaLink="false">http://www.diederickdevries.net/blog/?p=972</guid>
		<description><![CDATA[Between 2004 and 2008 I used to work for a lab of  the Netherlands Cancer Institute, where scientists crystallised proteins to be able model them. Crystallization is a neat way of lining them up perfectly. This is necessary because they are so small that if you measure just one of them, you don&#8217;t get a [...]]]></description>
			<content:encoded><![CDATA[<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.diederickdevries.net%2Fblog%2F2011%2F06%2F25%2Fnew-horizons-ice-hunters%2F&amp;title=New%20Horizons%20Ice%20Hunters" id="wpa2a_8"><img src="http://www.diederickdevries.net/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><p>Between 2004 and 2008 I used to work for a lab of  the <a href="http://www.nki.nl/Research/">Netherlands Cancer Institute</a>, where scientists <a href="http://www.bio.davidson.edu/Courses/Molbio/MolStudents/spring2003/Kogoy/protein.html">crystallised</a> proteins to be able model them. Crystallization is a neat way of lining them up perfectly. This is necessary because they are so small that if you measure just one of them, you don&#8217;t get a signal. If you put a few precisely in a row, their signals add up and you start to see things.</p>
<p>Crystallizing proteins isn&#8217;t very easy though. They used mainly solutions of salt and other solvents, but the whole thing was basically a trial and error process. They had plates with wells lined up in rows, each with a slightly different solution. Robots would periodically take lots of pictures of them, so that the scientists could see which ones made progress. Seeing a crystal form was usually reason for cake.</p>
<p>We had an algorithm that could recognize interesting artefacts, but scoring these images is typically something that the human brain does a much better job of than computers. You don&#8217;t even need to be a trained scientist.  I did some of them too. A short instruction was enough to be able to tell what&#8217;s what.</p>
<p>I had to think about this when I stumbled upon the New Horizons <a href="http://www.icehunters.org/">Ice Hunters</a> web site. <a href="http://www.nasa.gov/mission_pages/newhorizons/main/index.html">New Horizons</a> is a probe on its way to Pluto. When it gets there in 2015 it will return awesome pictures back to us, just like the <a href="http://saturn.jpl.nasa.gov/">Cassini</a> probe is doing now at Saturn. But it won&#8217;t stay there (obviously &#8211; it doesn&#8217;t have the means to slow down). After Pluto it will continue toward the <a href="http://en.wikipedia.org/wiki/Kuiper_belt">Kuiper Belt</a>, an asteroid belt outside Neptune&#8217;s orbit, filled with icy objects called Kuiper Belt Objects (KBOs).</p>
<p>The problem is, these KBOs have to be identified first. And like recognizing the crystals, that is something that humans are better at than computers. Ice Hunters lets the visitor identify these distant worlds of eyes, thus helping out the scientists. It&#8217;s really fun (and addictive) to do, and not that hard. In 38 images I found 19 of them, and I just got started.</p>
<p><a rel="attachment wp-att-974" href="http://www.diederickdevries.net/blog/2011/06/25/new-horizons-ice-hunters/huntingkbos/"><img class="aligncenter size-full wp-image-974" title="huntingKBOs" src="http://www.diederickdevries.net/blog/wp-content/uploads/2011/06/huntingKBOs.png" alt="" width="527" height="402" /></a></p>
<p>There is a tutorial video and some text on where the images come from.  You are presented with small square images, on which you can click to  indicate where the KBOs are. There are lots and lots of images to be scored, so there is a lot of work to do. Every image is scored by a few people, so don&#8217;t be afraid to make mistakes. And before you can start, you need to sign up, so that they can attach your name to your results.</p>
<p>I find that pretty cool.</p>

]]></content:encoded>
			<wfw:commentRss>http://www.diederickdevries.net/blog/2011/06/25/new-horizons-ice-hunters/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Elite</title>
		<link>http://www.diederickdevries.net/blog/2011/04/14/elite/</link>
		<comments>http://www.diederickdevries.net/blog/2011/04/14/elite/#comments</comments>
		<pubDate>Thu, 14 Apr 2011 19:27:35 +0000</pubDate>
		<dc:creator>diederick</dc:creator>
				<category><![CDATA[cool stuff]]></category>
		<category><![CDATA[lifestyle]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[ocjp]]></category>

		<guid isPermaLink="false">http://www.diederickdevries.net/blog/?p=832</guid>
		<description><![CDATA[Today, I found this in my mail: The &#8220;success kit&#8221; included a lifetime membership card for (&#8230;) an elite group of Oracle Certified Professionals (&#8230;) And I had hoped for a coffee pack But still. Excellent.]]></description>
			<content:encoded><![CDATA[<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.diederickdevries.net%2Fblog%2F2011%2F04%2F14%2Felite%2F&amp;title=Elite" id="wpa2a_10"><img src="http://www.diederickdevries.net/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><p>Today, I found this in my mail:</p>
<p><a rel="attachment wp-att-833" href="http://www.diederickdevries.net/blog/2011/04/14/elite/ocjp/"><img class="aligncenter size-full wp-image-833" title="ocjp" src="http://www.diederickdevries.net/blog/wp-content/uploads/2011/04/ocjp-e1302807438788.png" alt="" width="450" height="316" /></a></p>
<p>The &#8220;success kit&#8221; included a lifetime membership card for</p>
<blockquote><p>(&#8230;) an elite group of Oracle Certified Professionals (&#8230;)</p></blockquote>
<p>And I had hoped for a coffee pack <img src='http://www.diederickdevries.net/blog/wp-includes/images/smilies/icon_sad.gif' alt=':-(' class='wp-smiley' /> </p>
<p>But still. Excellent.</p>

]]></content:encoded>
			<wfw:commentRss>http://www.diederickdevries.net/blog/2011/04/14/elite/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Undead robot</title>
		<link>http://www.diederickdevries.net/blog/2011/04/14/undead-robot/</link>
		<comments>http://www.diederickdevries.net/blog/2011/04/14/undead-robot/#comments</comments>
		<pubDate>Thu, 14 Apr 2011 09:58:03 +0000</pubDate>
		<dc:creator>diederick</dc:creator>
				<category><![CDATA[cool stuff]]></category>
		<category><![CDATA[skepsis]]></category>
		<category><![CDATA[geek zodiac]]></category>
		<category><![CDATA[robot]]></category>
		<category><![CDATA[undead]]></category>

		<guid isPermaLink="false">http://www.diederickdevries.net/blog/?p=866</guid>
		<description><![CDATA[According to the Geek Zodiac, I am an Undead, since I was born in 1976. I am apparently soulful, transcendental and know the value of all life. I am also haunted, tormented and have difficulty connecting to humanity. Obviously, this is utter nonsense. I am clearly a Robot: law-abiding, dedicated and logical as well as [...]]]></description>
			<content:encoded><![CDATA[<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.diederickdevries.net%2Fblog%2F2011%2F04%2F14%2Fundead-robot%2F&amp;title=Undead%20robot" id="wpa2a_12"><img src="http://www.diederickdevries.net/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><p>According to the <a href="http://geektyrant.com/news/2011/4/7/the-geek-zodiac.html">Geek Zodiac</a>, I am an Undead, since I was born in 1976. I am apparently soulful, transcendental and know the value of all life. I am also haunted, tormented and have difficulty connecting to humanity.</p>
<p>Obviously, this is utter nonsense. I am clearly a Robot: law-abiding, dedicated and logical as well as stubborn, intractable and cold. But apparently I was born in the wrong year for that.</p>
<p style="text-align: center;"><a rel="attachment wp-att-868" href="http://www.diederickdevries.net/blog/2011/04/14/undead-robot/robot/"><img class="aligncenter size-full wp-image-868" title="robot" src="http://www.diederickdevries.net/blog/wp-content/uploads/2011/04/robot.jpg" alt="" width="558" height="272" /></a></p>
<p>That proves it. <a href="http://www.badastronomy.com/bad/misc/astrology.html">Astrology is bull</a>.</p>

]]></content:encoded>
			<wfw:commentRss>http://www.diederickdevries.net/blog/2011/04/14/undead-robot/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A decade of cell phones</title>
		<link>http://www.diederickdevries.net/blog/2011/04/11/a-decade-of-cell-phones/</link>
		<comments>http://www.diederickdevries.net/blog/2011/04/11/a-decade-of-cell-phones/#comments</comments>
		<pubDate>Mon, 11 Apr 2011 13:54:36 +0000</pubDate>
		<dc:creator>diederick</dc:creator>
				<category><![CDATA[cool stuff]]></category>
		<category><![CDATA[gadgets]]></category>
		<category><![CDATA[lifestyle]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[fairphone]]></category>
		<category><![CDATA[hi]]></category>
		<category><![CDATA[kpnpocketlineswing]]></category>
		<category><![CDATA[lgoptimux2x]]></category>
		<category><![CDATA[nokia6210]]></category>
		<category><![CDATA[orange]]></category>
		<category><![CDATA[sonyericssoncmdj5]]></category>
		<category><![CDATA[sonyericssonw810i]]></category>
		<category><![CDATA[sonyericssonwc902]]></category>
		<category><![CDATA[tmobile]]></category>

		<guid isPermaLink="false">http://www.diederickdevries.net/blog/?p=615</guid>
		<description><![CDATA[I got a new phone. It&#8217;s my first real smart phone, it has Android and two CPU cores. I like it. It&#8217;s an LG Optimus 2x and it looks like this: I like it for having a Linux kernel, a big screen, a 3.5 mm earphone jack, convenient volume buttons, a slick design and because [...]]]></description>
			<content:encoded><![CDATA[<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.diederickdevries.net%2Fblog%2F2011%2F04%2F11%2Fa-decade-of-cell-phones%2F&amp;title=A%20decade%20of%20cell%20phones" id="wpa2a_14"><img src="http://www.diederickdevries.net/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><p>I got a new phone. It&#8217;s my first real smart phone, it has Android and two CPU cores. I like it. It&#8217;s an <a href="http://www.phonearena.com/phones/LG-Optimus-2X_id5021">LG Optimus 2x</a> and it looks like this:</p>
<div id="attachment_693" class="wp-caption aligncenter" style="width: 304px"><a rel="attachment wp-att-693" href="http://www.diederickdevries.net/blog/2011/04/11/a-decade-of-cell-phones/lg-optimus-speed-2x/"><img class="size-full wp-image-693" title="LG-Optimus-Speed-2X" src="http://www.diederickdevries.net/blog/wp-content/uploads/2011/04/LG-Optimus-Speed-2X.jpg" alt="" width="294" height="306" /></a><p class="wp-caption-text">LG Optimus 2x</p></div>
<p>I like it for having a Linux kernel, a big screen, a <a href="http://www.phonescoop.com/glossary/term.php?gid=440">3.5 mm earphone jack</a>, convenient volume buttons, a slick design and because I can greatly expand its usefulness by installing apps. It&#8217;s not become a lifestyle though. The first Saturday after I got it, while waiting outside of a dressing room for someone to try on some new piece of clothing, I did not check my messages or Facebook wall. That&#8217;s not product dissatisfaction, I&#8217;m just <em>really</em> in control.</p>
<p>So I wanted to make a list of all the different cell phones I&#8217;ve owned. &#8216;Owned&#8217; being off course a relative term (albeit decreasingly so in each case), since I got each one for free (also relative, increasingly, also inversely correlated with &#8216;owned&#8217;) with a subscription that would last for two years, after which the phone was more than fully paid.</p>
<h3>KPN Pocketline Swing</h3>
<p>My very first cell phone was the <a href="http://www.portablegear.nl/reviews/Pocketline_Swing-200.htm">KPN Pocketline Swing</a> (links to page in Dutch).</p>
<div id="attachment_616" class="wp-caption aligncenter" style="width: 134px"><a rel="attachment wp-att-616" href="http://www.diederickdevries.net/blog/2011/04/11/a-decade-of-cell-phones/pocketlineswing200/"><img class="size-full wp-image-616" title="PocketlineSwing200" src="http://www.diederickdevries.net/blog/wp-content/uploads/2011/03/PocketlineSwing200.gif" alt="" width="124" height="300" /></a><p class="wp-caption-text">KPN Pocketline Swing</p></div>
<p>The `Swing&#8217; was a very popular phone in the Netherlands at the time. It is the only one I used with a pre-paid subscription. My service provider was <a href="http://www.kpn.com/">KPN</a>-owned <a href="http://www.kpn.com/corporate/aboutkpn/Company-profile/Brands/hi.htm">Hi</a>, which was targeted at young people. I got the phone in January 2000, while away from home for the entire month. I remember the first thing I tried to find out about it was how to turn off the high-pitched beep at every key press. Apart from the extensible antenna for noticeably better reception I don&#8217;t remember much else. Its functionality was limited to making and receiving calls, text messaging, name/number storage and an alarm clock. But it was as cool a gadget as I&#8217;ve ever had.</p>
<h3>Nokia 6210</h3>
<p>When I got a new phone, I sold the Pocketline Swing, including its phone number. And for good reason. The law that enables you to take your phone number with you when switching service providers didn&#8217;t exist yet, and if I stayed with Hi I didn&#8217;t have a lot of options choosing my next phone. So I switched to <a href="http://en.wikipedia.org/wiki/Ben_NL">Ben</a>, which gave me a <a href="http://europe.nokia.com/support/product-support/nokia-6210">Nokia 6210</a>.</p>
<div id="attachment_617" class="wp-caption aligncenter" style="width: 172px"><a rel="attachment wp-att-617" href="http://www.diederickdevries.net/blog/2011/04/11/a-decade-of-cell-phones/nokia-6210-572956/"><img class="size-full wp-image-617" title="nokia-6210.572956" src="http://www.diederickdevries.net/blog/wp-content/uploads/2011/03/nokia-6210.572956.jpg" alt="" width="162" height="239" /></a><p class="wp-caption-text">Noka 6210</p></div>
<p>Also targeted at young people, Ben was the übercool brand of the time. I believe the first name of the guy who founded it was Ben, and in Dutch, &#8220;ben&#8221; also translates to &#8220;I am&#8221;, which provided for lots of subtle advertising possibilities.  They were growing, but their coverage wasn&#8217;t very good when I first got this phone. I lived in <a href="http://maps.google.com/maps?f=q&amp;source=s_q&amp;hl=en&amp;geocode=&amp;q=oude+ebbingestraat+61,+groningen&amp;aq=t&amp;sll=53.219384,6.566502&amp;sspn=0.123339,0.273628&amp;ie=UTF8&amp;hq=&amp;hnear=Oude+Ebbingestraat+61,+Stadscentrum,+Groningen,+The+Netherlands&amp;z=16">Groningen</a> then, and I remember only having reception in the down-town area. As soon as I crossed a bridge over the enclosing canal,  the connection was lost. Ben was bought by T-Mobile in 2002 as their way to get access to the Dutch market. They closed down the brand, but reinstated it in 2008.</p>
<p>A Nokia 6210 from Ben was what everybody in my demographic had. Apart from calling and text messaging, the user could compose his very own ring tones. I remember using the opening theme of Shostakovich&#8217;s <a href="http://en.wikipedia.org/wiki/String_Quartet_No._6_%28Shostakovich%29">Sixth</a> string quartet as my ring tone, because we were rehearsing that at the time. And off course there was the very addictive game of <a href="http://my-symbian.com/s60v3/software/applications.php?name=Snake&amp;fldAuto=654&amp;faq=9">Snake</a>. I got pretty good at it. Obviously, because everyone was.</p>

]]></content:encoded>
			<wfw:commentRss>http://www.diederickdevries.net/blog/2011/04/11/a-decade-of-cell-phones/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Scripting Scry</title>
		<link>http://www.diederickdevries.net/blog/2011/01/12/scripting-scry/</link>
		<comments>http://www.diederickdevries.net/blog/2011/01/12/scripting-scry/#comments</comments>
		<pubDate>Wed, 12 Jan 2011 00:33:26 +0000</pubDate>
		<dc:creator>diederick</dc:creator>
				<category><![CDATA[cool stuff]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[jhead]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mogrify]]></category>
		<category><![CDATA[scp]]></category>
		<category><![CDATA[scry]]></category>

		<guid isPermaLink="false">http://www.diederickdevries.net/blog/?p=513</guid>
		<description><![CDATA[Yesterday, I wrote about Scry, a PHP photo publishing script that I basically like for the same reasons I like my favorite Linux distribution: simplicity and elegance make it easy to use and to maintain. To make things even easier, tonight I wrote a small bash script that allows me to publish a collection of [...]]]></description>
			<content:encoded><![CDATA[<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.diederickdevries.net%2Fblog%2F2011%2F01%2F12%2Fscripting-scry%2F&amp;title=Scripting%20Scry" id="wpa2a_16"><img src="http://www.diederickdevries.net/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><p>Yesterday, I wrote about <a href="http://www.diederickdevries.net/blog/2011/01/10/scry/">Scry</a>, a PHP photo publishing script that I basically like for the same reasons I like my <a href="http://www.google.nl/url?sa=t&amp;source=web&amp;cd=1&amp;ved=0CB0QFjAA&amp;url=http%3A%2F%2Fwww.archlinux.org%2F&amp;ei=g_MsTe3bDMGbOq62tM0K&amp;usg=AFQjCNHBJwJZGGNQOe4ZlnbMOM676Q1H7g&amp;sig2=HQKRgHyMTEr4-7UriNsM8Q">favorite</a> Linux distribution: simplicity and elegance make it easy to use and to maintain.</p>
<p>To make things even easier, tonight I wrote a small bash script that allows me to publish a collection of pictures on my hard drive to the Scry installation on my server. Here is is:</p>
<pre class="brush: bash">
#!/bin/bash

targethost=target host or ip
target=&quot;/local/path/to/collection&quot;
imgwidth=publication full size with
tmp=/tmp/scryify

EXPECTED_ARGS=2
E_BADARGS=65

if [ $# -ne $EXPECTED_ARGS ]
then
  echo &quot;Usage: `basename $0` &lt;/local/path/to/collection/ &lt;/remote/path/to/supercollection&gt;&quot;
  exit $E_BADARGS
fi

source=$1
name=`basename &quot;$source&quot;`
target=$target/$2
targetdir=$(echo &quot;$target/$name/&quot; | sed &#039;s/ /\\ /g&#039;)
tmpdir=$(echo &quot;$tmp/$name&quot; | sed &#039;s/ /\\ /g&#039;)

echo &quot;Copying originals&quot;
mkdir -p $tmp
cp -R &quot;$source&quot; $tmp/

echo &quot;Processing copies&quot;
find &quot;$tmp/$name&quot; -name *JPG -print0 | while read -d $&#039;\0&#039; file
do
  jhead -q -autorot &quot;$file&quot; &gt; /dev/null
  mogrify -scale $imgwidth &quot;$file&quot;
  jhead -q -n%Y%m%d%H%M%S_%f &quot;$file&quot; &gt; /dev/null
done

echo &quot;Publishing copies&quot;
ssh $targethost mkdir -p &quot;$targetdir&quot;
eval cd &quot;$tmpdir&quot;
scp *jpg $targethost:&quot;$targetdir/&quot; &gt; /dev/null

echo &quot;Cleaning up&quot;
rm -rf $tmp
</pre>
<p>If you want to use this, you will need to adapt some of the lines 3 through 6 to your set up. Path names are without closing slashes and should be enclosed in parentheses when they contain spaces. <code>imgwidth</code> Is the width of the picture when your visitor clicks the full screen link.</p>
<p>The script needs an ssh server running on the server. Setting up <a href="http://onlamp.com/pub/a/onlamp/excerpt/ssh_8/">key authorization</a> is useful if you want to be able to start the script and do <a href="http://xkcd.com/303/">other things</a> while it runs. Obviously, mogrify and jhead must be present as well, as does sed. The former will most likely be part of the <a href="http://www.imagemagick.org/script/index.php">ImageMagick</a> package.</p>
<p>Put the script in a file with a name you will remember (I call it scryify), make the file executable and put it in a directory in your path. The script takes two arguments, the full path to the collection on your hard drive and the path below the directory on the server where Scry keeps its collections under which you want the collection to be published.</p>
<p>For instance, if you order your collections per year, like me, and you have pictures of last years Christmas dinner in a local folder /home/me/pictures/Christmas dinner/, you would issue:</p>
<pre># scryify /home/me/pictures/christmas\ dinner/ 2010</pre>
<p>The script will run (and tell you what it is doing) and when you get your prompt back, you can go to your photo site and voilà, there they are. Well, at least at my site it works, but obviously there are no guarantees. Also, use at your risk.</p>

]]></content:encoded>
			<wfw:commentRss>http://www.diederickdevries.net/blog/2011/01/12/scripting-scry/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Arch Linux: an end to my distro shuffle!</title>
		<link>http://www.diederickdevries.net/blog/2011/01/10/arch-linux-an-end-to-my-distro-shuffle/</link>
		<comments>http://www.diederickdevries.net/blog/2011/01/10/arch-linux-an-end-to-my-distro-shuffle/#comments</comments>
		<pubDate>Mon, 10 Jan 2011 21:37:01 +0000</pubDate>
		<dc:creator>diederick</dc:creator>
				<category><![CDATA[cool stuff]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[arch]]></category>
		<category><![CDATA[crux]]></category>
		<category><![CDATA[KISS]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[suse]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.diederickdevries.net/blog/?p=506</guid>
		<description><![CDATA[For some time now I’ve been meaning to write about Arch, the Linux distribution I’ve been using for almost a year now. Today I stumbled onto an old OSNews article, which perfectly describes my feelings on Arch. The article is in fact from 2004, but if you replace Mozzila-firebird in the text with Firefox, it [...]]]></description>
			<content:encoded><![CDATA[<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.diederickdevries.net%2Fblog%2F2011%2F01%2F10%2Farch-linux-an-end-to-my-distro-shuffle%2F&amp;title=Arch%20Linux%3A%20an%20end%20to%20my%20distro%20shuffle%21" id="wpa2a_18"><img src="http://www.diederickdevries.net/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><p><a rel="attachment wp-att-680" href="http://www.diederickdevries.net/blog/2011/01/10/arch-linux-an-end-to-my-distro-shuffle/arch-linux-logo/"><img class="alignleft size-full wp-image-680" style="border: 0pt none;" title="arch-linux-logo" src="http://www.diederickdevries.net/blog/wp-content/uploads/2011/01/arch-linux-logo.png" alt="" width="251" height="210" /></a>For some time now I’ve been meaning to write about <a href="http://www.archlinux.org/">Arch</a>, the Linux distribution I’ve been using for almost a year now. Today I stumbled onto an old <a href="http://www.osnews.com/story/5971/Arch_Linux_An_End_To_My_Distro_Shuffle_">OSNews article</a>, which perfectly describes my feelings on Arch. The article is in fact from 2004, but if you replace <a href="http://en.wikipedia.org/wiki/Firefox#Early_Versions">Mozzila-firebird</a> in the text with Firefox, it is still current.</p>
<p>Since I ditched <a href="http://en.wikipedia.org/wiki/Windows_98">Windows ’98</a>, back in, well, ’98,  I have used a couple of Linux distributions. The first one was <a href="http://www.novell.com/linux/">SuSE Linux</a>, I think version 5 or 6, in any case well before Novell acquired it. I bought it in a book store and it came on 6 CDs and included a few books. I already had an Internet connection at home, but that was too slow to download an entire distribution on.</p>
<h3>Different</h3>
<p>I liked Linux for being different. I became interested in the ideas behind free and open source software and got kind of hooked. Using SuSE however occasionally proved frustrating. Hardware support wasn’t very good and the <a href="http://en.wikipedia.org/wiki/RPM_Package_Manager">RPM</a> package management didn’t have dependency management. I really hated <a href="http://en.opensuse.org/Portal:YaST">YaST</a> for being heavy, inflexible and unstable. Around 2002 I started distro juggling, trying out <a href="http://fedoraproject.org/">Fedora</a>, <a href="http://www.gentoo.org/">Gentoo</a>, and <a href="http://www.linuxfromscratch.org/">Linux from Scratch</a> each at least twice.</p>
<p>In 2004 I tried <a href="http://crux.nu/">Crux</a>, and I liked it. The <a href="http://en.wikipedia.org/wiki/KISS_principle">Keep It Simple, Stupid!</a> (KISS) philosophy really sat well with me and it kind of made me feel nerdy compiling everything that I installed. Everything was optimized for i686 (Pentium 4) which made computer really fast. Unneeded extras like documentation (which can always be found on the Internet) are not installed. I liked the ports package system for its elegance and even had my own registered repository at some point. It contained an <a href="http://openmsx.sourceforge.net/">MSX emulator</a> and related utilities, some musical software and some drivers and other useful <a href="http://www.diederickdevries.net/armada/">stuff</a> for my Compaq Armada laptop. This was born out of necessity, since the official Crux repositories only contained very popular software. Anyone with any special needs had to learn how to create packages.</p>
<h3>Downsides</h3>
<p><a rel="attachment wp-att-681" href="http://www.diederickdevries.net/blog/2011/01/10/arch-linux-an-end-to-my-distro-shuffle/cruxlogo/"><img class="alignright size-full wp-image-681" style="border: 0pt none;" title="cruxlogo" src="http://www.diederickdevries.net/blog/wp-content/uploads/2011/01/cruxlogo.png" alt="" width="143" height="183" /></a>Crux had downsides too. Many of its packages weren’t maintained that well, and it frequently happened that things would stop working after an update. And every now and then there was a new Crux release. This usually meant an entire weekend of work. Deciding that I hadn&#8217;t any ambitions of becoming my own private system administrator I switched to <a href="http://www.ubuntu.com/">Ubuntu</a>. Ubuntu was growing very popular and many people were using it to their satisfaction. Ubuntu was more or less opposite of Crux, in that it tried to take system maintenance out of the user&#8217;s hand, so that she could concentrate on being productive. To do that, Ubuntu kept the complex stuff hidden from the user. The downside was that when something broke or the user wanted something Canonical did not foresee, trying to figure out what happened was hard. Things got worse with each new version. Whenever I had become accustomed to the current set of quirks, a new distro release added a completely new set of irritations. Usually, doing a fresh install was a better idea that performing a dist-upgrade (I’ve seen dist-upgrades of Ubuntu Server LTS completely brick a machine), but things were far from complex, I and I started looking around again.</p>
<h3>Rolling release</h3>
<p>Then I found Arch. Arch is inspired by Crux. Complex stuff isn’t hidden, only necessary stuff is installed, and packages are i686 or x86-64 (64-bit) optimized. This makes my Arch system just as fast as it was when it was still running Crux. But it has a few very nice differences. First of all, the package maintenance is very dependable. Updates never break anything, as long as you read the update notes. Secondly, Arch is a rolling release distro. Distribution releases have no impact on existing Arch installations. Arch’s package manager takes care of everything. This means that as long as I stick with Arch and my current hard drive, I will never have to install another operating system. I think that is down right awesome.</p>
<p>Everything that&#8217;s on an Arch installation is consciously installed, so when something breaks because of an update, I can easily figure out what went wrong. Part of updating my packages is manually updating config files, but only the ones that I changed myself, so I know what the changes mean. This can take some time, but usually no more than fifteen minutes. And I will never need to spend an entire evening installing or upgrading a complete distribution.</p>

]]></content:encoded>
			<wfw:commentRss>http://www.diederickdevries.net/blog/2011/01/10/arch-linux-an-end-to-my-distro-shuffle/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Scry</title>
		<link>http://www.diederickdevries.net/blog/2011/01/10/scry/</link>
		<comments>http://www.diederickdevries.net/blog/2011/01/10/scry/#comments</comments>
		<pubDate>Mon, 10 Jan 2011 11:18:44 +0000</pubDate>
		<dc:creator>diederick</dc:creator>
				<category><![CDATA[cool stuff]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[jhead]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mogrify]]></category>
		<category><![CDATA[scry]]></category>
		<category><![CDATA[zenphoto]]></category>

		<guid isPermaLink="false">http://www.diederickdevries.net/blog/?p=492</guid>
		<description><![CDATA[Whenever I do something or go out with family or friends, I usually take lots of pictures. And so do they, at least some of them. Afterwards, we are often interested in each other&#8217;s pictures, so I usually collect them all to show them to everyone. But that is easier said than done. I have [...]]]></description>
			<content:encoded><![CDATA[<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.diederickdevries.net%2Fblog%2F2011%2F01%2F10%2Fscry%2F&amp;title=Scry" id="wpa2a_20"><img src="http://www.diederickdevries.net/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><p>Whenever I do something or go out with family or friends, I usually take lots of pictures. And so do they, at least some of them. Afterwards, we are often interested in each other&#8217;s pictures, so I usually collect them all to show them to everyone. But that is easier said than done. I have tried emailing <a href="http://en.wikipedia.org/wiki/ZIP_(file_format)">zip files</a>, but that is too cumbersome. Even when everybody&#8217;s email box will accept large files, the concept of unzipping files appears new and painful to most people.</p>
<p>Given the fact that I have my own web server, the solution is pretty obvious. Now there are lots of scripts available that will publish pictures on a web page, but most are way too bloated for my purposes, and with bloatware comes tiresome maintenance. I&#8217;ve tried <a href="http://www.zenphoto.org/">Zenphoto</a> for instance, because it allegedly integrates well with <a href="http://wordpress.org/">WordPress</a>, which is the script behind this blog. It didn&#8217;t, and I had to invest way too much time to find out it couln&#8217;t do what I wanted.</p>
<p>Enter <a href="http://scry.org/">Scry</a>, a small collection of php scripts with the tagline:</p>
<blockquote><p>Scry is the simplest PHP photo album you&#8217;ll ever love.</p></blockquote>
<p>It really is. It doesn&#8217;t need a database, has no admin interface, doesn&#8217;t allow naming pictures or comments and won&#8217;t let you manually reorder them (as if I would ever want that). But it is very simple, elegant, and most importantly, predictable. There are a few configuration options (how many thumbnails per page, which directory contains the collections) which are set in one of the <a href="http://www.php.net/">PHP</a> files itself.</p>
<p>Scry needs a directory in which directories with pictures can be placed. Every collection goes into its own directory, and you can group collections into super collections as much as you want. I have grouped collections per year, because I find that useful. The only thing I had to do was create the directories and move the right directories to them. Scry scans the directories and shows the pictures, recursively.</p>
<p>When a visitor navigates to the site, the first thing she sees is the top level directories.</p>
<p style="text-align: center;"><a rel="attachment wp-att-496" href="http://www.diederickdevries.net/blog/2011/01/10/scry/scry_toplevel/"><img class="aligncenter size-full wp-image-496" title="scry_toplevel" src="http://www.diederickdevries.net/blog/wp-content/uploads/2011/01/scry_toplevel.png" alt="" width="704" height="179" /></a><a rel="attachment wp-att-496" href="http://www.diederickdevries.net/blog/2011/01/10/scry/scry_toplevel/"></a></p>
<p>When a directory contains pictures, these are shown as thumbnails.</p>
<p><a rel="attachment wp-att-497" href="http://www.diederickdevries.net/blog/2011/01/10/scry/scry_collection/"><img class="aligncenter size-large wp-image-497" title="scry_collection" src="http://www.diederickdevries.net/blog/wp-content/uploads/2011/01/scry_collection-1024x337.png" alt="" width="715" height="230" /></a></p>
<p>When a thumbnail is clicked on, it is shown big, with below it some <a href="http://en.wikipedia.org/wiki/Exchangeable_image_file_format">EXIF</a> meta data (using a plugin called <a href="http://www.jakeo.com/software/exif/index.php">Exifer</a>)  and the thumbnails of the previous and the next picture in that directory, which can be clicked to navigate.</p>
<p><a rel="attachment wp-att-498" href="http://www.diederickdevries.net/blog/2011/01/10/scry/scry_picture/"><img class="aligncenter size-large wp-image-498" title="scry_picture" src="http://www.diederickdevries.net/blog/wp-content/uploads/2011/01/scry_picture-1024x624.png" alt="" width="717" height="550" /></a></p>
<p>Apart from the easy maintenance, I really like the clean and straightforward layout. Everything is clear, nothing is obscure or confusing. The script shows pictures. That&#8217;s all it does, but it does it well.</p>
<p>The pictures do need a little processing before they can be published using Scry, though. First, I want my pictures ordered by the time they were taken. But since my collections contain pictures from different camera&#8217;s with different file naming schemes, I need them ordered by the timestamp value from the EXIF meta data. I also take lots of pictures in portrait orientation, so pictures must be rotated correctly as well. This information too can also be found in the EXIF meta data.</p>
<p>Scry, like Zenphoto, doesn&#8217;t do any ordering or EXIF rotation. But since Scry doesn&#8217;t use a database, the ordering is naturally done by filename. So all I need is to take the time stamp values and prepend them to the file names. The pictures will then be ordered by time. <a href="http://linux.die.net/man/1/jhead">jhead(1)</a> Can do that:</p>
<pre># jhead -n%Y%m%d%H%M%S_%f *jpg</pre>
<p>This will change any picture whose filename ends with jpg from something like img0129.jpg into something like 20110101120000_img0129.jpg.</p>
<p>jhead Can also rotate images:</p>
<pre># /usr/bin/jhead -autorot *jpg</pre>
<p>This will correctly rotate any picture whose filename ends with jpg, including any embedded thumbnails, adjust the width and height values and remove the orientation value from the meta data. That last thing is important, so EXIF-rotation aware programs won&#8217;t rotate the picture any more.</p>
<p>I also don&#8217;t publish full 11 mega pixel images over the web, so I always downsize the images, using <a href="http://www.imagemagick.org/">ImageMagick</a>&#8216;s <a href="http://www.imagemagick.org/www/mogrify.html">mogrify</a>:</p>
<pre># mogrify -scale 25% *JPG</pre>
<p>It&#8217;s things like this that show the command line&#8217;s superiority to any GUI: even if your collection contains thousands of images, you just need these three commands to order, rotate and shrink them all.</p>
<p>When you go to the Scry website, it appears that Scry is not very much maintained at the moment. The latest news is the announcing of version 1.2 on 15 July 2006, which is some time ago. Scry has few dependencies however, and seems to work without issue on my <a href="http://www.archlinux.org/">Arch</a> Linux server which I update weekly.</p>
<p><em>UPDATE</em><em>: Actually, Scry does have one issue. When installing Scry on a server with PHP 5.3.0 or later installed, you&#8217;ll notice you&#8217;ll get deprecation warnings. Scry makes use of <a href="http://php.net/manual/en/function.eregi.php">eregi</a>. The easiest work-around is putting an &#8216;@&#8217; sign in front of every eregi function call, like this:</em></p>
<pre class="brush: php">
...
if (@eregi(&quot;^&quot; . rtrim(&#039;/&#039;, $test) . &quot;.*&quot;, rtrim(&#039;/&#039;, realpath($victim)))) {
...
</pre>
<p><em>(line 34 in functions.php)</em></p>
<p><em> You will find them in functions.php and view.tpl in the default template, as well as <em>exif.php if you install the exifer plugin (see below).</em></em></p>
<p><em><em>UPDATE2: It appears &#8216;m  not much of a PHP wizard. Using the solution above will make the warnings disappear from the site, but not from your logs. That means one warning messages per request, which is every time someone clicks anything on your Scry site. I have therefore submitted patches to Scry that replace all <code>eregi</code> and <code>eregi_replace</code> calls with <code>preg_match</code> and <code>preg_replace</code> calls. Since the Scry CVS is <a href="http://cvs.sourceforge.net/viewcvs.py/scry/scry/">unreachable</a>, you will find them on the feature request <a href="https://sourceforge.net/tracker/?group_id=5015&amp;atid=355015">page</a>.</em></em></p>

]]></content:encoded>
			<wfw:commentRss>http://www.diederickdevries.net/blog/2011/01/10/scry/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

