<?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>Biboroku</title>
	<atom:link href="http://okomestudio.net/biboroku/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://okomestudio.net/biboroku</link>
	<description>Taro Sato&#039;s Memorandum</description>
	<lastBuildDate>Thu, 11 Oct 2012 21:07:29 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5</generator>
		<item>
		<title>Setting up MySQL Database from .sql Dump on DotCloud</title>
		<link>http://okomestudio.net/biboroku/?p=1965</link>
		<comments>http://okomestudio.net/biboroku/?p=1965#comments</comments>
		<pubDate>Wed, 10 Oct 2012 23:20:17 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[DotCloud]]></category>
		<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://okomestudio.net/biboroku/?p=1965</guid>
		<description><![CDATA[Here I assume that MySQL service is running as db for my application named myapp. If I don&#8217;t remember, the password can be obtained as follows: If I have a MySQL dump file named somedb.sql, do This is it. It &#8230; <a href="http://okomestudio.net/biboroku/?p=1965">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Here I assume that MySQL service is running as <em>db</em> for my application named <em>myapp</em>.  If I don&#8217;t remember, the password can be obtained as follows:</p>
<pre class="brush: bash; title: ; notranslate">$ dotcloud info myapp.db
... a bunch of info, one of which is passwd ...</pre>
<p>If I have a MySQL dump file named <em>somedb.sql</em>, do</p>
<pre class="brush: bash; title: ; notranslate">$ dotcloud run myapp.db -- mysql -u root -pMYMYSQLROOTPASSWOD &lt; somedb.sql</pre>
<p>This is it.  It is probably a good idea to create a regular MySQL user.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=1965</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Customizing &amp; Installing Linux Kernel on Debian Wheezy</title>
		<link>http://okomestudio.net/biboroku/?p=1903</link>
		<comments>http://okomestudio.net/biboroku/?p=1903#comments</comments>
		<pubDate>Sun, 30 Sep 2012 09:01:56 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Debian/Wheezy]]></category>
		<category><![CDATA[install procedure]]></category>
		<category><![CDATA[kernel]]></category>

		<guid isPermaLink="false">http://okomestudio.net/biboroku/?p=1903</guid>
		<description><![CDATA[Here is a quickie for customizing and install Linux kernel 3.5.x on Wheezy. Add yourself to some groups: You need to logout and login for this change to take effect. You also need to be able to use sudo or &#8230; <a href="http://okomestudio.net/biboroku/?p=1903">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Here is a quickie for customizing and install Linux kernel 3.5.x on Wheezy.</p>
<p>Add yourself to some groups:</p>
<pre class="brush: bash; title: ; notranslate"># adduser username sudo</pre>
<p>You need to logout and login for this change to take effect.  You also need to be able to use <em>sudo</em> or <em>su</em> to install the new kernel in the end.</p>
<p>Install some packages and kernel source:</p>
<pre class="brush: bash; title: ; notranslate">$ sudo aptitude update
$ sudo aptitude install kernel-package pkg-config bzip2 g++ libqt4-dev libncurses5-dev fakeroot</pre>
<p>The kernel packaged for Wheezy is at version 3.2.  A newer kernel can be obtained from <a href="http://www.kernel.org/">kernel.org</a> and saved somewhere.  You just need to expanding the compressed source somewhere (even under your home directory, which is the case in this post).  Either way, the customization procedure is similar.  Here I just follow the Debian way:</p>
<pre class="brush: bash; title: ; notranslate">$ sudo aptitude install linux-source-3.2</pre>
<p>Extract the source tree:</p>
<pre class="brush: bash; title: ; notranslate">$ cd ~/src
$ tar -jxf /usr/src/linux-source-3.2.tar.bz2
$ ln -s linux-source-3.2 linux
$ cd linux</pre>
<p>Edit the EXTRAVERSION entry in <em>Makefile</em>, as in:</p>
<pre class="brush: bash; title: ; notranslate">EXTRAVERSION = .20120929.1</pre>
<p>for example to add .20120929.1 to the kernel version number.  This is convenient for keeping the existing, working kernels around when you need to recompile with different options.</p>
<p>Use <em>xconfig</em> or <em>menuconfig</em> to customize the kernel options.  Before the <code>make-kpkg</code> lines, setting concurrency (most likely to the number of cores of my processor) is optinal but having a higher number typically reduces the compilation time.</p>
<pre class="brush: bash; title: ; notranslate">$ make mrproper
$ make xconfig    # or make menuconfig
$ export CONCURRENCY_LEVEL=2    # this is optional
$ fakeroot make-kpkg clean
$ fakeroot make-kpkg --initrd kernel_image
$ sudo dpkg -i ../linux-image-3.2.20120929.*_amd64.deb</pre>
<p>Upon reboot in the GRUB menu you will find the newly installed kernel:</p>
<pre class="brush: bash; title: ; notranslate">$ sudo reboot</pre>
<h3>Purging Old Kernel Image from System</h3>
<p>For example, if the kernel to be uninstalled is of version 2.6.26 and the extra version that I used was 20091112.1, do:</p>
<pre><code>$ sudo dpkg -P linux-image-2.6.26.20091112.1</code></pre>
<p>That&#8217;s it.  However it is often a good idea to keep at least one kernel image that I know for sure to work so that when a custom kernel fails, I have something to fall back on.  On the other hand, it is also a good idea to purge very old kernel images to save space in <em>/boot</em>.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=1903</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Power Management on Lenovo T430s with Debian Wheezy</title>
		<link>http://okomestudio.net/biboroku/?p=1915</link>
		<comments>http://okomestudio.net/biboroku/?p=1915#comments</comments>
		<pubDate>Sun, 30 Sep 2012 08:58:06 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Debian/Wheezy]]></category>
		<category><![CDATA[power management]]></category>
		<category><![CDATA[T430s]]></category>

		<guid isPermaLink="false">http://okomestudio.net/biboroku/?p=1915</guid>
		<description><![CDATA[Since tp_smapi does not work properly on T430s, I am using TLP this time. I still want some traditional tools but not others: To install, follow the instruction. In short, first update the APT source list by adding the following &#8230; <a href="http://okomestudio.net/biboroku/?p=1915">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Since <code>tp_smapi</code> <a href="https://github.com/evgeni/tp_smapi/issues/14">does not work properly</a> on T430s, I am using <a href="http://linrunner.de/en/tlp/tlp.html">TLP</a> this time.  I still want some traditional tools</p>
<pre class="brush: bash; title: ; notranslate">$ sudo aptitude install powertop</pre>
<p>but not others:</p>
<pre class="brush: bash; title: ; notranslate">$ sudo aptitude remove --purge laptop-mode-tools</pre>
<p>To install, <a href="http://linrunner.de/en/tlp/docs/tlp-linux-advanced-power-management.html#installation">follow the instruction</a>.  In short, first update the APT source list by adding the following line to <em>/etc/apt/sources.list</em>:</p>
<pre class="brush: bash; title: ; notranslate">deb http://ppa.launchpad.net/linrunner/tlp/ubuntu lucid main</pre>
<p>and run </p>
<pre class="brush: bash; title: ; notranslate">$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 02D65EFF
$ sudo aptitude update
$ sudo aptitude install tlp tlp-rdw tp-smapi-dkms smartmontools ethtool acpi-call-tools</pre>
<p>Upon reboot, TLP starts running.</p>
<p>I am impressed by the ease of installation and how effective TLP is on configuring T430s to star saving from the get go.  According to <ode>powertop</code>, T430s is already using just 7 - 8 W on battery.  That's several watts below I had been using on other ThankPads!!</p>
<p>Controlling the behavior of TPL is done by modifying <em>/etc/default/tlp</em>.  I mostly use the default except the following changes:</p>
<pre class="brush: bash; title: ; notranslate">...

# Main battery (values in %)
START_CHARGE_THRESH_BAT0=75
STOP_CHARGE_THRESH_BAT0=90
# Ultrabay battery (values in %)
START_CHARGE_THRESH_BAT1=75
STOP_CHARGE_THRESH_BAT1=90

...

# Radio devices to disable on connect
DEVICES_TO_DISABLE_ON_LAN_CONNECT=&quot;wifi wwan&quot;
DEVICES_TO_DISABLE_ON_WIFI_CONNECT=&quot;wwan&quot;
DEVICES_TO_DISABLE_ON_WWAN_CONNECT=&quot;wifi&quot;

# Radio devices to enable on disconnect
DEVICES_TO_ENABLE_ON_LAN_DISCONNECT=&quot;wifi&quot;
DEVICES_TO_ENABLE_ON_WIFI_DISCONNECT=&quot;&quot;
DEVICES_TO_ENABLE_ON_WWAN_DISCONNECT=&quot;&quot;</pre>
<p>Note that in this configuration the battery charge thresholds are intentionally set lower than the factory default to prolong the health of batteries.  When I wish to fully charge them, do:</p>
<pre class="brush: bash; title: ; notranslate">$ sudo tlp fullcharge [ BAT0 | BAT1 ]</pre>
<p>and the thresholds will be set back to the factory default.  The setting reverts to the custom configuration upon next reboot.</p>
<h3>Enables RC6 Power Saving</h3>
<p>Edit <em>/etc/default/grub</em> and add the option <em>i915.i915_enable_rc6=1</em> to GRUB:</p>
<pre class="brush: bash; title: ; notranslate">GRUB_CMDLINE_LINUX_DEFAULT=&quot;quiet i915.i915_enable_rc6=1&quot;</pre>
<p>After editing, update Grub:</p>
<pre class="brush: bash; title: ; notranslate">$ sudo update-grub</pre>
<p>This can save about 0.5 W of power!</p>
<h3>Fan Control</h3>
<p>I have not fine tuned this, but the fan can be controlled manually via <code><a href="http://thinkfan.sourceforge.net/">thinkfan</a></code>:</p>
<pre class="brush: bash; title: ; notranslate">$ sudo aptitude install thinkfan</pre>
<p>Create (or edit) <em>/etc/modprobe.d/thinkpad_acpi.conf</em> and add the line:</p>
<pre class="brush: bash; title: ; notranslate">options thinkpad_acpi fan_control=1</pre>
<p>Reboot.  The fan can be controlled manually following <a href="http://www.thinkwiki.org/wiki/How_to_control_fan_speed">this Wiki article</a>.</p>
<h3>Configuring System on Switch between AC &#038; Battery</h3>
<p>For regular daemons (like <code>ssh</code>), TLP provides a way to start/stop based on AC status.</p>
<p>For other personal processes, KDE power management can also do some work by running a script upon dis/connecting with AC. In particular, the sound for the KDE system notifications should be disabled entirely, because they cause quite a number of unwanted interruptions according to <code>powertop</code>. Also, I wish to start/stop programs like flux and Dropbox when on battery just to squeeze more juice. I create a script like this:</p>
<pre class="brush: bash; title: ; notranslate">#!/usr/bin/env bash
##############################################################################
# This is a script to run when AC/battery switches.  Ideally used
# within the power management configuration setting on KDE.  Requires
# tp_smapi to be loaded for the detection of AC/battery.
  
USERNAME=johndoe
LATITUDE=37.78
LONGITUDE=-122.42
  
  
##############################################################################
# DO NOT MODIFY BELOW
 
statuspath=&quot;/sys/class/power_supply/AC/online&quot;
  
if [ ! -f &quot;$statuspath&quot; ]; then
    exit 0
fi
  
tag=pmpersonal
status=`cat &quot;$statuspath&quot;`
 
if [ &quot;$status&quot; = &quot;1&quot; ]; then
    logger -t $tag &quot;on ac&quot;
  
    logger -t $tag &quot;start xflux&quot;
    for i in `pgrep ^xflux$` ; do kill -9 $i ; done
    xflux -l $LATITUDE -g $LONGITUDE
  
    logger -t $tag &quot;start dropbox&quot;
    dropbox start
  
    logger -t $tag &quot;enable system notification&quot;
    kwriteconfig --file=&quot;/home/$USERNAME/.kde/share/config/knotifyrc&quot; --group=Sounds --key=&quot;No sound&quot; false
else
    logger -t $tag &quot;on battery&quot;
  
    logger -t $tag &quot;stop xflux&quot;
    for i in `pgrep ^xflux$` ; do kill -9 $i ; done
  
    logger -t $tag &quot;stop dropbox&quot;
    dropbox stop
  
    logger -t $tag &quot;disable system notification&quot;
    kwriteconfig --file=&quot;/home/$USERNAME/.kde/share/config/knotifyrc&quot; --group=Sounds --key=&quot;No sound&quot; true
fi</pre>
<p>Save this to <em>~/bin/pmpersonal.sh</em>. Go to System Settings -> Power Management -> Energy Saving Settings. There, for each of “On AC,” “On Battery,” and “On Low Battery,” I can set different configurations. I can also specify “Run Script” option for each profile to enable/disable a few desktop related applications and settings. The script should be run on profile load.</p>
<h3>Preload Daemon</h3>
<pre class="brush: bash; title: ; notranslate">$ sudo aptitude install preload</pre>
<p>In <em>/etc/default/preload</em>, uncomment the line reading</p>
<pre class="brush: bash; title: ; notranslate">OPTIONS=&quot;-l /dev/null&quot;</pre>
<p>This should reduce disk activity.</p>
<h3>Disabling Nepomuk, Strigi and Akonadi on KDE</h3>
<p>I am not fond of these daemon. Disable them by going to System Settings -> Desktop Search and unchecking “Enable Nepomuk Semantic Desktop.” In <em>~/.config/akonadi/akonadiserverrc</em>, set:</p>
<pre class="brush: bash; title: ; notranslate">StartServer=false</pre>
<p>so that it doesn’t start at all. On <code>powertop</code>, this shows up as a service running <code>mysqld</code> constantly.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=1915</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>LaTeX on Debian Wheezy</title>
		<link>http://okomestudio.net/biboroku/?p=1870</link>
		<comments>http://okomestudio.net/biboroku/?p=1870#comments</comments>
		<pubDate>Sat, 29 Sep 2012 22:11:13 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Debian/Wheezy]]></category>
		<category><![CDATA[LaTeX]]></category>

		<guid isPermaLink="false">http://okomestudio.net/biboroku/?p=1870</guid>
		<description><![CDATA[Install basic packages for LaTeX: Use pdflatex to compile TeX documents. dvipng may be needed to render LaTeX on Matplotlib:]]></description>
				<content:encoded><![CDATA[<p>Install basic packages for LaTeX:</p>
<pre class="brush: bash; title: ; notranslate">$ sudo aptitude install texlive texlive-latex-extra</pre>
<p><!--<br />
 texlive-latex-extra texlive-math-extra<br />
$ sudo aptitude install texinfo cm-super[/bash]<br />
--></p>
<p>Use <em>pdflatex</em> to compile TeX documents.</p>
<p><code>dvipng</code> may be needed to render LaTeX on Matplotlib:</p>
<pre class="brush: bash; title: ; notranslate">$ sudo aptitude install dvipng</pre>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=1870</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing NixNote on Debian Wheezy</title>
		<link>http://okomestudio.net/biboroku/?p=1928</link>
		<comments>http://okomestudio.net/biboroku/?p=1928#comments</comments>
		<pubDate>Sat, 29 Sep 2012 21:20:47 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Debian/Wheezy]]></category>
		<category><![CDATA[Nevernote]]></category>

		<guid isPermaLink="false">http://okomestudio.net/biboroku/?p=1928</guid>
		<description><![CDATA[After downloading the .deb for 64-bit Wheezy, do:]]></description>
				<content:encoded><![CDATA[<p>After <a href="http://sourceforge.net/projects/nevernote/files/">downloading the .deb</a> for 64-bit Wheezy, do:</p>
<pre class="brush: bash; title: ; notranslate">$ sudo aptitude install default-jre
$ sudo dpkg -i nixnote-1.2_amd64.deb</pre>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=1928</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Debian Wheezy on Lenovo T420</title>
		<link>http://okomestudio.net/biboroku/?p=1821</link>
		<comments>http://okomestudio.net/biboroku/?p=1821#comments</comments>
		<pubDate>Thu, 27 Sep 2012 22:52:46 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Debian/Wheezy]]></category>
		<category><![CDATA[install procedure]]></category>
		<category><![CDATA[T420]]></category>

		<guid isPermaLink="false">http://okomestudio.net/biboroku/?p=1821</guid>
		<description><![CDATA[Some loser stole my T410s, so I was needing a quick replacement. With T430s on its way (ordered a month ago since I needed a backup anyways) but with the shipment being delayed for so long with hardware issues, I &#8230; <a href="http://okomestudio.net/biboroku/?p=1821">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Some loser stole my T410s, so I was needing a quick replacement. With T430s on its way (ordered a month ago since I needed a backup anyways) but with the shipment being delayed for so long with hardware issues, I could wait no longer and decided to get this one on budget. This T420 cost me $650 (actually wanted ThinkPad Edge for a couple hundred bucks less, but it wasn&#8217;t available at the store).</p>
<p>By the way, if you see a T410s with serial number R84K78G, it&#8217;s mine, stolen at a San Francisco Starbucks on September 9, 2012. Please report to police and have the douche bag who stole the thing well-deserved punishment&#8230;</p>
<h3>General Hardware Specifications</h3>
<p>My <a href="http://support.lenovo.com/en_US/research/hints-or-tips/detail.page?&amp;DocID=HT063244">Lenovo T420</a> is 4177X07. This is so-called T420i, a budget version of T420 with Intel Core i3. Not Linux certified but seems to work fine.</p>
<table width="100%" border="1" cellspacing="1" cellpadding="1">
<tbody>
<tr>
<td><em>Hardware Components</em></td>
<td><em>Status under Linux</em></td>
<td><em>Notes</em></td>
</tr>
<tr>
<td>Intel Core i3 2310M 2.1 GHz</td>
<td>Works</td>
<td></td>
</tr>
<tr>
<td>14.0 HD+ (1600 x 900)</td>
<td>Works</td>
<td></td>
</tr>
<tr>
<td>Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)</td>
<td>Works</td>
<td></td>
</tr>
<tr>
<td>NVIDIA Corporation GF119 [Quadro NVS 4200M]</td>
<td>Not tested</td>
<td></td>
</tr>
<tr>
<td>4 GB Memory</td>
<td>Works</td>
<td></td>
</tr>
<tr>
<td>320GB 7200rpm Hitachi HTS723232A7A364</td>
<td>Works</td>
<td></td>
</tr>
<tr>
<td>Intel Corporation 82579LM Gigabit Network Connection (rev 04)</td>
<td>Not tested</td>
<td></td>
</tr>
<tr>
<td>Intel Corporation Centrino Advanced-N 6205 (rev 34)</td>
<td>Works</td>
<td></td>
</tr>
<tr>
<td>HL-DT-STDVDRAM GT33N</td>
<td>Works</td>
<td></td>
</tr>
<tr>
<td>Sanyo 42T4791 Battery</td>
<td>Works</td>
<td></td>
</tr>
<tr>
<td>Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio</td>
<td>Works</td>
<td></td>
</tr>
<tr>
<td>Integrated Speaker &amp; Microphone</td>
<td>Not tested</td>
<td></td>
</tr>
<tr>
<td>ThinkLight</td>
<td>Works</td>
<td></td>
</tr>
<tr>
<td>TrackPoint &amp; TrackPad</td>
<td>Works</td>
<td></td>
</tr>
<tr>
<td>Keyboard</td>
<td>Not fully tested</td>
<td>Haven&#8217;t thoroughly tested special keys</td>
</tr>
</tbody>
</table>
<p>The stock kernel (3.2.0-3-amd64) seems to work fine with this configuration.</p>
<h3>Installing Debian Wheezy</h3>
<h4>Recovery Media</h4>
<p>Make sure to create factory recovery disks in case the factory default needs to be restored. In order to do this, on Windows 7, launch ThinkVantage and go to Factory Recovery Disks. Check both boot and data. Four blank DVDs were necessary for me (one for boot and three for data). After making the disks, it is recommended to test if they work or not by rebooting off the boot disk just created.</p>
<h4>Shrink the Windows Partition</h4>
<p>For T420, I decided to dual boot Windows 7 and Linux in case I ever need to run something on Windows (e.g., games). This is actually PITA to do due to &#8220;unmovable system files.&#8221; I found <a href="http://www.howtogeek.com/howto/windows-vista/working-around-windows-vistas-shrink-volume-inadequacy-problems/">this article</a> useful for what needs to be disabled before shrinking a partition on Windows (for me no external utilities were necessary to shrink it to the minimum).</p>
<h4>Installing Wheezy</h4>
<p>I decided to do netinst with wireless firmware already included into the boot media, so that I don&#8217;t have to bother with missing firemware during the install process while on WiFi. The latest installer at the writing is still at beta 2, but an ISO image is <a href="http://cdimage.debian.org/cdimage/unofficial/non-free/cd-including-firmware/wheezy_di_beta2/amd64/">available here</a>. Burn this onto a blank CD/DVD. The availability of netinst media with firmware made the whole process such a breeze! Simply boot off the DVD and follow the on-screen instruction.</p>
<h3>Installation Customization Options</h3>
<p>Debian installation has gotten easy enough that I don&#8217;t feel the need for this any more, but just for completeness, here goes.  Obviously this is just one way to customize.  I used the text installer.</p>
<ul>
<li>Language: English</li>
<li>Country, territory or area: United States</li>
<li>Keymap: American English</li>
<li><em>Primary network interface should be configured automatically, even if the installer complains about missing firmware.</em></li>
<li>Hostname: (choice)</li>
<li>Domain name: (choice)</li>
<li>Root password: (choice)</li>
<li>Full name for the new user: (choice)</li>
<li>Username for your account: (choice)</li>
<li>Choose a password for the new user: (choice)</li>
<li>Select your time zone: Pacific</li>
<li>Partitioning method: Manual</li>
</ul>
<p>I&#8217;m doing dual boot, but my Linux partition scheme is very simple:</p>
<pre class="brush: bash; title: ; notranslate">$ df -Tlh
Filesystem                    Type      Size  Used Avail Use% Mounted on
rootfs                        rootfs    491M  172M  295M  37% /
/dev/disk/by-uuid/cc0...      ext4      491M  172M  295M  37% /
/dev/sda6              　    ext4      101M   24M   72M  25% /boot
/dev/sda7               　   ext4      4.9G  201M  4.5G   5% /tmp
/dev/sda8                　  ext4      3.9G  1.2G  2.6G  32% /var
/dev/sda9                 　 ext4      9.8G  2.8G  6.6G  30% /usr
/dev/sda10                 　ext4      9.8G  318M  9.0G   4% /usr/local
/dev/sda12                 　ext4      168G  5.2G  154G   4% /home
</pre>
<ul>
<li>Debian archive mirror country: United States</li>
<li>Participate in the package usage survey: Yes</li>
<li>Choose software to install: (I want a fairly minimal install.  I only check ssh, laptop, and standard system utilities.)</li>
<li>Install the GRUB boot loader to the master boot record: Yes</li>
</ul>
<p>Reboot and a very simple Debian box is ready.  Upon the first reboot, I login as root and install a few essential packages for system administration, for example:</p>
<pre class="brush: bash; title: ; notranslate"># aptitude install sudo ssh rsync wget wireless-tools emacs</pre>
<p>and in case I need to run 32-bit applications:</p>
<pre class="brush: bash; title: ; notranslate"># aptitude install ia32-libs ia32-libs-gtk</pre>
<p>I also install basic KDE:</p>
<pre class="brush: bash; title: ; notranslate"># aptitude install kde-plasma-desktop kmix network-manager-kde</pre>
<h4>Setting up sudo</h4>
<p>At this point I add myself as an sudoer by adding username to <em>/etc/sudoers</em>, just under the entry for root, giving full admin privileges (i.e., just copy the line for root).</p>
<pre class="brush: bash; title: ; notranslate"># chmod 640 /etc/sudoers
# emacs -nw /etc/sudoers
 ... add a regular user to the list ... 
# chmod 440 /etc/sudoers</pre>
<h3>Manage Network with Network Manager</h3>
<p>After configuring the basic system, I had trouble using the KDE network manager.  The installing is simple as usual:</p>
<pre class="brush: bash; title: ; notranslate">$ sudo aptitude install network-manager-kde</pre>
<p>If I don&#8217;t see it on the system tray, right-click on the tray, System Tray Settings -&gt; Display -&gt; Extra Items, and check Network Management.</p>
<p>I found that the network manager neither found any WiFi access points nor recognized the ones that I added manually.  This seems to happen when I use WiFi to do netinst, in which case my <em>/etc/network/interfaces</em> includes the following lines:</p>
<pre class="brush: bash; title: ; notranslate">allow-hotplug wlan0
iface wlan0 inet dhcp
    wpa-ssid MYACCESSPOINT
    wpa-psk  MYPASSWORD</pre>
<p>Uncomment all these lines and perhaps add a new line instead:</p>
<pre class="brush: bash; title: ; notranslate">allow-hotplug eth0</pre>
<p>This will make the network manager work as usual.</p>
<h3>TrackPoint and TouchPad</h3>
<p>I can use the red <a href="http://okomestudio.net/biboroku/?p=1816">TrackPoint for scrolling</a>.  I usually disable TouchPad, since it interferes often with my palms.</p>
<h3>Suspend, Resume, and Power Management</h3>
<p>I have always been a type who turns off computer when not used, but I am now using suspend/resume frequently.  So this hasn&#8217;t been tested yet.  I have a set of power management tips on <a href="http://okomestudio.net/biboroku/?p=1875">separate post</a>, though.</p>
<p>One problem I have been having with T420 is that, when on battery, shutdown operation leads to reboot.  This seems to be caused by a kernel bug, but fortunately there is a solution (thanks to <a href="http://forums.lenovo.com/t5/T400-T500-and-newer-T-series/T430s-on-AC-Shutdown-restarts-not-shut-down-power-off/td-p/827335">this post</a>, which I pretty much duplicate here).  Create a file <em>/etc/init.d/shutdownfixes.sh</em>:</p>
<pre class="brush: bash; title: ; notranslate">#!/bin/sh -e
### BEGIN INIT INFO
# Provides:          shutdownfixes.sh 
# Required-Start:    
# Required-Stop:     
# X-Stop-After:      $network
# Default-Start:     
# Default-Stop:      0
# Short-Description: Fixes shutdown-to-reboot glitch.
# Description:       Fixes shutdown-to-reboot glitch.
### END INIT INFO

PATH=&quot;/sbin:/bin&quot;

echo -n &quot;Preparing PCI busses for shutdown...&quot;
for i in /sys/bus/pci/devices/*/power/control; do
  echo on &gt; $i
done
echo &quot;done.&quot;

echo -n &quot;Removing e1000e module...&quot;
lsmod | grep -q e1000e &amp;&amp; rmmod e1000e
echo &quot;done.&quot;</pre>
<p>Give this an executable permission:</p>
<pre class="brush: bash; title: ; notranslate">$ sudo chmod ugo+x /etc/init.d/shutdownfixes.sh</pre>
<p>and install it</p>
<pre class="brush: bash; title: ; notranslate">$ cd /etc/init.d
$ sudo update-rc.d shutdownfixes.sh 8 0 0 .</pre>
<p>On the next attempt, shutdown should be successful and not result in reboot.</p>
<h2>Miscellaneous</h2>
<h3>Installing Applications</h3>
<p>Here is a list of applications to install on my machine.  This is to be done&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=1821</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Power Management on Lenovo T420 with Debian Wheezy</title>
		<link>http://okomestudio.net/biboroku/?p=1875</link>
		<comments>http://okomestudio.net/biboroku/?p=1875#comments</comments>
		<pubDate>Sun, 23 Sep 2012 06:28:31 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Debian/Wheezy]]></category>
		<category><![CDATA[power management]]></category>
		<category><![CDATA[T420]]></category>

		<guid isPermaLink="false">http://okomestudio.net/biboroku/?p=1875</guid>
		<description><![CDATA[NOTE: This is an older method. I have moved on to using TLP and the amount of powersaving is quite amazing (yes, 6 &#8211; 7 W is possible!!). I will eventually try to update this post, but for now the &#8230; <a href="http://okomestudio.net/biboroku/?p=1875">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>NOTE: This is an older method.  I have moved on to using TLP and the amount of powersaving is quite amazing (yes, 6 &#8211; 7 W is possible!!).  I will eventually try to update this post, but for now <a href="http://okomestudio.net/biboroku/?p=1915">the solution that I wrote for T430s should be followed</a>.</p>
<p>Here is my continuously growing notes.  I use Debian Wheezy (amd64) on T420.</p>
<p>First, install must-have packages:</p>
<pre class="brush: bash; title: ; notranslate">$ sudo aptitude install powertop acpi acpid tp-smapi-dkms</pre>
<p>To load tp-smapi module on boot, add the line</p>
<pre class="brush: bash; title: ; notranslate">tp-smapi</pre>
<p>to <em>/etc/modules</em>.</p>
<p>To monitor the power consumption, use <em>powertop</em>:</p>
<pre class="brush: bash; title: ; notranslate">$ sudo powertop</pre>
<p>This is one of the most useful tool for power management.  I can see which processes wake up the computer most, and try to eliminate them one by one.</p>
<h2>Laptop Mode Configurations</h2>
<p>Install <em>laptop-mode-tools</em>:</p>
<pre class="brush: bash; title: ; notranslate">$ sudo aptitude install laptop-mode-tools</pre>
<p>In <em>/etc/laptop-mode/laptop-mode.conf</em>, make sure to have this line:</p>
<pre class="brush: bash; title: ; notranslate">ENABLE_AUTO_MODULES=1</pre>
<p>(which was set to 0 by default on Squeeze but does not appears to be the case for Wheezy).  When on battery this will apply a bunch of power saving settings.  This sole step should typically save about 2 &#8211; 2.5 W of power consumption according to <em>powertop</em>!  Note that wattage information only shows up while running on battery.</p>
<p>The following additional tweaks (overriding the default settings) are optional.</p>
<p>To disable ethernet when on battery, make sure <em>/etc/laptop-mode/conf.d/ethernet.conf</em> has the following lines:</p>
<pre class="brush: bash; title: ; notranslate">CONTROL_ETHERNET=&quot;auto&quot;
DISABLE_ETHERNET_ON_BATTERY=1</pre>
<p>For more aggressive power saving on Intel HDA, make sure <em>/etc/laptop-mode/conf.d/intel-hda-powersave.conf</em> has the following lines:</p>
<pre class="brush: bash; title: ; notranslate">CONTROL_INTEL_HDA_POWER=&quot;auto&quot;
INTEL_HDA_DEVICE_TIMEOUT=2
INTEL_HDA_DEVICE_CONTROLLER=1</pre>
<p>For more aggressive power saving on the wireless adapter, make sure /etc/laptop-mode/conf.d/wireless-iwl-power.conf has the following lines:</p>
<pre class="brush: bash; title: ; notranslate">CONTROL_IWL_POWER=&quot;auto&quot;
IWL_BATT_POWER=3</pre>
<p>After changing the configuration, restart laptop-mode:</p>
<pre class="brush: bash; title: ; notranslate">$ sudo /etc/init.d/laptop-mode restart</pre>
<p>to make the changes effective.</p>
<h3>Disabling Nepomuk, Strigi and Akonadi on KDE</h3>
<p>I am not fond of these daemon.  Disable them by going to System Settings -> Desktop Search and unchecking &#8220;Enable Nepomuk Semantic Desktop.&#8221;  In <em>~/.config/akonadi/akonadiserverrc</em>, set:</p>
<pre class="brush: bash; title: ; notranslate">StartServer=false</pre>
<p>so that it doesn&#8217;t start at all.  On <em>powertop</em>, this shows up as a service running mysqld constantly.</p>
<h3>Starting &amp; Stopping Services</h3>
<p>Some daemons running in the background can be stopped while on battery by laptop-mode.  If the init scripts are stored under <em>/etc/init.d</em>, the simplest method is to place a symlink to the init script under <em>/etc/laptop-mode/*-stop</em> directories.</p>
<p>For example, if I want to stop ssh from running while on battery, do this:</p>
<pre class="brush: bash; title: ; notranslate">$ cd /etc/laptop-mode/batt-stop
$ sudo ln -s /etc/init.d/ssh .</pre>
<p>Now, I want ssh to get restarted when on AC:</p>
<pre class="brush: bash; title: ; notranslate">$ cd /etc/[lm|nolm]-ac-start
$ sudo ln -s /etc/init.d/ssh .</pre>
<p>(depending on how laptop-mode is configured, I create a symlink either in <em>lm-ac-start</em> or <em>nolm-ac-start</em>.)</p>
<p>I should create similar symlinks for all services that should be stopped while on battery.</p>
<h3>Configuring System on Switch between AC &amp; Battery</h3>
<p>For certain things that laptop-mode does not take care of, I create a script which gets run each time the AC is plugged or unplugged.  Depending on the state (on battery or on AC), I change some settings.</p>
<p>Such a script may look like this:</p>
<pre class="brush: bash; title: ; notranslate">#!/bin/bash

if [ ! -f /sys/devices/platform/smapi/ac_connected ]; then
  exit 0
fi

TAG=pmtp
STATUS=`cat /sys/devices/platform/smapi/ac_connected`

if [ &quot;$STATUS&quot; = &quot;1&quot; ]; then
  logger -t $TAG &quot;on ac&quot;
  logger -t $TAG &quot;increasing swappiness&quot;
  sysctl -w vm.swappiness=60
else
  logger -t $TAG &quot;on battery&quot;
  logger -t $TAG &quot;reducing swappiness&quot;
  sysctl -w vm.swappiness=10
fi</pre>
<p>Let us save this script as <em>/usr/local/bin/pmtp</em>.  (FYI, this script changes the amount of swap disk usage, effectively reducing disk access while on battery.  This is a recommended thing to do.)</p>
<p>To let laptop-mode handle this script, modify <em>/etc/laptop-mode/conf.d/exec-commands.conf</em> to have these lines:</p>
<pre class="brush: bash; title: ; notranslate">BATT_EXEC_COMMAND_0=&quot;/usr/local/bin/pmtp&quot;
LM_AC_EXEC_COMMAND_0=&quot;/usr/local/bin/pmtp&quot;
NOLM_AC_EXEC_COMMAND_0=&quot;/usr/local/bin/pmtp&quot;</pre>
<p>This way the script gets run each time the AC/battery state changes.</p>
<p>For personal processes, KDE power management can also do some work by running a script upon dis/connecting with AC.  In particular, the sound for the KDE system notifications should be disabled entirely, because they cause quite a number of unwanted interruptions according to <em>powertop</em>.  Also, I wish to start/stop programs like flux and Dropbox when on battery just to squeeze more juice.  I create a script like this:</p>
<pre class="brush: bash; title: ; notranslate">#!/bin/bash
##############################################################################
# This is a script to run when AC/battery switches.  Ideally used
# within the power management configuration setting on KDE.  Requires
# tp_smapi to be loaded for the detection of AC/battery.

USERNAME=johndoe
LATITUDE=37.78
LONGITUDE=-122.42


##############################################################################
# DO NOT MODIFY BELOW 

if [ ! -f /sys/devices/platform/smapi/ac_connected ]; then
    exit 0
fi

TAG=pmpersonal
STATUS=`cat /sys/devices/platform/smapi/ac_connected`

if [ &quot;$STATUS&quot; = &quot;1&quot; ]; then
    logger -t $TAG &quot;on ac&quot;

    logger -t $TAG &quot;start xflux&quot;
    for i in `pgrep ^xflux$` ; do kill -9 $i ; done
    xflux -l $LATITUDE -g $LONGITUDE

    logger -t $TAG &quot;start dropbox&quot;
    dropbox stop
    dropbox start

    logger -t $TAG &quot;enable system notification&quot;
    kwriteconfig --file=&quot;/home/$USERNAME/.kde/share/config/knotifyrc&quot; --group=Sounds --key=&quot;No sound&quot; false
else
    logger -t $TAG &quot;on battery&quot;

    logger -t $TAG &quot;stop xflux&quot;
    for i in `pgrep ^xflux$` ; do kill -9 $i ; done

    logger -t $TAG &quot;stop dropbox&quot;
    dropbox stop

    logger -t $TAG &quot;disable system notification&quot;
    kwriteconfig --file=&quot;/home/$USERNAME/.kde/share/config/knotifyrc&quot; --group=Sounds --key=&quot;No sound&quot; true
fi</pre>
<p>Save this to <em>~/bin/pmpersonal.sh</em>.  Go to System Settings -> Power Management -> Energy Saving Settings.  There, for each of &#8220;On AC,&#8221; &#8220;On Battery,&#8221; and &#8220;On Low Battery,&#8221; I can set different configurations.  I can also specify &#8220;Run Script&#8221; option for each profile to enable/disable a few desktop related applications and settings.  The script should be run on profile load.</p>
<h3>Disabling Bluetooth</h3>
<p>To control the on/off status of wireless device on the command line, I need:</p>
<pre class="brush: bash; title: ; notranslate">$ sudo aptitude install rfkill
... below is an example usage ...
$ rfkill list</pre>
<p>I can live without Bluetooth entirely (in fact, my T420 does not have Bluetooth).  To disable Bluetooth at boot time, add the following line:</p>
<pre class="brush: bash; title: ; notranslate">rfkill block bluetooth</pre>
<p>to <em>/etc/rc.local</em> before the “exit 0″ statement.</p>
<h3>Preload Daemon</h3>
<pre class="brush: bash; title: ; notranslate">$ sudo aptitude install preload</pre>
<p>In <em>/etc/default/preload</em>, uncomment the line reading</p>
<pre class="brush: bash; title: ; notranslate">OPTIONS=&quot;-l /dev/null&quot;</pre>
<p>This should reduce disk activity.</p>
<h3>Changing Swappiness</h3>
<p>On the command line,</p>
<pre class="brush: bash; title: ; notranslate">$ sudo sysctl -w vm.swappiness=10</pre>
<p>The system will try to use physical RAM as much as possible instead of swapping.  To make this in effect upon boot, add the line</p>
<pre class="brush: bash; title: ; notranslate">vm.swappiness=10</pre>
<p>to <em>/etc/sysctl.conf</em>.  However, I opt to change this particular setting dynamically using a custom script described above.</p>
<h3>Battery Charge Thresholds</h3>
<p>To extend battery life, charge thresholds should be tweaked.  My current settings are:</p>
<pre class="brush: bash; title: ; notranslate">$ echo 90 | sudo tee /sys/devices/platform/smapi/BAT0/start_charge_thresh
$ echo 95 | sudo tee /sys/devices/platform/smapi/BAT0/stop_charge_thresh</pre>
<p>Do this for each battery in my system (BAT0, BAT1, etc.)</p>
<h3>Chromium over Firefox</h3>
<p>My default browser is Firefox.  When browsing the web, however, Chromium is much easier on power.  I can save about 1 W using Chromium.</p>
<h3>Powertop Status</h3>
<p>Currently, I typically use 11 &#8211; 13 W during typical usage.</p>
<h3>Reference</h3>
<ul>
<li><a href="http://www.thinkwiki.org/wiki/How_to_reduce_power_consumption">ThinkWiki</a> – A great resource for ThinkPad Linux users.</li>
<li><a href="http://pcplus.techradar.com/node/3172/">PC Plus article</a> &#8211; See especially the comment section.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=1875</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Installing Firefox on Debian Wheezy</title>
		<link>http://okomestudio.net/biboroku/?p=1868</link>
		<comments>http://okomestudio.net/biboroku/?p=1868#comments</comments>
		<pubDate>Sat, 22 Sep 2012 08:05:42 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Debian/Wheezy]]></category>
		<category><![CDATA[Firefox]]></category>

		<guid isPermaLink="false">http://okomestudio.net/biboroku/?p=1868</guid>
		<description><![CDATA[I don&#8217;t like to get stuck with a very old version of browser, so I install a Firefox binary provided by Mozilla, not the one by Debian. Make sure to download a 64-bit version (as I use amd64) from here. &#8230; <a href="http://okomestudio.net/biboroku/?p=1868">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I don&#8217;t like to get stuck with a very old version of browser, so I install a Firefox binary provided by Mozilla, not the one by Debian.</p>
<p>Make sure to download a 64-bit version (as I use amd64) from <a href="http://releases.mozilla.org/pub/mozilla.org/firefox/releases/latest/linux-x86_64/">here</a>.  The tarball expands to a directory named <em>firefox</em>.  For example:</p>
<pre class="brush: bash; title: ; notranslate">$ cd /usr/local/src
$ sudo wget http://releases.mozilla.org/pub/mozilla.org/firefox/releases/latest/linux-x86_64/en-US/firefox-15.0.1.tar.bz2
$ sudo tar -xvjf firefox-15.0.1.tar.bz2
$ sudo mv firefox ..
$ cd /usr/local/bin
$ sudo ln -s ../firefox/firefox .</pre>
<p>This makes <em>firefox</em> command available system-wide.</p>
<p>To install flash, do:</p>
<pre class="brush: bash; title: ; notranslate">$ sudo aptitude install flashplugin-nonfree</pre>
<p>To install Java plugin, do:</p>
<pre class="brush: bash; title: ; notranslate">$ sudo aptitude install icedtea-7-plugin</pre>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=1868</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Skype on Debian Wheezy</title>
		<link>http://okomestudio.net/biboroku/?p=1851</link>
		<comments>http://okomestudio.net/biboroku/?p=1851#comments</comments>
		<pubDate>Sat, 22 Sep 2012 06:35:39 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Debian/Wheezy]]></category>
		<category><![CDATA[install procedure]]></category>
		<category><![CDATA[Skype]]></category>

		<guid isPermaLink="false">http://okomestudio.net/biboroku/?p=1851</guid>
		<description><![CDATA[Go to Skype web site and download an appropriate version (Debian 6.0 64-bit for me) of the deb file. Then simply works.]]></description>
				<content:encoded><![CDATA[<p>Go to <a href="http://www.skype.com">Skype web site</a> and download an appropriate version (Debian 6.0 64-bit for me) of the deb file.  Then</p>
<pre class="brush: bash; title: ; notranslate">$ sudo aptitude install ia32-libs ia32-libs-gtk
$ sudo dpkg -i skype-debian_4.0.0.8-1_amd64.deb</pre>
<p>simply works.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=1851</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Japanese on Debian Wheezy</title>
		<link>http://okomestudio.net/biboroku/?p=1834</link>
		<comments>http://okomestudio.net/biboroku/?p=1834#comments</comments>
		<pubDate>Sat, 22 Sep 2012 04:23:39 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[Debian/Wheezy]]></category>
		<category><![CDATA[install procedure]]></category>
		<category><![CDATA[Japanese]]></category>

		<guid isPermaLink="false">http://okomestudio.net/biboroku/?p=1834</guid>
		<description><![CDATA[The goal is to make the system capable for Japanese input, while letting the base system remain English. For the Japanese input method, I had been using Anthy, but I will be using mozc, which is now better supported and &#8230; <a href="http://okomestudio.net/biboroku/?p=1834">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>The goal is to make the system capable for Japanese input, while letting the base system remain English.  For the Japanese input method, I had been using  <a href="http://anthy.sourceforge.jp/">Anthy</a>, but I will be using <a href="http://code.google.com/p/mozc/">mozc</a>, which is now better supported and presumably much better (it is).</p>
<p>First, set up locales and install <em>im-config</em>.  In addition to my base English locale (<em>en_US.UTF-8</em>), install Japnese locales <em>ja_JP.EUC-JP</em> and <em>ja_JP.UTF-8</em>:</p>
<pre class="brush: bash; title: ; notranslate">$ sudo aptitude install locales im-config
$ sudo dpkg-reconfigure locales</pre>
<p>Set the default locale for the system to <em>en_US.UTF-8</em>.</p>
<p>Install some Japanese fonts:</p>
<pre class="brush: bash; title: ; notranslate">$ sudo aptitude install ttf-kochi-mincho ttf-kochi-gothic ttf-sazanami-mincho</pre>
<h3>IBus</h3>
<p>Install <a href="http://code.google.com/p/ibus/">IBus</a>-related packages and configure for KDE:</p>
<pre class="brush: bash; title: ; notranslate">$ sudo aptitude install ibus ibus-mozc ibus-qt4 ibus-gtk ibus-gtk3 ibus-clutter
$ im-config
... choose IBus ...</pre>
<p>Run the IBus setup program:</p>
<pre class="brush: bash; title: ; notranslate">$ ibus-setup</pre>
<p>If asked, start ibus-daemon.  Logout the KDE sesssion, restart X session, and login again.  Under the Input Method tab, add &#8220;Japanese &#8211; Mozc&#8221;.  Configure IBus to my liking, such as making Ctrl + Space (as opposed to Shift + Space) trigger the Japanese input mode.  The IBus icon also shows up in the system tray, from which various settings can be changed.</p>
<h3>Mozc</h3>
<p>Run</p>
<pre class="brush: bash; title: ; notranslate">$ sudo aptitude install ibus-mozc mozc-utils-gui
$ /usr/lib/mozc/mozc_tool --mode=config_dialog</pre>
<p>to configure Mozc to my liking.</p>
<h3>Using Japanese in Emacs</h3>
<p>Install <em>ibus-el</em>:</p>
<pre class="brush: bash; title: ; notranslate">$ sudo aptitude install ibus-el</pre>
<p>Within emacs, <em>M-x ibus-mode</em> will toggle IBus on and off.  Very easy!</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=1834</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>NX Client on Debian Wheezy</title>
		<link>http://okomestudio.net/biboroku/?p=1819</link>
		<comments>http://okomestudio.net/biboroku/?p=1819#comments</comments>
		<pubDate>Fri, 21 Sep 2012 19:33:57 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Debian/Wheezy]]></category>
		<category><![CDATA[install procedure]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[NX]]></category>

		<guid isPermaLink="false">http://okomestudio.net/biboroku/?p=1819</guid>
		<description><![CDATA[My preferred NX client is NoMachine. Simply download the AMD64 version of deb package and do: On KDE, the short cuts will be under Applications -> Internet. The installation is under /usr/NX.]]></description>
				<content:encoded><![CDATA[<p>My preferred NX client is <a href="http://www.nomachine.com/download-package.php?Prod_Id=3829">NoMachine</a>.  Simply download the AMD64 version of deb package and do:</p>
<pre class="brush: bash; title: ; notranslate">$ sudo dpkg -i nxclient_3.5.0-7_amd64.deb</pre>
<p>On KDE, the short cuts will be under Applications -> Internet.  The installation is under <em>/usr/NX</em>.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=1819</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enabling ThinkPad TrackPoint Scrolling on Debian</title>
		<link>http://okomestudio.net/biboroku/?p=1816</link>
		<comments>http://okomestudio.net/biboroku/?p=1816#comments</comments>
		<pubDate>Fri, 21 Sep 2012 18:21:42 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[ThinkPad]]></category>
		<category><![CDATA[TrackPoint]]></category>

		<guid isPermaLink="false">http://okomestudio.net/biboroku/?p=1816</guid>
		<description><![CDATA[One of the major reason for using ThinkPad is that red TrackPoint thing, which allows the control of cursor without leaving the keyboard. However, when I install Linux on a new ThinkPad, scrolling often does not work out of the &#8230; <a href="http://okomestudio.net/biboroku/?p=1816">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>One of the major reason for using ThinkPad is that red TrackPoint thing, which allows the control of cursor without leaving the keyboard.  However, when I install Linux on a new ThinkPad, scrolling often does not work out of the box.  There are several ways to do this, but my preferred way is to use <code>xinput</code>:</p>
<pre class="brush: bash; title: ; notranslate">$ sudo aptitude install xinput</pre>
<p>See what event ID is associated with TrackPoint:</p>
<pre class="brush: bash; title: ; notranslate">$ xinput list
⎡ Virtual core pointer                          id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ SynPS/2 Synaptics TouchPad                id=11   [slave  pointer  (2)]
⎜   ↳ TPPS/2 IBM TrackPoint                     id=13   [slave  pointer  (2)]
⎣ Virtual core keyboard                         id=3    [master keyboard (2)]
    ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]
    ↳ Power Button                              id=6    [slave  keyboard (3)]
    ↳ Video Bus                                 id=7    [slave  keyboard (3)]
    ↳ Sleep Button                              id=8    [slave  keyboard (3)]
    ↳ Integrated Camera                         id=9    [slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard              id=10   [slave  keyboard (3)]
    ↳ ThinkPad Extra Buttons                    id=12   [slave  keyboard (3)]
    ↳ ACPI Virtual Keyboard Device              id=14   [slave  keyboard (3)]</pre>
<p>The TrackPoint’s ID is 13 in my current configuration.  </p>
<pre class="brush: bash; title: ; notranslate">$ xinput --set-prop --type=int --format=8 13 &quot;Evdev Wheel Emulation&quot; 1
$ xinput --set-prop --type=int --format=8 13 &quot;Evdev Wheel Emulation Button&quot; 2
$ xinput --set-prop --type=int --format=8 13 &quot;Evdev Wheel Emulation Axes&quot; 6 7 4 5</pre>
<p>The change should be noticeable immediately; moving TrackPoint while pressing down the blue middle button right below the space bar acts as scroll, both vertically and horizontally.</p>
<p>I can also do this automatically on start-up by having the same lines in <em>~/.xsessionrc</em> (create this file if it does not already exist):</p>
<pre class="brush: bash; title: ; notranslate">#!/bin/bash

# extract device id
s=`xinput | grep TrackPoint`
s=&quot;${s#*id=}&quot;
id=${s:0:2}

xinput --set-prop --type=int --format=8 &quot;$id&quot; &quot;Evdev Wheel Emulation&quot; 1
xinput --set-prop --type=int --format=8 &quot;$id&quot; &quot;Evdev Wheel Emulation Button&quot; 2
xinput --set-prop --type=int --format=8 &quot;$id&quot; &quot;Evdev Wheel Emulation Axes&quot; 6 7 4 5</pre>
<p>Note that the device ID may change depending on the environment (e.g., attaching USB mouse on boot, disabling graphics card, etc.), so this kind of automation is useful and prevents WTF moments when you notice TrackPoint scrolling suddenly stops working.</p>
<p>Now that TrackPoint can be used for scrolling, I see little reason to enable TrackPad (I think I have a mild case of hyperhydrosis, so I have developed aversion to thermally sensitive touch/track pad).  TrackPad can be disabled in BIOS to save power consumption as well as to prevent accidentally touching it with my palms while typing.  </p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=1816</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Installing Dropbox on Debian Wheezy</title>
		<link>http://okomestudio.net/biboroku/?p=1814</link>
		<comments>http://okomestudio.net/biboroku/?p=1814#comments</comments>
		<pubDate>Fri, 21 Sep 2012 17:53:42 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[Debian/Wheezy]]></category>
		<category><![CDATA[Dropbox]]></category>
		<category><![CDATA[install procedure]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://okomestudio.net/biboroku/?p=1814</guid>
		<description><![CDATA[Go to the Dropbox download website and download the .deb package, here dropbox_1.4.0_amd64.deb. Then The program will be listed under the menu Applications -> Internet. On the first launch it will download the daemon and I will need to go &#8230; <a href="http://okomestudio.net/biboroku/?p=1814">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Go to the Dropbox download website and download the .deb package, here <em>dropbox_1.4.0_amd64.deb</em>.  Then</p>
<pre class="brush: bash; title: ; notranslate">$ sudo aptitude install python-gtk2 python-gpgme
$ sudo dpkg -i dropbox_1.4.0_amd64.deb</pre>
<p>The program will be listed under the menu Applications -> Internet.  On the first launch it will download the daemon and I will need to go through the guided setup process which should be self-explanatory.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=1814</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Browsing command history on Bash</title>
		<link>http://okomestudio.net/biboroku/?p=1806</link>
		<comments>http://okomestudio.net/biboroku/?p=1806#comments</comments>
		<pubDate>Thu, 06 Sep 2012 00:45:44 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[shell tips]]></category>

		<guid isPermaLink="false">http://okomestudio.net/biboroku/?p=1806</guid>
		<description><![CDATA[This is useful for finding a command that was executed a while ago but still in the history: where search_term is the term to search for within my history, and history_number is the number which identifies that command in the &#8230; <a href="http://okomestudio.net/biboroku/?p=1806">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>This is useful for finding a command that was executed a while ago but still in the history:</p>
<pre class="brush: bash; title: ; notranslate">$ history | grep search_term
...
$ !history_number</pre>
<p>where <em>search_term</em> is the term to search for within my history, and <em>history_number</em> is the number which identifies that command in the history output.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=1806</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Some control+key commands on Linux shell</title>
		<link>http://okomestudio.net/biboroku/?p=1799</link>
		<comments>http://okomestudio.net/biboroku/?p=1799#comments</comments>
		<pubDate>Tue, 04 Sep 2012 21:08:42 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[shell tips]]></category>

		<guid isPermaLink="false">http://okomestudio.net/biboroku/?p=1799</guid>
		<description><![CDATA[There are a couple I keep forgetting to remember: ctrl-s freezes the screen and stops any display on the screen from continuing (equivalent to a no-scroll key) (sometimes takes a moment to work) ctrl-q un-freezes the screen and lets screen &#8230; <a href="http://okomestudio.net/biboroku/?p=1799">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>There are a couple I keep forgetting to remember:</p>
<pre>ctrl-s
    freezes the screen and stops any display on the screen from continuing 
    (equivalent to a no-scroll key) (sometimes takes a moment to work) 
ctrl-q
    un-freezes the screen and lets screen display continue 
ctrl-c
    interrupts a running program 
ctrl-\
    same as ctrl-c but stronger (used when terminal doesn't respond) 
ctrl-z
    suspends a running program (use the fg command to continue the program, see section Controlling Jobs) 
ctrl-h
    deletes last character typed 
ctrl-w
    deletes last word typed 
ctrl-u
    deletes last line typed 
ctrl-r
    redraws last line typed 
ctrl-d
    ends text input for many UNIX programs, including mail and write. 
</pre>
<p>(Originally from <a href="http://web.cecs.pdx.edu/~rootd/catdoc/guide/TheGuide_38.html">this page</a>.)</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=1799</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Running Tornado on dotCloud</title>
		<link>http://okomestudio.net/biboroku/?p=1781</link>
		<comments>http://okomestudio.net/biboroku/?p=1781#comments</comments>
		<pubDate>Mon, 23 Jul 2012 05:56:14 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[DotCloud]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Tornado]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://okomestudio.net/biboroku/?p=1781</guid>
		<description><![CDATA[To brush up my web development skills, I decided to try Tornado. I also wanted to find a hosting service of some sort for my projects, which must be cheap and developer friendly. There, dotCloud seemed very nice and I &#8230; <a href="http://okomestudio.net/biboroku/?p=1781">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>To brush up my web development skills, I decided to try <a href="http://www.tornadoweb.org/">Tornado</a>.  I also wanted to find a hosting service of some sort for my projects, which must be cheap and developer friendly.  There, <a href="http://www.dotcloud.com/">dotCloud</a> seemed very nice and I wanted to give it a shot.  From what I gather, the support for Tornado is still on a <a href="http://answers.dotcloud.com/question/439/tornado-on-dotcloud">best-effort basis</a>, so things may still be fluid, but so far I like everything about the platform.  Very intuitive and easy to use.</p>
<p>However, I was having a hard time finding a simple working example of using Tornado on dotCloud.  I&#8217;m totally a beginner in the application stack after all, so I wanted to see a &#8220;hello world&#8221; all done nicely with Tornado on dotCloud, and keep modifying it to experiment things.</p>
<p>It turns out, <a href="https://github.com/dotcloud/tornado-on-dotcloud">there is one</a>, and deploying it is easy.  Assuming that I have installed CLI properly already, all I need to do is this:</p>
<pre class="brush: bash; title: ; notranslate">$ git clone git://github.com/jpetazzo/tornado-on-dotcloud
$ mv tornado-on-dotcloud tornadotest
$ cd tornadotest
$ rm -rf .git
$ dotcloud create tornadotest
$ dotcloud push tornadotest .</pre>
<p>In the <em>tornadotest</em> directory, I can modify <em>main.py</em> to do other stuff.  </p>
<p>For a dotCloud beginner, the line
<pre class="brush: bash; title: ; notranslate">$ rm -rf .git</pre>
<p> was important!  I did not know the dotCloud push process was actually integrated with the existing git repository, and after modifying <em>main.py</em> countless times and pushing the changes only to see them never being reflected on the sandbox, I was <em>this</em> close to taking my own life (and being Japanese, I&#8217;m naturally very good at suicide).  Alternatively, I could keep logging the changes to the git repo, instead of removing it.  Then, every time I make a change to a file, I do the usual add-commit sequence of git, before pushing via <em>dotcloud</em> command.  That&#8217;s another way of avoiding suicidal thoughts.</p>
<p>All that took a day to figure out!  Lack of documentation or unwillingness to read through it is always a source of frustration.  Otherwise, I think I&#8217;m in love with dotCloud to the extent that I won&#8217;t ever need to have a wife.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=1781</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Searching for Nearest-Neighbors between Two Coordinate Catalogs</title>
		<link>http://okomestudio.net/biboroku/?p=1768</link>
		<comments>http://okomestudio.net/biboroku/?p=1768#comments</comments>
		<pubDate>Fri, 29 Jun 2012 00:26:03 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[astro]]></category>
		<category><![CDATA[computing]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[research]]></category>
		<category><![CDATA[scipy]]></category>

		<guid isPermaLink="false">http://okomestudio.net/biboroku/?p=1768</guid>
		<description><![CDATA[Say I have two catalogs of points, each in two-dimensional space. For each object in a catalog, I want to find the nearest object(s) in the other catalog. I can do this by computing the distances between every single unique &#8230; <a href="http://okomestudio.net/biboroku/?p=1768">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Say I have two catalogs of points, each in two-dimensional space.  For each object in a catalog, I want to find the nearest object(s) in the other catalog.  I can do this by computing the distances between every single unique pairs of objects and find the ones within a search radius and possibly doing an additional sort.  However, there is a much more efficient way using <a href="http://en.wikipedia.org/wiki/K-d_tree">k-d tree</a>, and Scipy has the class for doing this sort of thing fairly easily.</p>
<p>Here is an example Python code:</p>
<pre class="brush: python; title: ; notranslate">#!/usr/bin/env python2.6
from cProfile import Profile
import numpy as np
from numpy.random import random
from scipy.spatial import KDTree, cKDTree


def getnnidx(d1, d2, r):
    t1 = KDTree(d1)
    t2 = KDTree(d2)
    idx = t1.query_ball_tree(t2, r)
    return idx


def cgetnnidx(d1, d2, r, k=5):
    t = cKDTree(d2)
    d, idx = t.query(d1, k=k, eps=0, p=2, distance_upper_bound=r)
    return idx


def main():
    # number of points
    np1 = 4000
    np2 = 2000

    # search radius
    r = 0.01

    # prepare coordinates; the input data for the constructor of
    # KCTree needs to be in the form:
    #
    #   data = [[x0, y0], [x1, y1], ... , [xN, yN]]
    #
    d1 = np.empty((np1, 2))
    d2 = np.empty((np2, 2))
    d1[:, 0] = random(np1)
    d1[:, 1] = random(np1)
    d2[:, 0] = random(np2)
    d2[:, 1] = random(np2)

    # profile two versions of KDTree implementations
    p = Profile()

    result = p.runcall(getnnidx, d1.copy(), d2.copy(), r)
    p.print_stats()

    p.clear()
    
    result = p.runcall(cgetnnidx, d1.copy(), d2.copy(), r)
    p.print_stats()


if __name__ == '__main__':
    main()</pre>
<p>When I run this script, I get the following output:</p>
<pre class="brush: plain; title: ; notranslate">         706932 function calls (692470 primitive calls) in 1.663 CPU seconds

   Ordered by: standard name

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
     1720    0.001    0.000    0.004    0.000 fromnumeric.py:1067(nonzero)
        2    0.000    0.000    0.000    0.000 fromnumeric.py:1147(shape)
    42293    0.046    0.000    0.224    0.000 fromnumeric.py:1314(sum)
        2    0.000    0.000    0.000    0.000 fromnumeric.py:1708(amax)
        2    0.000    0.000    0.000    0.000 fromnumeric.py:1769(amin)
      860    0.001    0.000    0.002    0.000 fromnumeric.py:664(argmax)
    14462    0.008    0.000    0.025    0.000 function_base.py:776(copy)
        2    0.000    0.000    0.045    0.022 kdtree.py:113(__init__)
      862    0.001    0.000    0.001    0.000 kdtree.py:139(__init__)
      860    0.001    0.000    0.001    0.000 kdtree.py:143(__init__)
   1722/2    0.033    0.000    0.045    0.022 kdtree.py:150(__build)
    42293    0.183    0.000    0.992    0.000 kdtree.py:22(minkowski_distance)
    12744    0.085    0.000    0.104    0.000 kdtree.py:36(__init__)
        1    0.002    0.002    1.618    1.618 kdtree.py:437(query_ball_tree)
  12743/1    0.270    0.000    1.616    1.616 kdtree.py:462(traverse_checking)
     6371    0.031    0.000    0.157    0.000 kdtree.py:49(split)
    42293    0.372    0.000    0.682    0.000 kdtree.py:7(minkowski_distance_p)
    12743    0.133    0.000    0.430    0.000 kdtree.py:72(min_distance_rectangle)
     7385    0.052    0.000    0.219    0.000 kdtree.py:76(max_distance_rectangle)
   169174    0.095    0.000    0.213    0.000 numeric.py:201(asarray)
        1    0.000    0.000    1.663    1.663 xmatch.py:8(getnnidx)
    57063    0.036    0.000    0.036    0.000 {isinstance}
     5164    0.001    0.000    0.001    0.000 {len}
      860    0.001    0.000    0.001    0.000 {method 'argmax' of 'numpy.ndarray' objects}
    25488    0.019    0.000    0.019    0.000 {method 'astype' of 'numpy.ndarray' objects}
        1    0.000    0.000    0.000    0.000 {method 'disable' of '_lsprof.Profiler' objects}
        2    0.000    0.000    0.000    0.000 {method 'max' of 'numpy.ndarray' objects}
        2    0.000    0.000    0.000    0.000 {method 'min' of 'numpy.ndarray' objects}
     1720    0.003    0.000    0.003    0.000 {method 'nonzero' of 'numpy.ndarray' objects}
    42293    0.146    0.000    0.146    0.000 {method 'sum' of 'numpy.ndarray' objects}
    22165    0.008    0.000    0.008    0.000 {method 'tolist' of 'numpy.ndarray' objects}
        2    0.000    0.000    0.000    0.000 {numpy.core.multiarray.arange}
   183636    0.135    0.000    0.135    0.000 {numpy.core.multiarray.array}
        1    0.000    0.000    0.000    0.000 {range}


         32 function calls in 0.008 CPU seconds

   Ordered by: standard name

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
        3    0.000    0.000    0.000    0.000 fromnumeric.py:107(reshape)
        3    0.000    0.000    0.000    0.000 fromnumeric.py:1147(shape)
        1    0.000    0.000    0.000    0.000 fromnumeric.py:1708(amax)
        1    0.000    0.000    0.000    0.000 fromnumeric.py:1769(amin)
        1    0.000    0.000    0.000    0.000 fromnumeric.py:1865(prod)
        1    0.000    0.000    0.000    0.000 fromnumeric.py:32(_wrapit)
        2    0.000    0.000    0.000    0.000 numeric.py:201(asarray)
        4    0.000    0.000    0.000    0.000 numeric.py:314(ascontiguousarray)
        1    0.000    0.000    0.008    0.008 xmatch.py:15(cgetnnidx)
        1    0.000    0.000    0.000    0.000 {getattr}
        1    0.000    0.000    0.000    0.000 {method 'disable' of '_lsprof.Profiler' objects}
        1    0.000    0.000    0.000    0.000 {method 'max' of 'numpy.ndarray' objects}
        1    0.000    0.000    0.000    0.000 {method 'min' of 'numpy.ndarray' objects}
        1    0.000    0.000    0.000    0.000 {method 'prod' of 'numpy.ndarray' objects}
        1    0.007    0.007    0.007    0.007 {method 'query' of 'scipy.spatial.ckdtree.cKDTree' objects}
        3    0.000    0.000    0.000    0.000 {method 'reshape' of 'numpy.ndarray' objects}
        6    0.000    0.000    0.000    0.000 {numpy.core.multiarray.array}</pre>
<p>from which it is clear that cKDTree is much faster (1.663 vs. 0.008 seconds!).  Not surprising given cKDTree is a C implementation of basically the same thing.</p>
<p>These classes are not exactly equivalent and therefore the outputs are different.  KDTree.query_ball_tree returns:</p>
<pre class="brush: plain; title: ; notranslate">
[[],
 [216, 1767],
 [317],
 ...,
 [],
 [367],
 [1465, 1899]]</pre>
<p>which is an array of indices of nearest neighbors.  If an object is not found within the search radius, it simply returns an array of zero element.</p>
<p>cKDTree.query, on the other hand, returns something like</p>
<pre class="brush: plain; title: ; notranslate">[[2000 2000 2000 2000 2000]
 [ 216 1767 2000 2000 2000]
 [ 317 2000 2000 2000 2000]
 ..., 
 [2000 2000 2000 2000 2000]
 [ 367 2000 2000 2000 2000]
 [1465 1899 2000 2000 2000]]</pre>
<p>which is an array of indices of five nearest neighbors.  When not found within a search radius, it uses the number of elements as a place holder.  The number of nearest neighbors to retain can be specified by the input argument (k).</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=1768</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Ubuntu (12.04 LTS 64-bit) from an ISO Image on Hard Drive</title>
		<link>http://okomestudio.net/biboroku/?p=1748</link>
		<comments>http://okomestudio.net/biboroku/?p=1748#comments</comments>
		<pubDate>Mon, 14 May 2012 05:23:21 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[install procedure]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[XPS 630i]]></category>

		<guid isPermaLink="false">http://okomestudio.net/biboroku/?p=1748</guid>
		<description><![CDATA[Sometimes it&#8217;s useful to be able to install Linux off an ISO image on hard drive for whatever reason. My Dell XPS 630i has had some issues when I was installing Debian off an install CD/USB, likely related to how &#8230; <a href="http://okomestudio.net/biboroku/?p=1748">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Sometimes it&#8217;s useful to be able to install Linux off an ISO image on hard drive for whatever reason. My Dell XPS 630i has had some issues when I was installing Debian off an install CD/USB, likely related to how GRUB 2 does not gracefully deals with SATA configuration particular to this machine (the install process doesn&#8217;t appear to recognize <em>/dev/sdaX</em> properly at some point, ending up in IO errors or kernel panic). In any case, I could solve this by installing Linux off a pre-partitioned hard drive.  This time, I install Ubuntu.  (I&#8217;m giving my XPS 630i away before moving back to the States!)</p>
<p>Here goes the procedure.  I assume that I am installing Ubuntu from scratch and hard drive has been formatted.</p>
<p>First, I need a Linux Live media, whatever from which I can boot the computer.  I burn a CD for this particular post.  Go to the <a href="http://www.ubuntu.com/download/desktop">Ubuntu website</a>, download an ISO image (here <em>ubuntu-12.04-desktop-amd64.iso</em>), and burn a Live CD.</p>
<p>Boot up the computer off Ubuntu Live (do not install at this point!) and prepare the disk partitions, using <a href="http://gparted.sourceforge.net/"><em>GParted</em></a>.  It would be best to create full partition scheme at this point, so during the installation I can simply format them without repartitioning.  For Ubuntu, the root partition (&#8220;/&#8221;) must be at least 2.5 GB, otherwise the installer may complain.  Typically, a <em>/boot</em> partition needs to be about 300 MB or so, but I store all my ISO files under <em>/boot/iso</em>, so I will use 3 GB for the partition just in case.  (For an Ubuntu ISO image, 700 MB may be enough but for Linux Mint, I may need 2 GB, for example; I can also store multiple ISO images if I wish.)  Here&#8217;s the partition scheme:</p>
<pre class="brush: bash; title: ; notranslate">Filesystem            Size   Mounted on
/dev/sda5               3G   /
/dev/sda6               3G   /boot
/dev/sda7              10G   /tmp
/dev/sda8               6G   /var
/dev/sda9              10G   /usr
/dev/sda10             20G   /usr/local
/dev/sda11              8G   Linux Swap
/dev/sda12            690G   /home</pre>
<p>Then on Terminal I install GRUB 2 on <em>/dev/sda</em>:</p>
<pre class="brush: bash; title: ; notranslate">$ sudo mount /dev/sda5 /mnt
$ sudo mkdir /mnt/boot
$ sudo mount /dev/sda6 /mnt/boot
$ sudo grub-install --root-directory=/mnt /dev/sda
$ sudo mkdir /mnt/boot/boot-isos
$ sudo cp ~/Downloads/ubuntu-12.04-desktop-amd64.iso /mnt/boot/boot-isos
$ sudo umount /mnt/boot
$ sudo umount /mnt</pre>
<p>I assumed that the ISO image was already downloaded to <em>~/Downloads</em> directory.  Now, reboot and on the GRUB prompt, follow this to boot off the ISO image:</p>
<pre class="brush: bash; title: ; notranslate">$ set prefix=(hd0,6)/grub
$ insmod linux
$ insmod loopback
$ insmod iso9660
$ loopback loop (hd0,6)/boot-isos/ubuntu-12.04-desktop-amd64.iso
$ set root=(loop)
$ linux /casper/vmlinuz boot=casper iso-scan/filename=/boot-isos/ubuntu-12.04-desktop-amd64.iso noprompt noeject toram
$ initrd /casper/initrd.lz
$ boot</pre>
<p>The machine should boot into Ubuntu Live.  Once in Ubuntu, I should unmount <em>/isodevice</em>:</p>
<pre class="brush: bash; title: ; notranslate">$ sudo umount -l -r -f /isodevice</pre>
<p>Then I can simply run the installer on Ubuntu.  In order to prevent the installer from stalling (see <a href="https://bugs.launchpad.net/ubuntu/+source/ubiquity/+bug/875343">this bug report</a>), I had to &#8220;format&#8221; all partitions except <em>/boot</em>.  But otherwise everything should go fine.</p>
<h3>Reference</h3>
<p><a href="http://ubuntuforums.org/showthread.php?t=1549847">HOWTO: ISO Booting with Grub 2</a><br />
<a href="http://ubuntuforums.org/showthread.php?t=1599293">HOWTO: Boot &#038; Install Ubuntu from the Grub Rescue Prompt</a></p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=1748</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Repeating Failed Linux Command on Bash</title>
		<link>http://okomestudio.net/biboroku/?p=1735</link>
		<comments>http://okomestudio.net/biboroku/?p=1735#comments</comments>
		<pubDate>Fri, 04 May 2012 15:33:24 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[Bash]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://okomestudio.net/biboroku/?p=1735</guid>
		<description><![CDATA[I was in need of backing up a lot of data in a hurry.  I used rsync between the file server and a locally mounted USB drive, but for some reason the command kept failing.  It had something to do &#8230; <a href="http://okomestudio.net/biboroku/?p=1735">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I was in need of backing up a lot of data in a hurry.  I used <em>rsync</em> between the file server and a locally mounted USB drive, but for some reason the command kept failing.  It had something to do with checksum calculation, but it may have had something to do with how hardware is set up, so I didn&#8217;t wish to go looking for the very root of the problem; I just needed to back things up.</p>
<p>I simply decided to repeat the <em>rsync</em> command when it failed, until it succeeded syncing all files.  Here&#8217;s a simple example script to do this:</p>
<pre class="brush: bash; title: ; notranslate">#!/bin/bash

CMD=&quot;rsync -av --delete remote:/scrXX/dir /media/usb/storage&quot;

while :
do
    echo $CMD ;
    $CMD ;

    if [ $? -eq 0 ]; then
        break;
    fi

    echo &quot;... redo ...&quot; ;
done

echo &quot;Done.&quot; ;</pre>
<p>The gist of the Bash trick is to use &#8220;$?&#8221;, which stores the return code of the last executed process.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=1735</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Using Linux Shell Command within Python</title>
		<link>http://okomestudio.net/biboroku/?p=1727</link>
		<comments>http://okomestudio.net/biboroku/?p=1727#comments</comments>
		<pubDate>Fri, 20 Jan 2012 19:54:34 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[reference]]></category>

		<guid isPermaLink="false">http://okomestudio.net/biboroku/?p=1727</guid>
		<description><![CDATA[If you just want to do some simple task, this would do:]]></description>
				<content:encoded><![CDATA[<p>If you just want to do some simple task, this would do:</p>
<pre class="brush: python; title: ; notranslate">from subprocess import call
cmd = &quot;mkdir -p tmp/some/dir&quot;
call(cmd, shell=True)
</pre>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=1727</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Firefox 9 on Debian Squeeze</title>
		<link>http://okomestudio.net/biboroku/?p=1714</link>
		<comments>http://okomestudio.net/biboroku/?p=1714#comments</comments>
		<pubDate>Fri, 30 Dec 2011 18:53:39 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[Debian/Squeeze]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[install procedure]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[web browser]]></category>

		<guid isPermaLink="false">http://okomestudio.net/biboroku/?p=1714</guid>
		<description><![CDATA[The questionable move by Firefox to the rapid release schedule has me disappointed.  A little bugs here and there, incompatible add-ons, and so on.  Seriously, the major, if not the most important advantage of Firefox is all these add-ons we &#8230; <a href="http://okomestudio.net/biboroku/?p=1714">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>The questionable move by Firefox to the rapid release schedule has me disappointed.  A little bugs here and there, incompatible add-ons, and so on.  Seriously, the major, if not the most important advantage of Firefox is all these add-ons we have come to love, so making them unstable only makes the browser lose the edge.</p>
<p>Yet Firefox remains my default browser (it might change when I have time to give Chrome a serious shot though).  On Debian, with its slow release schedule, this means that I need to custom install the latest stable version.  Here&#8217;s the procedure.</p>
<p>Go to the <a href="http://www.mozilla.org/en-US/firefox/all.html">Firefox download web page</a>.  Choose the version you want and download to a temporary directory, here <em>~/tmp</em>.  Then follow this:</p>
<pre class="brush: bash; title: ; notranslate">$ cd ~/tmp
$ ls
firefox-9.0.1.tar.bz2
$ tar -xvjf firefox-9.0.1.tar.bz2
$ sudo mv firefox /usr/local/firefox-9.0.1
$ cd /usr/local
$ sudo ln -s firefox-9.0.1 firefox
$ cd /usr/local/bin
$ sudo ln -s ../firefox/firefox-bin firefox
</pre>
<p>This is it! You should be able to launch Firefox with the command <em>firefox</em> anywhere on the system.</p>
<h3>Flash</h3>
<p>I recommend installing <a href="https://addons.mozilla.org/en-US/firefox/addon/flash-aid/">Flash-Aid</a> add-on and re-install Flash using the Firefox just installed.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=1714</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing kcorrect (v4_2) for IDL Locally on Linux</title>
		<link>http://okomestudio.net/biboroku/?p=1698</link>
		<comments>http://okomestudio.net/biboroku/?p=1698#comments</comments>
		<pubDate>Wed, 28 Dec 2011 19:46:53 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[astro]]></category>
		<category><![CDATA[IDL]]></category>
		<category><![CDATA[kcorrect]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://okomestudio.net/biboroku/?p=1698</guid>
		<description><![CDATA[I usually stay away from IDL but wanted to test the new version of kcorrect which usually runs on IDL.  Fortunately a Linux box in the department has IDL installed, so I decided to test it there, installing kcorrect locally.  &#8230; <a href="http://okomestudio.net/biboroku/?p=1698">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I usually stay away from IDL but wanted to test the new version of <a href="http://howdy.physics.nyu.edu/index.php/Kcorrect">kcorrect</a> which usually runs on IDL.  Fortunately a Linux box in the department has IDL installed, so I decided to test it there, installing kcorrect locally.  As expected I ran into sneaky problems, so here&#8217;s my installation note.</p>
<p>I assume that the user home directory is <em>/home/johndoe</em> and all the stuff will be installed under <em>/home/johndoe/lib</em>.  This isn&#8217;t my own Linux box and looks like this:</p>
<pre class="brush: bash; title: ; notranslate">$ uname -a
Linux xxxx.somehost.somewhere 2.6.18-194.el5.centos.plus #1 SMP Tue May 18 17:01:19 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux</pre>
<p>First, add the following lines to <em>~/.bashrc</em>:</p>
<pre class="brush: bash; title: ; notranslate">export IDL_PATH=+/usr/local/rsi:$IDL_PATH

export IDLUTILS_DIR=/home/johndoe/lib/idlutils
export PATH=$IDLUTILS_DIR/bin:$PATH
export IDL_PATH=+$IDLUTILS_DIR/pro:$IDL_PATH
export IDL_PATH=+$IDLUTILS_DIR/goddard/pro:$IDL_PATH</pre>
<p>Here, the first line is important and need to be set to the (system) IDL installation directory, here <em>/usr/local/rsi</em>; if this isn&#8217;t done anywhere, then IDL will not find all the procedures that are installed by default!  (This sneaky caveat caused me quite a headache!)</p>
<p>Next, download <a href="http://sdss3.org/dr8/software/idlutils.php">idlutils</a> via svn and compile the source code:</p>
<pre class="brush: bash; title: ; notranslate">$ . ~/.bashrc
$ mkdir -p ~/lib
$ cd ~/lib
$ svn ls http://www.sdss3.org/svn/repo/idlutils/tags
... a list of tags; the latest version v5_4_26 here...
$ svn export http://www.sdss3.org/svn/repo/idlutils/tags/v5_4_26 idlutils
$ cd $IDLUTILS_DIR
$ evilmake all</pre>
<p>Make sure there is no error during the compilation.</p>
<p>We are ready to install kcorrect.  Add the following lines to <em>~/.bashrc</em> just below what we just added above:</p>
<pre class="brush: bash; title: ; notranslate">export KCORRECT_DIR=/home/taro/lib/kcorrect
export PATH=$KCORRECT_DIR/bin:$PATH
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$KCORRECT_DIR/lib
export IDL_PATH=$IDL_PATH:+$KCORRECT_DIR/pro</pre>
<p>Download the tarball and compile the source codes:</p>
<pre class="brush: bash; title: ; notranslate">$ . ~/.bashrc
$ cd ~/lib
$ wget http://cosmo.nyu.edu/blanton/kcorrect/kcorrect.v4_2.tar.gz
$ tar -xvzf kcorrect.v4_2.tar.gz
$ cd kcorrect
$ evilmake -k all</pre>
<p>Make sure there is no error during compilation.  That should be it.  Also, don&#8217;t forget to browse through the Known Problems section of the kcorrect distribution website.  In particular, the DEEP2 filters need to be updated by downloading from the most recent subversion repository.</p>
<p>To test if the installation went fine, try the first example on the kcorrect distribution website:</p>
<pre class="brush: bash; title: ; notranslate">$ idl
IDL Version 8.0.1 (linux x86_64 m64). (c) 2010, ITT Visual Information Solutions
Installation number: XXXXXX.
Licensed for use by: Saint Mary's Univ, Astronomy and Physics

IDL&gt; kcorrect, [1., 4.78, 10.96, 14.45, 19.05],  $
IDL&gt;           [1100., 28., 7.7, 4.4, 2.5], $
IDL&gt;           0.03, kcorrect, band_shift=0.1, chi2=chi2

... bunch of output ...

IDL&gt; print, kcorrect
    -0.381880    -0.342148    -0.191399    -0.158157    -0.132817</pre>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=1698</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>g3data</title>
		<link>http://okomestudio.net/biboroku/?p=1685</link>
		<comments>http://okomestudio.net/biboroku/?p=1685#comments</comments>
		<pubDate>Wed, 11 May 2011 16:10:32 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[astro]]></category>
		<category><![CDATA[computing]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[install procedure]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[research]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://okomestudio.net/biboroku/?p=1685</guid>
		<description><![CDATA[This is all I needed to use this: Love Debian.]]></description>
				<content:encoded><![CDATA[<pre class="brush: bash; title: ; notranslate">$ sudo aptitude install g3data</pre>
<p>This is all I needed to use this:</p>
<p><a href="http://okomestudio.net/biboroku/wp-content/uploads/2011/05/g3data.png"><img class="alignnone size-medium wp-image-1686" title="g3data" src="http://okomestudio.net/biboroku/wp-content/uploads/2011/05/g3data-300x269.png" alt="" width="300" height="269" /></a></p>
<p>Love Debian.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=1685</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Half-Light Radii for Various Profiles</title>
		<link>http://okomestudio.net/biboroku/?p=1646</link>
		<comments>http://okomestudio.net/biboroku/?p=1646#comments</comments>
		<pubDate>Mon, 14 Feb 2011 22:17:51 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[astro]]></category>
		<category><![CDATA[reference]]></category>
		<category><![CDATA[research]]></category>

		<guid isPermaLink="false">http://okomestudio.net/biboroku/?p=1646</guid>
		<description><![CDATA[For a radial profile of , the enclosed flux within the radius is given by I&#8217;m only concerned about azimuthal symmetric cases, so .  The idea is to solve for . Gaussian Profile Say the Gaussian intensity profile is given &#8230; <a href="http://okomestudio.net/biboroku/?p=1646">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>For a radial profile of <img src='http://s.wordpress.com/latex.php?latex=I%28r%29&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='I(r)' title='I(r)' class='latex' />, the enclosed flux within the radius <img src='http://s.wordpress.com/latex.php?latex=r&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='r' title='r' class='latex' /> is given by</p>
<img src='http://s.wordpress.com/latex.php?latex=F%28r%29%20%3D%20%5Cint_%7B0%7D%5E%7B2%5Cpi%7D%20d%5Cphi%20%5Cint_%7B0%7D%5E%7Br%7D%20dr%20r%20I%28r%2C%5Cphi%29%20%5C%20%2C&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='F(r) = \int_{0}^{2\pi} d\phi \int_{0}^{r} dr r I(r,\phi) \ ,' title='F(r) = \int_{0}^{2\pi} d\phi \int_{0}^{r} dr r I(r,\phi) \ ,' class='latex' />
<p>I&#8217;m only concerned about azimuthal symmetric cases, so <img src='http://s.wordpress.com/latex.php?latex=F%28r%29%20%3D%202%5Cpi%20%5Cint_%7B0%7D%5E%7Br%7D%20dr%20r%20I%28r%29&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='F(r) = 2\pi \int_{0}^{r} dr r I(r)' title='F(r) = 2\pi \int_{0}^{r} dr r I(r)' class='latex' />.  The idea is to solve</p>
<img src='http://s.wordpress.com/latex.php?latex=%5Cfrac%7BF%28r_%7B1%2F2%7D%29%7D%7BF%28%5Cinfty%29%7D%20%3D%20%5Cfrac%7B1%7D%7B2%7D&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\frac{F(r_{1/2})}{F(\infty)} = \frac{1}{2}' title='\frac{F(r_{1/2})}{F(\infty)} = \frac{1}{2}' class='latex' />
<p>for <img src='http://s.wordpress.com/latex.php?latex=r_%7B1%2F2%7D&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='r_{1/2}' title='r_{1/2}' class='latex' />.</p>
<h3>Gaussian Profile</h3>
<p>Say the Gaussian intensity profile is given by</p>
<img src='http://s.wordpress.com/latex.php?latex=I%28r%29%20%3D%20I_0%20%5Cexp%7B%5Cleft%28-%5Cfrac%7Br%5E2%7D%7B2%5Csigma%5E2%7D%5Cright%29%7D%20%5C%20.&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='I(r) = I_0 \exp{\left(-\frac{r^2}{2\sigma^2}\right)} \ .' title='I(r) = I_0 \exp{\left(-\frac{r^2}{2\sigma^2}\right)} \ .' class='latex' />
<p>The enclosed flux within <img src='http://s.wordpress.com/latex.php?latex=r&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='r' title='r' class='latex' /> is given by</p>
<img src='http://s.wordpress.com/latex.php?latex=F%28r%29%20%3D%202%5Cpi%20I_0%20%5Cint_0%5Er%20dr%20r%20%5Cexp%7B%5Cleft%28-%5Cfrac%7Br%5E2%7D%7B2%5Csigma%5E2%7D%5Cright%29%7D%20%3D%202%5Cpi%20I_0%20%5Csigma%5E2%20%5Cleft%5B1%20-%20%5Cexp%7B%5Cleft%28-%5Cfrac%7Br%5E2%7D%7B2%5Csigma%5E2%7D%5Cright%29%7D%5Cright%5D%5C%20.%20&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='F(r) = 2\pi I_0 \int_0^r dr r \exp{\left(-\frac{r^2}{2\sigma^2}\right)} = 2\pi I_0 \sigma^2 \left[1 - \exp{\left(-\frac{r^2}{2\sigma^2}\right)}\right]\ . ' title='F(r) = 2\pi I_0 \int_0^r dr r \exp{\left(-\frac{r^2}{2\sigma^2}\right)} = 2\pi I_0 \sigma^2 \left[1 - \exp{\left(-\frac{r^2}{2\sigma^2}\right)}\right]\ . ' class='latex' />
<p>Hence</p>
<img src='http://s.wordpress.com/latex.php?latex=%5Cboxed%7Br_%7B1%2F2%7D%20%3D%20%5Csqrt%7B-2%20%5Cln%7B0.5%7D%7D%20%5Csigma%20%5C%20.%7D%20&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\boxed{r_{1/2} = \sqrt{-2 \ln{0.5}} \sigma \ .} ' title='\boxed{r_{1/2} = \sqrt{-2 \ln{0.5}} \sigma \ .} ' class='latex' />
<h3>Exponential Profile</h3>
<p>The radial surface-brightness profile <img src='http://s.wordpress.com/latex.php?latex=I%28r%29&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='I(r)' title='I(r)' class='latex' /> of a disk galaxy is often fitted by the exponential profile:</p>
<img src='http://s.wordpress.com/latex.php?latex=I%28r%29%20%3D%20I_d%20%5Cexp%7B%5Cleft%28-%5Cfrac%7Br%7D%7Br_d%7D%5Cright%29%7D%20%5C%20%2C&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='I(r) = I_d \exp{\left(-\frac{r}{r_d}\right)} \ ,' title='I(r) = I_d \exp{\left(-\frac{r}{r_d}\right)} \ ,' class='latex' />
<p>where <img src='http://s.wordpress.com/latex.php?latex=r_d&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='r_d' title='r_d' class='latex' /> is the disk scale length.  The flux enclosed within the radius <img src='http://s.wordpress.com/latex.php?latex=r&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='r' title='r' class='latex' /> is given by</p>
<img src='http://s.wordpress.com/latex.php?latex=F%28r%29%20%3D%202%5Cpi%20I_d%20%5Cint_0%5Er%20dr%20r%20%5Cexp%7B%5Cleft%28-%5Cfrac%7Br%7D%7Br_d%7D%5Cright%29%7D%20%5C%20.&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='F(r) = 2\pi I_d \int_0^r dr r \exp{\left(-\frac{r}{r_d}\right)} \ .' title='F(r) = 2\pi I_d \int_0^r dr r \exp{\left(-\frac{r}{r_d}\right)} \ .' class='latex' />
<p>Solving for the half-light radius <img src='http://s.wordpress.com/latex.php?latex=r_%7B1%2F2%7D&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='r_{1/2}' title='r_{1/2}' class='latex' /> leads to the following:</p>
<img src='http://s.wordpress.com/latex.php?latex=%5Cleft%281%20%2B%20%5Cfrac%7Br_%7B1%2F2%7D%7D%7Br_d%7D%5Cright%29%20%5Cexp%7B%5Cleft%28-%5Cfrac%7Br_%7B1%2F2%7D%7D%7Br_d%7D%5Cright%29%7D%20%3D%20%5Cfrac%7B1%7D%7B2%7D%20%5C%20.&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\left(1 + \frac{r_{1/2}}{r_d}\right) \exp{\left(-\frac{r_{1/2}}{r_d}\right)} = \frac{1}{2} \ .' title='\left(1 + \frac{r_{1/2}}{r_d}\right) \exp{\left(-\frac{r_{1/2}}{r_d}\right)} = \frac{1}{2} \ .' class='latex' />
<p>A relevant numerical solution is</p>
<img src='http://s.wordpress.com/latex.php?latex=%5Cboxed%7Br_%7B1%2F2%7D%20%3D%201.67835%20r_d%20%5C%20.%7D&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\boxed{r_{1/2} = 1.67835 r_d \ .}' title='\boxed{r_{1/2} = 1.67835 r_d \ .}' class='latex' />
<h3>Sersic/de Vaucouleurs Profile</h3>
<p>The radial surface-brightness profile <img src='http://s.wordpress.com/latex.php?latex=I%28r%29&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='I(r)' title='I(r)' class='latex' /> of a spheroidal galaxy is often fitted by the Sersic (de Vaucouleurs when <img src='http://s.wordpress.com/latex.php?latex=n%20%3D%204&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='n = 4' title='n = 4' class='latex' />) profile:</p>
<img src='http://s.wordpress.com/latex.php?latex=I%28r%29%20%3D%20I_%7B1%2F2%7D%20%5Cexp%7B%5Cleft%28%20-k%20%5Cleft%28%20%5Cleft%28%5Cfrac%7Br%7D%7Br_%7B1%2F2%7D%7D%5Cright%29%5E%7B1%2Fn%7D%20-%201%20%5Cright%29%20%5Cright%29%7D%20%5C%20.&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='I(r) = I_{1/2} \exp{\left( -k \left( \left(\frac{r}{r_{1/2}}\right)^{1/n} - 1 \right) \right)} \ .' title='I(r) = I_{1/2} \exp{\left( -k \left( \left(\frac{r}{r_{1/2}}\right)^{1/n} - 1 \right) \right)} \ .' class='latex' />
<p>where <img src='http://s.wordpress.com/latex.php?latex=k%20%3D%201.992%20n%20-%200.3271&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='k = 1.992 n - 0.3271' title='k = 1.992 n - 0.3271' class='latex' /> (Capaccioli 1989).  This expression explicitly parametrizes the profile in terms of half-light radius.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=1646</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>SciPy Weave Bug in Debian Squeeze</title>
		<link>http://okomestudio.net/biboroku/?p=1636</link>
		<comments>http://okomestudio.net/biboroku/?p=1636#comments</comments>
		<pubDate>Fri, 04 Feb 2011 20:30:59 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[computing]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Debian/Squeeze]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[research]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://okomestudio.net/biboroku/?p=1636</guid>
		<description><![CDATA[I was trying to remove a bottleneck by converting a portion of Python code into C++ via scipy.weave.inline, and encountered a bug. Here is my code: And this is what I get: running build_ext running build_src build_src building extension "sc_1eb4d019edb4774720031f15557074a811" &#8230; <a href="http://okomestudio.net/biboroku/?p=1636">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I was trying to remove a bottleneck by converting a portion of Python code into C++ via <code>scipy.weave.inline</code>, and encountered a bug.  Here is my code:</p>
<pre class="brush: python; title: ; notranslate">#!/usr/bin/env python2.6
import numpy as np
from scipy import weave
from scipy.weave import converters


def compute_unique_pair_dists(xs, ys, ds):
    code = r'''
    int n = xs.size();
    int idx = 0;
    for (int i = 0; i &lt; n; ++i) {
        float x = xs(i);
        float y = ys(i);
        for (int j = 0; j &lt; n - 1 - i; ++j) {
            float dx = xs(i+1+j) - x;
            float dy = ys(i+1+j) - y;
            ds(idx++) = sqrt(dx * dx + dy * dy);
        }
    }
    '''
    weave.inline(code, ['xs', 'ys', 'ds'], type_converters=converters.blitz,
                 compiler='gcc', verbose=2)


def main():
    n = 10
    xs = np.arange(0, n)
    ys = np.arange(0, n)
    ds = np.zeros(n * (n + 1) / 2)
    compute_unique_pair_dists(xs, ys, ds)
    print(ds)


if __name__ == '__main__':
    main()
</pre>
<p>And this is what I get:</p>
<pre><code><weave: compiling>
running build_ext
running build_src
build_src
building extension "sc_1eb4d019edb4774720031f15557074a811" sources
build_src: building npy-pkg config files
customize UnixCCompiler
customize UnixCCompiler using build_ext
customize UnixCCompiler
customize UnixCCompiler using build_ext
building 'sc_1eb4d019edb4774720031f15557074a811' extension
compiling C++ sources
C compiler: g++ -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -fPIC

compile options: '-I/usr/lib/python2.6/dist-packages/scipy/weave -I/usr/lib/python2.6/dist-packages/scipy/weave/scxx -I/usr/lib/python2.6/dist-packages/scipy/weave/blitz -I/usr/lib/pymodules/python2.6/numpy/core/include -I/usr/include/python2.6 -c'
g++: /home/taro/.python26_compiled/sc_1eb4d019edb4774720031f15557074a811.cpp
In file included from /usr/lib/python2.6/dist-packages/scipy/weave/blitz/blitz/applics.h:394,
                 from /usr/lib/python2.6/dist-packages/scipy/weave/blitz/blitz/vecexpr.h:26,
                 from /usr/lib/python2.6/dist-packages/scipy/weave/blitz/blitz/vecpick.cc:16,
                 from /usr/lib/python2.6/dist-packages/scipy/weave/blitz/blitz/vecpick.h:287,
                 from /usr/lib/python2.6/dist-packages/scipy/weave/blitz/blitz/vector.h:443,
                 from /usr/lib/python2.6/dist-packages/scipy/weave/blitz/blitz/tinyvec.h:424,
                 from /usr/lib/python2.6/dist-packages/scipy/weave/blitz/blitz/array-impl.h:38,
                 from /usr/lib/python2.6/dist-packages/scipy/weave/blitz/blitz/array.h:26,
                 from /home/taro/.python26_compiled/sc_1eb4d019edb4774720031f15557074a811.cpp:11:
/usr/lib/python2.6/dist-packages/scipy/weave/blitz/blitz/mathfunc.h: In static member function ‘static long int blitz::_bz_abs<long int>::apply(long int)’:
/usr/lib/python2.6/dist-packages/scipy/weave/blitz/blitz/mathfunc.h:45: error: ‘labs’ is not a member of ‘std’
In file included from /usr/lib/python2.6/dist-packages/scipy/weave/blitz/blitz/array/funcs.h:23,
                 from /usr/lib/python2.6/dist-packages/scipy/weave/blitz/blitz/array/newet.h:23,
                 from /usr/lib/python2.6/dist-packages/scipy/weave/blitz/blitz/array/et.h:21,
                 from /usr/lib/python2.6/dist-packages/scipy/weave/blitz/blitz/array-impl.h:2509,
                 from /usr/lib/python2.6/dist-packages/scipy/weave/blitz/blitz/array.h:26,
                 from /home/taro/.python26_compiled/sc_1eb4d019edb4774720031f15557074a811.cpp:11:
/usr/lib/python2.6/dist-packages/scipy/weave/blitz/blitz/funcs.h: In static member function ‘static int blitz::Fn_abs<int>::apply(int)’:
/usr/lib/python2.6/dist-packages/scipy/weave/blitz/blitz/funcs.h:503: error: call of overloaded ‘abs(int&#038;)’ is ambiguous
/usr/include/c++/4.4/cmath:94: note: candidates are: double std::abs(double)
/usr/include/c++/4.4/cmath:98: note:                 float std::abs(float)
/usr/include/c++/4.4/cmath:102: note:                 long double std::abs(long double)
/usr/lib/python2.6/dist-packages/scipy/weave/blitz/blitz/funcs.h: In static member function ‘static long int blitz::Fn_abs<long int>::apply(long int)’:
/usr/lib/python2.6/dist-packages/scipy/weave/blitz/blitz/funcs.h:524: error: ‘labs’ is not a member of ‘std’
In file included from /usr/lib/python2.6/dist-packages/scipy/weave/blitz/blitz/applics.h:394,
                 from /usr/lib/python2.6/dist-packages/scipy/weave/blitz/blitz/vecexpr.h:26,
                 from /usr/lib/python2.6/dist-packages/scipy/weave/blitz/blitz/vecpick.cc:16,
                 from /usr/lib/python2.6/dist-packages/scipy/weave/blitz/blitz/vecpick.h:287,
                 from /usr/lib/python2.6/dist-packages/scipy/weave/blitz/blitz/vector.h:443,
                 from /usr/lib/python2.6/dist-packages/scipy/weave/blitz/blitz/tinyvec.h:424,
                 from /usr/lib/python2.6/dist-packages/scipy/weave/blitz/blitz/array-impl.h:38,
                 from /usr/lib/python2.6/dist-packages/scipy/weave/blitz/blitz/array.h:26,
                 from /home/taro/.python26_compiled/sc_1eb4d019edb4774720031f15557074a811.cpp:11:
/usr/lib/python2.6/dist-packages/scipy/weave/blitz/blitz/mathfunc.h: In static member function ‘static long int blitz::_bz_abs<long int>::apply(long int)’:
/usr/lib/python2.6/dist-packages/scipy/weave/blitz/blitz/mathfunc.h:45: error: ‘labs’ is not a member of ‘std’
In file included from /usr/lib/python2.6/dist-packages/scipy/weave/blitz/blitz/array/funcs.h:23,
                 from /usr/lib/python2.6/dist-packages/scipy/weave/blitz/blitz/array/newet.h:23,
                 from /usr/lib/python2.6/dist-packages/scipy/weave/blitz/blitz/array/et.h:21,
                 from /usr/lib/python2.6/dist-packages/scipy/weave/blitz/blitz/array-impl.h:2509,
                 from /usr/lib/python2.6/dist-packages/scipy/weave/blitz/blitz/array.h:26,
                 from /home/taro/.python26_compiled/sc_1eb4d019edb4774720031f15557074a811.cpp:11:
/usr/lib/python2.6/dist-packages/scipy/weave/blitz/blitz/funcs.h: In static member function ‘static int blitz::Fn_abs<int>::apply(int)’:
/usr/lib/python2.6/dist-packages/scipy/weave/blitz/blitz/funcs.h:503: error: call of overloaded ‘abs(int&#038;)’ is ambiguous
/usr/include/c++/4.4/cmath:94: note: candidates are: double std::abs(double)
/usr/include/c++/4.4/cmath:98: note:                 float std::abs(float)
/usr/include/c++/4.4/cmath:102: note:                 long double std::abs(long double)
/usr/lib/python2.6/dist-packages/scipy/weave/blitz/blitz/funcs.h: In static member function ‘static long int blitz::Fn_abs<long int>::apply(long int)’:
/usr/lib/python2.6/dist-packages/scipy/weave/blitz/blitz/funcs.h:524: error: ‘labs’ is not a member of ‘std’
Traceback (most recent call last):
  File "bug.py", line 34, in <module>
    main()
  File "bug.py", line 29, in main
    compute_unique_pair_dists(xs, ys, ds)
  File "bug.py", line 22, in compute_unique_pair_dists
    compiler='gcc', verbose=2)
  File "/usr/lib/python2.6/dist-packages/scipy/weave/inline_tools.py", line 335, in inline
    **kw)
  File "/usr/lib/python2.6/dist-packages/scipy/weave/inline_tools.py", line 462, in compile_function
    verbose=verbose, **kw)
  File "/usr/lib/python2.6/dist-packages/scipy/weave/ext_tools.py", line 365, in compile
    verbose = verbose, **kw)
  File "/usr/lib/python2.6/dist-packages/scipy/weave/build_tools.py", line 288, in build_extension
    raise e
scipy.weave.build_tools.CompileError: error: Command "g++ -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -fPIC -I/usr/lib/python2.6/dist-packages/scipy/weave -I/usr/lib/python2.6/dist-packages/scipy/weave/scxx -I/usr/lib/python2.6/dist-packages/scipy/weave/blitz -I/usr/lib/pymodules/python2.6/numpy/core/include -I/usr/include/python2.6 -c /home/taro/.python26_compiled/sc_1eb4d019edb4774720031f15557074a811.cpp -o /tmp/taro/python26_intermediate/compiler_8430959729cb93b29ebb911a70f70625/home/taro/.python26_compiled/sc_1eb4d019edb4774720031f15557074a811.o" failed with exit status 1
</code></pre>
<p>Fortunately <a href="https://bugs.launchpad.net/scipy/+bug/302649/comments/15">there is a fix</a>:</p>
<blockquote><p>
The fix for this bug is simple. As per the debian patch linked to below, one needs to add an include for cstdlib above the BZ_NAMESPACE(blitz) call in the following files:<br />
/usr/share/pyshared/scipy/weave/blitz/blitz/blitz.h<br />
/usr/share/pyshared/scipy/weave/blitz/blitz/mathfunc.h</p>
<p>http://bugs.debian.org/cgi-bin/bugreport.cgi?msg=10;filename=blitz%2B%2B.patch;att=1;bug=455661</p>
<p>This fix works for me by manually editing those files.
</p></blockquote>
<p>The bug appears to be reported a couple years ago but hadn&#8217;t been fixed for some reason.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=1636</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Comparing the Efficiencies of Gaussian Convolution Routines</title>
		<link>http://okomestudio.net/biboroku/?p=1629</link>
		<comments>http://okomestudio.net/biboroku/?p=1629#comments</comments>
		<pubDate>Wed, 26 Jan 2011 01:13:00 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[astro]]></category>
		<category><![CDATA[computing]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[reference]]></category>
		<category><![CDATA[research]]></category>

		<guid isPermaLink="false">http://okomestudio.net/biboroku/?p=1629</guid>
		<description><![CDATA[These days I quite often need to convolve (i.e., smooth) 2D images by some Gaussian. There are quite a few routines that can do this with varying efficiencies. So I compared a couple of them. On my laptop, this script &#8230; <a href="http://okomestudio.net/biboroku/?p=1629">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>These days I quite often need to convolve (i.e., smooth) 2D images by some Gaussian.  There are quite a few routines that can do this with varying efficiencies.  So I compared a couple of them.</p>
<pre class="brush: python; title: ; notranslate">#!/usr/bin/env python2.6
import os
from time import time
import numpy as np
from numpy import exp, pi, sqrt
import pyfits as pf
from scipy.ndimage import gaussian_filter
from scipy.signal import convolve, fftconvolve
from pyraf import iraf
from pyraf.irafpar import IrafParList


KSIZE = 4


def gauss(x, s):
    return exp(-x**2 / (2. * s**2)) / sqrt(2. * pi) / s


def kernel(sx, sy, size):
    dx, dy = int(round(size * sx)), int(round(size * sy))
    xs, ys = np.arange(-dx, dx + 1), np.arange(-dy, dy + 1)
    fxs, fys = np.matrix(gauss(xs, sx)), np.matrix(gauss(ys, sy))
    return fxs.T * fys


def cv_iraf_gauss(data, sx, sy):
    def default_irafpar(task):
        # Return the IrafParList object for default parameters.
        return IrafParList(task.getName(), parlist=task.getDefaultParList())

    size = KSIZE
    ftmpin = 'tmpin.fits'
    ftmpout = 'tmpout.fits'
    pf.PrimaryHDU(data).writeto(ftmpin)

    # Load IRAF packages.
    iraf.image(_doprint=0)
    iraf.image.imfilter(_doprint=0)

    # Get default parameters and override some.
    plist = default_irafpar(iraf.gauss)
    plist.setParList(input = ftmpin,
                     output = ftmpout,
                     sigma = sx,
                     ratio = (1. * sy) / sx,
                     nsigma = size,
                     bilinear = 'yes')
    t1 = time()
    iraf.gauss(ParList=plist)
    t2 = time()

    os.remove(ftmpin)
    os.remove(ftmpout)

    return t2 - t1


def cv_convolve(data, sx, sy):
    k = kernel(sx, sy, KSIZE)

    t1 = time()
    convolve(data, k, mode='same')
    return time() - t1


def cv_fftconvolve(data, sx, sy):
    k = kernel(sx, sy, KSIZE)

    t1 = time()
    fftconvolve(data, k, mode='same')
    return time() - t1


def cv_gaussian_filter(data, sx, sy):
    t1 = time()
    gaussian_filter(data, [sy, sx])
    return time() - t1


def main():
    xsig, ysig = 5, 5
    nrep = 3

    for imsize in [512, 1024, 2048]:
        print('image size = %d' % imsize)
        data = np.zeros((imsize, imsize), dtype=np.float32)
        for func in [cv_gaussian_filter,
                     cv_convolve,
                     cv_fftconvolve,
                     cv_iraf_gauss]:
            ts = []
            for i in range(nrep):
                t = func(data, xsig, ysig)
                ts.append(t)

            print('%s: %f sec' % (func.__name__, np.mean(ts)))
        print('')


if __name__ == '__main__':
    main()</pre>
<p>On my laptop, this script gives me the following results:</p>
<pre><code>image size = 512
cv_gaussian_filter: 0.022649 sec
cv_convolve: 2.872223 sec
cv_fftconvolve: 0.096408 sec
cv_iraf_gauss: 0.069467 sec

image size = 1024
cv_gaussian_filter: 0.103350 sec
cv_convolve: 12.024448 sec
cv_fftconvolve: 0.401396 sec
cv_iraf_gauss: 0.253028 sec

image size = 2048
cv_gaussian_filter: 0.451775 sec
cv_convolve: 44.597186 sec
cv_fftconvolve: 1.838378 sec
cv_iraf_gauss: 1.009065 sec
</code></pre>
<p>Clearly the winner is <code>scipy.ndimage.gaussian_filter</code>.  (This is not a fair comparison for the IRAF/PyRAF&#8217;s <code>image.imfilter.gauss</code>, because it includes time that it takes to do the file I/O; I don&#8217;t know of a way to avoid this.  As is usually the case for IRAF/PyRAF routines, there is no way to get around the &#8220;feature,&#8221; and it merely shows its limitation as a library.)</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=1629</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using NTP Server to Synchronize Time on Debian Squeeze</title>
		<link>http://okomestudio.net/biboroku/?p=1582</link>
		<comments>http://okomestudio.net/biboroku/?p=1582#comments</comments>
		<pubDate>Sun, 09 Jan 2011 19:20:56 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Debian/Squeeze]]></category>
		<category><![CDATA[install procedure]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://okomestudio.net/biboroku/?p=1582</guid>
		<description><![CDATA[I want the time of my computer to get synchronized with a reliable time server. To do this, install ntp: $ sudo aptitude install ntp $ sudo /etc/init.d/ntp restart After restarting the NTP server (the second line above) the system &#8230; <a href="http://okomestudio.net/biboroku/?p=1582">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I want the time of my computer to get synchronized with a reliable time server.  To do this, install <code>ntp</code>:</p>
<pre><code>$ sudo aptitude install ntp
$ sudo /etc/init.d/ntp restart
</code></pre>
<p>After restarting the NTP server (the second line above) the system time should be synchronized within a couple minutes.</p>
<p>On a laptop, the NTP daemon should be stopped while on battery.  With <code>laptop-mode</code>, this can easily be done by creating symlinks under the <em>/etc/laptop-mode</em> directories:</p>
<pre><code>$ cd /etc/laptop-mode/batt-stop
$ sudo ln -s /etc/init.d/ntp .
$ cd /etc/laptop-mode/lm-ac-start
$ sudo ln -s /etc/init.d/ntp .
</code></pre>
<p>This way, the daemon runs while on AC, but not when the battery is used.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=1582</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Suppressing Warnings in PyFITS</title>
		<link>http://okomestudio.net/biboroku/?p=1457</link>
		<comments>http://okomestudio.net/biboroku/?p=1457#comments</comments>
		<pubDate>Wed, 29 Dec 2010 02:19:24 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[astro]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[PyFITS]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=1457</guid>
		<description><![CDATA[PyFITS is obviously a great Python package if you ever need to deal with data in astronomy. One thing that consistently annoyed me however was their use of warning messages.  For example, whenever you overwrite an existing FITS file, the &#8230; <a href="http://okomestudio.net/biboroku/?p=1457">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.stsci.edu/resources/software_hardware/pyfits">PyFITS</a> is obviously a great Python package if you ever need to deal with data in astronomy.</p>
<p>One thing that consistently annoyed me however was their use of warning messages.  For example, whenever you overwrite an existing FITS file, the <code>writeto</code> method issues a warning, saying &#8220;overwrite existing file &#8230;&#8221;  This is a very redundant message, as PyFITS doesn&#8217;t overwrite files by default, and I&#8217;m giving an explicit <code>clobber</code> option&#8230;</p>
<p>It&#8217;s actually very easy to suppress this sort of warning with the <code>with</code> statement:</p>
<pre class="brush: python; title: ; notranslate">import warnings
import pyfits
...
hdus = pyfits.PrimaryHDU(data)
...
with warnings.catch_warnings():
    warnings.simplefilter('ignore')
    hdus.writeto(&quot;somefile.fits&quot;, clobber=True)
...</pre>
<p>Suppressing warning messages is discussed in the PyFITS user manual, but the method using <code>with</code> described here is more elegant.</p>
<p>The Python <code>with</code> statement is a pleasure to use.  I should&#8217;ve started using this long time ago.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=1457</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Installing Firefox 4 Beta 9 on Debian Squeeze</title>
		<link>http://okomestudio.net/biboroku/?p=1445</link>
		<comments>http://okomestudio.net/biboroku/?p=1445#comments</comments>
		<pubDate>Fri, 24 Dec 2010 16:47:56 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Debian/Squeeze]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[install procedure]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[web browser]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=1445</guid>
		<description><![CDATA[I find the easiest way is to download a precompiled binary from this nightly build repository. For beta 9 on AMD64: $ wget http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-trunk/firefox-4.0b9pre.en-US.linux-x86_64.tar.bz2 $ tar -xvjf firefox*.tar.bz2 $ sudo mv firefox /usr/local/firefox4-b9pre $ sudo ln -s /usr/local/firefox4-b9pre /usr/local/firefox4 $ &#8230; <a href="http://okomestudio.net/biboroku/?p=1445">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I find the easiest way is to download a precompiled binary from this <a href="http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-trunk/">nightly build repository</a>.</p>
<p>For beta 9 on AMD64:</p>
<pre><code>$ wget http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-trunk/firefox-4.0b9pre.en-US.linux-x86_64.tar.bz2
$ tar -xvjf firefox*.tar.bz2
$ sudo mv firefox /usr/local/firefox4-b9pre
$ sudo ln -s /usr/local/firefox4-b9pre /usr/local/firefox4
$ sudo ln -s /usr/local/firefox4/firefox /usr/local/bin/firefox4</code></pre>
<p>That&#8217;s it.</p>
<p>For some post install configurations (such as incompatible add-ons), see a <a href="http://okomestudio.net/biboroku/?p=1166">previous post</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=1445</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Mounting an ext4 Partition over NFS on Mac OS X Snow Leopard</title>
		<link>http://okomestudio.net/biboroku/?p=1429</link>
		<comments>http://okomestudio.net/biboroku/?p=1429#comments</comments>
		<pubDate>Mon, 20 Dec 2010 19:59:09 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Debian/Squeeze]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[install procedure]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[OS X/Snow Leopard]]></category>
		<category><![CDATA[USB]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=1429</guid>
		<description><![CDATA[The title says it all.  I want to use a USB drive formatted with ext4 on Snow Leopard.  I mostly use the drive with Linux but sometimes I wish to mount it on my iMac at work to transfer a &#8230; <a href="http://okomestudio.net/biboroku/?p=1429">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>The title says it all.  I want to use a USB drive formatted with ext4 on Snow Leopard.  I mostly use the drive with Linux but sometimes I wish to mount it on my iMac at work to transfer a large amount of data (the wired network is just much faster there&#8230;).</p>
<p>My first attempt to mount an ext4 filesystem on Snow Leopard was to use <a href="http://code.google.com/p/macfuse/">MacFUSE</a> and <a href="https://github.com/gerard/ext4fuse">ext4fuse</a>, but I quickly found this solution was inflexible (largely the ext4 support is very preliminary).</p>
<p>My solution is to install Debian Squeeze on the iMac using <a href="http://www.virtualbox.org/">VirtualBox</a>, mount the ext4 formatted USB drive on the guest Linux, and export the partition over NSF to the host iMac.  I had shied away from any virtualization up until this point, but it was actually quit trivial to set it up, so no installation note here.  Just download and install VirtualBox on iMac, install an OS by popping in an install media, following the standard Debian install procedure, and that was it.  The Debian installer has gotten easier to use so this should be very trivial.</p>
<h4>Configure VirtualBox for Detect a USB Drive</h4>
<p>Here I follow <a href="http://www.cyberciti.biz/faq/mac-os-x-read-ext3-ext4-external-usb-hard-disk-partition/">this article</a>.</p>
<p>On VirtualBox, select the Debian I just installed.  Go to Settings -&gt; Ports -&gt; USB.  Check &#8220;Enable USB Controller&#8221; and &#8220;Enable USB 3.0 (EHCI) Controller.&#8221;  Add a new USB filter with all fields initially set to empty strings.  This is important so that the ext4 formatted USB drive gets detected before OS X does.  (When OS X detects such a device, it thinks the device is unreadable and gives me an option to either initialize (omg), ignore, or eject.  When this happens, make sure to choose &#8220;ignore.&#8221;)</p>
<h4>Configure Network between Host and Guest</h4>
<p>Here I follow <a href="http://muffinresearch.co.uk/archives/2010/02/08/howto-ssh-into-virtualbox-3-linux-guests/">this article</a>.</p>
<p>On VirtualBox, select the Debian I just installed.  Go to Settings -&gt; Network -&gt; Adapter 2.  Check &#8220;Enable Network Adapter.&#8221;  For &#8220;Attached to,&#8221; choose &#8220;Host-only Adapter&#8221; and &#8220;vboxnet0&#8243; for its name.  I may leave the default advanced settings.</p>
<p>On iMac host, find out the IP address of vboxnet0:</p>
<pre><code>host$ sudo ifconfig
...
vboxnet0: ...
    ...
    inet 192.168.56.1 netmask 0xffffff00 broadcast 192.168.56.255</code></pre>
<p>So the host machine is at 192.168.56.1.</p>
<p>Now, login to Debian guest as a regular user.  I configure the second network adapter that I created as follows.  Edit <em>/etc/network/interfaces</em> to have the following lines:</p>
<pre><code>auto eth1
iface eth1 inet static
    address 192.168.56.10
    netmask 255.255.255.0</code></pre>
<p>so that the guest machine is at 192.168.56.10.  Do</p>
<pre><code>guest$ sudo ifup eth1</code></pre>
<p>and try to login to guest from host:</p>
<pre><code>host$ ssh 192.168.56.10</code></pre>
<p>Make sure everything works fine through this point.</p>
<h4>Mount the USB Drive in Debian</h4>
<p>I just follow a standard procedure for mounting a USB drive, but here goes.  Start the guest Linux system.  Once logged in as a regular user, plug in the USB drive to iMac.  Find out which node the device has been attached:</p>
<pre><code>guest$ dmesg | tail
...
scsi 3:0:0:1: Attached scsi generic sg3 type 13
...
 sdb: sdb1
...</code></pre>
<p>This is how it looks like on my system.  Create a mount point and mount it:</p>
<pre><code>guest$ mkdir ~/usb
guest$ sudo mount /dev/sdb1 /home/username/usb
guest$ ls /home/username/usb
... should see the content of the usb drive ...</code></pre>
<p>If this works, the next step is to set up the NFS.</p>
<h4>Setting up NFS on Debian Guest</h4>
<p><del>On iMac host, find out the uid and gid of myself as a regular user:</del></p>
<p><del></del></p>
<pre><code>host$ id
uid=501(username) gid=20(staff) ...</code></pre>
<p><del>Take a note of these numbers.</del></p>
<p>On Debian, install some packages:</p>
<pre><code>guest$ sudo aptitude install nfs-kernel-server nfs-common portmap</code></pre>
<p>In <em>/etc/exports</em>, have the following line:</p>
<pre><code>/home/username/usb 192.168.56.1(rw,sync,all_squash,no_subtree_check,anonuid=0,anongid=0)</code></pre>
<p><del>[NOTE: THIS ACTUALLY DOESN'T WORK AS I THOUGHT.] Here, use the uid and gid of my regular user on iMac for anonuid and anongid; this is important so that the NFS mounted filesystem can be used as a regular user on iMac host</del>.  Then execute:</p>
<pre><code>guest$ sudo exportfs -a</code></pre>
<p>Now <em>/home/username/usb</em> should be mountable on iMac.</p>
<h4>Mounting the NFS Partition on iMac Host</h4>
<pre><code>host$ mkdir usb
host$ sudo mount_nfs -P 192.168.56.10:/home/username/usb usb
host$ ls usb
... should see the content of the usb drive ...</code></pre>
<p>That&#8217;s it.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=1429</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Power Management on Lenovo T410s</title>
		<link>http://okomestudio.net/biboroku/?p=1406</link>
		<comments>http://okomestudio.net/biboroku/?p=1406#comments</comments>
		<pubDate>Sun, 19 Dec 2010 17:57:41 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Debian/Squeeze]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[T410s]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=1406</guid>
		<description><![CDATA[T410s&#8217;s battery life is very short, providing only 2 &#8211; 3 hours without a ultrabay module battery. I wish to continually improve the battery life, ideally getting around 5 hours in the end with the main and the ultrabay module &#8230; <a href="http://okomestudio.net/biboroku/?p=1406">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>T410s&#8217;s battery life is very short, providing only 2 &#8211; 3 hours without a ultrabay module battery.  I wish to continually improve the battery life, ideally getting around 5 hours in the end with the main and the ultrabay module combined.  Here is my continually growing notes.</p>
<p>I use Debian Squeeze.  The general configuration of my T410s box is described in <a title="Installing Debian Squeeze (AMD64) on Lenovo T410s" href="http://okomestudio.net/biboroku/?p=856">another page</a>.</p>
<p>First, install must-have software:</p>
<pre><code>$ sudo aptitude install powertop acpi acpid</code></pre>
<p>To monitor the power consumption,</p>
<pre><code>$ sudo powertop</code></pre>
<p>I&#8217;d say this is the most essential tool for power management.  I can see which processes wake up the computer most, and try to eliminate them one by one.  Here&#8217;s how powertop typically looks like on my T410s.</p>
<p><a href="http://okomestudio.net/biboroku/wp-content/uploads/2010/12/powertop.png"><img class="alignnone size-medium wp-image-1422" title="powertop" src="http://okomestudio.net/biboroku/wp-content/uploads/2010/12/powertop.png?w=240" alt="" width="240" height="300" /></a></p>
<h3>Laptop Mode Configurations</h3>
<p>Install laptop-mode-tools:</p>
<pre><code>$ sudo aptitude install laptop-mode-tools</code></pre>
<p>In <em>/etc/laptop-mode/laptop-mode.conf</em>, make sure to have this line:</p>
<pre><code>ENABLE_AUTO_MODULES=1</code></pre>
<p>which is set to 0 by default.  When on battery this will apply a bunch of power saving settings.  This sole step should typically save about 2 &#8211; 2.5 W of power consumption according to powertop!  The following additional tweaks (overriding the default settings) are optional.</p>
<p>To disable ethernet when on battery, make sure <em>/etc/laptop-mode/conf.d/ethernet.conf</em> has the following lines:</p>
<pre><code>CONTROL_ETHERNET="auto"
DISABLE_ETHERNET_ON_BATTERY=1</code></pre>
<p>For more aggressive power saving on Intel HDA, make sure <em>/etc/laptop-mode/conf.d/intel-hda-powersave.conf</em> has the following lines:</p>
<pre><code>CONTROL_INTEL_HDA_POWER="auto"
INTEL_HDA_DEVICE_TIMEOUT=3
INTEL_HDA_DEVICE_CONTROLLER=1</code></pre>
<p>For more aggressive power saving on the wireless adapter, make sure /etc/laptop-mode/conf.d/wireless-iwl-power.conf has the following lines:</p>
<pre><code>CONTROL_IWL_POWER="auto"
IWL_BATT_POWER=5</code></pre>
<p>After changing the configuration, restart laptop-mode:</p>
<pre><code>$ sudo /etc/init.d/laptop-mode restart</code></pre>
<p>to make the changes effective.</p>
<h4>Starting &amp; Stopping Services</h4>
<p>Some daemons running in the background can be stopped while on battery by laptop-mode.  If the init scripts are stored under <em>/etc/init.d</em>, the simplest method is to place a symlink to the init script under <em>/etc/laptop-mode/*-stop</em> directories.</p>
<p>For example, if I want to stop ssh from running while on battery, do this:</p>
<pre><code>$ cd /etc/laptop-mode/batt-stop
$ sudo ln -s /etc/init.d/ssh .</code></pre>
<p>Now, I want ssh to get restarted when on AC:</p>
<pre><code>$ cd /etc/[lm|nolm]-ac-start
$ sudo ln -s /etc/init.d/ssh .</code></pre>
<p>(depending on how laptop-mode is configured, I create a symlink either <em>lm-ac-start</em> or <em>nolm-ac-start</em>.)</p>
<p>I should create similar symlinks for all services that should be stopped while on battery.</p>
<h3>Configuring System on Switch between AC &amp; Battery</h3>
<p>For certain things that laptop-mode does not take care of, I create a script which gets run each time the AC is plugged or unplugged.  Depending on the state (on battery or on AC), I change some settings.</p>
<p>Such a script may look like this:</p>
<pre class="brush: bash; title: ; notranslate">#!/bin/bash

if [ ! -f /sys/devices/platform/smapi/ac_connected ]; then
  exit 0
fi

TAG=pmtp
STATUS=`cat /sys/devices/platform/smapi/ac_connected`

if [ &quot;$STATUS&quot; = &quot;1&quot; ]; then
  logger -t $TAG &quot;on ac&quot;
  logger -t $TAG &quot;increasing swappiness&quot;
  sysctl -w vm.swappiness=60
else
  logger -t $TAG &quot;on battery&quot;
  logger -t $TAG &quot;reducing swappiness&quot;
  sysctl -w vm.swappiness=10
fi</pre>
<p>Let us save this script as <em>/usr/local/bin/pmtp</em>.  (FYI, this script changes the amount of swap disk usage, effectively reducing disk access while on battery.  This is a recommended thing to do.)</p>
<p>To let laptop-mode handle this script, modify <em>/etc/laptop-mode/conf.d/exec-commands.conf</em> to have these lines:</p>
<pre><code>BATT_EXEC_COMMAND_0="/usr/local/bin/pmtp"
LM_AC_EXEC_COMMAND_0="/usr/local/bin/pmtp"
NOLM_AC_EXEC_COMMAND_0="/usr/local/bin/pmtp"</code></pre>
<p>This way the script gets run each time the AC/battery state changes.</p>
<h3>KDE</h3>
<p>In addition to what I do above, I let KDE do some power management work.</p>
<p>Go to Menu -&gt; Computer -&gt; System Settings -&gt; Advanced -&gt; Power Management -&gt; Edit Profiles.  There, I can change various options for different profiles.  It is good idea to change the display brightness under the Screen tab.</p>
<p>I also run a script to enable/disable a few desktop related applications and settings.  In particular, the sound for the KDE system notifications should be disabled entirely, because they cause a vast amount of interruptions.  (If I see knotify4 processes popping up in powertop, this is the cause.)  So I create the following script:</p>
<pre class="brush: bash; title: ; notranslate">#!/bin/bash

if [ ! -f /sys/devices/platform/smapi/ac_connected ]; then
    exit 0
fi

TAG=pmkde
STATUS=`cat /sys/devices/platform/smapi/ac_connected`

if [ &quot;$STATUS&quot; = &quot;1&quot; ]; then
    logger -t $TAG &quot;on ac&quot;

    logger -t $TAG &quot;start xflux&quot;
    for i in `pgrep ^xflux$` ; do kill -9 $i ; done
    xflux -l 44.65 -g -63.6

    logger -t $TAG &quot;start dropbox&quot;
    for i in `pgrep ^dropbox$` ; do kill -9 $i ; done
    /usr/local/dropbox/dropboxd &amp;amp;

    logger -t $TAG &quot;enable system notification&quot;
    kwriteconfig --file=/home/username/.kde/share/config/knotifyrc --group=Sounds --key=&quot;No sound&quot; false
else
    logger -t $TAG &quot;on battery&quot;

    logger -t $TAG &quot;stop xflux&quot;
    for i in `pgrep ^xflux$` ; do kill -9 $i ; done

    logger -t $TAG &quot;stop dropbox&quot;
    for i in `pgrep ^dropbox$` ; do kill -9 $i ; done

    logger -t $TAG &quot;disable system notification&quot;
    kwriteconfig --file=/home/username/.kde/share/config/knotifyrc --group=Sounds --key=&quot;No sound&quot; true
fi</pre>
<p>Save this to maybe <em>~/bin/pmkde.sh</em>.  In this script, I also start/stop flux and Dropbox.</p>
<p>Under the CPU and System tab, specify this shell script for the &#8220;When loading profile execute:&#8221; entry.  This script should be used for all profiles.</p>
<h3>Disabling Bluetooth</h3>
<p>I can use Fn + F5 to switch on/off just WiFi, not Bluetooth.  But I don’t use any Bluetooth device at all.  To control the on/off status of wireless device on the command line, I need:</p>
<pre><code>$ sudo aptitude install rfkill
... below is an example usage ...
$ rfkill list
$ rfkill block bluetooth</code></pre>
<p>I can live without Bluetooth entirely.</p>
<p>To disable Bluetooth at boot time, add the following line:</p>
<pre><code>$ rfkill block bluetooth</code></pre>
<p>to <em>/etc/rc.local</em> (before the “exit 0″ statement, of course).</p>
<h3>Preload Daemon</h3>
<pre><code>$ sudo aptitude install preload</code></pre>
<p>In <em>/etc/default/preload</em>, uncomment the line reading</p>
<pre><code>OPTIONS="-l /dev/null"</code></pre>
<p>This should reduce disk activity.</p>
<h3>Changing Swappiness</h3>
<p>On the command line,</p>
<pre><code>$ sudo sysctl -w vm.swappiness=10</code></pre>
<p>The system will try to use physical RAM as much as possible instead of swapping.  To make this in effect upon boot, add the line</p>
<pre><code>vm.swappiness=10</code></pre>
<p>to <em>/etc/sysctl.conf</em>.  However, I opt to change this particular setting dynamically using a custom script described above.</p>
<h3>Battery Charge Thresholds</h3>
<p>To extend battery life, charge thresholds should be tweaked.  My current settings are:</p>
<pre><code>$ echo 90 | sudo tee /sys/devices/platform/smapi/BAT0/start_charge_thresh
$ echo 95 | sudo tee /sys/devices/platform/smapi/BAT0/stop_charge_thresh</code></pre>
<p>Do this for each battery in my system (BAT0, BAT1, etc.)</p>
<h3>Chromium over Firefox</h3>
<p>My default browser is Firefox.  When browsing the web, however, Chromium is much easier on power.  I can save about 1 W using Chromium.</p>
<h3>Powertop Status</h3>
<p>December 19, 2010 &#8212; With all this effort, I currently run T410s with about 10 W on idle.  That goes up to 13 &#8211; 14 W with typical usage (WiFi on, browsing the web, writing on an editor, etc.).</p>
<h3>Reference</h3>
<ul>
<li><a href="http://www.thinkwiki.org/">ThinkWiki</a> – A truly great resource for ThinkPad users.</li>
<li><a href="http://pcplus.techradar.com/node/3172/">PC Plus article</a> &#8211; See especially the comment section.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=1406</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Automounting a USB Hard Drive in Debian Squeeze</title>
		<link>http://okomestudio.net/biboroku/?p=1402</link>
		<comments>http://okomestudio.net/biboroku/?p=1402#comments</comments>
		<pubDate>Sun, 19 Dec 2010 05:40:41 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Debian/Squeeze]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[install procedure]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[USB]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=1402</guid>
		<description><![CDATA[I want to automatically mount a USB hard disk drive at a fixed mount point every time it gets plugged in.  I also want to automatically unmount the device from the system when it&#8217;s unplugged. With udev, this is easy. &#8230; <a href="http://okomestudio.net/biboroku/?p=1402">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I want to automatically mount a USB hard disk drive at a fixed mount point every time it gets plugged in.  I also want to automatically unmount the device from the system when it&#8217;s unplugged.</p>
<p>With <em>udev</em>, this is easy.</p>
<p>First, attach the USB drive to the computer and find out its serial number:</p>
<pre class="brush: bash; title: ; notranslate">$ /sbin/udevadm info -a -p $(/sbin/udevadm info -q path -n /dev/sdb)</pre>
<p>(Here, I assume the drive is assigned <em>/dev/sdb</em>; check with dmesg if unsure.)  This will spew out a lot of information, but it should be easy to track down.  In my case, I see lines like this:</p>
<pre class="brush: plain; title: ; notranslate">...
    ATTRS{manufacturer}==&quot;Western Digital&quot;
    ATTRS{product}==&quot;My Passport 0730&quot;
    ATTRS{serial}==&quot;57383&quot;
...</pre>
<p>Take a note of the serial number to identify the device.</p>
<p>Under <em>/etc/udev/rules.d</em>, create a file named like <em>80-usb-wd.rules</em>, with the following content:</p>
<pre class="brush: plain; title: ; notranslate">ACTION==&quot;add&quot;, SUBSYSTEMS==&quot;usb&quot;, ATTRS{serial}==&quot;57583&quot;, SYMLINK+=&quot;wd%n&quot;
ACTION==&quot;add&quot;, SUBSYSTEMS==&quot;usb&quot;, ATTRS{serial}==&quot;57583&quot;, RUN+=&quot;/bin/mkdir /media/wd&quot;
ACTION==&quot;add&quot;, SUBSYSTEMS==&quot;usb&quot;, ATTRS{serial}==&quot;57583&quot;, RUN+=&quot;/bin/mount -t auto -o defaults /dev/wd1 /media/wd&quot;, OPTIONS=&quot;last_rule&quot;
ACTION==&quot;remove&quot;, SUBSYSTEMS==&quot;usb&quot;, ATTRS{serial}==&quot;57583&quot;, RUN+=&quot;/bin/umount /media/wd&quot;
ACTION==&quot;remove&quot;, SUBSYSTEMS==&quot;usb&quot;, ATTRS{serial}==&quot;57583&quot;, RUN+=&quot;/bin/rmdir /media/wd&quot;, OPTIONS=&quot;last_rule&quot;</pre>
<p>What these instructions do is two things.  When the USB drive with the specific serial number is attached, udev creates device nodes like <em>/dev/wd</em>, <em>/dev/wd0</em>, <em>/dev/wd1</em>, &#8230;, the exact number of these nodes depending on how many partitions are in the drive.  I only have one partition on this drive, and <em>/dev/wd1</em> points to it.  Then it creates a directory <em>/media/wd</em>, and the partition <em>/dev/wd1</em> gets mounted to the node.</p>
<p>Unfortunately, the device is mounted as root, so in order to unmount the filesystem, I need to unmount as root:</p>
<pre class="brush: bash; title: ; notranslate">$ sudo umount /media/wd</pre>
<p>When the USB drive is removed from the system, it unmounts the partition and the <em>/media/wd</em> directory is deleted as well.</p>
<p>Restart udev and the change will be in effect:</p>
<pre class="brush: bash; title: ; notranslate">$ sudo /etc/init.d/udev restart</pre>
<p>This way I can expect the specific USB drive to be always mounted at <em>/media/wd</em>.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=1402</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>PS3 Media Server on Debian Squeeze</title>
		<link>http://okomestudio.net/biboroku/?p=1391</link>
		<comments>http://okomestudio.net/biboroku/?p=1391#comments</comments>
		<pubDate>Tue, 14 Dec 2010 14:49:57 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Debian/Squeeze]]></category>
		<category><![CDATA[install procedure]]></category>
		<category><![CDATA[Last.fm]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[multimedia]]></category>
		<category><![CDATA[music]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[PS3]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=1391</guid>
		<description><![CDATA[My music collection consists of Ogg Vorbis files.  Rather than re-encoding them again for PlayStation 3, I decided to serve music files via a media server.  Fortunately this is very easy to do. Installation Mostly following this note: $ sudo &#8230; <a href="http://okomestudio.net/biboroku/?p=1391">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>My music collection consists of Ogg Vorbis files.  Rather than re-encoding them again for PlayStation 3, I decided to serve music files via a media server.  Fortunately this is very easy to do.</p>
<h4>Installation</h4>
<p>Mostly following <a href="http://blog.livedoor.jp/ha_yshr/archives/51475396.html">this note</a>:</p>
<pre><code>$ sudo aptitude update
$ sudo aptitude install sun-java6-jre
$ sudo aptitude install mplayer mencoder ffmpeg
$ sudo update-alternatives --config java  # choose Sun Java if multiple Java installs exist</code></pre>
<p>Move to temporary directory and <a href="http://code.google.com/p/ps3mediaserver/downloads/list">download Linux source tarball</a>:</p>
<pre><code>... download .tgz file ...
$ tar -xvjf pms*.tgz
$ sudo mv pms-generic-linux-unix-1.20.412 /usr/local/pms-1.20.412
$ sudo ln -s /usr/local/pms-1.20.412 /usr/local/pms
$ sudo chmod a+x /usr/local/pms/PMS.sh</code></pre>
<p>To launch the server properly, I have to run the PMS.sh script from the <em>/usr/local/pms</em> directory.  Instead of having to cd into that directory each time, I created the following startup script and saved it as <em>/usr/local/bin/pms</em>:</p>
<pre class="brush: bash; title: ; notranslate">#!/bin/sh
(cd /usr/local/pms &amp;amp;&amp;amp; exec ./PMS.sh)</pre>
<p>Giving the executable permissions:</p>
<pre><code>$ sudo chmod a+x /usr/local/bin/pms</code></pre>
<p>This way, the pms command will launch the media server anywhere on the system.</p>
<h4>Scrobbling with Last.fm</h4>
<p>I want music tracks to be scrobbled with Last.fm.  Looking at <a href="http://ps3mediaserver.org/forum/viewtopic.php?f=12&amp;t=721&amp;sid=5db138e68ccc1eaa3a1a8aac45a2e968&amp;start=50#p18100">this forum thread</a>, there is a plugin to make this possible.</p>
<p>Download the <a href="http://ps3mediaserver.org/forum/download/file.php?id=521">LastFMScrobbler.zip</a>, unzip the content and move the <em>LastFMScrobbler.jar</em> file to <em>/usr/local/pms/plugins</em>.</p>
<p>Restart the PMS server.</p>
<p>Choose the General Configuration tab.  Under the Plugin Systems section, there is an entry for Last.fm Scrobbler plugin.  Click on it and I&#8217;m asked to provide the username and password for Last.fm.  This info gets stored unencrypted in a text file, so be careful about the password&#8230;</p>
<p>Restart the PMS server and the music tracks should now be scrobbled.  Check on my Last.fm profile page.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=1391</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Debian Squeeze from Hard Disk</title>
		<link>http://okomestudio.net/biboroku/?p=1386</link>
		<comments>http://okomestudio.net/biboroku/?p=1386#comments</comments>
		<pubDate>Tue, 14 Dec 2010 14:37:21 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Debian/Squeeze]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[install procedure]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=1386</guid>
		<description><![CDATA[Unfortunately the Debian installer does not work on my Dell desktop box.  I still wanted to do a fresh install of Squeeze, and the only sensible option for me was to install off hard disk.  I have been having the &#8230; <a href="http://okomestudio.net/biboroku/?p=1386">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Unfortunately the Debian installer does not work on my Dell desktop box.  I still wanted to do a fresh install of Squeeze, and the only sensible option for me was to install off hard disk.  I have been having the same issue for several months and I have not been able to solve it myself, and nobody responds to my bug report&#8230;  However, this hard drive method may work well even if I have a working install USB stick/CD media.</p>
<p>I assume that a working Linux installation exists on the system already; it will only be used to launch the installer.  (In practice, I used an existing Lenny installation to go through this procedure, only to wipe it over with Squeeze.)  For this note I use the Debian installer beta 2 for Squeeze (AMD64).</p>
<p>Create a partition large enough to hold a netinst .iso image (~ 170 MB) plus maybe 20 MB for kernel image and whatnot.  For illustration, I assume it is at <em>/dev/sda11</em>.  Move to a temporary working directory, download some files, mount the partition, and copy files to the install partition:</p>
<pre><code>$ wget http://ftp.nl.debian.org/debian/dists/testing/main/installer-amd64/current/images/hd-media/initrd.gz
$ wget http://ftp.nl.debian.org/debian/dists/testing/main/installer-amd64/current/images/hd-media/vmlinuz
$ wget http://cdimage.debian.org/cdimage/squeeze_di_beta2/amd64/iso-cd/debian-squeeze-di-beta2-amd64-netinst.iso
$ mkdir mnt
$ sudo mount /dev/sda11 mnt
$ sudo cp initrd.gz mnt
$ sudo cp vmlinuz mnt
$ sudo cp debian-squeeze-di-beta2-amd64-netinst.iso mnt/netinst.iso
$ sudo umount /dev/sda11</code></pre>
<p>Now I need to modify the GRUB menu to add an entry for the installer that I just made.  </p>
<p>For the new GRUB version 2, an entry in <em>/boot/grub/grub.cfg</em> looks a bit complicated:</p>
<pre><code>menuentry 'Squeeze Installer Beta 2' --class debian --class gnu-linux --class os {
  insmod part_msdos
  insmod ext2
  set root='<em>(hd0,msdos11)</em>'
  search --no-floppy --fs-uuid --set <em>SOMELENGTHYHASH</em>
  echo 'Loading Squeeze installer'
  linux /vmlinuz root=UUID=<em>SOMELENGTHYHASH</em>
  echo 'Loading init ramdisk'
  initrd /initrd.gz
}</code></pre>
<p>Here, the root in which the install partition is the eleventh partition of the first hard drive (hence <code>hd0, msdos11</code>).  With the lengthy UUID hash for the hard drive, I&#8217;d just copy one of the GRUB entries for working installations.</p>
<p>For an old version of GRUB, an entry in﻿ <em>/boot/grub/menu.lst</em> would look like this:</p>
<pre><code>title  Squeeze Installer Beta 2
root   (hd0,10)
kernel /vmlinuz
initrd /initrd.gz</code></pre>
<p>This means the install partition is located at the 11th partition of the first hard drive, and the paths to the kernel and initrd images are located at the topmost level of the partition.  This is the sort of entry I copy and paste from other entries in <em>/boot/grub/menu.lst</em>.</p>
<p>After reboot, select the menu entry just added and I will be starting the installer right away!</p>
<p>IMPORTANT: When I partition the drive during the installation process, do not mount the install partition.  If I do, the partitioning and the subsequent installation will fail.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=1386</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>USB 3.0 ExpressCard Adapter on Debian Squeeze</title>
		<link>http://okomestudio.net/biboroku/?p=1360</link>
		<comments>http://okomestudio.net/biboroku/?p=1360#comments</comments>
		<pubDate>Thu, 09 Dec 2010 19:10:00 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Debian/Squeeze]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[install procedure]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[T410s]]></category>
		<category><![CDATA[USB 3.0]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=1360</guid>
		<description><![CDATA[My Lenovo T410s has a rather small 80 GB SSD, and with the amount of data that I need to deal with these days, something like mounting network drive isn&#8217;t fast enough for me.  So I decided to try USB &#8230; <a href="http://okomestudio.net/biboroku/?p=1360">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>My Lenovo T410s has a rather small 80 GB SSD, and with the amount of data that I need to deal with these days, something like mounting network drive isn&#8217;t fast enough for me.  So I decided to try USB 3.0, since I have an open ExpressCard slot.</p>
<p>Browsing the web, I found that most USB 3.0 controllers are using NEC uPD720200, which the Linux kernel natively supports.  As long as the adapter uses the chip, I should be okay.  I got <a href="http://www.amazon.com/Transcend-Express-Adapter-Laptop-TS-PNU3/dp/B003QJX1K8">Transcend USB 3.0 ExpressCard Adapter</a>, after making sure on the manufacture web site that it uses the NEC chip.</p>
<h4>Kernel Configuration</h4>
<p>I have to make sure relevant kernel options are enabled.  If not, <a title="Customizing &amp; Installing Linux Kernel on Debian Squeeze" href="http://okomestudio.net/biboroku/?p=754">build a kernel from source</a>, making sure the following options are set:</p>
<pre><code>PM=y
ACPI=y
PCI=y
PCIEPORTBUS=y
HOTPLUG_PCI=m
HOTPLUG_PCI_ACPI=m
USB=m
USB_ANNOUNCE_NEW_DEVICES=y
USB_XHCI_HCD=m</code></pre>
<p>Hope I didn&#8217;t leave out other essential options&#8230;</p>
<h4>Using ExpressCard</h4>
<p>If not loaded automatically, I need to load the acpiphp kernel module manually:</p>
<pre><code>$ sudo modprobe acpiphp</code></pre>
<p>When I insert the adapter, it should be recognized:</p>
<pre><code>$ lspci | grep USB
...
05:00.0 USB Controller: NEC Corporation uPD720200 USB 3.0 Host Controller (rev 03)
...</code></pre>
<p>This should be it.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=1360</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Installing JWM on Debian Squeeze</title>
		<link>http://okomestudio.net/biboroku/?p=1358</link>
		<comments>http://okomestudio.net/biboroku/?p=1358#comments</comments>
		<pubDate>Tue, 07 Dec 2010 05:27:36 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Debian/Squeeze]]></category>
		<category><![CDATA[install procedure]]></category>
		<category><![CDATA[JWM]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=1358</guid>
		<description><![CDATA[To really save battery consumption when needed, I decided to install JWM on my laptop. As usual, I did $ sudo aptitude install jwm and just selected jwm at the KDM login menu. However, every time I tried to launch &#8230; <a href="http://okomestudio.net/biboroku/?p=1358">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>To really save battery consumption when needed, I decided to install <a href="http://joewing.net/programs/jwm/">JWM</a> on my laptop.</p>
<p>As usual, I did</p>
<pre><code>$ sudo aptitude install jwm</code></pre>
<p>and just selected jwm at the KDM login menu.</p>
<p>However, every time I tried to launch JWM, my computer got stack with no response.  It turns out the configuration files are not installed properly by default, so I needed to copy and unzip <em>/usr/share/doc/jwm/example.jwmrc.gz</em>, and have it renamed to <em>~/.jwmrc</em>.  After doing this, I was able to login to a JWM session, although the resource file is extremely basic, so I have to learn how to configure things to make it usable.</p>
<p>At the same time, powertop doesn&#8217;t show too drastic an improvement on power consumption compared to when I&#8217;m using KDE.  I wonder why.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=1358</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SExtractor on Debian Squeeze (AMD64)</title>
		<link>http://okomestudio.net/biboroku/?p=1344</link>
		<comments>http://okomestudio.net/biboroku/?p=1344#comments</comments>
		<pubDate>Tue, 30 Nov 2010 14:30:29 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[astro]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Debian/Squeeze]]></category>
		<category><![CDATA[install procedure]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[research]]></category>
		<category><![CDATA[SExtractor]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=1344</guid>
		<description><![CDATA[Installing from Debian Repository $ sudo aptitude install sextractor This version is rather old (v2.4.4) though. Installing from Source I need FFTW and ATLAS installed already, and assume that FFTW was installed at /usr/local/fftw, and ATLAS at /usr/local/atlas following the &#8230; <a href="http://okomestudio.net/biboroku/?p=1344">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<h4>Installing from Debian Repository</h4>
<pre><code>$ sudo aptitude install sextractor</code></pre>
<p>This version is rather old (v2.4.4) though.</p>
<h4>Installing from Source</h4>
<p>I need <a title="FFTW on Debian Squeeze (AMD64)" href="http://okomestudio.net/biboroku/?p=1339">FFTW</a> and <a title="ATLAS on Debian Squeeze (AMD64)" href="http://okomestudio.net/biboroku/?p=1328">ATLAS</a> installed already, and assume that FFTW was installed at <em>/usr/local/fftw</em>, and ATLAS at <em>/usr/local/atlas</em> following the source install procedures described in those notes.  Make  sure that you build both double and single precision versions of FFTW  by going through the make procedure twice to install both.</p>
<p>Download the <a href="http://www.astromatic.net/software/sextractor">SExtractor</a> source into a temporary directory:</p>
<pre><code>$ mkdir tmp
$ cd tmp
... download sextractor-2.8.6.tar.gz
$ tar -xvzf sex*.tar.gz
$ cd sextractor-2.8.6
$ ./configure --prefix=/usr/local/sextractor-2.8.6 \
    --with-atlas=/usr/local/atlas/lib --with-atlas-incdir=/usr/local/atlas/include \
    --with-fftw=/usr/local/fftw/lib --with-fftw-incdir=/usr/local/fftw/include \
    --enable-threads
$ make
$ sudo make install
$ ln -s /usr/local/sextractor-2.8.6 /usr/local/sextractor
$ sudo cp -rp config /usr/local/sextractor-2.8.6</code></pre>
<p>This will install SExtractor at <em>/usr/local/sextractor-2.8.6</em> (which is symlinked by <em>/usr/local/sextractor</em>) and an executable command sex will be located at <em>/usr/local/sextractor/bin/sex</em>.  Make a simlink to that binary <em>/usr/local/bin</em> to make it available system-wide if I wish.  I might also want to make a simlink to <em>/usr/local/sextractor/bin/ldactoasc</em>,  which is a utility command that might be useful.  The last line copies  the SExtractor configuration files and convolution masks to <em>/usr/local/sextractor/config</em>.  The default convolution masks are often used so it may be a good idea to keep them under the same installation directory.</p>
<p><em>Error at configure</em>.  For version 2.8.4, I might encounter errors at the configure stage.  If this happens, inspect <em>config.log</em> file to see what went wrong.  Typically I found myself getting stuck because my ATLAS source installation had a linking bug (?) that caused the &#8220;hidden symbol&#8221; error which is described in the ATLAS installation note mentioned above; this was fixed with rebuilding ATLAS.  Another problem that I might encounter is &#8220;undefined reference&#8221; errors when linking with LAPACK.  This can be solved by modifying <em>configure</em> script so that it has &#8220;-lf77blas&#8221; for every occurrence of &#8220;-llapack&#8221; in that file.  There is a <a href="http://okomestudio.net/biboroku/wp-content/uploads/2011/01/sexconfigfix.patch">patch</a> to fix this; download to the source directory, rename it to <em>sexconfigfix.patch</em> and then do</p>
<pre><code>$ patch &lt; sexconfigfix.patch</code></pre>
<p>This will make necessary modifications.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=1344</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FFTW on Debian Squeeze (AMD64)</title>
		<link>http://okomestudio.net/biboroku/?p=1339</link>
		<comments>http://okomestudio.net/biboroku/?p=1339#comments</comments>
		<pubDate>Tue, 30 Nov 2010 13:56:40 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[computing]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Debian/Squeeze]]></category>
		<category><![CDATA[FFTW]]></category>
		<category><![CDATA[install procedure]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[research]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=1339</guid>
		<description><![CDATA[Installing from Debian Repository $ sudo aptitude install libfftw3-3 libfftw3-dev The second package is only necessary for development. Installing from Source The version of FFTW I use here is 3.2.2.  Follow this: $ mkdir tmp $ cd tmp $ wget &#8230; <a href="http://okomestudio.net/biboroku/?p=1339">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<h4>Installing from Debian Repository</h4>
<pre><code>$ sudo aptitude install libfftw3-3 libfftw3-dev</code></pre>
<p>The second package is only necessary for development.</p>
<h4>Installing from Source</h4>
<p>The version of <a href="http://www.fftw.org/">FFTW</a> I use here is <a href="http://www.fftw.org/fftw-3.2.2.tar.gz">3.2.2</a>.  Follow this:</p>
<pre><code>$ mkdir tmp
$ cd tmp
$ wget http://www.fftw.org/fftw-3.2.2.tar.gz
$ tar -xvzf fftw-3.2.2.tar.gz
$ cd fftw-3.2.2
$ ./configure --prefix=/usr/local/fftw-3.2.2 --enable-threads \
    <span style="color: #ff0000;">--enable-single F77=gfortran</span>
$ make
$ sudo make install
$ sudo ln -s /usr/local/fftw-3.2.2 /usr/local/fftw</code></pre>
<p>This will install FFTW under <em>/usr/local/fftw-3.2.2</em>, symlinked by <em>/usr/local/fftw</em> as well.</p>
<p>Note that the portion in red at the configure line should be modified accordingly.  I use GFortran, hence the F77 option.  One of the programs that I often ends up building need both double and single precision versions of FFTW, so I run <code>./configure ; make ; make install</code> once with <code>--enable-single</code> and another without the <code>--enable-single</code> option.  This will install both versions under the same lib directory.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=1339</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>ATLAS on Debian Squeeze (AMD64)</title>
		<link>http://okomestudio.net/biboroku/?p=1328</link>
		<comments>http://okomestudio.net/biboroku/?p=1328#comments</comments>
		<pubDate>Tue, 30 Nov 2010 13:38:31 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[ATLAS]]></category>
		<category><![CDATA[computing]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Debian/Squeeze]]></category>
		<category><![CDATA[install procedure]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[research]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=1328</guid>
		<description><![CDATA[Installing from Debian Repository $ sudo aptitude install libatlas3gf-base $ sudo aptitude install libatlas-base-dev The second line is necessary only for development. Installing from Source Disable CPU throttling.  Find out how many CPUs I have: $ cat /proc/cpuinfo ... info &#8230; <a href="http://okomestudio.net/biboroku/?p=1328">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<h4>Installing from Debian Repository</h4>
<pre><code>$ sudo aptitude install libatlas3gf-base
$ sudo aptitude install libatlas-base-dev</code></pre>
<p>The second line is necessary only for development.</p>
<h4>Installing from Source</h4>
<p><em>Disable CPU throttling</em>.  Find out how many CPUs I have:</p>
<pre><code>$ cat /proc/cpuinfo
... info for each CPU ...</code></pre>
<p>Check which CPU I have.  Mine is ﻿﻿Intel(R) Core(TM) i5 CPU M 520 @ 2.40GHz and there are four CPUs (really two CPUs but becomes four with hyperthreading).  Set each CPU&#8217;s governor as performance:</p>
<pre><code>$ for i in {0..3}; do sudo cpufreq-set -g performance -c $i ; done</code></pre>
<p>(Note &#8220;{0..3}&#8221; should reflect how many CPUs there are; for a dual core machine, it probably should be {0..1}.)</p>
<p>In case, do this first:</p>
<pre><code>$ sudo aptitude install gcc gfortran</code></pre>
<p>I download tarballs for <a href="http://math-atlas.sourceforge.net/">ATLAS</a> and <a href="http://www.netlib.org/lapack/">LAPACK</a> from the official repositories.  Here I use ATLAS 3.9.32 (still a development version) and LAPACK   3.3.0.  I assume the compiled library and header files will be installed   at <em>/usr/local/atlas</em>-3.9.32, which will be symbolic linked at <em>/usr/local/atlas</em>.</p>
<p>Prepare the source directory:</p>
<pre><code>$ mkdir tmp
$ cd tmp
$ wget http://www.netlib.org/lapack/lapack.tgz  # at the time of writing this is v3.3.0
... download the tarball for ATLAS from sourceforge ...
$ tar -xvjf atlas3.9.32.tar.bz2
$ mv ATLAS atlas-3.9.32
$ ln -s atlas-3.9.32 atlas
$ mkdir atlas/bld
$ cd atlas/bld
$ ../configure -b 64 --shared \
  --prefix=/usr/local/atlas-3.9.32 --with-netlib-lapack-tarfile=../../lapack.tgz</code></pre>
<p><em>Hidden symbol in gcc error</em>.  Now this may only be relevant to my current configuration, but when I linked some other program against my custom ATLAS build (I was compiling SExtractor), I have the following error:</p>
<pre><code>/usr/bin/ld: prog: hidden symbol `__powidf2' in /usr/lib/gcc/x86_64-.../libgcc.a(_powidf2.o) is referenced by DSO
/usr/bin/ld: final link failed: Nonrepresentable section on output</code></pre>
<p>which prevented me to build programs which link to ATLAS.  It took a while to find a fix, but to prevent this error, I need to modify <em>lib/Makefile</em> in the bld directory (after I run ../configure once) so that</p>
<pre><code>liblapack.so : liblapack.a
        ld $(LDFLAGS) -shared -soname $(LIBINSTdir)/liblapack.so \
            -o liblapack.so  -rpath-link $(LIBINSTdir) --whole-archive \
           liblapack.a --no-whole-archive $(F77SYSLIB) <span style="color: #ff0000;">-lgcc</span></code></pre>
<p>&#8220;-lgcc&#8221; (in red) is added.</p>
<p><em>Specifying Architecture</em>.  The build process might take very long time if I don&#8217;t specify right architecture.  Do this:</p>
<pre><code>$ make xprint_enums ; ./xprint_enums</code></pre>
<p>and I get a list of enums for different CPU architectures.  Mine is Intel Core i5, which isn&#8217;t actually listed but I figured it might be close enough to Core i7, so I chose that one (18).  I will feed this to the configure script.  Earlier I also found out that my CPU runs at 2.4 GHz.  I will also feed this info to the configure script as seen next.</p>
<p>Now we do:</p>
<pre><code>$ ../configure <span style="color: #ff0000;">-A 18</span> -b 64 <span style="color: #ff0000;">-D c -DPentiumCPS=2400</span> -Fa alg -fPIC --shared \
  --prefix=/usr/local/atlas-3.9.32 --with-netlib-lapack-tarfile=../../lapack.tgz
$ time make build</code></pre>
<p>(Note the options &#8220;-A 18&#8243; and &#8220;-D c -DPentiumCPS=2400&#8243; have been added.)  This takes about 15 minutes on my Lenovo T410s.</p>
<p>If I wish to do some checking, do:</p>
<pre><code>$ make check
...
$ make time
...</code></pre>
<p>I may wish to compare the outputs with that found in <em>../doc/atlas_install.pdf</em>.  My timing tests look like this:</p>
<pre><code>            single precision                  double precision
            ********************************  *******************************
            real             complex          real             complex
            ---------------  ---------------  ---------------  ---------------
Benchmark   Refrenc Present  Refrenc Present  Refrenc Present  Refrenc Present
=========   ======= =======  ======= =======  ======= =======  ======= =======
kSelMM      718.6   863.4    663.4   798.7    339.3   402.4    334.5   405.6
kGenMM      185.4   216.8    183.8   218.6    179.1   194.9    177.6   204.4
kMM_NT      157.9   186.7    160.7   190.1    170.5   172.2    166.6   186.3
kMM_TN      177.7   206.6    184.3   217.9    171.4   186.0    169.7   196.2
BIG_MM      679.2   796.3    691.1   802.4    322.9   353.8    323.2   357.0
kMV_N       175.7   149.6    353.1   292.1     92.3    74.3    159.5   136.8
kMV_T       182.3   150.2    372.1   296.8     94.8    76.3    161.9   139.4
kGER        137.9   109.1    267.2   213.1     68.9    52.2    121.7   103.1
make[1]: Leaving directory `/usr/local/src/atlas/atlas-3.9.32/bld'</code></pre>
<p>If I don&#8217;t find any problem, finally do:</p>
<pre><code>$ sudo make install
$ sudo ln -s /usr/local/atlas-3.9.32 /usr/local/atlas</code></pre>
<p>That&#8217;s it.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=1328</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Installing IRAF version 2.15 on Debian Squeeze</title>
		<link>http://okomestudio.net/biboroku/?p=1302</link>
		<comments>http://okomestudio.net/biboroku/?p=1302#comments</comments>
		<pubDate>Sun, 28 Nov 2010 03:05:14 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[astro]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Debian/Squeeze]]></category>
		<category><![CDATA[install procedure]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[research]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=1302</guid>
		<description><![CDATA[My way of installing IRAF v2.15, now 64-bit by default. First create a regular user named &#8220;iraf&#8221;: $ sudo adduser iraf $ sudo aptitude install csh $ sudo ln -s /usr/lib/libncurses.so /usr/lib/libtermcap.so.2 The second line installing csh is necessary because &#8230; <a href="http://okomestudio.net/biboroku/?p=1302">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>My way of installing IRAF v2.15, now 64-bit by default.</p>
<p>First create a regular user named &#8220;iraf&#8221;:</p>
<pre><code>$ sudo adduser iraf
$ sudo aptitude install csh
$ sudo ln -s /usr/lib/libncurses.so /usr/lib/libtermcap.so.2</code></pre>
<p>The second line installing csh is necessary because people using csh don&#8217;t go away any time soon&#8230; The last line (which is quite a hack) is necessary to avoid a problem of this IRAF version linking to a very old library which no longer exists in Debian Squeeze.  Also it is recommended to modify the line in <em>/etc/passwd</em> so that /home/iraf becomes /iraf/iraf/local.  Mine looks like this:</p>
<pre><code>iraf:x:1001:1001:,,,:/iraf/iraf/local:/bin/csh</code></pre>
<p>Create the directory hierarchy:</p>
<pre><code>$ sudo mkdir /usr/local/iraf-2.15
$ sudo chown iraf /usr/local/iraf-2.15
$ sudo chgrp iraf /usr/local/iraf-2.15
$ sudo ln -s /usr/local/iraf-2.15 /iraf
$ cd /iraf
$ su iraf
... as user iraf ...
$ chsh
... enter /bin/csh to change to csh ...
$ mkdir bin imdirs iraf</code></pre>
<p>I&#8217;m doing it this way so that everything related to IRAF will be installed under <em>/usr/local/iraf-2.15</em>, for ease of future upgrade.  Download the tarball and expand it:</p>
<pre><code>$ cd /iraf/iraf
$ wget ftp://iraf.noao.edu/iraf/v215/PCIX/iraf.lnux.x86_64.gz
$ tar -xvzf iraf.lnux.x86_64.gz
$ su
... as root ...
# iraf=/iraf/iraf   # defining $iraf; csh user might do differently...
# $iraf/unix/hlib/install</code></pre>
<p>My responses to the installer queries:</p>
<ul>
<li>New iraf root directory: /iraf/iraf</li>
<li>Default root image storage directory: /iraf/imdirs</li>
<li>Local unix commands directory: /iraf/bin</li>
<li>Proceed with installation: yes</li>
<li>Proceed to post-install configuration stage: yes</li>
<li>Configure IRAF Networking on this machine: no</li>
<li>Create a default tapecap file: no</li>
<li>Do you wish to delete these unused HSI binaries: yes</li>
<li>Do you wish to strip the system of sources: no</li>
</ul>
<p>For testing the installation:</p>
<pre><code>$ su iraf
$ cd /iraf/iraf/local
$ mkiraf
$ /iraf/iraf/bin/cl</code></pre>
<p>This should start IRAF.</p>
<p>However, I just realized PyRAF probably isn&#8217;t compatible with this IRAF installation, and I only use IRAF via PyRAF these days.  Well, I guess I can install IRAF 2.14 and this version side by side.  Worth it?  No.  Hahaha&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=1302</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Some Physics Units Cheat Sheet</title>
		<link>http://okomestudio.net/biboroku/?p=1240</link>
		<comments>http://okomestudio.net/biboroku/?p=1240#comments</comments>
		<pubDate>Fri, 26 Nov 2010 02:42:42 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[astro]]></category>
		<category><![CDATA[reference]]></category>
		<category><![CDATA[research]]></category>
		<category><![CDATA[units]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=1240</guid>
		<description><![CDATA[Before I forget: In CGS: where]]></description>
				<content:encoded><![CDATA[<p>Before I forget:</p>
<p>In CGS:<br />
<img src='http://s.wordpress.com/latex.php?latex=%5Cfrac%7Be%5E2%7D%7B%5Chbar%20c%7D%20%3D%20%5Cfrac%7B1%7D%7B137%7D&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\frac{e^2}{\hbar c} = \frac{1}{137}' title='\frac{e^2}{\hbar c} = \frac{1}{137}' class='latex' /><br />
where<br />
<img src='http://s.wordpress.com/latex.php?latex=e%20%3D%204.8%20%5Ctimes%2010%5E%7B-10%7D%7E%5Ctext%7Besu%7D&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='e = 4.8 \times 10^{-10}~\text{esu}' title='e = 4.8 \times 10^{-10}~\text{esu}' class='latex' /><br />
<img src='http://s.wordpress.com/latex.php?latex=%5Chbar%20c%20%3D%20200%7E%5Ctext%7BMeV%20fm%7D&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\hbar c = 200~\text{MeV fm}' title='\hbar c = 200~\text{MeV fm}' class='latex' /></p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=1240</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Estimating Standard Deviation from N Data Points</title>
		<link>http://okomestudio.net/biboroku/?p=1185</link>
		<comments>http://okomestudio.net/biboroku/?p=1185#comments</comments>
		<pubDate>Wed, 24 Nov 2010 01:06:20 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[astro]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[reference]]></category>
		<category><![CDATA[research]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=1185</guid>
		<description><![CDATA[In astronomy people often estimate a standard deviation in, say, background counts from the observed data themselves, since it is very difficult to know what true standard deviations are. Then the question is this: How many measurements (e.g., the number &#8230; <a href="http://okomestudio.net/biboroku/?p=1185">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>In astronomy people often estimate a standard deviation in, say, background counts from the observed data themselves, since it is very difficult to know what true standard deviations are.</p>
<p>Then the question is this: How many measurements (e.g., the number of CCD pixels) do we need to estimate the true standard deviation?</p>
<p>I used the following code to find out empirically:</p>
<pre class="brush: python; title: ; notranslate">#!/usr/bin/env python2.6

import matplotlib.pyplot as plt
import numpy as np

def gauss(n, std):
    return np.random.normal(0, std, n)

def uniform(n, std):
    lim = std / 0.57735
    return np.random.uniform(-lim, +lim, n)

def poisson(n, std):
    return np.random.poisson(std * std, n)

def doeach(func, std0, nlogs, repeat=10000):
    percenterrors = []
    for nlog in nlogs:
        n = int(10**nlog)
        stds = []
        for i in range(repeat):
            values = func(n, std0)
            stds.append(np.std(values, ddof=1))

        std_in_measured = np.sqrt(((np.array(stds) - std0)**2).sum() / repeat)

        percenterror = std_in_measured / std0
        print('%6d %.3f %.3f' % (n, percenterror, 1./np.sqrt(n)))
        percenterrors.append(percenterror)
    return percenterrors

def main():
    funcs = [(gauss, 1., 'Gaussian', 'b--'),
             (poisson, 1., 'Poisson', 'r--'),
             (uniform, 1., 'Uniform', 'g--')]

    nlogs = np.linspace(0.5, 4.0, 20)

    for f, std, label, symbol in funcs:
        perrs = doeach(f, std, nlogs, repeat=10000)
        plt.loglog(10**nlogs, perrs, symbol, lw=2, label=label)

    plt.loglog(10**nlogs, 1./np.sqrt(10**nlogs), '-', lw=2, c='gray',
               label='1/sqrt(n)')
    plt.xlabel('Number of measurements')
    plt.ylabel('Std. dev. in measured std. dev. / true std. dev.')
    plt.xlim(2, 2e4)
    plt.legend()
    plt.grid(which='both')
    plt.show()

if __name__ == '__main__':
    main()</pre>
<p>If you assume the counts are drawn from three distributions (Gaussian, Poisson, and uniform, of somewhat arbitrary means and widths) then the fractional uncertainty in the estimate of true standard deviation falls off like <img src='http://s.wordpress.com/latex.php?latex=1%2F%5Csqrt%7Bn%7D&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='1/\sqrt{n}' title='1/\sqrt{n}' class='latex' /> where <img src='http://s.wordpress.com/latex.php?latex=n&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='n' title='n' class='latex' /> is the number of measurements that go into the estimate.</p>
<p><a href="http://okomestudio.net/biboroku/wp-content/uploads/2010/11/stddev_vs_n.png"><img class="alignnone size-medium wp-image-1188" title="Fractional uncertainty as a function of N" src="http://okomestudio.net/biboroku/wp-content/uploads/2010/11/stddev_vs_n.png?w=300" alt="Fractional uncertainty as a function of N" width="560" height="494" /></a></p>
<p>So the rule of thumb is that you need <img src='http://s.wordpress.com/latex.php?latex=n&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='n' title='n' class='latex' /> measurements to achieve a fractional uncertainty better than <img src='http://s.wordpress.com/latex.php?latex=1%2F%5Csqrt%7Bn%7D&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='1/\sqrt{n}' title='1/\sqrt{n}' class='latex' />.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=1185</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing mpi4py on Debian Squeeze</title>
		<link>http://okomestudio.net/biboroku/?p=1183</link>
		<comments>http://okomestudio.net/biboroku/?p=1183#comments</comments>
		<pubDate>Tue, 23 Nov 2010 04:03:24 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[computing]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Debian/Squeeze]]></category>
		<category><![CDATA[high performance computing]]></category>
		<category><![CDATA[install procedure]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=1183</guid>
		<description><![CDATA[I want to do parallel computing on my desktop to take advantage of quad core.  Actually, I just need to test programs to be run on HPC clusters.  It is actually easy to set up a parallel computing environment. Install &#8230; <a href="http://okomestudio.net/biboroku/?p=1183">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I want to do parallel computing on my desktop to take advantage of quad core.  Actually, I just need to test programs to be run on HPC clusters.  It is actually easy to set up a parallel computing environment.</p>
<p>Install a couple packages:</p>
<pre><code>$ sudo aptitude install openmpi-bin libopenmpi-dev</code></pre>
<p>The development file is necessary to build mpi4py against it.</p>
<p><a href="http://code.google.com/p/mpi4py/downloads/list">Download the mpi4py source</a> and install as usual:</p>
<pre><code>$ tar -xvzf mpi4py-*.tar.gz
$ cd mpi4py-*
$ python setup.py build
$ sudo python setup.py install</code></pre>
<p>That&#8217;s it.  The command <code>mpirun</code> is available for use.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=1183</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Installing Firefox 4 Beta on Debian Squeeze</title>
		<link>http://okomestudio.net/biboroku/?p=1166</link>
		<comments>http://okomestudio.net/biboroku/?p=1166#comments</comments>
		<pubDate>Mon, 22 Nov 2010 16:53:59 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Debian/Squeeze]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[install procedure]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[web browser]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=1166</guid>
		<description><![CDATA[Update: I think the following note that I made a while ago is no longer applicable. Please visit: http://mozilla.debian.net/ for a more streamlined installation via apt-get. Caution: This note won&#8217;t work for a version &#62;= Beta 8-1.  Unfortunately the new &#8230; <a href="http://okomestudio.net/biboroku/?p=1166">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Update: I think the following note that I made a while ago is no longer applicable.  Please visit:</p>
<p><a href="http://mozilla.debian.net/">http://mozilla.debian.net/</a></p>
<p>for a more streamlined installation via apt-get.</p>
<p>Caution: This note won&#8217;t work for a version &gt;= Beta 8-1.  Unfortunately the new release depends on newer versions of libraries than what Squeeze has.  Installing those libraries on Squeeze might defeat the purpose of using Debian for its stability and not recommended.  I think it&#8217;s best to <a href="http://okomestudio.net/biboroku/?p=1445">use a precompiled binary from Mozilla directly</a>.</p>
<p>Firefox 3.5 (a.k.a. Iceweasel in Debian) on Squeeze is a bit old, so I wish to install Firefox 4 (still beta) as well.  I&#8217;d like to keep an option of running stable Firefox 3.5, so what I do here is to install version 4 as a separate install.  Much of this note follows the information found in <a href="http://glandium.org/blog/?p=1032">this article and its comments</a>.</p>
<p>First, download .deb packages from a <a href="http://mozilla.debian.net/packages/">repository</a> to a temporary directory:</p>
<pre><code>$ wget http://mozilla.debian.net/packages/iceweasel_4.0~b7-2_amd64.deb
$ wget http://mozilla.debian.net/packages/libmozjs4d_2.0~b7-2_amd64.deb
$ wget http://mozilla.debian.net/packages/xulrunner-2.0_2.0~b7-2_amd64.deb</code></pre>
<p>I&#8217;ll be installing Firefox under <em>/usr/local/iceweasel4</em>. Do:</p>
<pre><code>$ sudo aptitude install libffi5 libevent-1.4-2
$ sudo dpkg –i libmozjs4d_2.0~b7-2_amd64.deb
$ sudo dpkg –i xulrunner-2.0_2.0~b7-2_amd64.deb
$ sudo mkdir /usr/local/iceweasel4
$ sudo dpkg-deb -x iceweasel_4.0~b7-2_amd64.deb /usr/local/iceweasel4/
$ sudo ln -s /usr/lib/xulrunner-2.0 /usr/local/iceweasel4/usr/lib/</code></pre>
<p>That&#8217;s it.  The application launch script is located at <em>/usr/local/iceweasel4/usr/bin/iceweasel</em>.  I create a symlink in <em>/usr/local/bin</em> so that it becomes available system-wide:</p>
<pre><code>$ sudo ln -s /usr/local/iceweasel4/usr/bin/iceweasel /usr/local/bin/iceweasel4</code></pre>
<p>This way I can launch it via command <code>iceweasel4</code> from shell.  It probably is a good idea to launch Firefox for the first time as</p>
<pre><code>$ iceweasel4 -ProfileManager</code></pre>
<p>to create a separate user profile for the beta.  Otherwise the profile needs to be converted each time you switch between version 3.5 and 4 beta.</p>
<h4>Making Incompatible Plugins to Bypass Compatibility Test</h4>
<p>The biggest advantage of Firefox is plugins (a major reason that I haven&#8217;t tried Google Chrome yet).  I cannot live without Delicious and Gmail Manager (among others that I don&#8217;t bother to mention), but most have not been updated to work with version 4 beta.</p>
<p>Some plugins are not tested on the beta, but some features actually work.  In order to <a href="http://www.howtogeek.com/howto/21478/how-to-bypass-firefox-4.0-betas-incompatible-add-on-error-and-install-extensions-anyway/">bypass version compatibility checks </a>upon installing plugins, visit <em>about:config</em> in the browser, and right-click somewhere the preference list, New -&gt; Boolean, and add a new preference with the name &#8220;extensions.checkCompatibility.4.0b&#8221; and set the boolean value to &#8220;false&#8221;.  After relaunching, the plugin version checks will be bypassed.</p>
<p><em><a href="https://addons.mozilla.org/en-US/firefox/addon/1320/">Gmail Manager</a></em>. The official release does not work, but <a href="http://forums.mozillazine.org/viewtopic.php?f=48&amp;t=332634&amp;start=3413">somebody posted a modified version</a> which works.  Download the .xpi file, and open the file with Firefox to install the plugin.  I&#8217;m not sure of its authenticity though.  Use at your own risk&#8230;</p>
<p><em><a href="https://addons.mozilla.org/en-US/firefox/addon/3615/">Delicious Bookmarks</a></em>. The official release works partially.  What I lose on the beta is the Delicious toolbar in which I can make frequently used tags available, but the bookmarks are all available from the Firefox toolbar.  I can live with it for now.</p>
<h4>Update History</h4>
<p>December 24, 2010 &#8211; Added a caution for beta 8-1.<br />
April 3, 2011 &#8211; Added a note to obsolete this document.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=1166</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Installing Sage (Math Library) on Debian Squeeze</title>
		<link>http://okomestudio.net/biboroku/?p=1155</link>
		<comments>http://okomestudio.net/biboroku/?p=1155#comments</comments>
		<pubDate>Mon, 22 Nov 2010 05:32:46 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[computing]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Debian/Squeeze]]></category>
		<category><![CDATA[install procedure]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=1155</guid>
		<description><![CDATA[First, download the source to some directory (here /usr/local/sage) from one of the official repositories (here it&#8217;s at U. of Washington, just for an illustration).  Move to the directory and then $ wget -c http://boxen.math.washington.edu/sage/src/sage-4.6.tar $ sudo aptitude install gcc &#8230; <a href="http://okomestudio.net/biboroku/?p=1155">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>First, <a href="http://www.sagemath.org/download-source.html">download the source</a> to some directory (here <em>/usr/local/sage</em>) from one of the official repositories (here it&#8217;s at U. of Washington, just for an illustration).  Move to the directory and then</p>
<pre><code>$ wget -c http://boxen.math.washington.edu/sage/src/sage-4.6.tar
$ sudo aptitude install gcc g++ gfortran make m4 perl binutils tar
$ tar -xvf sage-4.6.tar
$ sudo mv sage-4.6 /usr/local
$ sudo ln -s /usr/local/sage-4.6 /usr/local/sage
$ cd /usr/local/sage-4.6</code></pre>
<p>If you have a multiprocessor machine,</p>
<pre><code>$ export MAKE="make -j4"</code></pre>
<p>in which I used &#8220;4&#8243; because I have a quad core machine.  Then</p>
<pre><code>$ make</code></pre>
<p>This is it.</p>
<h4>Installing the Python package mpi4py</h4>
<p>Go to the Sage installation directory, run Sage:</p>
<pre><code>$ ./sage
...
sage: optional_packages()
...
sage: install_package('openmpi-XXX')
sage: install_package('mpi4py-YYY')</code></pre>
<p>I need to change the versions XXX and YYY of Open MPI and mpi4py depending on the ones found in the list obtained by optional_package().</p>
<p>That&#8217;s it.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=1155</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Setting Time and Time Zone in Debian on a Dual Boot Sytem with Windows</title>
		<link>http://okomestudio.net/biboroku/?p=1149</link>
		<comments>http://okomestudio.net/biboroku/?p=1149#comments</comments>
		<pubDate>Mon, 22 Nov 2010 02:02:39 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Debian/Squeeze]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=1149</guid>
		<description><![CDATA[I noticed that my time is way off on my Debian box.  I&#8217;m dual booting one of my desktop with Windows XP, so I have to set the CMOS clock to the local time as opposed to the UTC time &#8230; <a href="http://okomestudio.net/biboroku/?p=1149">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I noticed that my time is way off on my Debian box.  I&#8217;m dual booting one of my desktop with Windows XP, so I have to set the CMOS clock to the local time as opposed to the UTC time that&#8217;s preferred if the computer purely runs on Linux.  If the CMOS clock is not set in UTC, you need to tell Debian by modifying one of the lines in <em>/etc/default/rcS</em>:</p>
<pre><code>... some other stuff ...
UTC=no
... some other stuff ...</code></pre>
<p>This way, Debian can deal with dual boot with an OS like Windows.  Note that this won&#8217;t work if the real time clock is not supported by your kernel.  Make sure that the kernel options RTC_CLASS, RTC_INTF_DEV, and RTC_DRV_CMOS are enabled if for some reason you customized your kernel.  (It turned out that my problem was that I inadvertently disabled these options when I last customized kernel&#8230;)</p>
<p>To set time zone:</p>
<pre><code>$ sudo dpkg-reconfigure tzdata</code></pre>
<p>To set date and time (to 9:08:52 pm Nov 21, 2011):</p>
<pre><code>$ sudo date -s 2011-11-21
$ sudo date -s 21:08:52</code></pre>
<p>This should be it.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=1149</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux Image Manipulation Cheat Sheet</title>
		<link>http://okomestudio.net/biboroku/?p=1147</link>
		<comments>http://okomestudio.net/biboroku/?p=1147#comments</comments>
		<pubDate>Sun, 21 Nov 2010 22:41:35 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[graphics]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[reference]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=1147</guid>
		<description><![CDATA[This will be my cheat sheet for doing image manipulation on Linux. Scale Images ImageMagick has a command mogrify to do this: This will scale all .jpg images to half the original size. Create a GIF Animation More to be &#8230; <a href="http://okomestudio.net/biboroku/?p=1147">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>This will be my cheat sheet for doing image manipulation on Linux.</p>
<h4>Scale Images</h4>
<p>ImageMagick has a command <code>mogrify</code> to do this:</p>
<pre class="brush: bash; title: ; notranslate">$ mogrify -scale 50% *.jpg</pre>
<p>This will scale all .jpg images to half the original size.</p>
<h4>Create a GIF Animation</h4>
<pre class="brush: bash; title: ; notranslate">$ convert -delay 100 -loop 0 *.png anim.gif</pre>
<p>More to be added&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=1147</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing F.lux on Debian Squeeze</title>
		<link>http://okomestudio.net/biboroku/?p=1131</link>
		<comments>http://okomestudio.net/biboroku/?p=1131#comments</comments>
		<pubDate>Sat, 20 Nov 2010 19:28:48 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Debian/Squeeze]]></category>
		<category><![CDATA[install procedure]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=1131</guid>
		<description><![CDATA[In another feeble attempt to become a &#8220;morning person,&#8221; I&#8217;ve decided to follow the usual advice that I should not be looking at bright LCD screen at night to help myself going into the &#8220;sleep mode.&#8221; Hence F.lux. I want &#8230; <a href="http://okomestudio.net/biboroku/?p=1131">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>In another feeble attempt to become a &#8220;morning person,&#8221; I&#8217;ve decided to follow the usual advice that I should not be looking at bright LCD screen at night to help myself going into the &#8220;sleep mode.&#8221;</p>
<p>Hence <a href="http://www.stereopsis.com/flux/">F.lux</a>.</p>
<p>I want it to launch automatically at the start of a KDE session.</p>
<p>First of all, check the geographical coordinates of your location, perhaps using a search engine like <a href="http://www.travelmath.com/city/">this one</a>.  In my case (Halifax, Canada), the latitude and longitude is 44.65 and -63.6 (in degrees).</p>
<p>Download the Linux binary (i.e., the command-line version) from <a href="http://www.stereopsis.com/flux/linux.html">here</a>.  As of now, this is just a binary and no source codes.  So no compiling is necessary.  Do as:</p>
<pre><code>$ wget http://secure.herf.org/flux/xflux.tgz
$ tar -xvzf xflux.tgz
$ sudo cp xflux /usr/local/bin
$ sudo chmod 755 /usr/local/bin/xflux</code></pre>
<p>Now the command <code>xflux</code> is available system-wide.</p>
<p>To make it run at the KDE starup, create a shell script (called here <em>xflux.sh</em>) like this one:</p>
<pre><code>#!/bin/sh
xflux -l 44.65 -g -63.6</code></pre>
<p>Either place this script manually under <em>~/.kde/Autostart</em>, or go to KDE menu -&gt; Computer -&gt; System Settings -&gt; Advanced -&gt; Autostart, and add the <em>xflux.sh</em> script there.</p>
<p>If for some reason you need to stop this program, do:</p>
<pre><code>$ kill -9 `pgrep xflux`</code></pre>
<h4>Running F.lux on 64-bit Debian Squeeze</h4>
<p>I may have problem getting xflux to run at all on a 64-bit machine, possibly seeing a &#8220;xflux: No such file or directory&#8221; error.  The xflux binary is built against 32-bit libraries:</p>
<pre><code>$ file xflux
xflux: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV),
dynamically linked (uses shared libs), for GNU/Linux 2.6.15, not stripped</code></pre>
<p>so if I haven&#8217;t done so, I need to install 32-bit environment:</p>
<pre><code>$ sudo aptitude install ia32-libs</code></pre>
<p>After this, I should be able to run xflux without problems.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=1131</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Installing Exim4 on Debian Squeeze</title>
		<link>http://okomestudio.net/biboroku/?p=1128</link>
		<comments>http://okomestudio.net/biboroku/?p=1128#comments</comments>
		<pubDate>Sat, 20 Nov 2010 18:19:01 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Debian/Squeeze]]></category>
		<category><![CDATA[install procedure]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=1128</guid>
		<description><![CDATA[My goal is simply to make it possible to send a simple email message from command line via mail, for example to send an email notice when a command-line job finishes, so I do not care about setting up a &#8230; <a href="http://okomestudio.net/biboroku/?p=1128">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>My goal is simply to make it possible to send a simple email message from command line via <code>mail</code>, for example to send an email notice when a command-line job finishes, so I do not care about setting up a full-blown mail server.  If you care about such a thing, you&#8217;d better look elsewhere.</p>
<p>The relevant information about the environment:  My host is connected to the Internet via DHCP through an ISP.  I&#8217;ll use the SMTP server of the ISP.  (Apparently there is a <a href="http://wiki.debian.org/GmailAndExim4">way to use Gmail servers</a> as well.)</p>
<p>First, install Exim4 if not already and configure it:</p>
<pre><code>$ sudo aptitude install exim4
$ sudo dpkg-reconfigure exim4-config</code></pre>
<p>I get a series of queries to which I respond as follows:</p>
<ul>
<li>General type of mail configuration: mail sent by smarthost; received via SMTP or fetchmail</li>
<li>System mail name: (apparently this domain name needs to be valid in a sense that my ISP can &#8220;resolve&#8221; it.  If unresolved, the message does not get sent properly; can see this in a log at <em>/var/log/exim4/mainlog</em>.  So I use something like &#8220;school.edu&#8221; so that when username is prepended, it becomes a valid, existing email address of mine.)</li>
<li>IP-addresses to listen on for incoming SMTP connections: 127.0.0.1</li>
<li>Other destinations for which mail is accepted: localhost</li>
<li>Machines to relay mail for: (blank)</li>
<li>IP address or host name of the outgoing smarthost: smtp.someone.com (check what SMTP server is available with the ISP)</li>
<li>Hide local mail name in outgoing mail: No</li>
<li>Keep number of DNS-queries minimal (Dial-on-Demand): No</li>
<li>Delivery method for local mail: mbox format in /var/mail/</li>
<li>Split configuration into small files: No</li>
</ul>
<p>At this point exim4 should be restarted.  Try sending a test message:</p>
<pre><code>$ echo "test message" | mail -s "test message" myusername@school.edu</code></pre>
<p>(The email address should be changed to yours of course!)  To check the log, do:</p>
<pre><code>$ sudo tail /var/log/exim4/mainlog</code></pre>
<p>If there is an error, I should be able to catch it in the log.</p>
<p>I expect the configuration will be more challenging if the SMTP server requires authentication, for example.  But for now, it&#8217;s working for me.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=1128</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Installing MacTeX on OS X Snow Leopard</title>
		<link>http://okomestudio.net/biboroku/?p=1124</link>
		<comments>http://okomestudio.net/biboroku/?p=1124#comments</comments>
		<pubDate>Thu, 18 Nov 2010 20:21:40 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[install procedure]]></category>
		<category><![CDATA[LaTeX]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[OS X/Snow Leopard]]></category>
		<category><![CDATA[research]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=1124</guid>
		<description><![CDATA[I was looking for TeX Live distribution for OS X, and MacTeX appears to be the one. The installation is very easy.  Just download a mpkg.zip file, decompress, and click on .mpkg to start the usual OS X install procedure.  &#8230; <a href="http://okomestudio.net/biboroku/?p=1124">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I was looking for TeX Live distribution for OS X, and <a href="http://tug.org/mactex/">MacTeX</a> appears to be the one.</p>
<p>The installation is very easy.  Just download a mpkg.zip file, decompress, and click on .mpkg to start the usual OS X install procedure.  After the installation, all the familiar LaTeX shell commands will be available.  Pretty much the same as on Linux.</p>
<p>A good news for people in astrophysics is that the <a href="http://aastex.aas.org/">AASTeX</a> and <a href="http://hea-www.harvard.edu/~alexey/emulateapj/">emulateapj</a> class files are installed by default.  The ApJ font style file apjfonts.sty, however, is not.  It is easy to install this via command line:</p>
<pre><code>$ wget http://hea-www.harvard.edu/~alexey/emulateapj/apjfonts.sty
$ sudo mv apjfonts.sty /usr/local/texlive/2010/texmf-dist/tex/latex/emulateapj
$ sudo texconfig rehash</code></pre>
<p>That&#8217;s it.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=1124</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating an Installation USB Memory Stick for Debian Squeeze (AMD64)</title>
		<link>http://okomestudio.net/biboroku/?p=1116</link>
		<comments>http://okomestudio.net/biboroku/?p=1116#comments</comments>
		<pubDate>Wed, 17 Nov 2010 19:35:44 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Debian/Squeeze]]></category>
		<category><![CDATA[install procedure]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=1116</guid>
		<description><![CDATA[I think this is mostly a generic procedure for Debian, not specific to Squeeze, but here goes. If the USB stick is not blank, be careful to create a new bootable partition with cfdisk command in the following procedure, and &#8230; <a href="http://okomestudio.net/biboroku/?p=1116">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I think this is mostly a generic procedure for Debian, not specific to Squeeze, but here goes.</p>
<p>If the USB stick is not blank, be careful to create a new bootable partition with <code>cfdisk</code> command in the following procedure, and carefully note the correct path to the partition (<em>/dev/sdb1</em> in this article).</p>
<p>The line with getting <em>*-netinst.iso</em> may fail once Squeeze goes stable; the particular URL is good only for the beta 2 of Debian installer.  The important thing is to get a proper netinst ISO image, which you can find <a href="http://www.debian.org/devel/debian-installer/">here</a> for non-stable Debian versions.  (If you are going to install a stable release, get a proper netinst ISO, but also make sure to get a corresponding version of <em>hd-media/boot.img.gz</em> from the stable repository.)</p>
<p>I assume that you are a superuser.  Here is the procedure:</p>
<pre><code># aptitude install wget mbr
# fdisk -l    # Find the USB stick's device path; here I assume /dev/sdb.
# cfdisk -z /dev/sdb
# wget http://ftp.debian.org/debian/dists/squeeze/main/installer-amd64/current/images/hd-media/boot.img.gz
# wget http://cdimage.debian.org/cdimage/squeeze_di_beta2/amd64/iso-cd/debian-squeeze-di-beta2-amd64-netinst.iso
# zcat boot.img.gz &gt; /dev/sdb1
# mkdir -p /tmp/usbboot
# mount /dev/sdb1 /tmp/usbboot
# cp debian-squeeze-di-beta2-amd64-netinst.iso /tmp/usbboot
# umount /tmp/usbboot
# rmdir /tmp/usbboot
# install-mbr /dev/sdb</code></pre>
<p>That&#8217;s it.  Boot off the USB stick if the BIOS of your computer allows.</p>
<h4>Update History</h4>
<p>December 12, 2010 &#8212; Changed paths for the beta 2 release.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=1116</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Looping a YouTube Video</title>
		<link>http://okomestudio.net/biboroku/?p=1104</link>
		<comments>http://okomestudio.net/biboroku/?p=1104#comments</comments>
		<pubDate>Fri, 12 Nov 2010 20:42:53 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Misc.]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=1104</guid>
		<description><![CDATA[(Borrowed from this posting, keeping here for my own reference.) Each YouTube video has a key assigned to it.  For example, in this URL http://www.youtube.com/watch?v=sgjMK2sWgsE the bold portion is the key.  Once you know this, modify the URL as http://www.youtube.com/v/sgjMK2sWgsE&#38;loop=1&#38;autoplay=1 &#8230; <a href="http://okomestudio.net/biboroku/?p=1104">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>(Borrowed from <a href="http://www.ghacks.net/2009/10/13/how-to-loop-youtube-videos/">this posting</a>, keeping here for my own reference.)</p>
<p>Each YouTube video has a key assigned to it.  For example, in this URL</p>
<pre>http://www.youtube.com/watch?v=<strong>sgjMK2sWgsE</strong></pre>
<p>the bold portion is the key.  Once you know this, modify the URL as</p>
<pre>http://www.youtube.com/v/<strong>sgjMK2sWgsE</strong>&amp;loop=1&amp;autoplay=1</pre>
<p>This will keep the video playing.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=1104</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Xpdf from Source on Linux</title>
		<link>http://okomestudio.net/biboroku/?p=1101</link>
		<comments>http://okomestudio.net/biboroku/?p=1101#comments</comments>
		<pubDate>Mon, 08 Nov 2010 16:02:44 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[install procedure]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=1101</guid>
		<description><![CDATA[Some Linux machines that I use at work have older versions of software and Xpdf, at version 3.00, is one of them.  The rendering is ugly and it spews out a lot of errors when I&#8217;m using on the shell.  &#8230; <a href="http://okomestudio.net/biboroku/?p=1101">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Some Linux machines that I use at work have older versions of software and <a href="http://www.foolabs.com/xpdf/">Xpdf</a>, at version 3.00, is one of them.  The rendering is ugly and it spews out a lot of errors when I&#8217;m using on the shell.  So I decided to install the newest version manually from source.  I cannot be a superuser on those Linux boxes, so I&#8217;m doing a local (not system-wide) installation under my home directory, e.g., <em>/home/johndoe</em>.</p>
<p>First, download the libraries and Xpdf to <em>/home/johndoe/src</em>:</p>
<ul>
<li><span style="font-family:sans-serif;"><a href="ftp://ftp.foolabs.com/pub/xpdf/xpdf-3.02.tar.gz">xpdf-3.02.tar.gz</a></span></li>
<li><span style="font-family:sans-serif;"><a href="ftp://ftp.foolabs.com/pub/xpdf/t1lib-5.1.0.tar.gz">t1lib-5.1.0.tar.gz</a></span></li>
<li><span style="font-family:sans-serif;"><a href="ftp://ftp.foolabs.com/pub/xpdf/freetype-2.3.1.tar.bz2">freetype-2.3.1.tar.bz2</a></span></li>
</ul>
<p>Then follow this:</p>
<blockquote>
<pre>$ cd /home/johndoe/src

$ tar -xvzf t1lib-5.1.0.tar.gz
$ cd t1lib-5.1.0
$ ./configure --prefix=/home/johndoe
$ make; make install

$ cd ..
$ tar -xvjf freetype-2.3.1.tar.bz2
$ cd freetype-2.3.1
$ ./configure --prefix=/home/johndoe
$ make; make install

$ cd ..
$ tar -xvzf xpdf-3.02.tar.gz
$ cd xpdf-3.02
$ export LD_RUN_PATH=/home/johndoe/lib
$ ./configure --with-t1-library=/home/johndoe/lib \
              --with-t1-includes=/home/johndoe/include \
              --with-freetype2-library=/home/johndoe/lib \
              --with-freetype2-includes=/home/johndoe/include \
              --with-Xm-library=/usr/X11R1/lib \
              --with-Xm-includes=/usr/X11R6/include \
              --prefix=/home/johndoe
$ make; make install
</pre>
</blockquote>
<p>That&#8217;s it.  The executable should now be installed at <em>/home/johndoe/bin/xpdf</em>.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=1101</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using LD_RUN_PATH to Set the Run-time Library Search Path</title>
		<link>http://okomestudio.net/biboroku/?p=1097</link>
		<comments>http://okomestudio.net/biboroku/?p=1097#comments</comments>
		<pubDate>Mon, 08 Nov 2010 04:46:21 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[install procedure]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=1097</guid>
		<description><![CDATA[Sometimes you build a program from source which requires linking to a library located in some nonstandard directory (say, /home/johndoe/lib).  Quite often this results in  a disappointment as running the executable ends in an error looking like this: XXX: error &#8230; <a href="http://okomestudio.net/biboroku/?p=1097">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Sometimes you build a program from source which requires linking to a library located in some nonstandard directory (say, <em>/home/johndoe/lib</em>).  Quite often this results in  a disappointment as running the executable ends in an error looking like this:</p>
<blockquote>
<pre>XXX: error while loading shared libraries: YYY.so: cannot open shread object file: No such file or directory</pre>
</blockquote>
<p>The easiest way to avoid this is to set the environment variable LD_RUN_PATH to point to <em>/home/johndoe/lib</em>.  Hence the standard build procedure using make goes something like this:</p>
<blockquote>
<pre>$ export LD_RUN_PATH=/home/johndoe/lib
$ ./configure --with-YYY-library=/home/johndoe/lib \
    --with-YYY-includes=/home/johndoe/include \
    --prefix=/home/johndoe
$ make
$ make install</pre>
</blockquote>
<p>(This way you do not need to mess with LD_LIBRARY_PATH, which presumably is less reliable.)</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=1097</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Uncertainty in Flux and Magnitude</title>
		<link>http://okomestudio.net/biboroku/?p=1053</link>
		<comments>http://okomestudio.net/biboroku/?p=1053#comments</comments>
		<pubDate>Wed, 03 Nov 2010 17:52:06 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Astro]]></category>
		<category><![CDATA[Research]]></category>
		<category><![CDATA[astro]]></category>
		<category><![CDATA[reference]]></category>
		<category><![CDATA[research]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=1053</guid>
		<description><![CDATA[I keep forgetting this sort of simple algebra (aging is no fun), so here&#8217;s a note. Define magnitude to be related to flux as follows: where is the zero point flux which defines the magnitude scale.  Let be the magnitude &#8230; <a href="http://okomestudio.net/biboroku/?p=1053">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I keep forgetting this sort of simple algebra (aging is no fun), so here&#8217;s a note.</p>
<p>Define magnitude <img src='http://s.wordpress.com/latex.php?latex=m&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='m' title='m' class='latex' /> to be related to flux <img src='http://s.wordpress.com/latex.php?latex=f&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='f' title='f' class='latex' /> as follows:</p>
<img src='http://s.wordpress.com/latex.php?latex=m%20%3D%20-2.5%20%5Clog%7B%5Cfrac%7Bf%7D%7Bf_0%7D%7D%20%5C%20%2C&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='m = -2.5 \log{\frac{f}{f_0}} \ ,' title='m = -2.5 \log{\frac{f}{f_0}} \ ,' class='latex' />
<p>where <img src='http://s.wordpress.com/latex.php?latex=f_0&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='f_0' title='f_0' class='latex' /> is the zero point flux which defines the magnitude scale.  Let <img src='http://s.wordpress.com/latex.php?latex=%5CDelta%20m&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\Delta m' title='\Delta m' class='latex' /> be the magnitude uncertainty, which is related to the fractional uncertainty in flux, <img src='http://s.wordpress.com/latex.php?latex=%5CDelta%20f%20%2F%20f&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\Delta f / f' title='\Delta f / f' class='latex' />.  We wish to find how <img src='http://s.wordpress.com/latex.php?latex=m%20%5Cpm%20%5CDelta%20m&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='m \pm \Delta m' title='m \pm \Delta m' class='latex' /> is related to <img src='http://s.wordpress.com/latex.php?latex=%5Cleft%281%20%5Cmp%20%5CDelta%20f%20%2F%20f%20%5Cright%29%20f&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\left(1 \mp \Delta f / f \right) f' title='\left(1 \mp \Delta f / f \right) f' class='latex' />.  This means</p>
<img src='http://s.wordpress.com/latex.php?latex=%5Cbegin%7Barray%7D%7Brcl%7D%20%5Cpm%20%5CDelta%20m%20%26%3D%26%20-2.5%20%5Clog%7B%5Cleft%5B%5Cleft%281%20%5Cmp%20%5Cfrac%7B%5CDelta%20f%7D%7Bf%7D%5Cright%29%5Cfrac%7Bf%7D%7Bf_0%7D%5Cright%5D%7D%20%2B%202.5%20%5Clog%7B%5Cfrac%7Bf%7D%7Bf_0%7D%7D%20%5C%5C%20%26%3D%26%20-2.5%20%5Clog%7B%5Cleft%281%20%5Cmp%20%5Cfrac%7B%5CDelta%20f%7D%7Bf%7D%5Cright%29%7D%20%5Cend%7Barray%7D%20%5C%20.%20&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\begin{array}{rcl} \pm \Delta m &amp;=&amp; -2.5 \log{\left[\left(1 \mp \frac{\Delta f}{f}\right)\frac{f}{f_0}\right]} + 2.5 \log{\frac{f}{f_0}} \\ &amp;=&amp; -2.5 \log{\left(1 \mp \frac{\Delta f}{f}\right)} \end{array} \ . ' title='\begin{array}{rcl} \pm \Delta m &amp;=&amp; -2.5 \log{\left[\left(1 \mp \frac{\Delta f}{f}\right)\frac{f}{f_0}\right]} + 2.5 \log{\frac{f}{f_0}} \\ &amp;=&amp; -2.5 \log{\left(1 \mp \frac{\Delta f}{f}\right)} \end{array} \ . ' class='latex' />
<p>Solving for <img src='http://s.wordpress.com/latex.php?latex=%5CDelta%20f%20%2F%20f&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\Delta f / f' title='\Delta f / f' class='latex' /> we get</p>
<img src='http://s.wordpress.com/latex.php?latex=%5Cpm%20%5Cfrac%7B%5CDelta%20f%7D%7Bf%7D%20%3D%201%20-%2010%5E%7B%5Cmp%200.4%20%5CDelta%20m%7D%20%5C%20.%20&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\pm \frac{\Delta f}{f} = 1 - 10^{\mp 0.4 \Delta m} \ . ' title='\pm \frac{\Delta f}{f} = 1 - 10^{\mp 0.4 \Delta m} \ . ' class='latex' />
<p>In summary, we have the following relationships:</p>
<img src='http://s.wordpress.com/latex.php?latex=%5Cboxed%7B%20%5Cpm%20%5CDelta%20m%20%3D%20-2.5%20%5Clog%7B%5Cleft%281%20%5Cmp%20%5Cfrac%7B%5CDelta%20f%7D%7Bf%7D%5Cright%29%7D%20%5C%3B%5C%3B%5C%3B%20%5Ctext%7Bor%7D%20%5C%3B%5C%3B%5C%3B%20%5Cpm%20%5Cfrac%7B%5CDelta%20f%7D%7Bf%7D%20%3D%201%20-%2010%5E%7B%5Cmp%200.4%20%5CDelta%20m%7D%20%5C%20.%20%7D%20&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\boxed{ \pm \Delta m = -2.5 \log{\left(1 \mp \frac{\Delta f}{f}\right)} \;\;\; \text{or} \;\;\; \pm \frac{\Delta f}{f} = 1 - 10^{\mp 0.4 \Delta m} \ . } ' title='\boxed{ \pm \Delta m = -2.5 \log{\left(1 \mp \frac{\Delta f}{f}\right)} \;\;\; \text{or} \;\;\; \pm \frac{\Delta f}{f} = 1 - 10^{\mp 0.4 \Delta m} \ . } ' class='latex' />
<p>When <img src='http://s.wordpress.com/latex.php?latex=%5CDelta%20m%20%5Cll%201&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\Delta m \ll 1' title='\Delta m \ll 1' class='latex' /> or <img src='http://s.wordpress.com/latex.php?latex=%5CDelta%20f%20%2F%20f%20%5Cll%201&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\Delta f / f \ll 1' title='\Delta f / f \ll 1' class='latex' />, we may expand the log function about 1 and retain only the first order term:</p>
<img src='http://s.wordpress.com/latex.php?latex=%5Cbegin%7Barray%7D%7Brcl%7D%20%5Clog%7Bx%7D%20%26%3D%26%20%5Cfrac%7Bx%20-%201%7D%7B%5Cln%7B10%7D%7D%20-%20%5Cfrac%7B%28x%20-%201%29%5E2%7D%7B%5Cln%7B10%5E2%7D%7D%20%2B%20%5Cfrac%7B%28x%20-%201%29%5E3%7D%7B%5Cln%7B10%5E3%7D%7D%20-%20%5Cldots%20%5C%5C%20%26%5Capprox%26%20%5Cfrac%7Bx%20-%201%7D%7B%5Cln%7B10%7D%7D%20%5Cend%7Barray%7D%20&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\begin{array}{rcl} \log{x} &amp;=&amp; \frac{x - 1}{\ln{10}} - \frac{(x - 1)^2}{\ln{10^2}} + \frac{(x - 1)^3}{\ln{10^3}} - \ldots \\ &amp;\approx&amp; \frac{x - 1}{\ln{10}} \end{array} ' title='\begin{array}{rcl} \log{x} &amp;=&amp; \frac{x - 1}{\ln{10}} - \frac{(x - 1)^2}{\ln{10^2}} + \frac{(x - 1)^3}{\ln{10^3}} - \ldots \\ &amp;\approx&amp; \frac{x - 1}{\ln{10}} \end{array} ' class='latex' />
<p>for <img src='http://s.wordpress.com/latex.php?latex=x%20%5Csimeq%201&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='x \simeq 1' title='x \simeq 1' class='latex' />. In this limit we can write <img src='http://s.wordpress.com/latex.php?latex=%5CDelta%20m%20%5Capprox%20%282.5%20%2F%20%5Cln%7B10%7D%29%20%5CDelta%20f%20%2F%20f%20%5Capprox%201.085736%20%5CDelta%20f%20%2F%20f&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\Delta m \approx (2.5 / \ln{10}) \Delta f / f \approx 1.085736 \Delta f / f' title='\Delta m \approx (2.5 / \ln{10}) \Delta f / f \approx 1.085736 \Delta f / f' class='latex' />. Hence</p>
<img src='http://s.wordpress.com/latex.php?latex=%5Cboxed%7B%20%5CDelta%20m%20%5Capprox%201.085736%20%5Cfrac%7B%5CDelta%20f%7D%7Bf%7D%20%5C%3B%5C%3B%5C%3B%20%5Ctext%7Bfor%7D%20%5C%3B%5C%3B%5C%3B%20%5CDelta%20m%20%5C%3B%5Ctext%7Bor%7D%5C%3B%20%5CDelta%20f%20%2F%20f%20%5Cll%201%20%5C%20.%7D&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\boxed{ \Delta m \approx 1.085736 \frac{\Delta f}{f} \;\;\; \text{for} \;\;\; \Delta m \;\text{or}\; \Delta f / f \ll 1 \ .}' title='\boxed{ \Delta m \approx 1.085736 \frac{\Delta f}{f} \;\;\; \text{for} \;\;\; \Delta m \;\text{or}\; \Delta f / f \ll 1 \ .}' class='latex' />
<p>This is why an uncertainty in magnitude, when small, is often an adequate approximation to the fractional uncertainty in flux.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=1053</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Dropbox without Gnome on Debian Squeeze (AMD64)</title>
		<link>http://okomestudio.net/biboroku/?p=1045</link>
		<comments>http://okomestudio.net/biboroku/?p=1045#comments</comments>
		<pubDate>Sun, 31 Oct 2010 19:31:41 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Debian/Squeeze]]></category>
		<category><![CDATA[Dropbox]]></category>
		<category><![CDATA[install procedure]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=1045</guid>
		<description><![CDATA[I&#8217;m finally trying out Dropbox but didn&#8217;t like the way their Linux client depends on Gnome (I use KDE).  Following this procedure, it is possible to use Dropbox without Gnome and even on the shell.  Here&#8217;s my version of the &#8230; <a href="http://okomestudio.net/biboroku/?p=1045">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I&#8217;m finally trying out <a href="http://www.dropbox.com/">Dropbox</a> but didn&#8217;t like the way their Linux client depends on Gnome (I use KDE).  Following <a href="http://antrix.net/posts/2008/dropbox-without-gnome/">this procedure</a>, it is possible to use Dropbox without Gnome and even on the shell.  Here&#8217;s my version of the procedure.</p>
<p>First, download to a temporary directory the Linux client from here:</p>
<ul>
<li><a href="http://www.getdropbox.com/download?plat=lnx.x86">x86</a> (for 32-bit Linux)</li>
<li><a href="http://www.getdropbox.com/download?plat=lnx.x86_64">x86_64</a> (for AMD64 Linux)</li>
</ul>
<p>The downloaded file is a gzipped tarball which you can explode via</p>
<pre><code>$ tar -xvzf dropbox-lnx*.tar.gz</code></pre>
<p>This will generate a hidden directory named <em>.dropbox-dist</em> in the same directory.  Move that directory</p>
<pre><code>$ sudo mv .dropbox-dist /usr/local/dropbox-0.7.110
$ sudo ln -s /usr/local/dropbox-0.7.110 /usr/local/dropbox</code></pre>
<p>(-0.7.110 is a version number of Dropbox I&#8217;m using.)  I move it under <em>/usr/local</em> just because I like to keep local applications there as much as possible.</p>
<p>The daemon that needs to be running in background is <em>/usr/local/dropbox/dropboxd</em>.  If I wish the daemon to run every time I use KDE, let it start automatically by creating a symlink to it under <em>~/.kde/Autostart</em>:</p>
<pre><code>$ cd ~/.kde/Autostart
$ ln -s /usr/local/dropbox/dropboxd .</code></pre>
<p>This is it.  The client icon is accessible in the KDE system tray.  The synced files are placed under <em>~/Dropbox</em>.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=1045</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Linux Admin Cheat Sheet</title>
		<link>http://okomestudio.net/biboroku/?p=1036</link>
		<comments>http://okomestudio.net/biboroku/?p=1036#comments</comments>
		<pubDate>Sun, 24 Oct 2010 00:47:58 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[Bash]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=1036</guid>
		<description><![CDATA[This isn&#8217;t intended to be comprehensive at all.  I&#8217;ll just be listing commands that I sometimes but not often use to do miscellaneous administrative tasks. Finding CPU Temperature Passwordless SSH Between trusted hosts, I want to allow passwodless access via &#8230; <a href="http://okomestudio.net/biboroku/?p=1036">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>This isn&#8217;t intended to be comprehensive at all.  I&#8217;ll just be listing commands that I sometimes but not often use to do miscellaneous administrative tasks.</p>
<h3>Finding CPU Temperature</h3>
<pre class="brush: bash; title: ; notranslate">$ acpi -t</pre>
<h3>Passwordless SSH</h3>
<p>Between trusted hosts, I want to allow passwodless access via <code>ssh</code>. To do this, generate RSA key pair:</p>
<pre class="brush: bash; title: ; notranslate">$ ssh-keygen</pre>
<p>When prompted, accept the defaults unless things need to be changed.  Copy the public key just generated in <em>~/.ssh/id_rsa.pub</em> on the local host.  Login to a remote host, and append the key to <em>~/.ssh/authorized_keys</em>.  Next time I login to that host, I will not be prompted for password.</p>
<h3>Linux Equivalent of <code>open</code> on Mac OS X</h3>
<p>One command I like on Mac OS X is <code>open</code>, which open a file with an associated default application.  There is a command called <code>xdg-open</code> which does the same thing.  Make an alias to it so it acts like the one on Mac:</p>
<pre class="brush: bash; title: ; notranslate">alias open='xdg-open'</pre>
<p>Put this in <em>~/.bash_aliases</em>.</p>
<h3>Find the UUID of Devices</h3>
<pre class="brush: bash; title: ; notranslate">$ sudo blkid</pre>
<h3>Securely Erase Hard Drive</h3>
<pre class="brush: bash; title: ; notranslate"># fdisk -l                     # check hard drives file systems
# shred -vfz -n 20 /dev/sdb    # secure erase /dev/sdb</pre>
<h3>Redirect Output to Multiple Processes</h3>
<p>Use &#8220;tee &gt;(&#8230;)&#8221;:</p>
<pre class="brush: bash; title: ; notranslate">$ &lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: monospace;&quot;&gt;ls -A | tee &amp;gt;(grep ^[.] &amp;gt; hidden-files) &amp;gt;(grep -v ^[.] &amp;gt; normal-files)&lt;/span&gt;</pre>
<p>This example comes from <a href="http://linux.byexamples.com/archives/144/redirect-output-to-multiple-processes/">this article</a>.</p>
<h3>Repeating Same Operation on Many Files</h3>
<pre class="brush: bash; title: ; notranslate">$ for i in *.txt ; do echo $i ; done</pre>
<h3>Recursively Do Something on Files/Directories</h3>
<p>Find all files under a root path:</p>
<pre class="brush: bash; title: ; notranslate">$ find /path/to/root -print</pre>
<p>Change all directory permissions to 755:</p>
<pre class="brush: bash; title: ; notranslate">$ find /path/to/root -type d -print -exec chmod 755 {} \;</pre>
<p>Change all file permissions to 644:</p>
<pre class="brush: bash; title: ; notranslate">$ find /path/to/root -type f -print -exec chmod 644 {} \;</pre>
<p>Change all files and directories with 777 permissions to 755 permissions:</p>
<pre class="brush: bash; title: ; notranslate">$ find /path/to/root -perm 777 -print -exec chmod 755 {} \;</pre>
<h3>Show the n-th (e.g., 9th) Line of a Text File</h3>
<pre class="brush: bash; title: ; notranslate">$ sed -n '9p' somefile</pre>
<h3>Send an Email Message</h3>
<p>Provided the <a title="Installing Exim4 on Debian Squeeze" href="http://nomo17k.wordpress.com/2010/11/20/installing-exim4-on-debian-squeeze/">mail service is set up properly</a>, a simple message can be sent quickly on command line.</p>
<pre class="brush: bash; title: ; notranslate">$ echo &quot;message body&quot; | mail -s &quot;subject line&quot; your@mail.com</pre>
<p>This is useful when I want to get an email notification when a very time-consuming job finishes.  For a time consuming job, sometimes it&#8217;s desirable to email the output from the job.  I can redirect both standard output and standard error to the email message body by:</p>
<pre class="brush: bash; title: ; notranslate">$ someprogram 2&amp;gt;&amp;amp;1 | mail -s &quot;job is done&quot; your@mail.com</pre>
<h3>Keep a Process Running without Hangups</h3>
<p>When starting a process on a remote host (e.g., over <code>ssh</code>), that process is killed when you logout of the session. To keep it running there, use <code>nohup</code>:</p>
<pre class="brush: bash; title: ; notranslate">$ nohup somecommand &amp;amp;</pre>
<h3>Kill All Processes with a Given Name</h3>
<pre class="brush: bash; title: ; notranslate">$ kill -9 `pgrep someprogramname`</pre>
<p>This will kill all the processes with the name someprogramname; see the <code>man</code> page for <code>pgrep</code> for more info.</p>
<h3>Change Run-Level Configuration for Init Scripts</h3>
<pre class="brush: bash; title: ; notranslate">$ sudo sysv-rc-conf</pre>
<p>This will provide an easy-to-user user interface to configure init scripts.  Useful when I want to stop KDM from running at boot, for example.</p>
<h3>Find Out How Long the System Has Been Running</h3>
<pre class="brush: bash; title: ; notranslate">$ uptime</pre>
<h3>Search for Filename in Debian Packages</h3>
<p>The Debian packaging system is obviously useful, but I often struggle to find to which package a particular command belongs.  I can search for by filename:</p>
<pre class="brush: bash; title: ; notranslate">$ sudo apt-file search somefilename</pre>
<p>To do this, the command <code>apt-file</code> needs to be installed if not already:</p>
<pre class="brush: bash; title: ; notranslate">$ sudo aptitude install apt-file
$ sudo apt-file update</pre>
<h3>Clear Apt Package Cache</h3>
<p>The <em>/var</em> partition may quickly fill up with downloaded .deb packages and if the partition size is small, occasional cleanup will be necessary.  If I wish to just remove .deb files that are no longer relevant, do</p>
<pre class="brush: bash; title: ; notranslate">$ sudo aptitude autoclean</pre>
<p>If I need to remove <em>all</em> .deb files, then</p>
<pre class="brush: bash; title: ; notranslate">$ sudo aptitude clean</pre>
<p>The latter is okay as long as I don&#8217;t mind downloading many of them again when I need to update the system via the update-upgrade sequence, for example.</p>
<h3>View the CPU Information</h3>
<pre class="brush: bash; title: ; notranslate">$ cat /proc/cpuinfo</pre>
<h3>Check the Disk Usage by Directories</h3>
<pre class="brush: bash; title: ; notranslate">$ du -h --max-depth=1</pre>
<p>The resulting list may not to be sorted.  If I want to sort this by name, do:</p>
<pre class="brush: bash; title: ; notranslate">$ du -h --max-depth=1 | sort --key=2 --ignore-case</pre>
<h2>Bash Scripting</h2>
<h3>Get the Absolute Path to the Script&#8217;s Current Directory</h3>
<pre class="brush: bash; title: ; notranslate">DIR=&quot;`dirname $BASH_SOURCE`&quot;
ABSDIR=&quot;`cd $DIR; pwd`&quot;</pre>
<h3>Get the Host Name</h3>
<pre class="brush: bash; title: ; notranslate">HOST=&quot;`hostname -f`&quot;</pre>
<h3>Parse Space-Delimited String</h3>
<pre class="brush: bash; title: ; notranslate">SEED='a b c d'
set -- $SEED
echo $1
echo $2
echo $3
echo $4</pre>
<p>More to come.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=1036</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Mendeley on Debian Squeeze (AMD64)</title>
		<link>http://okomestudio.net/biboroku/?p=1032</link>
		<comments>http://okomestudio.net/biboroku/?p=1032#comments</comments>
		<pubDate>Sat, 23 Oct 2010 01:49:38 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Squeeze]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[astro]]></category>
		<category><![CDATA[Debian/Squeeze]]></category>
		<category><![CDATA[install procedure]]></category>
		<category><![CDATA[research]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=1032</guid>
		<description><![CDATA[Mendeley does have a Debian package which you can simply apt-get (yay), but it is only available for Lenny, the current stable release.  Here I outline the system-wide installation procedure using their tarball. First, download the tarball from Mendeley to &#8230; <a href="http://okomestudio.net/biboroku/?p=1032">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.mendeley.com/download-mendeley-desktop/">Mendeley</a> does have a Debian package which you can simply apt-get (yay), but it is only available for Lenny, the current stable release.  Here I outline the system-wide installation procedure using their tarball.</p>
<p>First, <a href="http://www.mendeley.com/download-mendeley-desktop/linux64/instructions/">download the tarball</a> from Mendeley to some temporary directory.  The file should be named like <em>mendeleydesktop-0.9.8.1-linux-x86_64.tar.bz2</em>.</p>
<blockquote>
<pre>$ umask 022
$ tar -xvjf mendeleydesktop-0.9.8.1-linux-x86_64.tar.bz2
$ sudo mv mendeleydesktop-0.9.8.1-linux-x86_64 /usr/local/mendeley-0.9.8.1
$ sudo ln -s /usr/local/mendeley-0.9.8.1 /usr/local/mendeley
$ cd /usr/local/bin
$ sudo ln -s /usr/local/mendeley/bin/mendeleydesktop .</pre>
</blockquote>
<p>This will install all the files under <em>/usr/local/mendeley</em>.  The command mendeleydesktop will be available system wide.  However, it may be more convenient to add an entry to your application launcher.</p>
<p>Addendum: For some reason my Mendeley installation has had a problem on launch for a while.  It always quit after asking me to &#8220;repaire&#8221; the database, etc.  After looking at the log (which is in <em>~/.local/share/data/Mendeley Ltd./Mendeley Desktop</em>), I leaned that MendeleyDesktop had a problem dealing with SQL database, which is located somewhere deep under <em>/var</em> (I don&#8217;t know for sure).  It turned out that my <em>/var</em> partition was full.  After doing <code>apt-get clean<code>, things are working fine.  So the moral of the story is that I should clean up my system more often...</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=1032</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Python Utility for the UVBLUE Stellar Spectrum Library</title>
		<link>http://okomestudio.net/biboroku/?p=1028</link>
		<comments>http://okomestudio.net/biboroku/?p=1028#comments</comments>
		<pubDate>Fri, 22 Oct 2010 21:46:37 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Research]]></category>
		<category><![CDATA[astro]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[research]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=1028</guid>
		<description><![CDATA[I have a need to use spectra from UVBLUE, but they only supply IDL programs (who needs these any more?) to deal with the data.  I want to use the spectra in Python, so I ported their program.  Download it &#8230; <a href="http://okomestudio.net/biboroku/?p=1028">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I have a need to use spectra from <a href="http://www.inaoep.mx/~modelos/uvblue/uvblue.html">UVBLUE</a>, but they only supply IDL programs (who needs these any more?) to deal with the data.  I want to use the spectra in Python, so I ported their program.  Download it from <a href="http://ap.smu.ca/~taro/software/uvblue/uvblue.py">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=1028</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Epson Perfection V30 on Debian Squeeze (AMD64)</title>
		<link>http://okomestudio.net/biboroku/?p=1025</link>
		<comments>http://okomestudio.net/biboroku/?p=1025#comments</comments>
		<pubDate>Thu, 21 Oct 2010 23:57:15 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Debian/Squeeze]]></category>
		<category><![CDATA[Epson Perfection V30]]></category>
		<category><![CDATA[install procedure]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[scanner]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=1025</guid>
		<description><![CDATA[First, download the following .deb files from here: (To get to the download page, you choose &#8220;Perfection V30,&#8221; &#8220;Debian&#8221; for distribution, and &#8220;others&#8221; for version; the exact version numbers may be different.) Install the SANE library and related packages, and &#8230; <a href="http://okomestudio.net/biboroku/?p=1025">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>First, download the following .deb files from <a href="http://www.avasys.jp/lx-bin2/linux_e/scan/DL1.do">here</a>:</p>
<pre class="brush: bash; title: ; notranslate">esci-interpreter-gt-f720_0.0.1-2_amd64.deb
iscan_2.26.0-3.ltdl7_amd64.deb
iscan-data_1.6.0-1_all.deb</pre>
<p>(To get to the download page, you choose &#8220;Perfection V30,&#8221; &#8220;Debian&#8221; for distribution, and &#8220;others&#8221; for version; the exact version numbers may be different.)</p>
<p>Install the SANE library and related packages, and then use the .deb files you just downloaded to install Image Scan ! for Linux:</p>
<pre class="brush: bash; title: ; notranslate">$ sudo aptitude install libsane xsltproc
$ sudo dpkg -i esci-interpreter-gt-f720_0.0.1-2_amd64.deb iscan_2.26.0-3.ltdl7_amd64.deb iscan-data_1.6.0-1_all.deb</pre>
<p>That&#8217;s it.  Image Scan! for Linux can be launched from the Graphics menu.  You can also use it from GIMP.  Very simple installation!  I&#8217;ve always had good experiences with Epson scanners!</p>
<p>Actually, I find Image Scan! quite lacking in features.  The official SANE page appears to indicate that Epson Perfection V30 is not fully supported by SANE, but after following the above procedure and installed XSANE:</p>
<pre class="brush: bash; title: ; notranslate">$ sudo aptitude install xsane</pre>
<p>the scanner works perfectly.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=1025</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Bruzual &amp; Charlot 2003 (GALAXEV) on Mac OS X Snow Leopard</title>
		<link>http://okomestudio.net/biboroku/?p=1022</link>
		<comments>http://okomestudio.net/biboroku/?p=1022#comments</comments>
		<pubDate>Tue, 19 Oct 2010 18:44:30 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Snow Leopard]]></category>
		<category><![CDATA[install procedure]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[stellar population synthesis]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=1022</guid>
		<description><![CDATA[You can follow the same procedure for Linux, except that csh probably is already installed at /bin/csh and gfortran needs to be installed differently (see this post).]]></description>
				<content:encoded><![CDATA[<p>You can follow the <a href="http://nomo17k.wordpress.com/2010/10/19/installing-bruzual-charlot-2003-galaxev-on-debian-squeeze/">same procedure for Linux</a>, except that csh probably is already installed at <em>/bin/csh</em> and gfortran needs to be installed differently (see <a href="http://nomo17k.wordpress.com/2010/03/22/installing-gfortran-on-mac-os-x-snow-leopard/">this post</a>).</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=1022</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Bruzual &amp; Charlot 2003 (GALAXEV) on Debian Squeeze</title>
		<link>http://okomestudio.net/biboroku/?p=1009</link>
		<comments>http://okomestudio.net/biboroku/?p=1009#comments</comments>
		<pubDate>Tue, 19 Oct 2010 18:20:03 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Squeeze]]></category>
		<category><![CDATA[install procedure]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[stellar population synthesis]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=1009</guid>
		<description><![CDATA[The installation procedure is confusing only if you are not using CSH (I use BASH) and if g77 is not available.  Otherwise you can simply follow the installation procedure outlined in the official documentation file (i.e., bc03/doc/bc03.ps.gz). First, you definitely need &#8230; <a href="http://okomestudio.net/biboroku/?p=1009">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>The installation procedure is confusing only if you are not using CSH (I use BASH) and if g77 is not available.  Otherwise you can simply follow the installation procedure outlined in the official documentation file (i.e., <em>bc03/doc/bc03.ps.gz</em>).</p>
<p>First, you definitely need csh and a FORTRAN compiler:</p>
<blockquote>
<pre>$ sudo apt-get install csh gfortran</pre>
</blockquote>
<p>Download from the <a href="http://www2.iap.fr/users/charlot/bc2003/galaxev_download.html">B&amp;C 2003 website</a> the following tarballs (assuming here they are saved under <em>/usr/local/SED</em>):</p>
<blockquote>
<pre>bc03.doc.tar.gz
bc03.models.padova_1994_chabrier_imf.tar.gz
bc03.models.padova_1994_salpeter_imf.tar.gz
bc03.src.tar.gz
bc03.templates.tar.gz</pre>
</blockquote>
<p>Uncompress and untar all these at once by</p>
<blockquote>
<pre>for i in *.tar.gz; do tar -xvzf $i; done</pre>
</blockquote>
<p>This will create the directory <em>bc03</em> under <em>/usr/local/SED</em> and all the subdirectories (<em>bc03/doc</em>, <em>bc03/models</em>, <em>bc03/src</em>, <em>bc03/templates</em>) should be filled with files.</p>
<p>Unfortunately the setup file only exists for csh (<em>bc03/src/.bc_cshrc</em>), so you need to create one for yourself.  Save the following to a file at <em>bc03/src/.bc_bash</em>:</p>
<blockquote>
<pre>export FILTERS="$bc03/FILTERBIN.RES"
export A0VSED="$bc03/A0V_KURUCZ_92.SED"
export RF_COLORS_ARRAYS="$bc03/RF_COLORS.filters"
####################################################
alias  add='csh $bc03/add_bursts.sh'
alias  csp='csh $bc03/csp_galaxev.sh'
alias  vdisp='csh $bc03/vel_disp.sh'
alias  cmev='csh $bc03/cm_evolution.sh'
alias  dgr='csh $bc03/downgrade_resolution.sh'
alias  gpl='$bc03/galaxevpl'
alias  zmag='$bc03/zmag'</pre>
</blockquote>
<p>(This file is actually provided by default in C&amp;B 2007, which you should be using instead of the 2003 version.)  Furthermore, you need to modify a line in <em>bc03/src/Makefile</em> to use gfortran instead of g77:</p>
<blockquote>
<pre>#FC =  g77 -ffixed-line-length-132  # comment out this line and add:
FC = gfortran -ffixed-line-length-none</pre>
</blockquote>
<p>Then compile the programs:</p>
<blockquote>
<pre>$ bc03=/usr/local/SED/bc03/src
$ cd $bc03
$ . .bc_bash
$ make all</pre>
</blockquote>
<p>Add the following lines to <em>~/.bashrc</em> and all the commands for GALAXEV will be available (as aliases):</p>
<blockquote>
<pre>export bc03=/usr/local/SED/bc03/src
. $bc03/.bc_bash</pre>
</blockquote>
<p>That&#8217;s it.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=1009</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Installing NeverNote on Debian Squeeze (AMD64)</title>
		<link>http://okomestudio.net/biboroku/?p=999</link>
		<comments>http://okomestudio.net/biboroku/?p=999#comments</comments>
		<pubDate>Thu, 14 Oct 2010 14:40:21 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Squeeze]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[Debian/Squeeze]]></category>
		<category><![CDATA[Evernote]]></category>
		<category><![CDATA[install procedure]]></category>
		<category><![CDATA[Nevernote]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=999</guid>
		<description><![CDATA[I still don&#8217;t understand what all the fuss is about on Evernote (not to mention their aversion to Linux).  However, some kind of note taking utility and having all the related data in the cloud still relives me from the &#8230; <a href="http://okomestudio.net/biboroku/?p=999">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I still don&#8217;t understand what all the fuss is about on <a href="http://www.evernote.com/">Evernote</a> (not to mention their aversion to Linux).  However, some kind of note taking utility and having all the related data in the cloud still relives me from the nuisance of syncing files across different computers.</p>
<p>You never know what people will do with those data, but who gives a fuck unless you have a terror plot or something&#8230;</p>
<p><a href="http://nomo17k.wordpress.com/2010/06/13/installing-evernote-for-windows-on-debian-squeeze/">Dale L. suggested NeverNote</a>, a Linux client for Evernote, and this looks promising.  I haven&#8217;t used the application thoroughly yet, but this certainly is a much improvement over the web client.</p>
<p>Here&#8217;s what I did to install it (version 0.94) on my Debian notebook.</p>
<p>Download nevernote-0.94_amd64.deb from the <a href="http://sourceforge.net/projects/nevernote/files/">Sourceforge repository</a>, and then</p>
<blockquote>
<pre>$ sudo dpkg -i nevernote-0.94_amd64.deb</pre>
</blockquote>
<p>For me, this is all I needed to do.</p>
<p>All the files, including the startup script, are installed under <em>/usr/share/nevernote</em>. I can launch the client by explicitly running the script:</p>
<blockquote>
<pre>$ /usr/share/nevernote/nevernote.sh</pre>
</blockquote>
<p>Perhaps it makes more sense to have a symlink to this script:</p>
<blockquote>
<pre>$ sudo ln -s /usr/share/nevernote/nevernote.sh /usr/local/bin/nevernote
</pre>
</blockquote>
<p>If I put such a symlink, the file <em>/usr/share/nevernote/nevernote.sh</em> needs to be modified so that the variable NEVERNOTE within the startup script points explicitly to <em>/usr/share/nevernote</em>:</p>
<blockquote>
<pre>NEVERNOTE=/usr/share/nevernote
</pre>
</blockquote>
<p>Otherwise the application cannot properly link to libraries.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=999</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Recipe: Name-dake (なめ筍)</title>
		<link>http://okomestudio.net/biboroku/?p=995</link>
		<comments>http://okomestudio.net/biboroku/?p=995#comments</comments>
		<pubDate>Sun, 15 Aug 2010 00:50:13 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Cooking]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=995</guid>
		<description><![CDATA[What you need: Enoki mushroom 180g Sake 10 ml Soy sauce 15 ml Mirin 15 ml Put enoki mushroom and sake into a pot.  Shimmer at low to mid heat for a few minutes.  Put soy sauce and mirin a &#8230; <a href="http://okomestudio.net/biboroku/?p=995">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>What you need:</p>
<ol>
<li>Enoki mushroom 180g</li>
<li>Sake 10 ml</li>
<li>Soy sauce 15 ml</li>
<li>Mirin 15 ml</li>
</ol>
<p>Put enoki mushroom and sake into a pot.  Shimmer at low to mid heat for a few minutes.  Put soy sauce and mirin a bit later and continue simmering till enoki becomes lightly brown and the sauce becomes thick.  The proportion of ingredients 2, 3, and 4 can be changed according to your taste.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=995</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Testing if a Point is Inside a Polygon in Python</title>
		<link>http://okomestudio.net/biboroku/?p=986</link>
		<comments>http://okomestudio.net/biboroku/?p=986#comments</comments>
		<pubDate>Thu, 24 Jun 2010 17:29:33 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=986</guid>
		<description><![CDATA[Finally got around to find this out by Googling.  It&#8217;s a useful function so I reproduce it here for copy &#38; paste: def inside_polygon(x, y, points): """ Return True if a coordinate (x, y) is inside a polygon defined by &#8230; <a href="http://okomestudio.net/biboroku/?p=986">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Finally got around to find this out by Googling.  It&#8217;s a useful function so I reproduce it here for copy &amp; paste:</p>
<blockquote>
<pre>def inside_polygon(x, y, points):
    """
    Return True if a coordinate (x, y) is inside a polygon defined by
    a list of verticies [(x1, y1), (x2, x2), ... , (xN, yN)].

    Reference: http://www.ariel.com.au/a/python-point-int-poly.html
    """
    n = len(points)
    inside = False
    p1x, p1y = points[0]
    for i in range(1, n + 1):
        p2x, p2y = points[i % n]
        if y &gt; min(p1y, p2y):
            if y &lt;= max(p1y, p2y):
                if x &lt;= max(p1x, p2x):
                    if p1y != p2y:
                        xinters = (y - p1y) * (p2x - p1x) / (p2y - p1y) + p1x
                    if p1x == p2x or x &lt;= xinters:
                        inside = not inside
        p1x, p1y = p2x, p2y
    return inside
</pre>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=986</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing STSCI_PYTHON on Debian Squeeze</title>
		<link>http://okomestudio.net/biboroku/?p=973</link>
		<comments>http://okomestudio.net/biboroku/?p=973#comments</comments>
		<pubDate>Tue, 15 Jun 2010 02:04:22 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Research]]></category>
		<category><![CDATA[Squeeze]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[astro]]></category>
		<category><![CDATA[Debian/Squeeze]]></category>
		<category><![CDATA[install procedure]]></category>
		<category><![CDATA[research]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=973</guid>
		<description><![CDATA[The version I use is 2.10. First, install IRAF, tables, and stsdas following this article. $ sudo aptitude install python-tk python-numpy python-pmw python-urwid $ sudo aptitude install libreadline6-dev python-matplotlib ipython $ wget http://stsdas.stsci.edu/download/stsci_python_2.10/stsci_python_2.10.tar.gz $ tar -xvzf stsci_python_2.10.tar.gz $ cd stsci_python_2.10 &#8230; <a href="http://okomestudio.net/biboroku/?p=973">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>The version I use is 2.10.</p>
<p>First, install IRAF, tables, and stsdas following <a href="http://nomo17k.wordpress.com/2010/06/14/installing-iraf-on-debian-squeeze/">this article</a>.</p>
<blockquote>
<pre>$ sudo aptitude install python-tk python-numpy python-pmw python-urwid
$ sudo aptitude install libreadline6-dev python-matplotlib ipython
$ wget http://stsdas.stsci.edu/download/stsci_python_2.10/stsci_python_2.10.tar.gz
$ tar -xvzf stsci_python_2.10.tar.gz
$ cd stsci_python_2.10
$ python setup.py build
$ sudo python setup.py install --home=/usr/local/stsci_python-2.10
$ sudo ln -s /usr/local/stsci_python-2.10 /usr/local/stsci_python
$ cd stscidocs
$ su
# export PATH=/usr/local/stsci_python/bin:"$PATH"
# export PYTHONPATH=/usr/local/stsci_python/lib/python:"$PYTHONPATH"
# python setup.py install --home=/usr/local/stsci_python-2.10</pre>
</blockquote>
<p>Add the following lines to <em>~/.bash_profile</em><em></em>:</p>
<blockquote>
<pre>export PATH=/usr/local/stsci_python/bin:"$PATH"
export PYTHONPATH=/usr/local/stsci_python/lib/python:"$PYTHONPATH"

# These two lines are necessary if IRAF was not installed at /usr/local/bin
export iraf=/iraf/iraf  # where IRAF is installed
export IRAFARCH=linux</pre>
</blockquote>
<p>That&#8217;s it.</p>
<h4>Update History</h4>
<p>November 27, 2010 &#8211; Updated for version 2.10.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=973</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing IRAF on Debian Squeeze</title>
		<link>http://okomestudio.net/biboroku/?p=953</link>
		<comments>http://okomestudio.net/biboroku/?p=953#comments</comments>
		<pubDate>Mon, 14 Jun 2010 19:45:57 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Research]]></category>
		<category><![CDATA[Squeeze]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=953</guid>
		<description><![CDATA[IRAF doesn&#8217;t have a standard installation procedure using make tools, so it is no fun to install in any system.  One solution is to go for Scisoft, but I don&#8217;t necessarily want to install a whole bunch of software that &#8230; <a href="http://okomestudio.net/biboroku/?p=953">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><a href="http://iraf.noao.edu/">IRAF</a> doesn&#8217;t have a standard installation procedure using make tools, so it is no fun to install in any system.  One solution is to go for <a href="http://www.eso.org/sci/data-processing/software/scisoft/">Scisoft</a>, but I don&#8217;t necessarily want to install a whole bunch of software that I never intend to use in a small-ish SSD disk drive that I now have with Lenovo T410s.</p>
<h3>Installing IRAF</h3>
<p>The IRAF version here is 2.14.1.  A 64-bit ready IRAF might be coming soon though.</p>
<p>I&#8217;m going to install this under <em>/usr/local/iraf-2.14.1</em>, which is eventually symlinked by <em>/iraf</em>.  I now hate overwriting locally installed software.</p>
<p>First prepare my machine for IRAF installation:</p>
<blockquote>
<pre>$ sudo apt-get install csh xutils-dev ncompress
$ sudo adduser iraf
  ... add IRAF admin user to the system ...
$ sudo nano /etc/passwd
  ... change /bin/bash to /bin/csh for user iraf ...
$ sudo mkdir /usr/local/iraf-2.14.1
$ sudo ln -s /usr/local/iraf-2.14.1 /iraf
$ cd /iraf/iraf
$ sudo chown iraf .
$ sudo chgrp iraf .
$ su iraf
$ mkdir bin extern imdirs iraf irafbin x11iraf
$ mkdir irafbin/bin.linux
$ mkdir irafbin/noao.bin.linux
$ cd /iraf/iraf
$ wget http://iraf.noao.edu/iraf/ftp/iraf/v214/PCIX/as.pcix.gen.gz
$ gunzip -c as.pcix.gen.gz | tar xvf -
$ cd /iraf/irafbin/bin.linux
$ wget http://iraf.noao.edu/iraf/ftp/iraf/v214/PCIX/ib.lnux.x86.gz
$ gunzip -c ib.lnux.x86.gz | tar xvf -
$ cd /iraf/irafbin/noao.bin.linux
$ wget http://iraf.noao.edu/iraf/ftp/iraf/v214/PCIX/nb.lnux.x86.gz
$ gunzip -c nb.lnux.x86.gz | tar xvf -
$ setenv iraf /iraf/iraf
$ cd $iraf/unix/hlib
$ source irafuser.csh
$ ./install -n  # Just go thru the motion to see what will be installed and set</pre>
</blockquote>
<p>Now we are ready to make changes to the system so that IRAF can be launched.  When actually running install script, I tell it the local bin directory is at <em>/iraf/bin</em> (i.e., <em>/usr/local/iraf-2.14.1/bin</em>).  By default startup scripts (like CL) are installed under <em>/usr/local/bin</em> so that anyone on the system can use, but I now have a policy to avoid system-wide installation unless I am pretty sure that I will not be updating the software in future.  When you are ready,</p>
<blockquote>
<pre>$ su
# ./install
# exit</pre>
</blockquote>
<p>Now IRAF should be ready.</p>
<h3>Installing xgterm v2.0 Beta</h3>
<p>There are better alternatives out there but this is what still is a necessary terminal for pure IRAF.</p>
<blockquote>
<pre>$ sudo apt-get install xutils-dev byacc flex bison libxaw7-dev
$ su iraf
$ cd /iraf/x11iraf
$ wget http://iraf.noao.edu/x11iraf/x11iraf-v2.0BETA-src.tar.gz
$ gunzip -c x11* | tar xvf -</pre>
</blockquote>
<p>I need to modify a couple files to get this thing to compile properly (see <a href="http://iraf.net/phpBB2/viewtopic.php?t=86279">this thread</a>):</p>
<p>In <em>obm/ObmW/Imakefile</em>, the line containing EXTRA_DEFINES should read</p>
<blockquote>
<pre>EXTRA_DEFINES = -D_NO_PROTO -DUSE_STDARG</pre>
</blockquote>
<p>and in <em>xgterm/button.c</em>, comment out the line reading char *malloc():</p>
<blockquote>
<pre>/* extern char *malloc(); */</pre>
</blockquote>
<p>The proceed to compile and install:</p>
<blockquote>
<pre>$ cd /iraf/x11iraf
$ xmkmf
$ make World
$ su
# ./install</pre>
</blockquote>
<p>Again for the last install script, I specify <em>/iraf/bin</em> as the binary installation directory.</p>
<h3>Testing Installation</h3>
<p>Next step is to test if I can use IRAF as a regular user.  Login as myself, and do:</p>
<blockquote>
<pre>$ cd ~
$ mkdir iraf
$ cd iraf
$ mkiraf</pre>
</blockquote>
<p>(I create ~/iraf just to avoid cluttering my home directory.)  Choose <em>xgterm</em> as your terminal.</p>
<p>With this installation, I actually need to add <em>/iraf/bin</em> to the PATH environment variable to use IRAF commands on a regular shell:</p>
<blockquote>
<pre>export PATH=/iraf/bin:"$PATH"</pre>
</blockquote>
<p>Add this to <em>~/.bash_profile</em> or <em>~/.bashrc</em> so that you don&#8217;t have to do this on each login.  Or I can even invoke CL as <em>/iraf/bin/cl</em>.  Whatever I prefer.</p>
<h3>Installing STSDAS and TABLES</h3>
<p>Since these may be required for stsci_python, here is the procedure.  Note that I cannot compile them from source due to incompatibility issues with 64-bit architecture.  Assuming I already logged in as user iraf,</p>
<blockquote>
<pre>$ mkdir /iraf/extern/stsdas
$ cd /iraf/extern/stsdas
$ wget http://stsdas.stsci.edu/download/stsdas_3.11/stsdas3.11.tar.gz
$ gunzip -c stsdas* | tar xvf -
$ mkpkg linux
$ cd bin.linux
$ wget http://stsdas.stsci.edu/download/stsdas_3.11/stsdas3.11.bin.redhat.tar.gz
$ gunzip -c stsdas* | tar xvf -
$ python -m compileall -q .</pre>
</blockquote>
<p>For tables,</p>
<blockquote>
<pre>$ mkdir /iraf/extern/tables
$ cd /iraf/extern/tables
$ wget http://stsdas.stsci.edu/download/tables_3.11/tables3.11.tar.gz
$ gunzip -c tables* | tar xvf -
$ mkpkg linux
$ cd bin.linux
$ wget http://stsdas.stsci.edu/download/tables_3.11/tables3.11.bin.redhat.tar.gz
$ gunzip -c tables* | tar xvf -</pre>
</blockquote>
<p>Add entries for tables and stsdas in <em>/iraf/iraf/unix/hlib/extern.pkg</em>.  An example file looks like this:</p>
<blockquote>
<pre># External (non core-system) packages.  To install a new package, add the
# two statements to define the package root directory and package task,
# then add the package helpdb to the `helpdb' list.

reset   noao            = iraf$noao/
task    noao.pkg        = noao$noao.cl

reset   tables          = iraf$../extern/tables/
task    tables.pkg      = tables$tables.cl

reset   mscred          = iraf$../extern/mscred/
task    mscred.pkg      = mscred$mscred.cl

reset   stsdas          = iraf$../extern/stsdas/
task    stsdas.pkg      = stsdas$stsdas.cl

reset   rvsao           = iraf$../extern/rvsao/rvsao-2.5.0/
task    rvsao.pkg       = rvsao$rvsao.cl

reset   xdimsum         = iraf$../extern/xdimsum/
task    xdimsum.pkg     = xdimsum$xdimsum.cl

reset   fuzzy           = iraf$../extern/fuzzy/
task    fuzzy.pkg       = fuzzy$fuzzy.cl

reset   fitsutil        = iraf$../extern/fitsutil/
task    fitsutil.pkg    = fitsutil$fitsutil.cl

reset   gmisc           = iraf$../extern/gmisc/
task    gmisc.pkg       = gmisc$gmisc.cl

reset   gemini          = iraf$../extern/gemini/
task    gemini.pkg      = gemini$gemini.cl

reset   helpdb          = "lib$helpdb.mip\
 ,noao$lib/helpdb.mip\
 ,tables$lib/helpdb.mip\
 ,stsdas$lib/helpdb.mip\
 ,mscred$lib/helpdb.mip\
 ,rvsao$lib/helpdb.mip\
 ,fitsutil$lib/helpdb.mip\
 ,gemini$lib/helpdb.mip\
 ,xdimsum$lib/helpdb.mip\
 "</pre>
</blockquote>
<h3>References</h3>
<p><a href="https://docs.astro.columbia.edu/attachment/wiki/IRAF/iraf-64-bit_step_by_step_installation">IRAF: iraf-64-bit_step_by_step_installation &#8211; CAL Network &#8211; Trac</a></p>
<p id="line1"><a href="http://mjhutchinson.com/journal/2006/11/05/install_iraf_on_ubuntu_edgy_amd64">Installing IRAF on Ubuntu Edgy amd64 | MJHutchinson.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=953</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Installing Evernote for Windows on Debian Squeeze</title>
		<link>http://okomestudio.net/biboroku/?p=950</link>
		<comments>http://okomestudio.net/biboroku/?p=950#comments</comments>
		<pubDate>Sun, 13 Jun 2010 23:40:28 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Squeeze]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=950</guid>
		<description><![CDATA[No Linux version!  Lame! First, install Wine as usual. Then download version 3.1 of Evernote for Windows (no, version 3.5 does not install due to its .Net requirement), and run the installer: $ wine Evernote_3.1.0.1225.exe That&#8217;s it.]]></description>
				<content:encoded><![CDATA[<p>No Linux version!  Lame!</p>
<p>First, install Wine as usual.</p>
<p>Then <a href="http://www.evernote.com/about/download/windows.php">download version 3.1 of Evernote for Windows</a> (no, version 3.5 does not install due to its .Net requirement), and run the installer:</p>
<blockquote>
<pre>$ wine Evernote_3.1.0.1225.exe</pre>
</blockquote>
<p>That&#8217;s it.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=950</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Installing KeePass on Debian Squeeze</title>
		<link>http://okomestudio.net/biboroku/?p=947</link>
		<comments>http://okomestudio.net/biboroku/?p=947#comments</comments>
		<pubDate>Sun, 13 Jun 2010 22:50:49 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Squeeze]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[Debian/Squeeze]]></category>
		<category><![CDATA[install procedure]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=947</guid>
		<description><![CDATA[$ sudo aptitude install keepassx This is my favorite username &#38; password manager.]]></description>
				<content:encoded><![CDATA[<blockquote>
<pre>$ sudo aptitude install keepassx
</pre>
</blockquote>
<p>This is my favorite username &amp; password manager.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=947</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PDF Viewing on Debian Squeeze</title>
		<link>http://okomestudio.net/biboroku/?p=944</link>
		<comments>http://okomestudio.net/biboroku/?p=944#comments</comments>
		<pubDate>Sun, 13 Jun 2010 22:44:13 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Squeeze]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=944</guid>
		<description><![CDATA[I find Okular to be a superb PDF reader.  Yes, you can even annotate directly onto PDF documents! $ sudo apt-get install okular poppler-data The last module is necessary to view Japanese PDF documents.]]></description>
				<content:encoded><![CDATA[<p>I find <a href="http://okular.kde.org/">Okular</a> to be a superb PDF reader.  Yes, you can even annotate directly onto PDF documents!</p>
<blockquote>
<pre>$ sudo apt-get install okular poppler-data</pre>
</blockquote>
<p>The last module is necessary to view Japanese PDF documents.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=944</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Skype on Debian Squeeze</title>
		<link>http://okomestudio.net/biboroku/?p=933</link>
		<comments>http://okomestudio.net/biboroku/?p=933#comments</comments>
		<pubDate>Sun, 13 Jun 2010 00:27:08 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Squeeze]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=933</guid>
		<description><![CDATA[To install Skype under /usr/local on Squeeze (AMD64), do: $ sudo apt-get install ia32-libs ia32-libs-gtk ... download Skype source (static version) ... $ bunzip2 -c skype_static-2.1.0.81.tar.bz2 &#124; tar xvf - $ sudo mv skype_static-2.1.0.81 /usr/local $ cd /usr/local/bin $ sudo &#8230; <a href="http://okomestudio.net/biboroku/?p=933">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>To install <a href="http://www.skype.com/intl/en-us/get-skype/on-your-computer/linux/post-download/">Skype</a> under <em>/usr/local</em> on Squeeze (AMD64), do:</p>
<blockquote>
<pre>$ sudo apt-get install ia32-libs ia32-libs-gtk
... download Skype source (static version) ...
$ bunzip2 -c skype_static-2.1.0.81.tar.bz2 | tar xvf -
$ sudo mv skype_static-2.1.0.81 /usr/local
$ cd /usr/local/bin
$ sudo ln -s /usr/local/skype_static-2.1.0.81/skype .</pre>
</blockquote>
<p>The program will be accessible at <em>/usr/local/bin/skype</em>.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=933</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Kindle for PC on Debian Squeeze</title>
		<link>http://okomestudio.net/biboroku/?p=931</link>
		<comments>http://okomestudio.net/biboroku/?p=931#comments</comments>
		<pubDate>Sat, 12 Jun 2010 03:27:37 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Debian/Squeeze]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[install procedure]]></category>
		<category><![CDATA[Kindle]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=931</guid>
		<description><![CDATA[I sometimes want to run Kindle for PC on Wine.  Amazon is so lame that they don&#8217;t even bother making a native Linux version of this software! Here is the procedure.  Move to a temporary directory and do: $ sudo &#8230; <a href="http://okomestudio.net/biboroku/?p=931">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I sometimes want to run Kindle for PC on Wine.  Amazon is so lame that they don&#8217;t even bother making a native Linux version of this software!</p>
<p>Here is the procedure.  Move to a temporary directory and do:</p>
<pre><code>$ sudo aptitude install wine lib32nss-mdns cabextract bzip2
$ wget http://www.kegel.com/wine/winetricks
$ sh winetricks corefonts
$ wget http://okomestudio.net/biboroku/wp-content/uploads/2010/06/KindleForPC-installer.exe.bz2
$ bunzip2 KindleForPC-installer.exe.bz2
$ wine KindleForPC-installer.exe</code></pre>
<p>After going through the above procedure, I need to run Wine Configuration to set Kindle for PC executable to run as a Windows 98 application.  I do this under the Applications tab of the Wine configuration.  It should be self-explanatory.</p>
<p>The program called <code>winetricks</code> is necessary to install necessary MS fonts once Kindle for PC launches.</p>
<p>The old version of Kindle for PC installer, which I just keep for myself here, is necessary to properly install it on Wine.  Unfortunately newer versions won&#8217;t work.  Hopefully Amazon releases a new version which runs at least on Wine&#8230;</p>
<h4>Update History</h4>
<p>Jan 26, 2011 &#8211; Fixing typos and added a couple packages based on a user comment.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=931</wfw:commentRss>
		<slash:comments>35</slash:comments>
		</item>
		<item>
		<title>High-performance Computing Tips</title>
		<link>http://okomestudio.net/biboroku/?p=914</link>
		<comments>http://okomestudio.net/biboroku/?p=914#comments</comments>
		<pubDate>Wed, 09 Jun 2010 14:33:44 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[HPC]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=914</guid>
		<description><![CDATA[A nice thing about my current institution is that it has access to high-performance computing (HPC) facility.  I get to use so-called supercomputers.  This is a cheat sheet for myself. Reserving your job: Show the information about a job with &#8230; <a href="http://okomestudio.net/biboroku/?p=914">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>A nice thing about my current institution is that it has access to high-performance computing (HPC) facility.  I get to use so-called supercomputers.  This is a cheat sheet for myself.</p>
<p>Reserving your job:</p>
<pre class="brush: bash; title: ; notranslate">$ qsub -R y jobscript</pre>
<p>Show the information about a job with id JOBID:</p>
<pre class="brush: bash; title: ; notranslate">$ qacct -j JOBID</pre>
<p>Change job priority:</p>
<pre class="brush: bash; title: ; notranslate">$ qalter -js 100 JOBID</pre>
<p>Delete a job:</p>
<pre class="brush: bash; title: ; notranslate">$ qdel JOBID</pre>
<p>or a array job task:</p>
<pre class="brush: bash; title: ; notranslate">$ qdel JOBID.TASKID</pre>
<p>Using remote shell with various settings:</p>
<pre class="brush: bash; title: ; notranslate">$ qrsh -now no -V -cwd -l h_rt=01:00:00,h_vmem=4G,h_stack=2G,test=true bash</pre>
<p>More to be added.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=914</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Securely Erasing Hard Disk</title>
		<link>http://okomestudio.net/biboroku/?p=908</link>
		<comments>http://okomestudio.net/biboroku/?p=908#comments</comments>
		<pubDate>Wed, 02 Jun 2010 13:36:33 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=908</guid>
		<description><![CDATA[Like when you need to sell your old computer, sometimes you wish to wipe clean a hard disk drive in a secure manner (i.e., not just removing reference to data). Here, /dev/sdb is the disk to be erased. Takes a &#8230; <a href="http://okomestudio.net/biboroku/?p=908">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Like when you need to sell your old computer, sometimes you wish to wipe clean a hard disk drive in a secure manner (i.e., not just removing reference to data).</p>
<pre class="brush: bash; title: ; notranslate">$ sudo fdisk -l

Disk /dev/sda: 80.0 GB, 80026361856 bytes
240 heads, 63 sectors/track, 10337 cylinders
Units = cylinders of 15120 * 512 = 7741440 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xbd3cc0bb

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1       10338    78149633    5  Extended
/dev/sda5               1          46      340992   83  Linux
/dev/sda6              46          52       48128   83  Linux
/dev/sda7              52         698     4881408   83  Linux
/dev/sda8             698        1086     2928640   83  Linux
/dev/sda9            1086        1861     5858304   83  Linux
/dev/sda10           1861        2830     7323648   83  Linux
/dev/sda11           9305       10338     7812096   82  Linux swap / Solaris
/dev/sda12           2830        9304    48949248   83  Linux

Partition table entries are not in disk order

Disk /dev/sdb: 262 MB, 262144000 bytes
16 heads, 32 sectors/track, 1000 cylinders
Units = cylinders of 512 * 512 = 262144 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1         999      255728    6  FAT16

$ sudo shred -vfz -n 3 /dev/sdb</pre>
<p>Here, <em>/dev/sdb</em> is the disk to be erased.  Takes a long time, but that&#8217;s it.  You can change the &#8220;-n&#8221; option to repeat more is you really want to be anal.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=908</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Debian Squeeze (AMD64) on Lenovo T410s</title>
		<link>http://okomestudio.net/biboroku/?p=856</link>
		<comments>http://okomestudio.net/biboroku/?p=856#comments</comments>
		<pubDate>Tue, 01 Jun 2010 14:22:09 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Debian/Squeeze]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[install procedure]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[T410s]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=856</guid>
		<description><![CDATA[So far the only thing that I do not like about T410s is its short battery life.  I can only get 2 &#8211; 3 hours out of &#8220;standard&#8221; usage.  Hopefully this will improve as I tweak things more. To Begin &#8230; <a href="http://okomestudio.net/biboroku/?p=856">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>So far the only thing that I do not like about T410s is its short  battery life.  I can only get 2 &#8211; 3 hours out of &#8220;standard&#8221; usage.   Hopefully this will improve as I tweak things more.</p>
<h4>To Begin With:  A Problem</h4>
<p>Unfortunately I had a major issue with my T410s recently (November 17, 2010).  A few months ago, the LCD started showing a vertical band in which graphics was lost.  Fortunately, <a href="http://www-307.ibm.com/pc/support/site.wss/document.do?lndocid=MIGR-76367">the issue seems to be fairly prevalent with T410s</a>, which means there was a solution.  So, I just got a warranty repair done, which involved replacing the LCD and motherboard.  It took exactly two weeks for the whole process using the local Lenovo contractor (in Canada), but now the laptop is fixed.  Anyone who got T410s around June 2010 or before should be aware of this LCD issue.</p>
<p>As of November 26, 2010, I decided to reinstall Debian Squeeze from scratch.  So this installation note now reflects the nearly stable version of Squeeze installation procedure.  Things that did not work before now works from the beginning!</p>
<h3>General Hardware Specifications</h3>
<p>My <a href="http://www-307.ibm.com/pc/support/site.wss/document.do?sitestyle=lenovo&amp;lndocid=MIGR-75219">Lenovo T410s</a> is 2901-CTO.</p>
<table border="1" cellspacing="1" cellpadding="1" width="100%">
<tbody>
<tr>
<td width="33%"><em>Hardware Components</em></td>
<td width="33%"><em>Status under Linux</em></td>
<td width="33%"><em>Notes</em></td>
</tr>
<tr>
<td width="33%">Intel Core i5 M520 2.4 GHz</td>
<td width="33%">Works</td>
<td width="33%"></td>
</tr>
<tr>
<td width="33%">14.1 WXGA+ TFT Display, w/ LED Backlight</td>
<td width="33%">Works</td>
<td width="33%"></td>
</tr>
<tr>
<td width="33%">Intel HD Graphics (IT 5700MHD, i5-520M AMT)</td>
<td width="33%">Works</td>
<td width="33%"></td>
</tr>
<tr>
<td width="33%">4 GB PC3-8500 DDR3 (2 DIMM)</td>
<td width="33%">Works</td>
<td width="33%"></td>
</tr>
<tr>
<td width="33%">80 GB SSD (INTEL SSDSA1M080G2LE, 2CV102J6, max UDMA/133)</td>
<td width="33%">Works</td>
<td width="33%"></td>
</tr>
<tr>
<td width="33%">Integrated Ethernet Card (Intel 82577LM Gigabit Network Connection (rev 06))</td>
<td width="33%">Works</td>
<td width="33%"></td>
</tr>
<tr>
<td width="33%">Wireless Network Card (Intel Centrino Ultimate-N 6300 (rev 35))</td>
<td width="33%">Works</td>
<td width="33%">Need to download firmware to <em>/lib/firmware</em>.</td>
</tr>
<tr>
<td width="33%">Matsushita DVD-RAM Drive (UJ892)</td>
<td width="33%">Works</td>
<td width="33%"></td>
</tr>
<tr>
<td width="33%">6 cell Prismatic Battery</td>
<td width="33%">Works</td>
<td width="33%"></td>
</tr>
<tr>
<td width="33%">Integrated Sound Card (Intel 3b57 (rev 06))</td>
<td width="33%">Works</td>
<td width="33%"></td>
</tr>
<tr>
<td width="33%">Integrated Speaker &amp; Microphone</td>
<td width="33%">Works</td>
<td width="33%"></td>
</tr>
<tr>
<td width="33%">Integrated Camera</td>
<td width="33%">Works</td>
<td width="33%">uvcvideo</td>
</tr>
<tr>
<td width="33%">ThinkLight</td>
<td width="33%">Works</td>
<td width="33%"></td>
</tr>
<tr>
<td width="33%">Fingerprint Reader</td>
<td width="33%">Not tested</td>
<td width="33%"></td>
</tr>
<tr>
<td width="33%">TrackPoint &amp; TrackPad</td>
<td width="33%">Works</td>
<td width="33%"></td>
</tr>
<tr>
<td width="33%">Keyboard</td>
<td width="33%">Not fully tested</td>
<td width="33%">Haven&#8217;t thoroughly tested special keys</td>
</tr>
</tbody>
</table>
<p>Note: Currently my T410s is operating on kernel version 2.26.36.2 from <a href="http://kernel.org/">kernel.org</a> which I <a href="http://nomo17k.wordpress.com/2010/03/21/customizing-installing-linux-kernel-on-debian-squeeze/">customized and compiled</a> myself.  I don&#8217;t think is necessary to get the basic things working though. On the other hand, I see some problem with kernel 2.26.36.2. When I do <code>dmesg</code>, I get numerous &#8220;scsi host1: __pm_runtime_resume()!&#8221; errors, and sometimes T410s locks up for several seconds.  In order to alleviate the problem, I have to boot with kernel option <code>pcie_ports=compat</code>.</p>
<h3>Why Debian Squeeze?</h3>
<p>I have always liked the leanness and stability of Debian, but I admit that I have recently flirted with the idea of migrating to Ubuntu; near the end of Debian release cycle, I have always found myself building from sources various programs for which their Debian versions became obsolete.  When I tried, I also liked Ubuntu for its ease of use; I didn&#8217;t have to do whole a lot of configurations myself to get my old laptop (a Dell Latitude) working.  However, it slightly felt like using Windows on a new computer; a lot of software that I don&#8217;t care to install are bundled with Ubuntu.  In the end, I decided to stay with Debian for now, but with Squeeze, still a testing distribution (Nov. 17, 2010).</p>
<h3>Installing Debian Squeeze</h3>
<p>First of all, make factory recovery disks in case you need to restore factory default.  There is little reason to keep Windows 7 around, but it&#8217;s always a good thing to have a way to restore default setting.  In order to do this, launch ThinkVantage and go to Factory Recovery Disks.  Check both boot and data.  In my case, three blank DVDs were used (one for boot and two for data; it looks like the boot disk only needs to be of very small capacity).  After making the disks, it is recommended to test if they work or not by rebooting off the boot disk just created.  Mine passed the test and factory reset was completely working.  I also updated BIOS to its latest version on Windows to avoid problems later.</p>
<p>Debian Squeeze will soon become the stable distribution, but till that happens I fetched the installer from the testing distribution site, and made a install USB stick, following <a href="http://nomo17k.wordpress.com/2010/11/17/creating-an-installation-usb-memory-stick-for-debian-squeeze-amd64">this article</a>.  For this installation note, I use the <a href="http://cdimage.debian.org/cdimage/squeeze_di_beta1/amd64/iso-cd/debian-squeeze-di-beta1-amd64-netinst.iso">Beta1 release of Squeeze</a>.</p>
<p>Boot off the USB stick by pressing F12 to start the installation.</p>
<h4>Installation Customization Options</h4>
<p>Debian installation has gotten easy enough that I don&#8217;t feel the need for this any more, but just for completeness.  Obviously you should customize to your liking.  I use a graphical installer here.</p>
<ul>
<li>Language: English</li>
<li>Country, territory or area: (your choice)</li>
<li>Keyboard layout: USA</li>
<li>Primary network interface: wlan0 (for wireless network installation, only WEP or manual appears working, for which you specify the wireless key and password perhaps.) or eth0 (wired network installation is often easier)</li>
<li>Hostname: (your choice)</li>
<li>Domain name: (your choice)</li>
<li>Root password: (your choice)</li>
<li>Full name for the new user: (your choice)</li>
<li>Username for your account: (your choice)</li>
<li>Choose a password for the new user: (your choice)</li>
<li>Select your time zone: (your choice)</li>
<li>Partitioning method: Manual</li>
</ul>
<p>I&#8217;m not doing dual boot, so my partition scheme is very simple:</p>
<pre><code>Filesystem            Size  Used Avail Use% Mounted on
/dev/sda5             323M  149M  157M  49% /
/dev/sda6              46M   27M   17M  62% /boot
/dev/sda7             4.6G  138M  4.3G   4% /tmp
/dev/sda8             2.8G  1.8G  841M  69% /var
/dev/sda9             5.5G  4.4G  914M  83% /usr
/dev/sda10            6.9G  4.4G  2.2G  67% /usr/local
/dev/sda11              8G                  Linux Swap
/dev/sda12             46G   19G   26G  43% /home</code></pre>
<ul>
<li>Policy for handling keymaps: Select keymap from arch list -&gt; qwerty -&gt; US american -&gt; Standard -&gt; Standard</li>
<li>Debian archive mirror country: (your choice)</li>
<li>Participate in the package usage survey: No</li>
<li>Choose software to install: (I want a fairly minimal install.  I only check Laptop.)</li>
<li>Install the GRUB boot loader to the master boot record: yes</li>
</ul>
<p>Reboot and a very simple Debian box is ready!</p>
<h3>Post-Install Admin Tweaks</h3>
<p>Login as root.  First I install a few essential packages for system administration, etc.:</p>
<pre><code># aptitude install sudo ssh rsync wget wireless-tools</code></pre>
<p>If I need to run 32-bit applications, it is also a good idea to do:</p>
<pre><code># aptitude install ia32-libs</code></pre>
<h4>Setting up sudo</h4>
<p>At this point I add myself as an sudoer by adding my regular username to <em>/etc/sudoers</em>, just under the entry for root, giving full admin privileges (i.e., just copy the line for root).</p>
<pre><code># chmod 640 /etc/sudoers
# emacs -nw /etc/sudoers
... add a regular user to the list ...
# chmod 440 /etc/sudoers</code></pre>
<p>I believe in using <code>sudo</code> rather than becoming root to do admin tasks.</p>
<h4>Setting up APT Sources</h4>
<p>It is also a good idea to modify <em>/etc/apt/sources.list</em> now.  Mine looks like this:</p>
<pre><code>deb http://ftp.us.debian.org/debian/ squeeze main contrib non-free
deb-src http://ftp.us.debian.org/debian/ squeeze main contrib non-free

deb http://security.debian.org/ squeeze/updates main contrib non-free
deb-src http://security.debian.org/ squeeze/updates main contrib non-free

deb http://www.debian-multimedia.org squeeze main non-free</code></pre>
<p>As I see, the debian-multimedia.org repository is added.  Though this isn&#8217;t absolutely essential, I may wish to do</p>
<pre><code># wget http://www.debian-multimedia.org/pool/main/d/debian-multimedia-keyring/debian-multimedia-keyring_2008.10.16_all.deb
# dpkg -i debian-multimedia-keyring_2008.10.16_all.deb
# aptitude update</code></pre>
<p>in order to avoid GPG error accessing this repository in future.</p>
<h4>Setting up DHCP Hostname</h4>
<p>Modify <em>/etc/dhcp/dhclient.conf</em> to have the line:</p>
<pre><code>send host-name "yourcomputershostname";</code></pre>
<p>This way, identify this computer on a router, for example, will be easier.</p>
<h4>Intel Centrino Ultimate-N 6300</h4>
<p>The built-in kernel for Squeeze (2.6.32) appears to have the driver for this WiFi card, but firmware need to be loaded:</p>
<pre><code>$ sudo aptitude install firmware-iwlwifi</code></pre>
<p>Or alternatively I can <a href="http://intellinuxwireless.org/?n=Downloads">download firmware</a>, and manually copy the file <em>iwlwifi-6000-4.ucode</em> to <em>/lib/firmware</em>.  For example:</p>
<pre><code>$ wget http://intellinuxwireless.org/iwlwifi/downloads/iwlwifi-6000-ucode-9.221.4.1.tgz
$ tar -xvzf iwlwifi*.tgz
$ sudo cp iwlwifi-6000-ucode-9.221.4.1/iwlwifi-6000-4.ucode /lib/firmware</code></pre>
<p>Either way, WiFi should be working after reboot.</p>
<h4>Integrated Webcam</h4>
<p>To check if the webcam works, the easiest is to use Kopete on KDE (Menu -&gt; Applications -&gt; Internet -&gt; Kopete).  Go to Settings -&gt; Configure -&gt; Video, and see if the preview works.</p>
<h3>KDE</h3>
<p>To install KDE,</p>
<pre><code># aptitude update
# aptitude install kdebase kdenetwork kmix
# reboot</code></pre>
<p>Upon reboot, the KDM login screen appears.</p>
<h4>KDE Network Manager</h4>
<p>If I don&#8217;t see any network manager on the system tray of the bottom bar, click on the system tray (this one is located to the left of the clock by default).  Right click -&gt; System Tray Settings -&gt; Plasma Widgets and check Network Management.  Try to add a wireless access point.</p>
<h3>Suspend and Resume</h3>
<p>I have always been a type who turns off computer when not used, but I am now using suspend/resume frequently.  Fortunately I have few problems using suspend to RAM/disk on T410s so far.</p>
<h3>TrackPoint Scrolling</h3>
<p>I can use the red TrackPoint for scrolling as well!  There are several ways to do this, but I&#8217;m going to use <code>xinput</code>.  If it is not installed, do</p>
<pre><code>$ sudo aptitude install xinput</code></pre>
<p>See what ID is associated with TrackPoint:</p>
<pre><code>$ xinput list
⎡ Virtual core pointer                          id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ SynPS/2 Synaptics TouchPad                id=11   [slave  pointer  (2)]
⎜   ↳ TPPS/2 IBM TrackPoint                     id=13   [slave  pointer  (2)]
⎣ Virtual core keyboard                         id=3    [master keyboard (2)]
    ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]
    ↳ Power Button                              id=6    [slave  keyboard (3)]
    ↳ Video Bus                                 id=7    [slave  keyboard (3)]
    ↳ Sleep Button                              id=8    [slave  keyboard (3)]
    ↳ Integrated Camera                         id=9    [slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard              id=10   [slave  keyboard (3)]
    ↳ ThinkPad Extra Buttons                    id=12   [slave  keyboard (3)]
    ↳ ACPI Virtual Keyboard Device              id=14   [slave  keyboard (3)]</code></pre>
<p>The TrackPoint&#8217;s ID is 13 in my current configuration.  Then add the following lines in <em>~/.xsessionrc</em>:</p>
<pre><code>xinput set-int-prop 13 "Evdev Wheel Emulation" 8 1
xinput set-int-prop 13 "Evdev Wheel Emulation Button" 8 2
xinput set-int-prop 13 "Evdev Wheel Emulation Axes" 8 6 7 4 5</code></pre>
<p>After restarting X, moving TrackPoint while pressing the blue middle button acts as scroll, either vertically or horizontally.</p>
<p>Now that TrackPoint can be used for scrolling, I see little reason to enable TrackPad, as I never use it.  It may be a good idea to disable TrackPad in BIOS to save power consumption as well as to prevent accidentally touching it with my hands while typing.  Note that after disabling TrackPad, ID (see above) may change, so <em>~/.xsessionrc</em> may need to be rewritten.</p>
<h3>Power Consumption Tips</h3>
<p>I now have a <a title="Power Management on Lenovo T410s" href="http://nomo17k.wordpress.com/2010/12/19/power-management-on-lenovo-t410s/">separate article</a> for this topic.</p>
<p><span class="Apple-style-span" style="font-size: 15px; font-weight: bold;">Miscellaneous</span></p>
<h4>snd_pcsp Inturrpts</h4>
<p>Under certain conditions (which I cannot always reproduce), the system becomes sluggish after playing sounds off Flash on Firefox, for example, and until KDE restarts, sounds are not working.  Looking at the processes with powertop, I found some process using snd_pcsp tends to make frequent interrupts.  A solution to this problem is to ensure that the snd_pcsp kernel module gets loaded after snd_hda_intel gets loaded by feeding &#8220;index=2&#8243; option.  Make sure that the file <em>/etc/modprobe.d/snd-pcsp</em> has a line like this:</p>
<pre><code>options snd-pcsp index=2</code></pre>
<h3>Installing Applications</h3>
<p>Just a list of applications to install on my machine:</p>
<ul>
<li><a href="http://nomo17k.wordpress.com/2010/11/22/installing-firefox-4-beta-on-debian-squeeze/">Firefox 4 (beta)</a></li>
<li><a href="http://nomo17k.wordpress.com/2010/10/31/installing-dropbox-without-gnome-on-debian-squeeze-amd64/">Dropbox</a></li>
<li><a href="http://nomo17k.wordpress.com/2010/10/22/installing-mendeley-on-debian-squeeze-amd64/">Mendeley</a></li>
<li><a href="http://nomo17k.wordpress.com/2010/11/20/installing-f-lux-on-debian-squeeze/">F.lux</a></li>
<li><a href="http://nomo17k.wordpress.com/2010/06/13/installing-keepass-on-debian-squeeze/">KeePass</a></li>
<li>More to come&#8230;</li>
</ul>
<h3>Document Update History</h3>
<p>June 1, 2010 &#8211; First version.</p>
<p>June 6, 2010 &#8211; Added a note on suspend and resume.</p>
<p>June 9, 2010 &#8211; Added ThinkWiki reference.  Added a section on TrackPoint scrolling.  Created Power Consumption Tips.  Added the preload daemon section.</p>
<p>November 27, 2010 &#8211; Major update after a warranty repair of the vertical band issue with LCD.</p>
<p>December 19, 2010 &#8211; Moved power consumption tips to another article.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=856</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>TestDisk</title>
		<link>http://okomestudio.net/biboroku/?p=853</link>
		<comments>http://okomestudio.net/biboroku/?p=853#comments</comments>
		<pubDate>Mon, 24 May 2010 10:46:18 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=853</guid>
		<description><![CDATA[Once I fucked up my Win XP/Linux dual boot installation really badly and it appeared all partitions were gone, or at least unrecognizable. I browsed partition recovery utilities on the web, and found TestDisk. After following a tutorial (which I &#8230; <a href="http://okomestudio.net/biboroku/?p=853">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Once I fucked up my Win XP/Linux dual boot installation really badly and it appeared all partitions were gone, or at least unrecognizable.</p>
<p>I browsed partition recovery utilities on the web, and found <a href="http://www.cgsecurity.org/wiki/TestDisk">TestDisk</a>.</p>
<p>After following a tutorial (which I lost track of), I could totally recover my old partitions!</p>
<p>Just keeping note for myself so that I don&#8217;t forget.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=853</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>python-mode.el for Emacs</title>
		<link>http://okomestudio.net/biboroku/?p=847</link>
		<comments>http://okomestudio.net/biboroku/?p=847#comments</comments>
		<pubDate>Thu, 29 Apr 2010 01:38:41 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Snow Leopard]]></category>
		<category><![CDATA[Emacs]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[python-mode]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=847</guid>
		<description><![CDATA[On Debian, you can simply install the package &#8220;python-mode,&#8221; but this describes the manual method. For OS X (I currently use Snow Leopard), I can install the python-mode package via FinkCommander. First, download python-mode.el and place it under ~/.emacs.d (create &#8230; <a href="http://okomestudio.net/biboroku/?p=847">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>On Debian, you can simply install the package &#8220;python-mode,&#8221; but this describes the manual method.</p>
<p>For OS X (I currently use Snow Leopard), I can install the python-mode package via FinkCommander.</p>
<p>First, <a href="http://launchpad.net/python-mode">download python-mode.el</a> and place it under <em>~/.emacs.d</em> (create this directory if it does not exist).</p>
<p>Then add the following lines to your Emacs configuration file <em>~/.emacs</em>:</p>
<blockquote><p>(load &#8220;~/.emacs.d/python-mode.el&#8221;)<br />
;;python<br />
(setq auto-mode-alist (cons &#8216;(&#8220;\\.py$&#8221; . python-mode) auto-mode-alist))<br />
(setq interpreter-mode-alist (cons &#8216;(&#8220;python&#8221; . python-mode)<br />
interpreter-mode-alist))<br />
(autoload &#8216;python-mode &#8220;python-mode&#8221; &#8220;Python editing mode.&#8221; t)</p>
<p>(global-font-lock-mode t)<br />
(font-lock-mode +1)</p></blockquote>
<p>That&#8217;s it.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=847</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Turning On X Forwarding on Mac OS X Snow Leopard</title>
		<link>http://okomestudio.net/biboroku/?p=843</link>
		<comments>http://okomestudio.net/biboroku/?p=843#comments</comments>
		<pubDate>Fri, 26 Mar 2010 05:06:16 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Snow Leopard]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=843</guid>
		<description><![CDATA[Read this article. sed 's/#X11Forwarding\ no/X11Forwarding\ yes/' /etc/sshd_config &#62; /tmp/sshd_config sudo mv /tmp/sshd_config /etc/.]]></description>
				<content:encoded><![CDATA[<p>Read<a href="http://developer.apple.com/mac/library/qa/qa2004/qa1383.html"> this article</a>.</p>
<blockquote>
<pre>
<pre>sed 's/#X11Forwarding\ no/X11Forwarding\ yes/' /etc/sshd_config &gt; /tmp/sshd_config
sudo mv /tmp/sshd_config /etc/.
</pre>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=843</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Tor on Debian Squeeze</title>
		<link>http://okomestudio.net/biboroku/?p=841</link>
		<comments>http://okomestudio.net/biboroku/?p=841#comments</comments>
		<pubDate>Wed, 24 Mar 2010 02:34:05 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Squeeze]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[Debian/Squeeze]]></category>
		<category><![CDATA[install procedure]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[privoxy]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[tor]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=841</guid>
		<description><![CDATA[Install packages: $ sudo aptitude install tor privoxy Add the following lines to relevant sections in /etc/privoxy/config: ... forward-socks4a / 127.0.0.1:9050 . ... listen-address 127.0.0.1:8118 ( See this thread for detail.)  Then $ sudo /etc/init.d/privoxy restart to make the change &#8230; <a href="http://okomestudio.net/biboroku/?p=841">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Install packages:</p>
<blockquote>
<pre>$ sudo aptitude install tor privoxy
</pre>
</blockquote>
<p>Add the following lines to relevant sections in <em>/etc/privoxy/config</em>:</p>
<blockquote>
<pre>...
forward-socks4a / 127.0.0.1:9050 .
...
listen-address 127.0.0.1:8118
</pre>
</blockquote>
<p>( See <a href="http://lists.debian.org/debian-user/2009/06/msg00045.html">this thread</a> for detail.)  Then</p>
<blockquote>
<pre>$ sudo /etc/init.d/privoxy restart
</pre>
</blockquote>
<p>to make the change effective.  In my browser proxy setting, use 127.0.0.1 as server and 8118 as port to use it.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=841</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Microsoft Natural Ergonomic Keyboard 4000 on Mac OS X Snow Leopard</title>
		<link>http://okomestudio.net/biboroku/?p=836</link>
		<comments>http://okomestudio.net/biboroku/?p=836#comments</comments>
		<pubDate>Tue, 23 Mar 2010 20:54:47 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[OS X/Snow Leopard]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=836</guid>
		<description><![CDATA[I don&#8217;t really need to tweak much for the MS keyboard to work with Snow Leopard, as it will be detected and configured automatically.  However, I&#8217;m not used to the Mac keyboard bindings, though I can live with it as &#8230; <a href="http://okomestudio.net/biboroku/?p=836">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I don&#8217;t really need to tweak much for the MS keyboard to work with Snow Leopard, as it will be detected and configured automatically.  However, I&#8217;m not used to the Mac keyboard bindings, though I can live with it  as long as emacs works as expected.  So here is how I configure, so that at least in the X-like environment keyboard bidings will be similar to Linux.</p>
<p>Go to Apple -&gt; System Preferences -&gt; Keyboard -&gt; Keyb0ard tab -&gt; Modifier Keys.  I configure as follows:</p>
<p><a href="http://okomestudio.net/biboroku/wp-content/uploads/2010/03/screen-shot-2010-03-23-at-5-48-06-pm.png"><img class="alignnone size-medium wp-image-838" title="MS Keyboard 4000 on Snow Leopard" src="http://okomestudio.net/biboroku/wp-content/uploads/2010/03/screen-shot-2010-03-23-at-5-48-06-pm.png?w=300" alt="" width="300" height="211" /></a></p>
<p>Also, launch X11 and go to X11 -&gt; Preferences -&gt; Input.  Uncheck &#8220;Enable key equivalents under X11.&#8221;</p>
<p>For now this works for me.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=836</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing PSFex on Mac OS X Snow Leopard</title>
		<link>http://okomestudio.net/biboroku/?p=831</link>
		<comments>http://okomestudio.net/biboroku/?p=831#comments</comments>
		<pubDate>Tue, 23 Mar 2010 00:45:11 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Snow Leopard]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=831</guid>
		<description><![CDATA[There seems to be no stable release for PSFex yet.  So we download source from subversion. Before doing that, you need to install FFTW and ATLAS first.  (You need a single-precision library for FFTW.) Download a tarball (for trunk) from &#8230; <a href="http://okomestudio.net/biboroku/?p=831">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>There seems to be no stable release for PSFex yet.  So we download source from subversion.</p>
<p>Before doing that, you need to install <a href="http://nomo17k.wordpress.com/2010/03/22/installing-psfex-on-mac-os-x-snow-leopard/">FFTW</a> and <a href="http://nomo17k.wordpress.com/2010/03/22/installing-atlas-from-source-on-mac-os-x-snow-leopard/">ATLAS</a> first.  (You need a single-precision library for FFTW.)</p>
<p>Download a tarball (for trunk) from the <a href="http://astromatic.iap.fr/wsvn/public/listing.php?repname=public+software.psfex&amp;path=&amp;">official subversion repository</a>.</p>
<blockquote>
<pre>$ mkdir /usr/local/src/psfex
$ cd /usr/local/src/psfex
... download tarball ...
$ tar xf *.tar.gz
$ cd trunk.r149
$ ./configure --with-atlas=/usr/local/atlas/lib --with-atlas-incdir=/usr/local/atlas/include \
    --with-fftw=/usr/local/lib --with-fftw-incdir=/usr/local/include --enable-threads
$ make
$ sudo make install</pre>
</blockquote>
<p>The executable <em>psfex</em> will be installed at <em>/usr/local/bin</em>.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=831</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing GFortran on Mac OS X Snow Leopard</title>
		<link>http://okomestudio.net/biboroku/?p=827</link>
		<comments>http://okomestudio.net/biboroku/?p=827#comments</comments>
		<pubDate>Tue, 23 Mar 2010 00:32:12 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[computing]]></category>
		<category><![CDATA[install procedure]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[OS X/Snow Leopard]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=827</guid>
		<description><![CDATA[Installing from GFortran Wiki (My Current Preferred Way) GCC Wiki has a link to Mac OS X installer.  As the command gfortran will be installed at /usr/local/gfortran and causes less interferences with other libraries and software, this is my preferred &#8230; <a href="http://okomestudio.net/biboroku/?p=827">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<h4>Installing from GFortran Wiki (My Current Preferred Way)</h4>
<p>GCC Wiki has a link to <a href="http://gcc.gnu.org/wiki/GFortranBinariesMacOS">Mac OS X installer</a>.  As the command <code>gfortran</code> will be installed at <em>/usr/local/gfortran</em> and causes less interferences with other libraries and software, this is my preferred way.</p>
<h4>Installing from Fink</h4>
<p>I use <a href="http://www.finkproject.org">Fink</a> (as opposed to MacPorts) to manage most Linux-like tools.</p>
<pre><code>$ fink install netcdf-gfortran</code></pre>
<p>This will make <code>gfortran</code> available at <em>/sw/bin/gfortran</em>.  It may take a bit of time to compile binaries though.</p>
<h4>Installing Binary from High Performance Computing for Mac OS X</h4>
<p><a href="http://hpc.sourceforge.net/">This site</a> has a bunch of pre-compiled binaries useful for scientific computing, and GFortran is one of them.</p>
<h4>Installing Binary from the R Project</h4>
<p>You may simply use a binary made available by the R people.  Download a .dmg file from <a href="http://r.research.att.com/tools/">here</a>.  This version will install at <em>/usr/local/bin</em>.</p>
<h4>Update History</h4>
<p>November 24, 2010 &#8211; Added different install options.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=827</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Installing SExtractor on Mac OS X Snow Leopard</title>
		<link>http://okomestudio.net/biboroku/?p=824</link>
		<comments>http://okomestudio.net/biboroku/?p=824#comments</comments>
		<pubDate>Tue, 23 Mar 2010 00:14:36 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[astro]]></category>
		<category><![CDATA[install procedure]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[OS X/Snow Leopard]]></category>
		<category><![CDATA[research]]></category>
		<category><![CDATA[SExtractor]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=824</guid>
		<description><![CDATA[(November 25, 2010) I screwed up SExtractor installation for no reason and in an attempt to fix it, I&#8217;ve found a few things.  After wasting a few hours again, I think this installation note can work for most people who &#8230; <a href="http://okomestudio.net/biboroku/?p=824">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>(November 25, 2010) I screwed up SExtractor installation for no reason and in an attempt to fix it, I&#8217;ve found a few things.  After wasting a few hours again, I think this installation note can work for most people who can actually build software from source&#8230; I think the usefulness of this note will be limited though, as a new release of SExtractor appears imminent.</p>
<h3>Installing from Fink</h3>
<p>Fink has a <a href="http://pdb.finkproject.org/pdb/package.php/sextractor">version of SExtractor</a>.  I can install this via the command <code>fink install</code>.</p>
<pre><code>$ fink install sextractor</code></pre>
<p>If Fink is already installed, this may be the most trouble free way of installing SExtractor.</p>
<h3>Installing from Source</h3>
<p>IMPORTANT: I need <a href="http://okomestudio.net/biboroku/?p=719">FFTW</a> and <a href="http://okomestudio.net/biboroku/?p=722">ATLAS</a> installed already, and assume that FFTW was installed at <em>/usr/local/fftw</em>, and ATLAS at <em>/usr/local/atlas</em> following the source install procedures described in those notes.  Make sure that you build both double and single precision versions of FFTW by going through the make procedure twice to install both.  Build both of them from source, and do not use the libraries from, say, Fink; otherwise dependency hell might arise.  So, if I have Fink or Scisoft installed, put them away during the installation to avoid path problems.  For example, temporarily rename <em>/sw</em> to <em>/sw.tmp</em> to put Fink away, <em>/usr/local/scisoft</em> to <em>/usr/local/scisoft.tmp</em> to put Scisoft away.  (Or alternatively I can &#8220;comment out&#8221; from your start up shell script those lines that set up Fink and Scisoft, so that environment variables won&#8217;t include paths to these things.)  Then restart the computer, and start the whole installation process (that is, including FFTW and ATLAS).</p>
<p>Download the <a href="http://www.astromatic.net/software/sextractor">SExtractor</a> source into a temporary directory:</p>
<pre><code>$ mkdir tmp
$ cd tmp
... download sextractor-2.8.6.tar.gz
$ tar -xvzf sex*.tar.gz
$ cd sextractor-2.8.6
$ ./configure --prefix=/usr/local/sextractor-2.8.6 \
    --with-atlas=/usr/local/atlas/lib --with-atlas-incdir=/usr/local/atlas/include \
    --with-fftw=/usr/local/fftw/lib --with-fftw-incdir=/usr/local/fftw/include \
    --enable-threads
$ make
$ sudo make install
$ ln -s /usr/local/sextractor-2.8.6 /usr/local/sextractor
$ sudo cp -rp config /usr/local/sextractor</code></pre>
<p>This will install SExtractor at <em>/usr/local/sextractor-2.8.6</em> (which is aliased by <em>/usr/local/sextractor</em>) and an executable command sex will be located at <em>/usr/local/sextractor/bin/sex</em>.  Make a simlink to that binary <em>/usr/local/bin</em> to make it available system-wide.  I might also want to make a simlink to <em>/usr/local/sextractor/bin/ldactoasc</em>, which is a utility command that might be useful.  The last line copies the SExtractor configuration files and convolution masks to <em>/usr/local/sextractor/config</em>.  The default convolution masks are often used so it may be a good idea to keep them under the same installation directory.</p>
<p>Hope this is it!</p>
<h4>What if Make Stops with an Error?</h4>
<p>There may be a bug in <code>./configure</code> script that makes the <code>--with-fftw-incdir</code> option to be not honored.  If the make stops with errors complaining as in &#8220;error: fftw3.h: No such file or directory&#8221; despite that I have installed FFTW properly, copy <em>/usr/local/fftw/include/fftw3.h</em> to the <em>sextractor-2.8.6/src</em> directory before doing make.  It will compile fine then.</p>
<h3>Update History</h3>
<p>November 25, 2010 &#8212; Made the procedure description a bit more elaborate where things may fail.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=824</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Installing ATLAS on Mac OS X Snow Leopard</title>
		<link>http://okomestudio.net/biboroku/?p=722</link>
		<comments>http://okomestudio.net/biboroku/?p=722#comments</comments>
		<pubDate>Tue, 23 Mar 2010 00:08:56 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[ATLAS]]></category>
		<category><![CDATA[computing]]></category>
		<category><![CDATA[install procedure]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[OS X/Snow Leopard]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=722</guid>
		<description><![CDATA[Installing from Fink Do: $ fink install atlas atlas-shlibs That&#8217;s it.  They will be installed under /sw/lib. Installing from Source (Recommended if Building Other Software That Depends on ATLAS) First of all, I need a FORTRAN compiler, so install it.  &#8230; <a href="http://okomestudio.net/biboroku/?p=722">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<h4>Installing from Fink</h4>
<p>Do:</p>
<pre><code>$ fink install atlas atlas-shlibs</code></pre>
<p>That&#8217;s it.  They will be installed under <em>/sw/lib</em>.</p>
<h4>Installing from Source (Recommended if Building Other Software That Depends on ATLAS)</h4>
<p>First of all, I need a FORTRAN compiler, so <a href="http://okomestudio.net/biboroku/?p=827">install it</a>.  I recommend using the Mac installer from the GCC Wiki site, so that GFortran won&#8217;t end up having hard-to-track-down dependencies.</p>
<p>I download tarballs for <a href="http://math-atlas.sourceforge.net/">ATLAS</a> and <a href="http://www.netlib.org/lapack/">LAPACK</a> from the official repositories.  Here I use ATLAS 3.9.32 and LAPACK 3.3.0.  I assume the compiled library and header files will be installed at <em>/usr/local/atlas</em>.</p>
<p>Here is the procedure:</p>
<pre><code>$ mkdir tmp
$ cd tmp
$ wget http://www.netlib.org/lapack/lapack.tgz
... download the tarball for ATLAS from sourceforge ...
$ tar -xvjf atlas3.9.32.tar.bz2
$ mv ATLAS atlas-3.9.32
$ ln -s atlas-3.9.32 atlas
$ cd atlas
$ mkdir bld
$ cd bld
$ ../configure -b 64 --shared --prefix=/usr/local/atlas-3.9.32 \
    --with-netlib-lapack-tarfile=../../lapack.tgz
$ make build</code></pre>
<p>If I wish to do some checking, do:</p>
<pre><code>$ make check
...
$ make time
...</code></pre>
<p>(I may wish to compare the output with <em>doc/atlas_install.pdf</em>.)</p>
<p>If I don&#8217;t find any problem, do:</p>
<pre><code>$ sudo make install
$ sudo ln -s /usr/local/atlas-3.9.32 /usr/local/atlas</code></pre>
<p>That&#8217;s it.</p>
<h4>Update History</h4>
<p>November 24, 2010 &#8211; Added the Fink section.  Using the most recent versions of ATLAS and LAPACK.  Made the install directory more explicit to the version installed.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=722</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Installing Squid Proxy Server on Mac OS X Snow Leopard</title>
		<link>http://okomestudio.net/biboroku/?p=816</link>
		<comments>http://okomestudio.net/biboroku/?p=816#comments</comments>
		<pubDate>Mon, 22 Mar 2010 19:52:42 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[install procedure]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[OS X/Snow Leopard]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=816</guid>
		<description><![CDATA[My goal is to set up a very basic proxy server on my Mac box on campus, so that I can have full access to subscription-based academic journals via the proxy on my laptop even when I am off campus.  &#8230; <a href="http://okomestudio.net/biboroku/?p=816">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>My goal is to set up a very basic proxy server on my Mac box on  campus, so that I can have full access to subscription-based academic  journals via the proxy on my laptop even when I am off campus.  Some  schools provide such (library) proxies but my school unfortunately does  not.  I want to set it up such that the proxy requires a password  authentication in order not to make it wide open to the public.</p>
<h3>Getting and Installing Squid</h3>
<p><a href="http://www.squid-cache.org/Versions/v2/2.7/">Download a  tarball</a> for a stable version from the repository.  The version that I  use here is 2.7.  I assume the file is downloaded to <em>/usr/local/src/squid</em>.</p>
<pre><code>$ cd /usr/local/src/squid
$ gunzip -c squid-2.7.STABLE9.tar.gz | tar xvf -
$ cd squid-2.7.STABLE9
$ ./configure
$ make
$ sudo make install
$ cd helpers/basic_auth/NCSA
$ make
$ sudo make install
$ sudo chown -R nobody /usr/local/squid/var
$ sudo /usr/local/squid/sbin/squid -z</code></pre>
<p>Squid will be installed at <em>/usr/local/squid</em>.  (The last  command is necessary to run a daemon as user <em>nobody</em>.)</p>
<h3>Configure Squid</h3>
<p>First, prepare a NCSA-compliant encrypted password file for a user  (here with username <em>johndoe</em>):</p>
<pre><code>$ cd /usr/local/squid/etc
$ sudo touch squid_passwd
$ sudo chmod o+r squid_passwd
$ sudo htpasswd squid_passwd johndoe
New password:
Re-type new passwod:
Adding passwod for user johndoe</code></pre>
<p>Now, edit <em>/usr/local/squid/etc/squid.conf</em>.  The following  lines need to be added:</p>
<pre><code># Add this to the auth_param section
auth_param basic program /usr/local/squid/libexec/ncsa_auth /usr/local/squid/etc/squid_passwd

# Add this to the bottom of the ACL section
acl ncsa_users proxy_auth REQUIRED

# Add this at the top of the http_access section
http_access allow ncsa_users</code></pre>
<p>Finally, run the server:</p>
<pre><code>$ sudo /usr/local/squid/sbin/squid -N -d 1 -D</code></pre>
<p>Firewall will prompt me to see if I allow incoming connections to  squid.  Say &#8220;allow.&#8221;</p>
<p>The IP address or host name of your Mac box at the port 3128 will be  available as a proxy server now.</p>
<h3>Launch Squid on Startup with launchd</h3>
<p>Under the directory <em>/Library/LaunchDaemons</em>, create a file  named <em>squid.plist</em> with the following content:</p>
<pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
&lt;plist version="1.0"&gt;
  &lt;dict&gt;
    &lt;key&gt;Label&lt;/key&gt;
    &lt;string&gt;squid&lt;/string&gt;
    &lt;key&gt;OnDemand&lt;/key&gt;
    &lt;false/&gt;
    &lt;key&gt;ProgramArguments&lt;/key&gt;
    &lt;array&gt;
      &lt;string&gt;/usr/local/squid/sbin/squid&lt;/string&gt;
      &lt;string&gt;-N&lt;/string&gt;
      &lt;string&gt;-d 1&lt;/string&gt;
      &lt;string&gt;-D&lt;/string&gt;
    &lt;/array&gt;
    &lt;key&gt;ServiceIPC&lt;/key&gt;
    &lt;false/&gt;
  &lt;/dict&gt;
&lt;/plist&gt;</code></pre>
<p>Then issuing</p>
<pre><code>$ sudo launchctl load -w /Library/LaunchDaemons/squid.plist</code></pre>
<p>will launch squid.  On reboot, the proxy  should also be working  automatically.</p>
<p>﻿</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=816</wfw:commentRss>
		<slash:comments>23</slash:comments>
		</item>
		<item>
		<title>Installing DS9 on Debian Squeeze</title>
		<link>http://okomestudio.net/biboroku/?p=807</link>
		<comments>http://okomestudio.net/biboroku/?p=807#comments</comments>
		<pubDate>Mon, 22 Mar 2010 01:29:55 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Squeeze]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[astro]]></category>
		<category><![CDATA[Debian/Squeeze]]></category>
		<category><![CDATA[DS9]]></category>
		<category><![CDATA[install procedure]]></category>
		<category><![CDATA[research]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=807</guid>
		<description><![CDATA[Download the latest version from the official website: $ wget http://hea-www.harvard.edu/saord/download/ds9/linux64/ds9.linux64.6.0.tar.gz $ tar -xvzf ds9*.tar.gz $ chmod 755 ds9 $ sudo mv ds9 /usr/local/bin (The wget line is an example.) This will install DS9 under /usr/local/bin.]]></description>
				<content:encoded><![CDATA[<p>Download the latest version from the <a href="http://hea-www.harvard.edu/RD/ds9/">official website</a>:</p>
<blockquote>
<pre>$ wget http://hea-www.harvard.edu/saord/download/ds9/linux64/ds9.linux64.6.0.tar.gz
$ tar -xvzf ds9*.tar.gz
$ chmod 755 ds9
$ sudo mv ds9 /usr/local/bin</pre>
</blockquote>
<p>(The wget line is an example.) This will install DS9 under <em>/usr/local/bin</em>.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=807</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Science Packages for Python on Debian Squeeze</title>
		<link>http://okomestudio.net/biboroku/?p=802</link>
		<comments>http://okomestudio.net/biboroku/?p=802#comments</comments>
		<pubDate>Mon, 22 Mar 2010 01:22:17 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Squeeze]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[astro]]></category>
		<category><![CDATA[Debian/Squeeze]]></category>
		<category><![CDATA[install procedure]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=802</guid>
		<description><![CDATA[Eventually it&#8217;s likely I need to build all NumPy, SciPy, and Matplotlib from source, but for now this is good enough: $ sudo aptitude install ipython python-mode $ sudo aptitude install python-numpy python-scipy python-matplotlib python-nose If I need WXAgg as &#8230; <a href="http://okomestudio.net/biboroku/?p=802">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Eventually it&#8217;s likely I need to build all NumPy, SciPy, and Matplotlib from source, but for now this is good enough:</p>
<blockquote>
<pre>$ sudo aptitude install ipython python-mode
$ sudo aptitude install python-numpy python-scipy python-matplotlib python-nose</pre>
</blockquote>
<p>If I need WXAgg as a backend for Matplotlib, I need wxpython:</p>
<blockquote>
<pre>$ sudo aptitude install python-wxgtk2.8</pre>
</blockquote>
<p>I need to modify matplotlibrc:</p>
<blockquote>
<pre>$ cp /etc/matplotlibrc ~/.matplotlib/
... edit ~/.matplotlib/matplotlibrc to have following lines ...
backend : WXAgg</pre>
</blockquote>
<p>(Debian moves the default matplotlibrc to such a weird location&#8230;)</p>
<h4>SciPy Might Fail Tests</h4>
<p>I test NumPy and SciPy on Python interactive session as follows:</p>
<blockquote>
<pre>&gt;&gt;&gt; import numpy
&gt;&gt;&gt; numpy.test('full', verbose=10)
...

&gt;&gt;&gt; import scipy
&gt;&gt;&gt; scipy.test('full', verbose=10)
...</pre>
</blockquote>
<p>I rarely see perfect results (i.e., absolutely no errors), but if there are too many fails then that may be a concern.</p>
<h4>Update History</h4>
<p>November 27, 2010 &#8211; Things have chanced a lot on Squeeze now that a stable release is approaching.  Removed obsolete information and updated everything.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=802</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing JD on Debian Squeeze</title>
		<link>http://okomestudio.net/biboroku/?p=799</link>
		<comments>http://okomestudio.net/biboroku/?p=799#comments</comments>
		<pubDate>Mon, 22 Mar 2010 01:00:16 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Squeeze]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=799</guid>
		<description><![CDATA[$ sudo apt-get install jd ttf-konatu ttf-monapo ttf-mona]]></description>
				<content:encoded><![CDATA[<blockquote>
<pre>$ sudo apt-get install jd ttf-konatu ttf-monapo ttf-mona</pre>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=799</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Freemind on Debian Squeeze</title>
		<link>http://okomestudio.net/biboroku/?p=795</link>
		<comments>http://okomestudio.net/biboroku/?p=795#comments</comments>
		<pubDate>Sun, 21 Mar 2010 23:42:03 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Squeeze]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=795</guid>
		<description><![CDATA[$ sudo apt-get install freemind]]></description>
				<content:encoded><![CDATA[<blockquote>
<pre>$ sudo apt-get install freemind</pre>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=795</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Wine on Debian Squeeze</title>
		<link>http://okomestudio.net/biboroku/?p=791</link>
		<comments>http://okomestudio.net/biboroku/?p=791#comments</comments>
		<pubDate>Sun, 21 Mar 2010 23:20:21 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Squeeze]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=791</guid>
		<description><![CDATA[$ sudo apt-get install wine lib32nss-mdns]]></description>
				<content:encoded><![CDATA[<blockquote>
<pre>$ sudo apt-get install wine lib32nss-mdns</pre>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=791</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Japanese on Debian Squeeze</title>
		<link>http://okomestudio.net/biboroku/?p=763</link>
		<comments>http://okomestudio.net/biboroku/?p=763#comments</comments>
		<pubDate>Sun, 21 Mar 2010 23:05:30 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Debian/Squeeze]]></category>
		<category><![CDATA[install procedure]]></category>
		<category><![CDATA[Japanese]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=763</guid>
		<description><![CDATA[The goal is to make the system capable for Japanese input, while the base system remains English.  For the Japanese input method, l use Anthy. First, set up locales and install im-switch.  In addition to my base English locale (i.e., &#8230; <a href="http://okomestudio.net/biboroku/?p=763">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>The goal is to make the system capable for Japanese input, while the base system remains English.  For the Japanese input method, l use  <a href="http://anthy.sourceforge.jp/">Anthy</a>.</p>
<p>First, set up locales and install im-switch.  In addition to my base English locale (i.e., en_US.UTF-8), install Japnese locales ja_JP.EUC-JP and ja_JP.UTF-8:</p>
<pre><code>$ sudo aptitude install locales im-switch
$ sudo dpkg-reconfigure locales</code></pre>
<p>Set the default locale for the system to <em>en_US.UTF-8</em> (or something else if you wish).</p>
<p>Also install at least some Japanese fonts:</p>
<pre><code>$ sudo aptitude install ttf-kochi-mincho ttf-kochi-gothic ttf-sazanami-mincho
$ sudo aptitude install ttf-ipafont-gothic ttf-ipafont-mincho</code></pre>
<h4>With IBus</h4>
<p>When I started using Squeeze, <a href="http://code.google.com/p/ibus/">IBus</a> was unstable and unusable, but things have changed and this is my preferred way now.</p>
<p>Install necessary Debian packages and configure for KDE:</p>
<pre><code>$ sudo aptitude install ibus ibus-anthy ibus-qt4 kasumi
$ im-switch -c
... choose IBus for the current locale ...</code></pre>
<p>Run the IBus setup program:</p>
<pre><code>$ ibus-setup</code></pre>
<p>If asked, start ibus-daemon.  Logout the KDE sesssion, restart X session, and login again.  Under the Input Method tab, add &#8220;Japanese &#8211; Anthy&#8221;.  Configure IBus to my liking.  By default, Ctrl + Space (unlike Shift + Space which used to be the case) triggers the Japanese input mode.  The IBus icon also shows up in the system tray, from which various settings can be changed.</p>
<h4>With UIM</h4>
<p>This section is largely left for historical purpose, as I now use IBus (see above), which acts more like SCIM used to.</p>
<p>Install necessary Debian packages and configure for KDE:</p>
<pre><code>$ sudo aptitude install uim uim-anthy uim-qt uim-xim kasumi
$ im-switch -c
... choose uim-toolbar-qt ...
$ uim-toolbar-qt4</code></pre>
<p>I also need to register <em>uim-toolbar-qt4</em> to run at KDE session startup: System Settings -&gt; Advanced -&gt; Autostart.  Add program <em>/usr/bin/uim-toolbar-qt4</em>.  Restart X.  This way, I do not have to issue the <em>uim-toolbar-qt4</em> command after every boot.</p>
<h4>Using Japanese in Emacs</h4>
<p>Launching Emacs by changing locale temporarily.  For example:</p>
<pre><code>$ LC_CTYPE=ja_JP.UTF-8 emacs somefile.txt</code></pre>
<p>It turns out this is all I need to make Emacs sensitive to Japanese.  There are other more elegant ways I suppose, but as long as it works for me&#8230;  I don&#8217;t use Japanese on Emacs much anyways.</p>
<h4>Adding Words to Kasumi Dictionary</h4>
<p>From command line, do:</p>
<pre><code>$ kasumi
$ kasumi -a   # this one goes directly to new word mode</code></pre>
<p>The same application can be launched from <em>KDE Menu -&gt; Applications -&gt; Settings -&gt; Anthy Dictionary Editor</em>.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=763</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Installing K3b on Debian Squeeeze</title>
		<link>http://okomestudio.net/biboroku/?p=785</link>
		<comments>http://okomestudio.net/biboroku/?p=785#comments</comments>
		<pubDate>Sun, 21 Mar 2010 22:49:24 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Squeeze]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[Debian/Squeeze]]></category>
		<category><![CDATA[install procedure]]></category>
		<category><![CDATA[multimedia]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=785</guid>
		<description><![CDATA[$ sudo aptitude install k3b libdvdcss transcode normalize-audio]]></description>
				<content:encoded><![CDATA[<blockquote>
<pre>$ sudo aptitude install k3b libdvdcss transcode normalize-audio</pre>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=785</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sound &amp; Music Applications on Debian Squeeze</title>
		<link>http://okomestudio.net/biboroku/?p=780</link>
		<comments>http://okomestudio.net/biboroku/?p=780#comments</comments>
		<pubDate>Sun, 21 Mar 2010 22:40:51 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Squeeze]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=780</guid>
		<description><![CDATA[Amarok is my favorite audio player. For tagging ogg files, I use EasyTAG: $ sudo apt-get install kmix $ sudo apt-get install amarok $ sudo apt-get easytag $ sudo apt-get install lastfm It seems replaygain became a built-in feature of &#8230; <a href="http://okomestudio.net/biboroku/?p=780">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><a href="http://amarok.kde.org/">Amarok</a> is my favorite audio player.  For tagging ogg files, I use <a href="http://easytag.sourceforge.net/">EasyTAG</a>:</p>
<blockquote>
<pre>$ sudo apt-get install kmix
$ sudo apt-get install amarok
$ sudo apt-get easytag
$ sudo apt-get install lastfm
</pre>
</blockquote>
<p>It seems replaygain became a built-in feature of Amarok.  Great.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=780</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing MPlayer on Debian Squeeze</title>
		<link>http://okomestudio.net/biboroku/?p=776</link>
		<comments>http://okomestudio.net/biboroku/?p=776#comments</comments>
		<pubDate>Sun, 21 Mar 2010 22:30:52 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Squeeze]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=776</guid>
		<description><![CDATA[One easy step: $ sudo apt-get install mplayer pulseaudio Should add the debianmultimedia.org repository to /etc/apt/sources.list though. I had a problem with audio stream when I played a music video (.flv).  I could solve this by installing pulseaudio, and under &#8230; <a href="http://okomestudio.net/biboroku/?p=776">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>One easy step:</p>
<blockquote>
<pre>$ sudo apt-get install mplayer pulseaudio
</pre>
</blockquote>
<p>Should add the debianmultimedia.org repository to <em>/etc/apt/sources.list</em> though.</p>
<p>I had a problem with audio stream when I played a music video (.flv).  I could solve this by installing pulseaudio, and under the audio preferences setting the driver to &#8220;pulse.&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=776</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Firefox (Iceweasel) on Debian Squeeze</title>
		<link>http://okomestudio.net/biboroku/?p=769</link>
		<comments>http://okomestudio.net/biboroku/?p=769#comments</comments>
		<pubDate>Sun, 21 Mar 2010 22:29:09 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Debian/Squeeze]]></category>
		<category><![CDATA[install procedure]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[web browser]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=769</guid>
		<description><![CDATA[Note that in Debian, Firefox is called iceweasel. $ sudo aptitude install iceweasel Then install some popular plugins. Java $ sudo aptitude install sun-java6-plugin sun-java6-fonts Flash Do: $ sudo aptitude install flashplugin-nonfree ttf-mscorefonts-installer ttf-xfree86-nonfree This should do it. Try youtube.com &#8230; <a href="http://okomestudio.net/biboroku/?p=769">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Note that in Debian, Firefox is called <em>iceweasel</em>.</p>
<pre><code>$ sudo aptitude install iceweasel</code></pre>
<p>Then install some popular plugins.</p>
<h4>Java</h4>
<pre><code>$ sudo aptitude install sun-java6-plugin sun-java6-fonts</code></pre>
<h4>Flash</h4>
<p>Do:</p>
<pre><code>$ sudo aptitude install flashplugin-nonfree ttf-mscorefonts-installer ttf-xfree86-nonfree</code></pre>
<p>This should do it.  Try youtube.com to see if Flash is working.</p>
<h4>MPlayer</h4>
<p>The following apt-get used to work, but apparently not on Squeeze:</p>
<pre><code>$ sudo aptitude install mozilla-mplayer</code></pre>
<p>I wonder where the new module is.</p>
<h3>Other Tips</h3>
<h4>Speeding Up via Pipelining</h4>
<p>Visit the URL <em>about:config</em> with Firefox and set the following items:</p>
<pre><code>network.http.pipelining = true
network.http.pipelining.maxrequests = 255
network.http.pipelining.ssl = true
network.http.proxy.pipelining = true</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=769</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Customizing &amp; Installing Linux Kernel on Debian Squeeze</title>
		<link>http://okomestudio.net/biboroku/?p=754</link>
		<comments>http://okomestudio.net/biboroku/?p=754#comments</comments>
		<pubDate>Sun, 21 Mar 2010 05:31:57 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Debian/Squeeze]]></category>
		<category><![CDATA[install procedure]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=754</guid>
		<description><![CDATA[Here is a quickie for customizing and install Linux kernel 2.6.x on Squeeze. Install some packages and kernel source: $ sudo aptitude update $ sudo aptitude install kernel-package bzip2 g++ libqt3-mt-dev libncurses5-dev sudo fakeroot If you do not belong to &#8230; <a href="http://okomestudio.net/biboroku/?p=754">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Here is a quickie for customizing and install Linux kernel 2.6.x on Squeeze.</p>
<p>Install some packages and kernel source:</p>
<pre><code>$ sudo aptitude update
$ sudo aptitude install kernel-package bzip2 g++ libqt3-mt-dev libncurses5-dev sudo fakeroot</code></pre>
<p>If you do not belong to group &#8220;src&#8221;, add yourself to the group as we work under <em>/usr/src</em>:</p>
<pre><code>$ sudo adduser username src</code></pre>
<p>You need to logout and login for this change to take effect.  You also need to be able to use <em>sudo</em> or <em>su</em> to install the new kernel in the end.</p>
<p>The kernel packaged for Squeeze is at version 2.6.32.  Alternatively a newer kernel could be obtained from <a href="http://www.kernel.org/">kernel.org</a> and saved to <em>/usr/src</em>.  The customization procedure should be similar.  Here I just follow the Debian way:</p>
<pre><code>$ sudo aptitude install linux-source-2.6.32</code></pre>
<p>Extract the source tree:</p>
<pre><code>$ sudo chgrp -R src /usr/src
$ sudo chmod -R g+w /usr/src
$ cd /usr/src
$ rm linux
$ tar -jxf linux-source-2.6.32.tar.bz2
$ ln -s linux-source-2.6.32 linux
$ cd linux</code></pre>
<p>Edit the EXTRAVERSION entry in <em>Makefile</em>, as in:</p>
<pre><code>EXTRAVERSION = .20100321.1</code></pre>
<p>for example to add .20100321.1 to the kernel version number.  This is convenient for keeping the existing, working kernels around when you need to recompile with different options.</p>
<p>Use <em>xconfig</em> or <em>menuconfig</em> to customize the kernel options.  Before the <code>make-kpkg</code> lines, setting concurrency (most likely to the number of cores of my processor) is optinal but having a higher number typically reduces the compilation time.</p>
<pre><code>$ make mrproper
$ make xconfig    # or make menuconfig
$ export CONCURRENCY_LEVEL=4    # this is optional
$ fakeroot make-kpkg clean
$ fakeroot make-kpkg --initrd kernel_image
$ cd ..
$ sudo dpkg -i linux-image-2.6.32.20100321.1_2.6.32.20100321.1-10.00.Custom_amd64.deb</code></pre>
<p>Upon reboot in the GRUB menu you will find the newly installed kernel:</p>
<pre><code>$ sudo reboot</code></pre>
<h3>Purging Old Kernel Image from System</h3>
<p>For example, if the kernel to be uninstalled is of version 2.6.26 and the extra version that I used was 20091112.1, do:</p>
<pre><code>$ sudo dpkg -P linux-image-2.6.26.20091112.1</code></pre>
<p>That&#8217;s it.  However it is often a good idea to keep at least one kernel image that I know for sure to work so that when a custom kernel fails, I have something to fall back on.  On the other hand, it is also a good idea to purge very old kernel images to save space in <em>/boot</em>.</p>
<h3>Giving Kernel Boot Options with Grub (Version 2)</h3>
<p>The new Grub has a slightly different way of specifying boot options (<em>/boot/grub/menu.lst</em> no longer exists for version 2!).</p>
<pre><code>$ sudo chmod +w /boot/grub/grub.cfg
... open and edit /boot/grub/grub.cfg ...
$ sudo chmod -w /boot/grub/grub.cfg</code></pre>
<p>If I need to provide a kernel with boot options, find the &#8220;menuentry&#8221; for the kernel, and change from</p>
<pre><code>linux /vmlinuz-2.6.36.1.3 root=UUID=somehash ro quiet</code></pre>
<p>to</p>
<pre><code>linux /vmlinuz-2.6.36.1.3 root=UUID=somehash ro quiet usbcore.autosuspend=1</code></pre>
<p>in order to set the usbcore.autosuspend option, for example.</p>
<h3>Playing with CONCURRENCY_LEVEL</h3>
<p>With Core i5 (2 cores but virtually 4 cores with hyperthreading), I get:</p>
<pre><code>$ fakeroot make-kpkg clean
$ export CONCURRENCY_LEVEL=4
$ time fakeroot make-kpkg --initrd kernel_image
...
real    6m50.028s
user    21m45.186s
sys     2m42.246s

$ fakeroot make-kpkg clean
$ export CONCURRENCY_LEVEL=1
$ time fakeroot make-kpkg --initrd kernel_image
...
real    13m55.216s
user    13m23.638s
sys     1m50.359s</code></pre>
<p>I say significant speed up!</p>
<h3>What if Kernel Panics after Reboot?</h3>
<p>(NOTE: This was true back when I was playing around when Squeeze was still far from stable.  I don&#8217;t think this section is relevant as of November 2010, since Squeeze is very close to stable now. Just leaving the note in case for its archival value.)  </p>
<p>Well, it turns out <code>make-kpkg --initrd</code> does not automatically create a <em>/boot/inird.img-*</em> file for my current configuration.  I wondered for a while why my new custom kernel keeps panicking upon reboot but finally realized that was the cause.</p>
<p>Fortunately, I can create the image myself easily:</p>
<pre><code>$ sudo update-initramfs -c -k 2.6.32.20100321.1
$ sudo update-grub</code></pre>
<p>This should work.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=754</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Installing Debian Squeeze on Dell XPS 630i</title>
		<link>http://okomestudio.net/biboroku/?p=742</link>
		<comments>http://okomestudio.net/biboroku/?p=742#comments</comments>
		<pubDate>Sun, 21 Mar 2010 05:17:26 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Debian/Squeeze]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[install procedure]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[NVIDIA GeForce 8800 GT]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[XPS 630i]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=742</guid>
		<description><![CDATA[First, a Big Problem I wanted to do a fresh install using an install CD or USB stick for Squeeze (still as testing), but unfortunately these install media have never worked for me on this desktop machine.  For some reason &#8230; <a href="http://okomestudio.net/biboroku/?p=742">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<h3>First, a Big Problem</h3>
<p>I wanted to do a fresh install using an install CD or USB stick for  Squeeze (still as testing), but unfortunately these install media have  never worked for me on this desktop machine.  For some reason it always ends in kernel panic,  which I couldn&#8217;t solve.  I haven&#8217;t been able to get help on the Debian  bug report system.  So this time I decided to do a <a title="Installing Debian Squeeze from Hard Disk" href="http://nomo17k.wordpress.com/2010/12/14/installing-debian-squeeze-from-hard-disk/">fresh install off </a><em><a title="Installing Debian Squeeze from Hard Disk" href="http://nomo17k.wordpress.com/2010/12/14/installing-debian-squeeze-from-hard-disk/">hard drive</a></em>,  after installing Debian Lenny normally, carefully keeping the disk  partitions that I did not wish to erase.  I don&#8217;t know why the Squeeze  installer never works on XPS 630i, when the Lenny installer perfectly  does its job!</p>
<h3>Installation</h3>
<p>The procedure assumes that I have already been able to start the Debian installer for Squeeze.  When it starts, choose:</p>
<ul>
<li>Choose a language: English (or whatever)</li>
<li>Choose a country, territory or area: Canada (or whatever)</li>
<li>Keymap to use: American English (or whatever)</li>
<li>Primary network interface: eth0: nVidia Corporation MCP51 Ethernet Controller (I use wired network)</li>
<li>Host name: (whatever)</li>
<li>Domain name: (whatever)</li>
<li>Root password: (whatever)</li>
<li>Full name fo rthe new user: (whatever)</li>
<li>Username for your account: (whatever)</li>
<li>Choose a password for the new user: (whatever)</li>
<li>Select your time zone: Atlantic (or whatever)</li>
<li>Partitioning method: Manual</li>
</ul>
<p>Here, I do manual partitioning since this is a reinstallation and  there are existing partitions (it is also a dual boot machine with  Windows XP; that&#8217;s why the partition scheme is a bit weird below).  I  keep <em>/home</em>, <em>/usr/local</em>, and <em>/install</em> partitions, but can format all the other partitions:</p>
<pre><code>SCSI1 (0,0,0) (sda) - 750.2 GB ATA Hitachi HDS72107
  #1  primary   83.9 GB  B    ntfs
  #2  primary  178.3 GB    K  ext3    /home/media
  #5  logical    6.3 GB    F  ext3    /var
  #6  logical   10.5 GB    F  ext3    /usr
  #7  logical   10.5 GB    K  ext3    /usr/local
  #8  logical    8.4 GB    F  swap    swap
  #9  logical  440.8 GB    K  ext3    /home
 #10  logical  700.0 MB    F  ext3    /
 #11  logical  350.0 MB    F  ext3    /boot
 #12  logical  200.0 MB    K  ext3    /install
 #13  logical   10.3 GB    F  ext3    /tmp</code></pre>
<p>Also, the <em>/install</em> partition should not be mounted during the installation.  When done, write changes to disk.</p>
<p>The following three questions will be asked now; otherwise it will be asked later.  I can check the <a href="http://mirror.debian.org/status.html">mirror server status</a> as well.</p>
<ul>
<li>Debian archive mirror country: United States (or whatever)</li>
<li>Debian archive mirror: ftp.us.debian.org (or whatever)</li>
<li>Proxy: none (or whatever)</li>
</ul>
<p>The base system will be installed.</p>
<ul>
<li>Participate in the package usage survey?: no (or yes if preferred)</li>
<li>Choose software to install: Select none; I can install everything later.</li>
<li>Install the GRUB boot loader to the master boot record?: Yes</li>
</ul>
<p>Should be done!  Reboot into newly installed Squeeze!</p>
<h3>Post-Install Admin Tweaks</h3>
<p>Login as root.  First I install a few essential packages for system administration, etc.:</p>
<pre><code># aptitude install sudo ssh rsync wget</code></pre>
<p>If I need to run 32-bit applications, it is also a good idea to do:</p>
<pre><code># aptitude install ia32-libs</code></pre>
<h4>Setting up sudo</h4>
<p>At this point I add myself as an sudoer by adding my regular username to <em>/etc/sudoers</em>, just under the entry for root, giving full admin privileges (i.e., just copy the line for root).</p>
<pre><code># chmod 640 /etc/sudoers
# nano /etc/sudoers
... add a regular user to the list ...
# chmod 440 /etc/sudoers</code></pre>
<p>I believe in using <code>sudo</code> rather than becoming root to do admin tasks.</p>
<h4>Setting up APT Sources</h4>
<p>It is also a good idea to modify <em>/etc/apt/sources.list</em> now.  Mine looks like this:</p>
<pre><code>deb http://ftp.us.debian.org/debian/ squeeze main contrib non-free
deb-src http://ftp.us.debian.org/debian/ squeeze main contrib non-free

deb http://security.debian.org/ squeeze/updates main contrib non-free
deb-src http://security.debian.org/ squeeze/updates main contrib non-free

deb http://www.debian-multimedia.org squeeze main non-free</code></pre>
<p>As I see, the debian-multimedia.org repository is added.  Though this isn’t absolutely essential, I may wish to do</p>
<pre><code># wget http://www.debian-multimedia.org/pool/main/d/debian-multimedia-keyring/debian-multimedia-keyring_2008.10.16_all.deb
# dpkg -i debian-multimedia-keyring_2008.10.16_all.deb
# aptitude update</code></pre>
<p>in order to avoid GPG error accessing this repository in future.</p>
<h4>Setting up DHCP Hostname</h4>
<p>Modify <em>/etc/dhcp/dhclient.conf</em> to have the line:</p>
<pre><code>send host-name "yourcomputershostname";</code></pre>
<p>This way, identify this computer on a router, for example, will be easier.</p>
<h3>KDE</h3>
<p>To install KDE,</p>
<pre><code># aptitude update
# aptitude install kdebase kdenetwork kmix
# reboot</code></pre>
<p>Upon reboot, the KDM login screen appears.</p>
<h3>Hardware</h3>
<h4>NVIDIA GeForce 8800 GT</h4>
<p>I usually use a custom kernel, so the nvidia module also has to be compiled.  Following <a href="http://wiki.debian.org/NvidiaGraphicsDrivers">this page</a>, here is the summary.  I assume the custom kernel has been compiled and installed <a title="Customizing &amp; Installing Linux Kernel on Debian Squeeze" href="http://nomo17k.wordpress.com/2010/03/21/customizing-installing-linux-kernel-on-debian-squeeze/">following this procedure</a>, and this procedure is done after reboot, while the system is running on that custom kernel.</p>
<pre><code>$ sudo aptitude install module-assistant nvidia-kernel-common
$ sudo m-a auto-install nvidia-kernel-source
$ sudo aptitude install nvidia-glx</code></pre>
<p>Now, logout of KDE and do a console login to modify <em>/etc/X11/xorg.conf</em>.  This file probably does not exist, in which case I can generate one by</p>
<pre><code>$ sudo X -configure</code></pre>
<p>Move the newly generated xorg.conf file to <em>/etc/X11/xorg.conf</em>.  Restart X and I should see the NVIDIA driver working</p>
<pre><code>$ sudo aptitude install mesa-utils
$ glxinfo | grep rendering
direct rendering: Yes</code></pre>
<p>This should be it!</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=742</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Using Some Python 3 in Python 2.6.x</title>
		<link>http://okomestudio.net/biboroku/?p=733</link>
		<comments>http://okomestudio.net/biboroku/?p=733#comments</comments>
		<pubDate>Fri, 19 Mar 2010 17:24:01 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[reference]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=733</guid>
		<description><![CDATA[This is just a note for myself to start getting used to the Python 3 coding practices. In order to use some Python 3 features in Python 2.6.x, use this statement in my script: It&#8217;s not a very good idea &#8230; <a href="http://okomestudio.net/biboroku/?p=733">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>This is just a note for myself to start getting used to the Python 3 coding practices.</p>
<p>In order to use some Python 3 features in Python 2.6.x, use this statement in my script:</p>
<pre class="brush: python; title: ; notranslate">from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals</pre>
<p>It&#8217;s not a very good idea to transition to Python 3 right away though, since most packages and modules are still for Python 2.x and it doesn&#8217;t seem to change for a while.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=733</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing pysao on Mac OS X Snow Leopard</title>
		<link>http://okomestudio.net/biboroku/?p=728</link>
		<comments>http://okomestudio.net/biboroku/?p=728#comments</comments>
		<pubDate>Fri, 19 Mar 2010 02:15:34 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Snow Leopard]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=728</guid>
		<description><![CDATA[The pysao (or python-sao) version used here is svn rev. 115: $ mkdir /usr/local/src/pysao $ cd /usr/local/src/pysao $ svn checkout http://python-sao.googlecode.com/svn/trunk/ python-sao $ cd python-sao $ python xpa_download.py $ tar xf xpa-2.1.12.tar.gz $ ln -s xpa-2.1.12 xpalib $ cd xpalib &#8230; <a href="http://okomestudio.net/biboroku/?p=728">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>The <a href="http://code.google.com/p/python-sao/">pysao</a> (or python-sao) version used here is svn rev. 115:</p>
<blockquote>
<pre><a name="pysao">$ mkdir /usr/local/src/pysao
$ cd /usr/local/src/pysao
$ svn checkout </a><a rel="nofollow" href="http://python-sao.googlecode.com/svn/trunk/">http://python-sao.googlecode.com/svn/trunk/</a> python-sao
$ cd python-sao
$ python xpa_download.py
$ tar xf xpa-2.1.12.tar.gz
$ ln -s xpa-2.1.12 xpalib
$ cd xpalib
$ ./configure CFLAGS="-arch ppc -arch i386 -arch x86_64"
$ make
$ cd ..
$ python setup.py build
$ sudo python setup.py install</pre>
</blockquote>
<p>That&#8217;s it.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=728</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing pdftk on Mac OS X Snow Leopard</title>
		<link>http://okomestudio.net/biboroku/?p=725</link>
		<comments>http://okomestudio.net/biboroku/?p=725#comments</comments>
		<pubDate>Fri, 19 Mar 2010 01:56:25 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Snow Leopard]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=725</guid>
		<description><![CDATA[There is a .dmg for pdftk 1.41 for OS X 10.6.2.  Thanks to fredericiana.com.  What a time saver.]]></description>
				<content:encoded><![CDATA[<p>There is a <a href="http://fredericiana.com/downloads/pdftk1.41_OSX10.6.dmg">.dmg for pdftk 1.41 for OS X 10.6.2</a>.  Thanks to <a href="http://fredericiana.com/">fredericiana.com</a>.  What a time saver.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=725</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing FFTW on Mac OS X Snow Leopard</title>
		<link>http://okomestudio.net/biboroku/?p=719</link>
		<comments>http://okomestudio.net/biboroku/?p=719#comments</comments>
		<pubDate>Fri, 19 Mar 2010 01:29:38 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[computing]]></category>
		<category><![CDATA[FFTW]]></category>
		<category><![CDATA[install procedure]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[OS X/Snow Leopard]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=719</guid>
		<description><![CDATA[No FORTRAN compiler appears to be included in Xcode, so I need to install it if I haven&#8217;t done so.  I installed GFortran.  In the configure statement below, set F77 to gfortran. Installing from Fink For FFTW version 3.x, do: &#8230; <a href="http://okomestudio.net/biboroku/?p=719">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>No FORTRAN compiler appears to be included in Xcode, so I need to install it if I haven&#8217;t done so.  I <a href="http://okomestudio.net/biboroku/?p=827">installed GFortran</a>.  In the configure statement below, set F77 to gfortran.</p>
<h4>Installing from Fink</h4>
<p>For FFTW version 3.x, do:</p>
<pre><code>$ fink install fftw3 fftw3-shlibs</code></pre>
<p>The library will be available under <em>/sw/lib</em>.</p>
<h4>Installing from Source</h4>
<p>The version of <a href="http://www.fftw.org/">FFTW</a> we use here is <a href="http://www.fftw.org/fftw-3.2.2.tar.gz">3.2.2</a>.  Follow this:</p>
<pre><code>$ mkdir tmp
$ cd tmp
$ wget http://www.fftw.org/fftw-3.2.2.tar.gz
$ tar -xvzf fftw-3.2.2.tar.gz
$ cd fftw-3.2.2
$ ./configure --prefix=/usr/local/fftw-3.2.2 --enable-threads \
    CC="gcc -arch i386 -arch x86_64" CXX="g++ -arch i386 -arch x86_64" \
    CPP="gcc -E" CXXCPP="g++ -E" F77=gfortran
$ make
$ sudo make install
$ sudo ln -s /usr/local/fftw-3.2.2 /usr/local/fftw</code></pre>
<p>This will install FFTW under <em>/usr/local/fftw-3.2.2</em>.  If a single precision version also needs to be installed, add <code>--enable-single</code> to the configure statement above and do the configure/make/make install sequence again (it&#8217;s a good idea to run &#8220;make clean&#8221; before the second time around though).</p>
<h4>Update History</h4>
<p>November 24, 2010 &#8211; Added the Fink version.  Changed the installation directory to <em>/usr/local/fftw</em> to avoid potential conflict later.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=719</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Installing HOTPANTS on Mac OS X Snow Leopard</title>
		<link>http://okomestudio.net/biboroku/?p=714</link>
		<comments>http://okomestudio.net/biboroku/?p=714#comments</comments>
		<pubDate>Thu, 18 Mar 2010 18:13:12 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Snow Leopard]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=714</guid>
		<description><![CDATA[You can&#8217;t have enough of hot pants in your life, so you need to reinstall HOTPANTS on Snow Leopard. First of all, you need a development version of CFITSIO already installed.  See this page if you need to install it &#8230; <a href="http://okomestudio.net/biboroku/?p=714">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>You can&#8217;t have <a href="http://nomo17k.wordpress.com/2010/03/10/installing-hotpants-5-1-10-on-mac-os-x-leopard/">enough of hot pants</a> in your life, so you need to reinstall HOTPANTS on Snow Leopard.</p>
<p>First of all, you need a development version of CFITSIO already installed.  See <a href="http://nomo17k.wordpress.com/2010/03/18/installing-cfitsio-on-mac-os-x-snow-leopard/">this page</a> if you need to install it yourself.</p>
<p>The version here is 5.1.10.  Download it from <a href="http://www.astro.washington.edu/users/becker/c_software.html">Andrew Becker&#8217;s distribution web page</a>.</p>
<blockquote>
<pre>$ mkdir /usr/local/src/hotpants
$ cd /usr/local/src/hotpants
$ wget http://www.astro.washington.edu/users/becker/software/hotpants_v5.1.10.tar.gz
$ tar xf hotpants_v5.1.10.tar.gz
$ cd hotpants_v5.1.10</pre>
</blockquote>
<p>Now you need to patch the source files for OS X.  The patch that I made is here, which you need to rename it (it is a simple text file, not a real .odt file; it&#8217;s a workaround to bypass a wordpress.com limitation):</p>
<blockquote>
<pre>$ wget http://okomestudio.net/biboroku/wp-content/uploads/2010/03/patch_v5-1-10.odt
$ mv patch_v5-1-10.odt patch_v5.1.10
$ patch -p1 &lt; patch_v5.1.10</pre>
</blockquote>
<p>You need to modify the paths for CFITSIOINCDIR and LIBDIR in <em>Makefile</em> depending on where your CFITSIO is located.  Then do:</p>
<blockquote>
<pre>$ make
$ sudo cp extractkern hotpants maskim /usr/local/bin
</pre>
</blockquote>
<p>The last line is only necessary if you wish to install the binaries for system-wide access.</p>
<p>That&#8217;s it!</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=714</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing CFITSIO on Mac OS X Snow Leopard</title>
		<link>http://okomestudio.net/biboroku/?p=711</link>
		<comments>http://okomestudio.net/biboroku/?p=711#comments</comments>
		<pubDate>Thu, 18 Mar 2010 17:41:12 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Snow Leopard]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=711</guid>
		<description><![CDATA[It&#8217;s handy to have CFITSIO against which you may build miscellaneous packages for science computing. To have this in your system, download the tarball (here it&#8217;s version 3.24) and build as follows: $ mkdir /usr/local/src/cfitsio # Need a correct file &#8230; <a href="http://okomestudio.net/biboroku/?p=711">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>It&#8217;s handy to have <a href="http://heasarc.gsfc.nasa.gov/docs/software/fitsio/fitsio.html">CFITSIO </a>against which you may build miscellaneous packages for science computing.</p>
<p>To have this in your system, <a href="ftp://heasarc.gsfc.nasa.gov/software/fitsio/c/cfitsio3240.tar.gz">download the tarball</a> (here it&#8217;s version 3.24) and build as follows:</p>
<blockquote>
<pre>$ mkdir /usr/local/src/cfitsio  # Need a correct file permission for this.
$ cd /usr/local/src/cfitsio
$ wget ftp://heasarc.gsfc.nasa.gov/software/fitsio/c/cfitsio3240.tar.gz
$ tar xf cfitsio3240.tar.gz
$ cd cfitsio
$ export CFLAGS="-arch i386 -arch x86_64 -g -O2"
$ ./configure
$ make</pre>
</blockquote>
<p>This should build for both i386 and x86_64 architectures, and the header and library files will be at <em>/usr/local/src/cfitsio/cfitsio/include</em> and <em>/usr/local/src/cfitsio/cfitsio/lib</em> directories just underneath the top of the source tree (which you use when building against other libraries).</p>
<p>If you also wish to install those at the standard library location, i.e., /usr/local, then do instead:</p>
<blockquote>
<pre>...
$ ./configure --prefix=/usr/local
$ make
$ sudo make install
</pre>
</blockquote>
<p>This should be it.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=711</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Restoring Hidden Files with Time Machine on Mac OS X Snow Leopard</title>
		<link>http://okomestudio.net/biboroku/?p=699</link>
		<comments>http://okomestudio.net/biboroku/?p=699#comments</comments>
		<pubDate>Tue, 16 Mar 2010 17:22:55 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Snow Leopard]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=699</guid>
		<description><![CDATA[Well I had this heart-stopping moment when I did not see all the &#8220;hidden&#8221; files (on Linux those are files with names starting with a &#8220;.&#8221;) while browsing Time Machine backups. It turns out a widget called hiddenfiles can toggle &#8230; <a href="http://okomestudio.net/biboroku/?p=699">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Well I had this heart-stopping moment when I did not see all the &#8220;hidden&#8221; files (on Linux those are files with names starting with a &#8220;.&#8221;) while browsing Time Machine backups.</p>
<p>It turns out a widget called <a href="http://www.apple.com/downloads/dashboard/developer/hiddenfiles.html">hiddenfiles</a> can toggle the visibility of hidden files.  Install and set it (on Dashboard) to show all hidden files, you can make those files in Time Machine as well.</p>
<p>The fact that this isn&#8217;t a built-in feature is beyond my comprehension&#8230;  Apparently Apple is contributing to the increased incidence of cardiac arrests.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=699</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Using Logitech MX Revolution on Mac OS X Snow Leopard</title>
		<link>http://okomestudio.net/biboroku/?p=696</link>
		<comments>http://okomestudio.net/biboroku/?p=696#comments</comments>
		<pubDate>Tue, 16 Mar 2010 16:43:02 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Snow Leopard]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=696</guid>
		<description><![CDATA[Yup.  Given I need the power of 64-bit computing, I upgraded my Leopard box to Snow Leopard.  So far, so good. For using Logitech MX Revolution on Snow Leopard, just download and install Logitech Control Center for OS X.  Works &#8230; <a href="http://okomestudio.net/biboroku/?p=696">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Yup.  Given I need the power of 64-bit computing, I upgraded my Leopard box to Snow Leopard.  So far, so good.</p>
<p>For using Logitech MX Revolution on Snow Leopard, just download and install <a href="http://www.logitech.com/index.cfm/494/3129&amp;cl=us,en">Logitech Control Center for OS X</a>.  Works flawlessly and it&#8217;s even fully 64-bit.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=696</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing QTScrobbler on Debian Lenny (AMD64)</title>
		<link>http://okomestudio.net/biboroku/?p=690</link>
		<comments>http://okomestudio.net/biboroku/?p=690#comments</comments>
		<pubDate>Sun, 14 Mar 2010 05:59:53 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Lenny]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=690</guid>
		<description><![CDATA[Download a tarball and expand it into a temporary directory. $ sudo apt-get install libcurl4-gnutls-dev libmtp-dev pkg-config libqt4-dev $ tar jxf qtscrob-0.10.tar.bz2 $ cd qtscrob-0.10 $ cd src/qt $ qmake $ make $ sudo cp qtscrob /usr/local/bin $ sudo chmod &#8230; <a href="http://okomestudio.net/biboroku/?p=690">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Download a tarball and expand it into a temporary directory.</p>
<blockquote>
<pre>$ sudo apt-get install libcurl4-gnutls-dev libmtp-dev pkg-config libqt4-dev
$ tar jxf qtscrob-0.10.tar.bz2
$ cd qtscrob-0.10
$ cd src/qt
$ qmake
$ make
$ sudo cp qtscrob /usr/local/bin
$ sudo chmod 755 /usr/local/bin/qtscrob
</pre>
</blockquote>
<p>That&#8217;s it.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=690</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing NumPy, SciPy, &amp; Matplotlib on Debian Lenny (AMD64) with Python 2.6</title>
		<link>http://okomestudio.net/biboroku/?p=675</link>
		<comments>http://okomestudio.net/biboroku/?p=675#comments</comments>
		<pubDate>Sun, 14 Mar 2010 02:38:17 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[computing]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Debian/Lenny]]></category>
		<category><![CDATA[install procedure]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=675</guid>
		<description><![CDATA[I assume that Python 2.6 has already been installed from source on Lenny. $ sudo apt-get install libatlas-headers libatlas-base-dev $ sudo apt-get install libfftw3-dev libsuitesparse-dev $ sudo apt-get install liblapack-dev gfortran swig Download NumPy from the official repository.  Then $ &#8230; <a href="http://okomestudio.net/biboroku/?p=675">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I assume that Python 2.6 has already been installed from source on Lenny.</p>
<pre><code>$ sudo apt-get install libatlas-headers libatlas-base-dev
$ sudo apt-get install libfftw3-dev libsuitesparse-dev
$ sudo apt-get install liblapack-dev gfortran swig</code></pre>
<p>Download NumPy from the <a href="https://sourceforge.net/projects/numpy/files/">official repository</a>.  Then</p>
<pre><code>$ cd /usr/local/src
$ tar -zxf numpy-1.3.0.tar.gz
$ cd numpy-1.3.0
$ python2.6 setup.py build
$ sudo python2.6 setup.py install</code></pre>
<p>Download SciPy from the <a href="http://sourceforge.net/projects/scipy/files/">official repository</a>.  Then</p>
<pre><code>$ cd /usr/local/src
$ tar -zxf scipy-0.7.1.tar.gz
$ cd scipy-0.7.1
$ sudo python2.6 setup.py install</code></pre>
<p>Before installing matplotlib, I want to install wx, since I want to use it as the main GUI backend.  See <a href="http://okomestudio.net/biboroku/?p=622">this installation note</a> if you need to build wxPython from source.  Be careful that when building against wxagg, you need</p>
<pre><code># export LD_LIBRARY_PATH=/usr/local/lib/wx/2.8/lib</code></pre>
<p>right before running <em>setup.py</em> so that the installer can find the wxWidgets libraries.</p>
<p>Download Matplotlib from the<a href="http://sourceforge.net/projects/matplotlib/files/matplotlib/"> official repository</a>.  Then</p>
<pre><code>$ cd /usr/local/src
$ tar -zxf matplotlib-0.99.1.1.tar.gz
$ cd matplotlib-0.99.1.1
$ emacs setup.cfg   # See README for how to configure.
$ su
# python2.6 setup.py install</code></pre>
<p>This should do it.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=675</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Installing Python 2.6 from Source on Debian Lenny (AMD64)</title>
		<link>http://okomestudio.net/biboroku/?p=677</link>
		<comments>http://okomestudio.net/biboroku/?p=677#comments</comments>
		<pubDate>Sun, 14 Mar 2010 00:38:44 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Debian/Lenny]]></category>
		<category><![CDATA[install procedure]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=677</guid>
		<description><![CDATA[First, development files need to be installed for some Python packages to be built: $ sudo apt-get install libreadline5-dev libbz2-dev tcl8.5-dev tk8.5-dev libsqlite3-dev You need to update the above package list if the Python modules you need are not being &#8230; <a href="http://okomestudio.net/biboroku/?p=677">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>First, development files need to be installed for some Python packages to be built:</p>
<pre><code>$ sudo apt-get install libreadline5-dev libbz2-dev tcl8.5-dev tk8.5-dev libsqlite3-dev</code></pre>
<p>You need to update the above package list if the Python modules you need are not being built.  You will be told which packages were not built, when <code>make</code> finishes.</p>
<p>Then</p>
<pre><code>$ tar -jxf Python-2.6.4.tar.bz2
$ cd Python-2.6.4
$ ./configure
$ make
$ sudo make install</code></pre>
<p>That&#8217;s it.  Nothing different about AMD64.  Note that before doing <code>sudo make install</code>, you may wish to remove <em>/usr/local/lib/python2.6/site-packages</em> directory especially if you have a previous installation of Python 32-bit system.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=677</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Installing 64-bit CFITSIO 3.181 on Mac OS X Leopard</title>
		<link>http://okomestudio.net/biboroku/?p=640</link>
		<comments>http://okomestudio.net/biboroku/?p=640#comments</comments>
		<pubDate>Thu, 11 Mar 2010 19:12:59 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Leopard]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Research]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=640</guid>
		<description><![CDATA[It turns out that the data I&#8217;m working on now are too big for 32-bit programs to handle!! So along side Scisoft OS X which is all 32-bit, I need to install 64-bit version of CFITSIO since many programs depend &#8230; <a href="http://okomestudio.net/biboroku/?p=640">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>It turns out that the data I&#8217;m working on now are too big for 32-bit programs to handle!!</p>
<p>So along side Scisoft OS X which is all 32-bit, I need to install 64-bit version of <a href="http://heasarc.nasa.gov/docs/software/fitsio/fitsio.html">CFITSIO</a> since many programs depend on this library.</p>
<p>I install from the tarball (located <a href="ftp://heasarc.gsfc.nasa.gov/software/fitsio/c/cfitsio3240.tar.gz">here</a>) downloaded into a temporary directory (e.g., /usr/local/src/cfitsio).  I use version 3.181.</p>
<p>Follow this:</p>
<blockquote>
<pre>$ mkdir /usr/local/src/cfitsio  # Need right permissions of course...
$ cd /usr/local/src/cfitsio
$ wget ftp://heasarc.gsfc.nasa.gov/software/fitsio/c/cfitsio3240.tar.gz
$ gunzip -c cfits*.gz | tar xvf -
$ cd cfitsio
$ export CFLAGS="-arch i386 -arch x86_64 -g -O2"
$ ./configure
$ make
$ sudo make install</pre>
</blockquote>
<p>(Key is to use &#8220;x86_64&#8243; architecture when compiling.)</p>
<p>This actually installs library and header files under /usr/local/src/cfitsio/cfitsio/lib and /usr/local/src/cfitsio/cfitsio/include.   Read <tt>./configure --help</tt> if you wish to install them in different locations; for example, doing <tt>./configure --prefix=/usr/local</tt> in the procedure above should get the library installed on the &#8220;standard&#8221; /usr/local locations.</p>
<p>That should be it!  When building a program linking to this library, you need to specify the &#8220;lib&#8221; and &#8220;include&#8221; directory paths when configuring make for the program.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=640</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Installing HOTPANTS 5.1.10 on Mac OS X Leopard</title>
		<link>http://okomestudio.net/biboroku/?p=636</link>
		<comments>http://okomestudio.net/biboroku/?p=636#comments</comments>
		<pubDate>Wed, 10 Mar 2010 22:21:18 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Leopard]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Research]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=636</guid>
		<description><![CDATA[You must love the name, but what the software does is far from sultry; it&#8217;s a piece of geekware. Anyways, I needed to edit files when I install HOTPANTS, photometric alignment utility by Andrew Becker.  Here is my installation note &#8230; <a href="http://okomestudio.net/biboroku/?p=636">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>You must love the name, but what the software does is far from sultry; it&#8217;s a piece of geekware.</p>
<p>Anyways, I needed to edit files when I install <a href="http://www.astro.washington.edu/users/becker/hotpants.html">HOTPANTS</a>, photometric alignment utility by Andrew Becker.  Here is my installation note before I forget.</p>
<p>HOTPANTS requires <a href="http://heasarc.nasa.gov/docs/software/fitsio/fitsio.html">CFITSIO</a> to be already installed.  On Leopard I use <a href="http://web.mac.com/npirzkal/Scisoft/Scisoft.html">Scisoft OS X</a>, so I don&#8217;t have to install CFITSIO separately.  Otherwise you have to install CFITSIO first.</p>
<p>Download the <a href="http://www.astro.washington.edu/users/becker/software/hotpants_v5.1.10.tar.gz">tarball</a> and expand it into a temporary directory.</p>
<p>First, you need to delete (or comment out) the line which reads</p>
<blockquote>
<pre>#include&lt;malloc.h&gt;
</pre>
</blockquote>
<p>from all *.c source code files.</p>
<p>Then modify Makefile.  To link CFITSIO properly, modify CFITSIOINCDIR and LIBDIR:</p>
<blockquote>
<pre>CFITSIOINCDIR=/Applications/scisoft/i386/Packages/cfitsio/include
LIBDIR=/Applications/scisoft/i386/Packages/cfitsio/lib</pre>
</blockquote>
<p>This is fine if you have Scisoft OS X.  If you installed CFITSIO elsewhere, you have to find the paths yourself.</p>
<p>You should also remove the &#8220;-pedantic-errors&#8221; option from COPTS so that the line reads like:</p>
<blockquote>
<pre>COPTS= -funroll-loops -O3 -ansi -Wall -I$(CFITSIOINCDIR)
</pre>
</blockquote>
<p>Then run <tt>make</tt> within the same directory.</p>
<p>That&#8217;s it.  You might wish to copy the binaries <tt>hotpants</tt>, <tt>extractkern</tt>, and <tt>maskim</tt> to one of those bin directories in your PATH.</p>
<h2>Building 64-bit HOTPANTS</h2>
<p>The 64-bit version of HOTPANTS is twice as sultry, I need to try it.  The change is that you need to first <a href="http://nomo17k.wordpress.com/2010/03/11/installing-64-bit-cfitsio-3-181-on-mac-os-x-leopard/">build 64-bit version of CFITSIO</a>.</p>
<p>The procedure is basically similar to the one above, with a couple of changes:</p>
<blockquote>
<pre>CFITSIOINCDIR=/usr/local/src/cfitsio/cfitsio/include
LIBDIR=/usr/local/src/cfitsio/cfitsio/lib</pre>
</blockquote>
<p>Basically you need to point them to the locations where you installed the 64-bit CFITSIO; see the CFITSIO installation note using the link above.  Another change is in the compiler options:</p>
<blockquote>
<pre>COPTS= -m64 -funroll-loops -O3 -ansi -Wall -I$(CFITSIOINCDIR)
</pre>
</blockquote>
<p>These should be the only difference.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=636</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Installing SExtractor 2.8.6 on Mac OS X Leopard</title>
		<link>http://okomestudio.net/biboroku/?p=631</link>
		<comments>http://okomestudio.net/biboroku/?p=631#comments</comments>
		<pubDate>Tue, 09 Mar 2010 23:37:09 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[astro]]></category>
		<category><![CDATA[install procedure]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[OS X/Leopard]]></category>
		<category><![CDATA[SExtractor]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=631</guid>
		<description><![CDATA[NOTE: This is an old article and there is a newer one which I believe is more thorough.  Please read that one instead. This was yet another painful experience trying to find out the best way to compile software with &#8230; <a href="http://okomestudio.net/biboroku/?p=631">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>NOTE: This is an old article and there is a <a href="http://okomestudio.net/biboroku/?p=824">newer one</a> which I believe is more thorough.  Please read that one instead.</p>
<p>This was yet another painful experience trying to find out the best way to compile software with minimal effort on OS X.  Yes, it required such an enormous minimal effort; hence my installation note.  Anyways, SExtractor requires ATLAS and FFTW, both programs of which I don&#8217;t really wish to build myself.  I wanted to use pre-compiled binaries, but I ended up doing a hybrid installation after attempts to get it compiled with Fink versions of ATLAS and FFTW failed.</p>
<p>First, I installed FFTW from source.  Just download a tarball into a temporary directory, uncompress, and do the usual make routine:</p>
<pre><code>$ wget http://www.fftw.org/fftw-3.2.2.tar.gz
$ gunzip -c fftw*.gz | tar xvf -
$ cd fftw-3.2.2
$ ./configure --enable-threads
$ make
$ sudo make install</code></pre>
<p>Then I installed the MacPort version of ATLAS.  Downloaded a binary for MacPort, installed it, and then from command line:</p>
<pre><code>$ sudo port install atlas</code></pre>
<p>I assume FFTW was installed at /usr/local, and ATLAS at /opt/local.</p>
<p>Download the SExtractor source into a temporary directory:</p>
<pre><code>$ wget ftp://ftp.iap.fr/pub/from_users/bertin/sextractor/sextractor-2.8.6.tar.gz
$ gunzip -c sex*.gz | tar xvf -
$ cd sextractor-2.8.6
$ ./configure --with-atlas=/opt/local/lib --with-atlas-incdir=/opt/local/include
    --with-fftw=/usr/local/lib --with-fftw-incdir=/usr/local/include
$ make
$ sudo make install</code></pre>
<p>This should make and install under /usr/local/bin an executable file called &#8220;sex.&#8221;  Totally worth it after wasting all these hours.</p>
<h2>PSFex</h2>
<p>The stable version of the software appears not public yet, but in addition to above, the single precision version of FFTW needs to be installed.  Go to the FFTW source tree, and redo the make proces with different configuration:</p>
<pre><code>$ make clean
$ ./configure --enable-threads --enable-single
$ make
$ sudo make install</code></pre>
<p>This should install libfftw3f.la, libfftw3f_threads.a libfftw3f_threads.la under /usr/local/lib.</p>
<p>Then simply do ./configure; make; sudo make install under the PSFex source tree.  That should do it.  I&#8217;m sure that I&#8217;m not linking to other optional libraries (since I didn&#8217;t specify with ./configure).  But I&#8217;ll add to this if I find them necessary later&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=631</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Installing wxPython 2.8 on Debian Lenny</title>
		<link>http://okomestudio.net/biboroku/?p=622</link>
		<comments>http://okomestudio.net/biboroku/?p=622#comments</comments>
		<pubDate>Mon, 08 Mar 2010 04:06:35 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Debian/Lenny]]></category>
		<category><![CDATA[install procedure]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=622</guid>
		<description><![CDATA[Actually Debian has the python-wxgtk2.8 package which you can simply apt-get if you wish to have it installed as part of Python 2.5 which is the stable version for Lenny.  I&#8217;m adding wxPython 2.8 to Python 2.6, which I installed &#8230; <a href="http://okomestudio.net/biboroku/?p=622">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Actually Debian has the <em>python-wxgtk2.8</em> package which you can simply apt-get if you wish to have it installed as part of Python 2.5 which is the stable version for Lenny.  I&#8217;m adding wxPython 2.8 to Python 2.6, which I installed from source.</p>
<p>I mostly followed what the <a href="http://www.wxpython.org/builddoc.php">official wxPython installation guide</a> says.  It was not a smooth installation for me, so this is my own installation note.  The version is 2.8.10.1.</p>
<p>First, download the <a href="http://downloads.sourceforge.net/wxpython/wxPython-src-2.8.10.1.tar.bz2">tarball for wxPython from the official repository</a>.  Here I assume the archive is downloaded to <em>/usr/local/src/wx</em>.</p>
<p>Some libraries need to be installed since wxWidgets will be built against them:</p>
<pre><code>$ sudo apt-get install libgtk2.0-dev libglu1-mesa-dev</code></pre>
<p>You need to first build wxWidgets, and then build extension module for wxPython.  Anyways, decompress and untar, and create a working directory for building wxWidgets:</p>
<pre><code>$ bunzip2 -c wxPython-src-2.8.10.1.tar.bz2 | tar xvf -
$ cd wxPython-src-2.8.10.1
$ mkdir bld
$ cd bld</code></pre>
<p>In the bld directory, create a file named .configure with the following content:</p>
<pre><code>#!/bin/sh
../configure \
 --prefix=/usr/local/lib/wx/2.8 \
 --with-gtk \
 --with-gnomeprint \
 --with-opengl \
 --with-libjpeg=builtin \
 --with-libpng=builtin \
 --with-libtiff=builtin \
 --with-zlib=builtin \
 --enable-optimize \
 --enable-geometry \
 --enable-graphics_ctx \
 --enable-sound --with-sdl \
 --enable-mediactrl \
 --enable-display \
 --enable-unicode \
 --enable-rpath=/usr/local/lib/wx/2.8/lib</code></pre>
<p>Here I am assuming the newly build wxWidgets library will be installed under <em>/usr/local/lib/wx/2.8</em>.  You may change the installation location, of course.  For details on what these switches will do, refer to the official installation guide for wxPython.</p>
<p>Create a file named .make with the following content:</p>
<pre><code>#!/bin/sh
make $* &amp;&amp; make -C contrib/src/gizmos $* &amp;&amp; make -C contrib/src/stc $*</code></pre>
<p>Give both the files an executable permision, and do the usual thing:</p>
<pre><code>$ chmod +x .configure
$ chmod +x .make
$ ./.configure

...

$ ./.make
$ sudo ./.make install</code></pre>
<p>If this process ends without errors, you are ready to install wxPython. Before you run <em>setup.py</em>, however, you need to patch a source file.  Download this <a href="http://devide.googlecode.com/svn/trunk/johannes/patches/wxpython28101_gdiwrap.diff">diff file</a> to the top installation directory (i.e., wxPython-src-2.8.10.1) and run the patch:</p>
<pre><code>$ cd ..
$ wget http://devide.googlecode.com/svn/trunk/johannes/patches/wxpython28101_gdiwrap.diff
$ patch -p0 &lt; wxpython28101_gdiwrap.diff</code></pre>
<p>After the patch is applied correctly, move to <em>wxPython</em> directory:</p>
<pre><code>$ cd wxPython</code></pre>
<p>Now, in <em>config.py</em>, you need to find the line that starts with WX_CONFIG and set the variable to the path to wx-config script, <em>/usr/local/lib/wx/2.8/bin/wx-config</em> in our case:</p>
<pre><code>WX_CONFIG = '/usr/local/lib/wx/2.8/bin/wx-config'</code></pre>
<p>Then finally install the wxPython package:</p>
<pre><code>$ python2.6 setup.py build_ext --inplace
$ sudo python2.6 setup.py install</code></pre>
<p>Here I&#8217;m running <em>setup.py</em> as a Python 2.6 script since I want to install wx into the <em>site-packages</em> directory for Python 2.6.</p>
<pre><code>$ python2.6
$ import wx</code></pre>
<p>If this gives no ImportError, it is a success.  If you receive an error, check the permission of <em>wx.pth</em> under<em>site-packages</em>; the file must be world readable (i.e., 644).</p>
<p>To avoid ImportError upon importing wx in Python, you need to add the following line in ~/.bashrc (or ~/.bash_profile):</p>
<pre><code>export LD_LIBRARY_PATH=/usr/local/lib/wx/2.8/lib:${LD_LIBRARY_PATH}</code></pre>
<p>That&#8217;s it.  Make sure &#8220;import wx&#8221; works under python2.6.  If not, well&#8230;</p>
<h4>TODO</h4>
<p>I want to have wx loaded without specifying LD_LIBRARY_PATH.  Using the &#8211;enable-rpath option is supposed to do this, but it apparently doesn&#8217;t for me.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=622</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Installing Python 2.6 on Mac OS X Leopard</title>
		<link>http://okomestudio.net/biboroku/?p=616</link>
		<comments>http://okomestudio.net/biboroku/?p=616#comments</comments>
		<pubDate>Fri, 05 Mar 2010 22:00:19 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[install procedure]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[OS X/Leopard]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=616</guid>
		<description><![CDATA[It is such a pain in the ass to deal with this weird hybrid system called Mac OS X, but I want to start migrating my tools to Python 2.6 in anticipation of eventually porting to Python 3. It didn&#8217;t &#8230; <a href="http://okomestudio.net/biboroku/?p=616">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>It is such a pain in the ass to deal with this weird hybrid system called Mac OS X, but I want to start migrating my tools to Python 2.6 in anticipation of eventually porting to Python 3.  It didn&#8217;t go as smoothly as I wanted, so here is my installation note.</p>
<p>First, download the Mac Installer Disk Image from the <a href="http://www.python.org/download/">official Python website</a>.  The version I use here is 2.6.4.  Just double-click the .dmg file and you can follow the GUI instruction.  Easy enough.</p>
<p>Now, one of the packages that I need to install later requires Tkinter.  After installing Python 2.6.4, check if the Tkinter module loads properly:</p>
<pre><code>$ python2.6
&gt;&gt;&gt; import Tkinter</code></pre>
<p>If you get no error, fine.  However you may be unlucky (like myself) and get an error indicating the Python installation has problem linking to Tk.  If that happens, download and install <a href="http://www.activestate.com/activetcl/downloads/">the latest 8.4 version of ActiveTcl</a>.  After that, the problem should go away.  I wasted a few hours trying to figure this out.  (I wish I could just stick to good old Linux systems&#8230;  Oh well.)</p>
<p>The default version of Python in Leopard is 2.5, so at this point both versions should be coexisting.  You can still use version 2.5 by explicitly calling the executable:</p>
<pre><code>$ python2.5  # This calls Python 2.5.
$ python2.6  # This calls Python 2.6.</code></pre>
<p>It appears the Python installer adds &#8220;/Library/Frameworks/Python.framework/Versions/2.6/bin:${PATH}&#8221; to the PATH environment variable in ~/.bash_profile.  If this is not desired, you need to tweak it there, after installing Python packages where Mac binaries exist (I think you need to ensure that Python 2.6 is used by default when installing binary packages via .dmg; otherwise you may overwrite existing installations for Python 2.5).</p>
<p>Basically this should get you going.  It is a very minimal installation but you can keep adding packages you need in standard manner.  The important thing is to explicitly run setup.py scripts via python2.6, so that the packages get installed under the site-packages directory for Python 2.6 and not for Python 2.5.</p>
<h2>Packages for Astrophysics</h2>
<p>For the packages where binaries do not exist (e.g., ipython, nose, readline, Pmw, urwid, stsci_python), I installed them from source.  Just made sure that I did &#8220;python2.6 setup.py install.&#8221;</p>
<p>I installed numpy, scipy, matplotlib, and wxPython (v2.8) using binaries available from their official websites.</p>
<p>So far, there has been no problem.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=616</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SExtractor</title>
		<link>http://okomestudio.net/biboroku/?p=613</link>
		<comments>http://okomestudio.net/biboroku/?p=613#comments</comments>
		<pubDate>Fri, 26 Feb 2010 21:23:13 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Research]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=613</guid>
		<description><![CDATA[Just a reminder for myself: The SExtractor convention is that the first pixel in a coordinate is indexed by one, not zero.]]></description>
				<content:encoded><![CDATA[<p>Just a reminder for myself:  The SExtractor convention is that the first pixel in a coordinate is indexed by one, not zero.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=613</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cooking Japanese Rice</title>
		<link>http://okomestudio.net/biboroku/?p=605</link>
		<comments>http://okomestudio.net/biboroku/?p=605#comments</comments>
		<pubDate>Sat, 06 Feb 2010 21:16:46 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Cooking]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=605</guid>
		<description><![CDATA[Just a reminder for myself on how to cook short-grain rice of sticky kind, with a regular pot. The amount will be good for three servings or four, depending on how much you like rice.  The exact timing is give &#8230; <a href="http://okomestudio.net/biboroku/?p=605">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Just a reminder for myself on how to cook short-grain rice of sticky kind, with a regular pot.  The amount will be good for three servings or four, depending on how much you like rice.  The exact timing is give or take.</p>
<ol>
<li>Take 360 mL of rice and wash and rinse repeatedly until water becomes clear.</li>
<li>Fill the pot with the rice and 400 mL of water, and cover with a lid.  Let it sit for about 15 minutes.</li>
<li>Bring the rice to boil, with medium to high heat (with my electric stove, this is 6/8 and takes about 6.5 minutes).</li>
<li>Once boiling, turn down the heat to medium low, until &#8220;holes&#8221; starts to appear (4/8 and takes about 1.5 minutes).</li>
<li>Bring the heat to low (2/8 and 5 minutes).</li>
<li>Turn the heat to max for 10 seconds to blow off excess water.</li>
<li>Turn the heat off and let it sit for about 15 minutes.</li>
<li>Fluff it up and serve!</li>
</ol>
<p>That&#8217;s it.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=605</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>scipy.interpolate.bisplrep</title>
		<link>http://okomestudio.net/biboroku/?p=601</link>
		<comments>http://okomestudio.net/biboroku/?p=601#comments</comments>
		<pubDate>Wed, 20 Jan 2010 23:06:27 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=601</guid>
		<description><![CDATA[Tried using scipy.interpolate.bisplrep to obtained a smooth interpolated image. It turns out that this function is not capable of handling 2D image when one side is more than 256 pixels. This should be documented in SciPy&#8230; Just a note for &#8230; <a href="http://okomestudio.net/biboroku/?p=601">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Tried using scipy.interpolate.bisplrep to obtained a smooth interpolated image.  It turns out that this function is not capable of handling 2D image when one side is more than 256 pixels.</p>
<p>This should be documented in SciPy&#8230;</p>
<p>Just a note for myself, hoping not to make the same damn mistake again.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=601</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wacom Intuos Tablet on Debian Lenny</title>
		<link>http://okomestudio.net/biboroku/?p=595</link>
		<comments>http://okomestudio.net/biboroku/?p=595#comments</comments>
		<pubDate>Sun, 17 Jan 2010 01:46:38 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Lenny]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=595</guid>
		<description><![CDATA[First, install a package: # apt-get install wacom-tools Add the following lines to /etc/X11/xorg.conf: # Device entries for Wacom Intuous: Section "InputDevice" Identifier "stylus" Driver "wacom" Option "Type" "stylus" Option "Mode" "Absolute" Option "USB" "on" Option "Threshold" "10" Option "Tilt" &#8230; <a href="http://okomestudio.net/biboroku/?p=595">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>First, install a package:</p>
<blockquote><pre>
# apt-get install wacom-tools
</pre>
</blockquote>
<p>Add the following lines to /etc/X11/xorg.conf:</p>
<blockquote><pre>
# Device entries for Wacom Intuous:
Section "InputDevice"
	Identifier	"stylus"
	Driver		"wacom"
	Option		"Type"		"stylus"
	Option		"Mode"		"Absolute"
	Option		"USB"		"on"
	Option		"Threshold"	"10"
	Option		"Tilt"		"on"
	Option		"Device"	"/dev/input/wacom"
EndSection

Section "InputDevice"
	Identifier	"eraser"
	Driver		"wacom"
	Option		"Type"		"eraser"
	Option		"Mode"		"Absolute"
	Option		"USB"		"on"
	Option		"Tilt"		"on"
	Option		"Threshold"	"10"
	Option		"Device"	"/dev/input/wacom"
EndSection

Section "InputDevice"
	Identifier	"cursor"
	Driver		"wacom"
	Option		"Type"		"cursor"
	Option		"Mode"		"Relative"
	Option		"USB"		"on"
	Option		"Threshold"	"10"
	Option		"Device"	"/dev/input/wacom"
EndSection

Section "InputDevice"
	Identifier	"pad"
	Driver		"wacom"
	Option		"Device"	"/dev/input/wacom"
	Option		"Type"		"pad"
	Option		"USB"		"on"
EndSection

# Add InputDevice lines in SeverLayout:
Section "ServerLayout"
	...

	InputDevice	"stylus"	"SendCoreEvents"
	InputDevice	"eraser"	"SendCoreEvents"
	InputDevice	"cursor"	"SendCoreEvents"
	InputDevice	"pad"		""
EndSection
</pre>
</blockquote>
<p>Reboot (or insert wacom module).</p>
<h2>Using with GIMP</h2>
<p>To use cool features like pressure sensitivity and eraser with GIMP, go to: File -&gt; Preferences -&gt; Input Devices -&gt; Configure Extended Input Devices, and set stylus, cursor, eraser, pad to “Screen.” This should be it!</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=595</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>python-sao</title>
		<link>http://okomestudio.net/biboroku/?p=592</link>
		<comments>http://okomestudio.net/biboroku/?p=592#comments</comments>
		<pubDate>Mon, 04 Jan 2010 04:35:27 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Research]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=592</guid>
		<description><![CDATA[Man, pysao is extremely useful.  Controlling DS9 from Python has never been easier.  Thank you, whoever is developing the software.]]></description>
				<content:encoded><![CDATA[<p>Man, <a href="http://code.google.com/p/python-sao/">pysao</a> is extremely useful.  Controlling DS9 from Python has never been easier.  Thank you, whoever is developing the software.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=592</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&quot;Line in&quot; doesn&#039;t work by default on Leopard</title>
		<link>http://okomestudio.net/biboroku/?p=590</link>
		<comments>http://okomestudio.net/biboroku/?p=590#comments</comments>
		<pubDate>Tue, 29 Dec 2009 20:56:24 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Leopard]]></category>
		<category><![CDATA[Mac OS X]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=590</guid>
		<description><![CDATA[How lame&#8230; Fortunately there is an application called LineIn which makes possible pass through (sounds coming in at line in goes to line out directly).  Just install it and enable &#8220;Pass Thru.&#8221;  That&#8217;s it.]]></description>
				<content:encoded><![CDATA[<p>How lame&#8230;</p>
<p>Fortunately there is an application called <a href="http://www.rogueamoeba.com/freebies/">LineIn</a> which makes possible pass through (sounds coming in at line in goes to line out directly).  Just install it and enable &#8220;Pass Thru.&#8221;  That&#8217;s it.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=590</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PyRAF Tips</title>
		<link>http://okomestudio.net/biboroku/?p=576</link>
		<comments>http://okomestudio.net/biboroku/?p=576#comments</comments>
		<pubDate>Fri, 27 Nov 2009 20:55:06 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Research]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=576</guid>
		<description><![CDATA[The Standard Calling Sequence for an IRAF Task within a Python Script This is just an example of how to run an IRAF task as if it is part of a Python module using PyRAF. It ensures that the task &#8230; <a href="http://okomestudio.net/biboroku/?p=576">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<h3>The Standard Calling Sequence for an IRAF Task within a Python Script</h3>
<p>This is just an example of how to run an IRAF task as if it is part of a Python module using PyRAF.  It ensures that the task parameters are set to their default values, and a user overrides only those parameters which need to be customized for a particular task.</p>
<blockquote><p><code>
<pre>

#!/usr/bin/env python
from pyraf import iraf
from pyraf.irafpar import IrafParList


def default_irafpar(task):
    # Return the IrafParList object for default parameters.
    return IrafParList(task.getName(), parlist=task.getDefaultParList())


def main():
    # Load IRAF packages.
    iraf.gemini(_doprint=0)
    iraf.gmos(_doprint=0)

    # Get default parameters and override some.
    yes, no = 'yes', 'no'
    plist = default_irafpar(iraf.gprepare)
    plist.setParList(inimages = 'someimage.fits',
                     rawpath = '/astro/data/',
                     fl_addmdf = yes,
                     mdfdir = '../mdf/',
                     logfile = '',
                     verbose = yes)

    # Run the task.
    iraf.gsprepare(ParList=plist)

    return


if __name__ == '__main__':
    main()



</pre>
<p></code>
</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=576</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Freemind on Debian Lenny</title>
		<link>http://okomestudio.net/biboroku/?p=573</link>
		<comments>http://okomestudio.net/biboroku/?p=573#comments</comments>
		<pubDate>Sun, 15 Nov 2009 04:15:48 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Lenny]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=573</guid>
		<description><![CDATA[Download .deb from Freemind&#8217;s sourceforge web page, e.g., freemind_0.8.1-2_all.deb. Then # apt-get install sun-java6-jre # apt-get install libcommons-codec-java libcommons-lang-java libjcalendar-java # apt-get install libjgoodies-forms-java librelaxng-datatype-java # dpkg -i freemind_0.8.1-2_all.deb Add the following line to ~/.bashrc: export JAVA_HOME=/usr/lib/jvm/java-6-sun (Without the environment &#8230; <a href="http://okomestudio.net/biboroku/?p=573">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Download .deb from Freemind&#8217;s <a href="http://sourceforge.net/projects/freemind/files/freemind-deb/">sourceforge web page</a>, e.g., freemind_0.8.1-2_all.deb.  Then</p>
<blockquote><p>
# apt-get install sun-java6-jre<br />
# apt-get install libcommons-codec-java libcommons-lang-java libjcalendar-java<br />
# apt-get install libjgoodies-forms-java librelaxng-datatype-java<br />
# dpkg -i freemind_0.8.1-2_all.deb
</p></blockquote>
<p>Add the following line to ~/.bashrc:</p>
<blockquote><p>
export JAVA_HOME=/usr/lib/jvm/java-6-sun
</p></blockquote>
<p>(Without the environment variable set, I could not get freemind to run at all.)  You can then launch it by typing freemind on the shell or choose the program in the menu under office.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=573</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>KCorrect: kcorrect Python Port Project</title>
		<link>http://okomestudio.net/biboroku/?p=539</link>
		<comments>http://okomestudio.net/biboroku/?p=539#comments</comments>
		<pubDate>Sun, 02 Aug 2009 21:01:18 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Research]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=539</guid>
		<description><![CDATA[By Taro Sato (taro at ap.smu.ca) NOTE: This is a page for my old side programming project, on astrophysical computing.  I just moved it here since I haven&#8217;t been tracking access and therefore I don&#8217;t know if there has been &#8230; <a href="http://okomestudio.net/biboroku/?p=539">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<h3>By Taro Sato (taro at ap.smu.ca)</h3>
<p><em>NOTE: This is a page for my old side programming project, on astrophysical computing.  I just moved it here since I haven&#8217;t been tracking access and therefore I don&#8217;t know if there has been any serious interest in doing k correction on Python rather than IDL.  If anyone is seriously interested in doing k correction with Python, this whole thing can be made into an open source project for communal use (if we can obtain an approval from the original library developer).</em></p>
<p>KCorrect is an attempt to wrap some of the utilities available in<a href="http://cosmo.nyu.edu/mb144/kcorrect/"><strong> kcorrect</strong> written by Michael Blanton</a> into an easy-to-use Python package.<strong> kcorrect</strong> is a collection of C/IDL codes which implements k corrections and photometric redshifts with broad-band photometry (and much more).</p>
<h2><a href="http://ap.smu.ca/~taro/software/kcorrect/KCorrect-0.2.1.tar.gz">Download Version 0.2.1</a></h2>
<h3>Motivation</h3>
<p>With <a href="http://numpy.scipy.org/">NumPy</a> quickly maturing into the standard platform for scientific computing with Python, there should be an increasing interest in carrying out astronomical data analysis on Python in near future.  Python is a well-designed programming language offering astronomers a simple-to-use yet very powerful platform with all the advantages of a modern programming language (e.g., object orientation, exceptions, namespace) as well as the simplicity of a scripting language, not to mention it is FREE.  We (actually I&#8230;as of now) hope to contribute to the increase in the usage of Python among astrophysicists.</p>
<h3>Conditions of Use</h3>
<p>Since KCorrect is simply a Python wrapper to kcorrect (v4_1_4), users are requested to follow the conditions of use described in <a href="http://cosmo.nyu.edu/mb144/kcorrect/">kcorrect distribution website</a>.</p>
<p><span style="text-decoration:line-through;">No extra citation is necessary on the use of the Python version</span>.  I changed my mind because there are too many people who are not very sincere.  Please acknowledge the use of this Python version clearly, if you ever use a portion of this program in your published work</p>
<p>Also, please do not modify the program yourself.  If you wish to do that, please consider contributing to the project instead, rather than secretly using it to your liking and don&#8217;t even acknowledge somebody else&#8217;s effort on which you build your work.</p>
<p>Although we do attemp to ensure that users obtain similar results to the IDL version when desired, bugs are a fact of life; please report bugs and comments to Taro Sato (email address given above) if you suspect the problems occur with the Python version.</p>
<h3>General Description</h3>
<p>The general concepts of k corrections are well documented in Michael Blanton&#8217;s <a href="http://cosmo.nyu.edu/mb144/kcorrect/">kcorrect distribution website</a>; users of KCorrect are urged to learn the principles behind the software by throughly reading his documentation.  There is also an <a href="http://adsabs.harvard.edu/cgi-bin/nph-bib_query?bibcode=2002astro.ph.10394H&amp;db_key=PRE&amp;data_type=HTML&amp;format=&amp;high=40c0dc207d00856">article written by David Hogg</a> which may be of interest for users of kcorrect.</p>
<p>The KCorrect Python port project is totally a volunteer effort by those who love to code in Python, so we have not implemented all the rich functionalities already available in the IDL version of kcorrect (it is slow going without external contributions; please let me know if you can contribute a tiny bit).</p>
<h3>Currently Available Functionalities</h3>
<ul>
<li>Core implementation of k correction</li>
<li>High-level interface for some redshift surveys (so far only SDSS and DEEP)</li>
</ul>
<h3>Installing KCorrect</h3>
<p>This version of KCorrect requires the following software to be already installed on your machine:</p>
<ul>
<li>Python 2.5.2 or better (http://www.python.org/)</li>
<li>NumPy 1.3 or better (http://www.scipy.org/Download/)</li>
<li>SWIG 1.3.36 or better (http://www.swig.org/)</li>
</ul>
<p>Download the snapshot version <a href="http://ap.smu.ca/~taro/software/kcorrect/KCorrect-0.2.1.tar.gz">here</a>. README.txt included in the tarball has a detailed installation instruction.  If you already have a working installation of the IDL version of kcorrect (which is a requirement), the standard python method</p>
<pre> $ python setup.py install</pre>
<p>should simply work.</p>
<h3>Usage</h3>
<p>Here is an example IPython session:</p>
<pre>In [1]: import KCorrect as KC

In [2]: maggie = [1., 4.78, 10.96, 14.45, 19.05]

In [3]: maggie_ivar = [1100., 28., 7.7, 4.4, 2.5]

In [4]: redshift = 0.03

In [5]: filters = KC.FilterList(['sdss_u0.par','sdss_g0.par','sdss_r0.par',
   ...:                          'sdss_i0.par','sdss_z0.par'])

In [6]: kc = KC.KCorrect()

In [7]: kc.set_data(redshift, filters, maggie, maggie_ivar)

In [8]: print kc.kcorrect(band_shift=0.1)
[[-0.38402203 -0.33727303 -0.19066639 -0.15796432 -0.13370053]]</pre>
<p>The above example is to be compared to the one given at <a href="http://cosmo.nyu.edu/mb144/kcorrect/">kcorrect distribution website</a>.  What we wanted to do with the Python version is to hide the part of implementation that users really do not want to deal with (e.g., conversions to &#8220;AB maggies,&#8221; preserving the projection table or the template spectra, etc.).  A more typical usage goes like this:</p>
<pre>In [11]: redshift = [1.029, 0.9581]

In [12]: deepmag = [[23.112, 22.363, 21.690],[24.668, 23.878, 23.248]]

In [13]: kc = KC.KCorrectDEEP(cosmo=(0.3,0.7,1.0))

In [14]: kc.set_data(redshift, deepmag)

In [15]: print kc.absmag()
[[-21.2052002  -21.69138336 -21.85865593]
 [-19.35534096 -19.64371872 -19.71680069]]

In [16]: vega2ab = KC.vega2ab(kc.filter_list)

In [17]: print kc.absmag() - vega2ab
[[-21.0925668  -21.93185531 -22.3164852 ]
 [-19.24270756 -19.88419066 -20.17462996]]

In [18]: bessell = KC.FilterList(['bessell_V.par','bessell_R.par'])

In [19]: print kc.appmag(filter_list=bessell)
[[ 22.75250435  22.36059952]
 [ 24.18490219  23.83894157]]</pre>
<p>Note that the classes in KCorrect package are designed so that users need to define the minimal set of input data.  Fine tuning of parameters (e.g., assumed cosmology above) can generally be done using optinal input arguments.  We also implement some auxiliary functions such as:</p>
<pre>In [28]: KC.get_available_filters()</pre>
<p>which returns the list of all available filter file names.</p>
<h3>Documentation</h3>
<p>At this point, no fancy documentation is available besides this web page.  We strive to document the software using Python&#8217;s native docstrings.  For example, doing</p>
<pre>In [29]: help(KC.KCorrectDEEP)</pre>
<p>should give you more detailed information about KCorrectDEEP class in KCorrect package.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=539</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Setting Up Squid Proxy Server on Mac OS X Leopard</title>
		<link>http://okomestudio.net/biboroku/?p=529</link>
		<comments>http://okomestudio.net/biboroku/?p=529#comments</comments>
		<pubDate>Thu, 30 Jul 2009 20:47:33 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[install procedure]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[OS X/Leopard]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=529</guid>
		<description><![CDATA[My goal is to set up a very basic proxy server on my Mac box on campus, so that I can have full access to subscription-based academic journals via the proxy on my laptop even when I am off campus.  &#8230; <a href="http://okomestudio.net/biboroku/?p=529">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>My goal is to set up a very basic proxy server on my Mac box on campus, so that I can have full access to subscription-based academic journals via the proxy on my laptop even when I am off campus.  Some schools provide such (library) proxies but my school unfortunately does not.  I want to set it up such that the proxy requires a password authentication in order not to make it wide open to the public.</p>
<h3>Getting and Installing Squid</h3>
<p><a href="http://www.squid-cache.org/Versions/v2/2.7/">Download a tarball</a> for a stable version from the repository.  The version that I use here is 2.7.  I assume the file is downloaded to <em>/usr/local/src/squid</em>.</p>
<pre><code>$ cd /usr/local/src/squid
$ gunzip -c squid-2.7.STABLE6.tar.gz | tar xvf -
$ cd squid-2.7.STABLE6
$ ./configure
$ make
$ sudo make install
$ cd helpers/basic_auth/NCSA
$ make
$ sudo make install
$ sudo chown -R nobody /usr/local/squid/var
$ sudo /usr/local/squid/sbin/squid -z</code></pre>
<p>Squid will be installed at <em>/usr/local/squid</em>.  (The last command is necessary to run a daemon as user <em>nobody</em>.)</p>
<h3>Configure Squid</h3>
<p>First, prepare a NCSA-compliant encrypted password file for a user (here with username <em>johndoe</em>):</p>
<pre><code>$ cd /usr/local/squid/etc
$ sudo touch squid_passwd
$ sudo chmod o+r squid_passwd
$ sudo htpasswd squid_passwd johndoe
New password:
Re-type new passwod:
Adding passwod for user johndoe</code></pre>
<p>Now, edit <em>/usr/local/squid/etc/squid.conf</em>.  The following lines need to be added:</p>
<pre><code># Add this to the auth_param section
auth_param basic program /usr/local/squid/libexec/ncsa_auth /usr/local/squid/etc/squid_passwd

# Add this to the bottom of the ACL section
acl ncsa_users proxy_auth REQUIRED

# Add this at the top of the http_access section
http_access allow ncsa_users</code></pre>
<p>Finally, run the server:</p>
<pre><code>$ sudo /usr/local/squid/sbin/squid -N -d 1 -D</code></pre>
<p>Firewall will prompt me to see if I allow incoming connections to squid.  Say &#8220;allow.&#8221;</p>
<p>The IP address or host name of your Mac box at the port 3128 will be available as a proxy server now.</p>
<h3>Launch Squid on Startup with launchd</h3>
<p>Under the directory <em>/Library/LaunchDaemons</em>, create a file named <em>squid.plist</em> with the following content:</p>
<pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
&lt;plist version="1.0"&gt;
  &lt;dict&gt;
    &lt;key&gt;Label&lt;/key&gt;
    &lt;string&gt;squid&lt;/string&gt;
    &lt;key&gt;OnDemand&lt;/key&gt;
    &lt;false/&gt;
    &lt;key&gt;ProgramArguments&lt;/key&gt;
    &lt;array&gt;
      &lt;string&gt;/usr/local/squid/sbin/squid&lt;/string&gt;
      &lt;string&gt;-N&lt;/string&gt;
      &lt;string&gt;-d 1&lt;/string&gt;
      &lt;string&gt;-D&lt;/string&gt;
    &lt;/array&gt;
    &lt;key&gt;ServiceIPC&lt;/key&gt;
    &lt;false/&gt;
  &lt;/dict&gt;
&lt;/plist&gt;</code></pre>
<p>Then issuing</p>
<pre><code>$ sudo launchctl load -w /Library/LaunchDaemons/squid.plist</code></pre>
<p>will launch squid.  On reboot, the proxy  should also be working automatically.</p>
<h3>Launch Squid on Startup with SystemStarter</h3>
<p>This method should be ignored in favor of the method with <tt>launchd</tt> described above.  This one is incomplete anyways&#8230;</p>
<p>This is a server so it would be convenient if the proxy starts up upon reboot automatically.  Here is a Mac way to do it:</p>
<pre><code>$ sudo mkdir /Library/StartupItems/squid
$ sudo touch /Library/StartupItems/squid/squid
$ sudo touch /Library/StartupItems/squid/StartupParameters.plist
$ sudo chmod +x /Library/StartupItems/squid/squid</code></pre>
<p>The newly created files should have contents as follows.</p>
<p>squid:</p>
<pre class="brush: bash; title: ; notranslate">#!/bin/sh

. /etc/rc.common

StartService()
{
 ConsoleMessage &quot;Starting squid&quot;
 /usr/local/squid/bin/RunCache &amp;amp;
}

StopService()
{
 ConsoleMessage &quot;Stopping squid&quot;
 # TODO: add a command to stop squid
}

RestartService()
{
 ConsoleMessage &quot;Restarting squid&quot;
 # TODO: add a command to restart squid
 StopService
 StartService
}

RunService &quot;$1&quot;</pre>
<p>StartupParameters.plist:</p>
<pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!DOCTYPE plist
 SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd"&gt;
&lt;plist version="0.9"&gt;
 &lt;dict&gt;
 &lt;key&gt;Description&lt;/key&gt;
 &lt;string&gt;squid&lt;/string&gt;
 &lt;key&gt;Provides&lt;/key&gt;
 &lt;array&gt;
 &lt;string&gt;squid&lt;/string&gt;
 &lt;/array&gt;
 &lt;key&gt;Requires&lt;/key&gt;
 &lt;array&gt;
 &lt;string&gt;Network&lt;/string&gt;
 &lt;/array&gt;
 &lt;key&gt;OrderPreference&lt;/key&gt;
 &lt;string&gt;Last&lt;/string&gt;
 &lt;/dict&gt;
&lt;/plist&gt;</code></pre>
<h3>References</h3>
<p><a href="http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch32_:_Controlling_Web_Access_with_Squid">Quick HOWTO: Ch32 : Controlling Web Access with Squid &#8211; Linux Home Networking</a></p>
<h4>Update History</h4>
<p>March 22, 2010: A minor error on the permission of &#8220;var&#8221; directory corrected.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=529</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>most (a pager application) Binary for Mac OS X Leopard</title>
		<link>http://okomestudio.net/biboroku/?p=523</link>
		<comments>http://okomestudio.net/biboroku/?p=523#comments</comments>
		<pubDate>Thu, 16 Jul 2009 20:19:24 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Leopard]]></category>
		<category><![CDATA[Mac OS X]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=523</guid>
		<description><![CDATA[My favorite pager is most, not more or less, so I build a binary. Simply gunzip and put it in your bin directory. Download MOST version 5.0.0 (S-Lang version pre2.2.0-121) for Mac OS X Leopard. No warranty of any kind &#8230; <a href="http://okomestudio.net/biboroku/?p=523">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>My favorite pager is <tt>most</tt>, not <tt>more</tt> or <tt>less</tt>, so I build a binary.  Simply gunzip and put it in your bin directory.</p>
<p><a href="http://ap.smu.ca/~taro/software/most.gz">Download</a> MOST version 5.0.0 (S-Lang version pre2.2.0-121) for Mac OS X Leopard.</p>
<p>No warranty of any kind though.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=523</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Logitech MX Revolution in Mac OS X Leopard</title>
		<link>http://okomestudio.net/biboroku/?p=514</link>
		<comments>http://okomestudio.net/biboroku/?p=514#comments</comments>
		<pubDate>Thu, 09 Jul 2009 19:27:10 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Leopard]]></category>
		<category><![CDATA[Mac OS X]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=514</guid>
		<description><![CDATA[I want to use this mouse as if it is a 3-button mouse, such that within X a middle click pastes the content in the clipboard. I find the Logitech Control Center (LCC) for Mac OS X to work just &#8230; <a href="http://okomestudio.net/biboroku/?p=514">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I want to use this mouse as if it is a 3-button mouse, such that within X a middle click pastes the content in the clipboard.</p>
<p>I find the <a href="http://www.logitech.com/index.cfm/428/130&amp;cl=ca,en?softwareid=659&amp;osid=9">Logitech Control Center (LCC) for Mac OS X</a> to work just fine.  After installation, it will show up under System Preferences under the category labeled &#8220;Other&#8221;.</p>
<p>First, in order to make One-Touch Search button (that&#8217;s a button right below the vertical scroll wheel) as the third button, plug in your Apple Mighty Mouse, go to System Preferences -&gt; Keyboard &amp; Mouse -&gt; Mouse, and select the middle button to act as &#8220;Button 3&#8243;.  Then unplug the Mighty Mouse and plug in your MX Revolution again.  Awkward, but it works&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=514</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Miscellaneous Mac OS X Leopard Tips</title>
		<link>http://okomestudio.net/biboroku/?p=494</link>
		<comments>http://okomestudio.net/biboroku/?p=494#comments</comments>
		<pubDate>Sun, 21 Jun 2009 20:54:07 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Leopard]]></category>
		<category><![CDATA[Mac OS X]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=494</guid>
		<description><![CDATA[Here is a list of miscellaneous tips when configuring my new iMac to my liking. Disable Automatic Login &#38; Password Protect the System Apple Menu -&#62; System Preferences -&#62; Security -&#62; General Check the following: &#8220;Require password to wake this &#8230; <a href="http://okomestudio.net/biboroku/?p=494">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Here is a list of miscellaneous tips when configuring my new iMac to my liking.</p>
<h3>Disable Automatic Login &amp; Password Protect the System</h3>
<p>Apple Menu -&gt; System Preferences -&gt; Security -&gt; General</p>
<p>Check the following: &#8220;Require password to wake this computer from sleep or screen saver&#8221; and &#8220;Disable automatic login.&#8221;</p>
<h3>Firefall</h3>
<p>Apple Menu -&gt; System Preferences -&gt; Security -&gt; Firewall</p>
<p>and choose &#8220;Allow only essential services&#8221; for the maximum protection.  Use by-application/service option for more flexibility, when allowing remote login via ssh, for example.</p>
<h3>Remote Login with SSH</h3>
<p>Apple Menu -&gt; System Preferences -&gt; Sharing</p>
<p>Check &#8220;Remote Login.&#8221;  Don&#8217;t forget to reconfigure the firewall to allow ssh (see above).</p>
<h3>Right Clicking with Apple Mouse</h3>
<p>Apple Menu -&gt; System Preferences -&gt; Keyboard &amp; Mouse -&gt; Mouse</p>
<p>and specify &#8220;Secondary Button&#8221; for the right side of your Apple Mouse.</p>
<h3>Japanese Input Method</h3>
<p>Apple Menu -&gt; System Preferences -&gt; International -&gt; Input Menu</p>
<p>and check the box for Kotoeri.  You can change the input method by clicking on a country-flag icon in the menu bar.</p>
<h3>Using Clipboard Contents in Terminal</h3>
<p>Use <tt>pbpaste</tt> and <tt>pbcopy</tt> commands.</p>
<p>For example, once you put text into the clipboard in your OS X application, do:</p>
<blockquote><pre>
$ pbpaste &gt; pasted.txt
</pre>
</blockquote>
<p>This will place the content of the clipboard into the file pasted.txt.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=494</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Setting Up Astro Research Environment on Mac OS X Leopard</title>
		<link>http://okomestudio.net/biboroku/?p=481</link>
		<comments>http://okomestudio.net/biboroku/?p=481#comments</comments>
		<pubDate>Sat, 20 Jun 2009 01:27:56 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Leopard]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Research]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=481</guid>
		<description><![CDATA[In my new research environment I have an iMac.  My preferred solution is Linux, but I figured that sometimes learning new things is a good thing (though I have to sacrifice my efficiency which I developed over the years using &#8230; <a href="http://okomestudio.net/biboroku/?p=481">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>In my new research environment I have an iMac.  My preferred solution is Linux, but I figured that sometimes learning new things is a good thing (though I have to sacrifice my efficiency which I developed over the years using a Debian-based Linux box).</p>
<p>There are nice existing resources, like</p>
<ul>
<li><a href="http://users.ociw.edu/jrigby/osx.html">OS X for Astronomers</a></li>
<li><a href="http://macsingularity.org/astrowiki/tiki-index.php?page=Setup+a+New+Mac+for+Astronomy">Setup a New Mac for Astronomy</a></li>
</ul>
<p>so what I leave here is a quickie for myself based on the above sites.</p>
<h2>X11</h2>
<p>X11 comes with Leopard.  Just drag the X11 icon at <em>/Applications/Utilities/X11</em> to your dock, so that clicking on it you have an X11 environment in which you can open up a shell terminal (Applications -&gt; Terminal).</p>
<h2>Xcode Tools</h2>
<p>This one includes all the necessary development applications.  Install these from the Mac OS X installation DVD.  Xcode Tools can be found under the Optional Installs directory.</p>
<h2>Fink</h2>
<p>As an apt-get afficionado, I like the way I can use the APT-based packaging system on Mac OS X.  Basically you can use the <tt>apt-get</tt> command the way you do on Debian.  Go to the <a href="http://www.finkproject.org/download/">Fink project web site</a> and download and install the software.  You can <a href="http://pdb.finkproject.org/pdb/">browse all the available packages</a> as well.  Nice.</p>
<h2>Software for Astrophysics</h2>
<p>Use <a href="http://web.mac.com/npirzkal/Scisoft">Scisoft</a> for Mac OS X to install a bunch at once.  People are lazy but that&#8217;s how innovations arise, I suppose.  The package will be installed at <em>/Applications/scisoft</em>.</p>
<h2>IRAF</h2>
<p>As of this writing, the version of IRAF is 2.14.  Applying 2.14.1 patch is actually easy by overwriting:</p>
<ol>
<li>Download IRAF binaries from ftp://iraf.noao.edu/iraf/v214/PCIX/ib.macx.x86.gz to <em>/Applications/scisoft/all/Packages/iraf/irafbin/bin.macintel</em> and just extract the archive with gzip and tar.</li>
<li>Download NOAO binaries from ftp://iraf.noao.edu/iraf/v214/PCIX/nb.macx.x86.gz to <em>/Applications/scisoft/all/Packages/iraf/irafbin/noao.bin.macintel</em> and extract the archive with gzip and tar.</li>
<li>Download the patch from ftp://iraf.noao.edu/iraf/v214/PCIX/patch1.tar.gz to <em>/Applications/scisoft/all/Packages/iraf/iraf</em> and extract the archive with gzip and tar.</li>
</ol>
<p>It is also recommended to check the versions of external packages.  If outdated, you can simply install them under <em>/Applications/scisoft/all/Packages/iraf/extern</em>.</p>
<p>If you are reusing login.cl file from a Linux installation, make sure to update your home environmental variable:</p>
<p>set home = &#8220;/Users/username&#8221;</p>
<p>(in Linux, it would be &#8220;/home/username&#8221; of course.)</p>
<p>IMPORTANT: Also, do not forget to do this:</p>
<blockquote><p>
$ cp /Applications/scisoft/all/Packages/iraf/iraf/dev/imtoolrc ~/.imtoolrc
</p></blockquote>
<p>Otherwise you may see DS9 not behaving well&#8230;</p>
<h2>DS9</h2>
<p>Download from <a href="http://hea-www.harvard.edu/RD/ds9/">here</a> and install the Leopard X11 version.</p>
<p>Others</p>
<ul>
<li><a href="http://download.openoffice.org/">OpenOffice.org</a></li>
<li><a href="http://www.gimp.org/downloads/">GIMP</a></li>
</ul>
<p>TO BE CONTINUED.  Still need to install quite a few packages via apt-get.</p>
<p>sudo apt-get install wget emacs22 gv less</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=481</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Microsoft Natural Ergonomic Keyboard 4000 on Mac OS X Leopard</title>
		<link>http://okomestudio.net/biboroku/?p=476</link>
		<comments>http://okomestudio.net/biboroku/?p=476#comments</comments>
		<pubDate>Fri, 19 Jun 2009 22:54:16 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[install procedure]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[OS X/Leopard]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=476</guid>
		<description><![CDATA[I just wish the keyboard to work fairly close to iMac keyboard.  Windows (labeled Start) and Alt keys are &#8220;flipped,&#8221; which is annoying.  Following this article, I set up the keyboard.  Basically Apple -&#62; System Preferences -&#62; Keyboard &#38; Mouse &#8230; <a href="http://okomestudio.net/biboroku/?p=476">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I just wish the keyboard to work fairly close to iMac keyboard.  Windows (labeled Start) and Alt keys are &#8220;flipped,&#8221; which is annoying.  Following <a href="http://codyhanson.com/blog/2007/11/13/os-x-leopard-and-usb-keyboards/">this article</a>, I set up the keyboard.  Basically</p>
<p>Apple -&gt; System Preferences -&gt; Keyboard &amp; Mouse (under Hardware submenu) -&gt; Keyboard tab -&gt; Modifier Keys</p>
<p>Select keyboard should be &#8220;Natural Ergonomic Keyboard 4000&#8243; and you just need to swap the Option and Command modifier key bindings.  That&#8217;s it.</p>
<p>However, the above change makes the key locations resemble that of Mac.  I am too used to the PC culture of using Ctrl + some key, and my productivity suffers when I cannot position my left hand that way.  Roughly speaking, the Command key on Mac corresponds to the Ctrl key on PC, so I decided to swap them as well:</p>
<p><a href="http://okomestudio.net/biboroku/wp-content/uploads/2009/06/picture-2.png"><img class="alignnone size-full wp-image-510" title="MS Natural Ergonomic Keyboard Configuration" src="http://okomestudio.net/biboroku/wp-content/uploads/2009/06/picture-2.png" alt="MS Natural Ergonomic Keyboard Configuration" width="431" height="293" /></a></p>
<p>This works much better for me.</p>
<p>There are quite a few special keys that do not work the ways they do on Windows, but I don&#8217;t use them much anyways so it&#8217;s good for now.  I&#8217;ll keep adding instructions as I find them on the web.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=476</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>More Japanese Fonts</title>
		<link>http://okomestudio.net/biboroku/?p=458</link>
		<comments>http://okomestudio.net/biboroku/?p=458#comments</comments>
		<pubDate>Wed, 22 Apr 2009 20:50:49 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=458</guid>
		<description><![CDATA[A few collections of web sites listing stylistic Japanese fonts for download: フリーフォント最前線 脱力系フォントのまとめ 無料で使える日本語フォント11選 Some are free, others are not. My favorite is 国鉄風フォント, which resembles the characters used by kokutetsu, the Japanese national railway system (now JR and &#8230; <a href="http://okomestudio.net/biboroku/?p=458">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>A few collections of web sites listing stylistic Japanese fonts for download:</p>
<ul>
<li><a href="http://www.akibatec.net/freefont/fff.cgi?page=1&amp;mode=kt&amp;kt=01_01&amp;sort=">フリーフォント最前線</a></li>
<li><a href="http://tangerine.sweetstyle.jp/?eid=596754">脱力系フォントのまとめ</a></li>
<li><a href="http://www.designwalker.com/2007/03/jp-font.html">無料で使える日本語フォント11選</a></li>
</ul>
<p>Some are free, others are not.</p>
<p>My favorite is <a href="http://homepage1.nifty.com/tabi-mo/font.htm">国鉄風フォント</a>, which resembles the characters used by kokutetsu, the Japanese national railway system (now JR and privatized).  It has a very retro feel that I like.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=458</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Astro Software in Debian Lenny</title>
		<link>http://okomestudio.net/biboroku/?p=335</link>
		<comments>http://okomestudio.net/biboroku/?p=335#comments</comments>
		<pubDate>Tue, 21 Apr 2009 00:44:49 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Lenny]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Research]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=335</guid>
		<description><![CDATA[Here my goal is to build a computing environment where Python is the glue of all the astro-related tools (PyRAF, stsci_python, etc.). IRAF In order to use PyRAF, IRAF needs to be installed first. Python At the very least, I &#8230; <a href="http://okomestudio.net/biboroku/?p=335">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Here my goal is to build a computing environment where Python is the glue of all the astro-related tools (PyRAF, stsci_python, etc.).</p>
<h2>IRAF</h2>
<p>In order to use PyRAF, <a href="http://nomo17k.wordpress.com/2009/04/17/iraf-on-debian-lenny/">IRAF needs to be installed first</a>.</p>
<h2>Python</h2>
<p>At the very least, I want the basic Python packages related to science/data analysis:</p>
<pre style="border:1px solid #ccc;padding:4px;">
# apt-get install python ipython python-doc
# apt-get install python-numpy python-scipy python-matplotlib
</pre>
<h2>PyRAF</h2>
<p>Install several Python packages:</p>
<pre style="border:1px solid #ccc;padding:4px;">
# apt-get install tk8.4-dev python-tk libf2c2-dev
# apt-get install python-dev python-pmw python-urwid
</pre>
<p>Test if the required Python modules exists by making sure that no ImportError occurs below:</p>
<pre style="border:1px solid #ccc;padding:4px;">
# python
&gt;&gt;&gt; import readline
&gt;&gt;&gt; import Tkinter
&gt;&gt;&gt; Tkinter._test()
&gt;&gt;&gt; import Pmw
&gt;&gt;&gt; import urwid
</pre>
<p>If you have an installation of previous version, check the section Cleaning An Old Installation of the <a href="http://www.stsci.edu/resources/software_hardware/pyraf/stsci_python/Installation">installation instruction at the STSci web site</a> to make sure things are clean.</p>
<p>Prepare the source directory:</p>
<pre style="border:1px solid #ccc;padding:4px;">
# mkdir /usr/local/src/python_packages/stsci_python
# cd /usr/local/src/python_packages/stsci_python
</pre>
<p>Download and extract the source:</p>
<pre style="border:1px solid #ccc;padding:4px;">
# wget http://stsdas.stsci.edu/download/stsci_python_2.7/stsci_python_2.7.tar.gz
# gunzip -c stsci_python_2.7.tar.gz | tar xvf -
# cd stsci_python_2.7/
</pre>
<p>Normally, using <tt>python setup.py install</tt> will do the job, but it probably ends in compilation error, complaining the header file <em>cfunc.h</em> not found.  In order to force the installation, modify <em>setup.py</em> in the current directory, so that at the very end of the file an additional include directory is defined:</p>
<pre style="border:1px solid #ccc;padding:4px;">
distutils.core.setup(

    # This name is used in various file names to identify this item.
    name="stsci_python",

    # This version is expected to be compared to other version numbers.
    # It will also appear in some file names.
    version="2.7",

    # Apparently, description is not used anywhere.
    description="",

    packages = all_packages,
    package_dir = all_package_dir,
    ext_modules = all_ext_modules,
    scripts = all_scripts,
    data_files = all_data_files,
    include_dirs = ['/usr/lib/python2.5/site-packages/numpy/numarray/numpy']
)
</pre>
<p>Then we can follow the normal instruction:</p>
<pre style="border:1px solid #ccc;padding:4px;">
# python setup.py install
# cd stscidocs
# python setup.py install
</pre>
<p>Before running PyRAF for the first time, clear the cache by removing directories under your &#8220;pyraf&#8221; directory, which is located in where you have your loginuser.cl for IRAF.</p>
<p>That&#8217;s it!</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=335</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IRAF on Debian Lenny</title>
		<link>http://okomestudio.net/biboroku/?p=341</link>
		<comments>http://okomestudio.net/biboroku/?p=341#comments</comments>
		<pubDate>Fri, 17 Apr 2009 22:54:36 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Lenny]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Research]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=341</guid>
		<description><![CDATA[Here is my installation note for IRAF (ver 2.14.1) on Debian Lenny. Basically, the installation procedure does not differ much from the one outlined in the official IRAF installation guide. First, create &#8220;iraf&#8221; user account to the system if it &#8230; <a href="http://okomestudio.net/biboroku/?p=341">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Here is my installation note for IRAF (ver 2.14.1) on Debian Lenny.</p>
<p>Basically, the installation procedure does not differ much from the one outlined in the <a href="http://iraf.noao.edu/">official IRAF installation guide</a>.</p>
<p>First, create &#8220;iraf&#8221; user account to the system if it does not exist already.  Also, install the C shell (csh) as it appears to be the preferred shell for IRAF (people apparently don&#8217;t know when to move on).</p>
<pre style="border:1px solid #ccc;padding:4px;">$ sudo apt-get install csh ncompress
$ sudo adduser iraf</pre>
<p>After user &#8220;iraf&#8221; has been added to the system, change its home directory and the default shell by modifying <em>/etc/passwd</em> to read:</p>
<pre style="border:1px solid #ccc;padding:4px;">iraf:x:1002:1002:IRAF Admin,,,:/iraf/iraf/local:/bin/csh</pre>
<p>Note that the number 1002 may be different depending on how many users already have the accounts on the system.  Only change the last two entries delimited by colon to <em>/iraf/iraf/local</em> and <em>/bin/csh</em>.</p>
<p>We assume IRAF will be installed under <em>/usr/local/iraf</em>, and a symlink <em>/iraf</em> points to that directory:</p>
<pre style="border:1px solid #ccc;padding:4px;"># mkdir /usr/local/iraf
# chown iraf /usr/local/iraf
# chgrp iraf /usr/local/iraf
# ln -s /usr/local/iraf /iraf</pre>
<p>Login as user &#8220;iraf,&#8221; and create a bunch of directories:</p>
<pre style="border:1px solid #ccc;padding:4px;"># su iraf
% cd /usr/local/iraf
% mkdir extern imdirs iraf irafbin x11iraf
% mkdir irafbin/bin.linux
% mkdir irafbin/noao.bin.linux</pre>
<p>Install x11iraf.  You may use the pre-built binary distribution:</p>
<pre style="border:1px solid #ccc;padding:4px;">% cd /usr/local/iraf/x11iraf
% wget http://iraf.noao.edu/x11iraf/x11iraf-v2.0BETA-bin.redhat.tar.gz
% gunzip -c x11* | tar xvf -
% su
# ./install
# exit</pre>
<p>and select defaults for all the user input upon installation.  (Note that if <tt>xgterm</tt> quits on an error complaining about &#8220;ptys,&#8221; then you may need to turn on the kernel configurations CONFIG_LEGACY_PTYS and CONFIG_UNIX98_PTYS; yes, you may need to <a href="http://nomo17k.wordpress.com/2009/03/22/customizing-installing-linux-kernel-26x-on-debian-lenny/">rebuild the kernel</a>&#8230;)</p>
<p>Install the source:</p>
<pre style="border:1px solid #ccc;padding:4px;">% cd /usr/local/iraf/iraf
% wget http://iraf.noao.edu/iraf/ftp/iraf/v214/PCIX/as.pcix.gen.gz
% gunzip -c as.pcix.gen.gz | tar xvf -</pre>
<p>Install the binaries:</p>
<pre style="border:1px solid #ccc;padding:4px;">% cd ../irafbin/bin.linux
% wget http://iraf.noao.edu/iraf/ftp/iraf/v214/PCIX/ib.lnux.x86.gz
% gunzip -c ib.lnux.x86.gz | tar xvf -

% cd ../noao.bin.linux
% wget http://iraf.noao.edu/iraf/ftp/iraf/v214/PCIX/nb.lnux.x86.gz
% gunzip -c nb.lnux.x86.gz | tar xvf -
% exit</pre>
<p>Run the install script:</p>
<pre style="border:1px solid #ccc;padding:4px;"># su iraf
% cd $iraf/unix/hlib
% source irafuser.csh
% su
# ./install</pre>
<p>Follow the instruction for the most part, but the following are not necessary: IRAF networking and tapecap device.</p>
<pre style="border:1px solid #ccc;padding:4px;"># exit
% cd
% source .login
% rehash
% cl</pre>
<p>This should start ecl.</p>
<p>For exposing external packages (which must already be installed if not already) within IRAF, the text file <em>extern.pkg</em> can be reused if these packages are already installed.  Copy it from a previous installation to <em>/usr/local/iraf/iraf/unix/hlib</em>.</p>
<pre style="border:1px solid #ccc;padding:4px;">
# External (non core-system) packages.  To install a new package, add the
# two statements to define the package root directory and package task,
# then add the package helpdb to the `helpdb' list.

reset	noao		= iraf$noao/
task	noao.pkg	= noao$noao.cl

reset	tables		= /iraf/extern/tables/
task	tables.pkg	= tables$tables.cl

reset	mscred		= /iraf/extern/mscred/
task	mscred.pkg	= mscred$mscred.cl

reset	stsdas		= /iraf/extern/stsdas/
task	stsdas.pkg	= stsdas$stsdas.cl
task	apropos		= stsdas$apropos.cl

reset	rvsao		= /iraf/extern/rvsao/rvsao-2.5.0/
task	rvsao.pkg	= rvsao$rvsao.cl

reset	xdimsum		= /iraf/extern/xdimsum/
task	xdimsum.pkg	= xdimsum$xdimsum.cl

reset	fuzzy		= /iraf/extern/fuzzy/
task	$fuzzy.pkg	= fuzzy$fuzzy.cl

set	crrefer		= "/home/astro_data/stsci_data/"

reset   helpdb          = "lib$helpdb.mip\
                          ,noao$lib/helpdb.mip\
                          ,tables$lib/helpdb.mip\
                          ,stsdas$lib/helpdb.mip\
                          ,mscred$lib/helpdb.mip\
                          ,rvsao$lib/helpdb.mip\
			  ,xdimsum$lib/helpdb.mip\
                          "

keep
</pre>
<p>You can simply comment out lines with &#8220;#&#8221; if some packages are not installed.</p>
<p>The packages <tt>stsdas</tt> and <tt>tables</tt> should be installed following the <a href="http://www.stsci.edu/resources/software_hardware/stsdas/download">official instruction</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=341</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Favorite Internet Radio Stations</title>
		<link>http://okomestudio.net/biboroku/?p=414</link>
		<comments>http://okomestudio.net/biboroku/?p=414#comments</comments>
		<pubDate>Fri, 10 Apr 2009 20:50:01 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Music]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=414</guid>
		<description><![CDATA[For funk and soul from 70s &#38; 80s, my favorites are: www.soulfm.de Very nice funky music from 70s and 80s.  DJ Joerg spins a variety of stuff from disco to 80s contemporary R&#38;B.  I can always listen to a few &#8230; <a href="http://okomestudio.net/biboroku/?p=414">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>For funk and soul from 70s &amp; 80s, my favorites are:</p>
<h2><a href="http://www.soulfm.de/">www.soulfm.de</a></h2>
<p>Very nice funky music from 70s and 80s.  DJ Joerg spins a variety of stuff from disco to 80s contemporary R&amp;B.  I can always listen to a few songs that I haven&#8217;t gotten to know which is cool.</p>
<p>Every Friday, 1pm &#8211; 3pm (UTC -7)</p>
<h2><a href="http://www.kcsb.org/">Jammin&#8217; A Little Old School (KCSB 91.9 FM Santa Barbara)</a></h2>
<p>A lot of bad jams like Rick James, Cameo, Shock, etc., etc.  It was quite a serendipitous find as it was the college radio station of my old university.</p>
<p>Every Friday, 6pm &#8211; 8pm (UTC-7)</p>
<p>Looking to find more of funk, soul, and boogie&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=414</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Beautiful (or Cool) Japanese Words?</title>
		<link>http://okomestudio.net/biboroku/?p=407</link>
		<comments>http://okomestudio.net/biboroku/?p=407#comments</comments>
		<pubDate>Fri, 10 Apr 2009 06:31:47 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Misc.]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=407</guid>
		<description><![CDATA[I&#8217;m currently on a personal mission to find a Japanese word to describe my personal operations.  I want to find a word that sounds and look beautiful and/or cool in Japanese as well as in English (when it&#8217;s spelled out &#8230; <a href="http://okomestudio.net/biboroku/?p=407">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I&#8217;m currently on a personal mission to find a Japanese word to describe my personal operations.  I want to find a word that sounds and look beautiful and/or cool in Japanese as well as in English (when it&#8217;s spelled out in alphabets).</p>
<p>Eventually I hope to use it as a (part of) domain name (which will be my Web portal for my freelance work such as writing, coding, etc.), but the search has actually been quite slow and difficult.  Not surprisingly, many suitable words are already taken by someone else.</p>
<p>Hmmm.  I will keep listing candidates here.</p>
<ul>
<li>okome (お米)
<ul>
<li>Just because I love rice&#8230;</li>
</ul>
</li>
<li>more to come</li>
</ul>
<p>Any ideas&#8230;?</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=407</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I Was a Great TA</title>
		<link>http://okomestudio.net/biboroku/?p=400</link>
		<comments>http://okomestudio.net/biboroku/?p=400#comments</comments>
		<pubDate>Fri, 10 Apr 2009 01:19:19 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Humor]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=400</guid>
		<description><![CDATA[and I have a letter from my student to prove it: Return-Path: Received: from web10908.mail.yahoo.com (web10908.mail.yahoo.com [216.136.131.44]) by ilpostino.physics.ucsb.edu (8.11.6/8.11.2) with SMTP id g9RIiBH25703 for ; Sun, 27 Oct 2002 10:44:11 -0800 Message-ID: Received: from [128.111.97.165] by web10908.mail.yahoo.com via HTTP; &#8230; <a href="http://okomestudio.net/biboroku/?p=400">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>and I have a letter from my student to prove it:</p>
<pre style="border:1px solid #ccc;padding:4px;">
Return-Path:
Received: from web10908.mail.yahoo.com (web10908.mail.yahoo.com [216.136.131.44])
	by ilpostino.physics.ucsb.edu (8.11.6/8.11.2) with SMTP id g9RIiBH25703
	for ; Sun, 27 Oct 2002 10:44:11 -0800
Message-ID:
Received: from [128.111.97.165] by web10908.mail.yahoo.com via HTTP; Sun, 27 Oct 2002 10:44:12 PST
Date: Sun, 27 Oct 2002 10:44:12 -0800 (PST)
From: mary watson
Subject: grading our first lab
To: taro@physics.ucsb.edu
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="0-157626628-1035744252=:40556"

--0-157626628-1035744252=:40556
Content-Type: text/plain; charset=us-ascii


Hello Taro Sato,

     I am a student in one of your labs. Im writing this email to let you know
that I feel you made a huge mistake grading our first lab. You never told us
how you wanted us to write the lab. Most of us were misled into thinking that
all we needed to do was answer the questions in the lab write up. This was not
our fault, and therefore, our grades should not reflect upon your mistake.
Curving our grades in the end is not nearly sufficient enough. At the very
least, you could throw that grade out or let us rewrite our first lab. You are
nothing less than a complete coward and a bastard if you decide to pass even a
shread of the responsibility for your mistake onto us.



---------------------------------
Do you Yahoo!?
Y! Web Hosting - Let the expert host your web site
</pre>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=400</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Updating Flash BIOS off a Bootable CD</title>
		<link>http://okomestudio.net/biboroku/?p=384</link>
		<comments>http://okomestudio.net/biboroku/?p=384#comments</comments>
		<pubDate>Fri, 10 Apr 2009 00:34:25 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=384</guid>
		<description><![CDATA[Note: These days, computers ship without floppy drives by default, so there may exist a better generic procedure for updating flash BIOS. This instruction is just kept for a historical reason. Flashing BIOS can be dangerous. A typical disclaimer of &#8230; <a href="http://okomestudio.net/biboroku/?p=384">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Note: These days, computers ship without floppy drives by default, so there may exist a better generic procedure for updating flash BIOS.  This instruction is just kept for a historical reason.</p>
<p>Flashing BIOS can be dangerous.  A typical disclaimer of the process applies.</p>
<p>First, download a DOS bootdisk image (win98-boot.img &#8212; missing for now while I find a semipermanent online disk space &#8212; can be useful) and the BIOS update program, e.g., BIOSUPDT.EXT, from the BIOS vendor to a directory (say <em>~/tmp</em> for an illustration).</p>
<p>Mount the DOS image and copy the BIOS update program as follows:</p>
<pre style="border:1px solid #ccc;padding:4px;">
# cd ~/tmp
# mkdir mnt
# mount -o loop -t vfat win98-boot.img mnt
# cp BIOSUPDT.EXE mnt
# umount mnt
</pre>
<p>Make a CD ISO image:</p>
<pre style="border:1px solid #ccc;padding:4px;">
# mkisofs -o image.iso -b win98-boot.img win98-boot.img
</pre>
<p>Burn the ISO image to a blank CD.  Boot from the CD and you should simply run the BIOS update program from DOS.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=384</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Search for Files Containing a Text</title>
		<link>http://okomestudio.net/biboroku/?p=377</link>
		<comments>http://okomestudio.net/biboroku/?p=377#comments</comments>
		<pubDate>Fri, 10 Apr 2009 00:14:20 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=377</guid>
		<description><![CDATA[Here is a little BASH script (which I name findstr) to search for the files containing a specified string: #!/usr/bin/env bash ############################################################################## # findstr # # Search for files containing a specified string. Show the file path, # line number, &#8230; <a href="http://okomestudio.net/biboroku/?p=377">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Here is a little BASH script (which I name <tt>findstr</tt>) to search for the files containing a specified string:</p>
<pre style="border:1px solid #ccc;padding:4px;">#!/usr/bin/env bash
##############################################################################
# findstr
#
# Search for files containing a specified string.  Show the file path,
# line number, and the line itself containing a specified string.
#
# EXAMPLE:
#
# To search for all the files with the file extension .html containing
# a string "body" under the current directory and all its
# subdirectories, do:
#
#   $ findstr . "*.html" "body"
#

find $1 -name \*$2 -exec grep -nH "$3" {} \;</pre>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=377</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DEEP2 Pipeline Tips</title>
		<link>http://okomestudio.net/biboroku/?p=375</link>
		<comments>http://okomestudio.net/biboroku/?p=375#comments</comments>
		<pubDate>Fri, 10 Apr 2009 00:03:36 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Research]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=375</guid>
		<description><![CDATA[Custom Extraction To run the DEEP2 pipeline with boxcar extraction with a specified sigma (4.0 here), do: $ echo 'boxcar_domask,nlsky=0,nsig_boxcar=4.0' &#124; idl -32 &#62; output.log Alternatively, use boxsprof_domask to use the boxsprof extraction algorithm.]]></description>
				<content:encoded><![CDATA[<h2>Custom Extraction</h2>
<p>To run the DEEP2 pipeline with boxcar extraction with a specified sigma (4.0 here), do:</p>
<pre style="border:1px solid #ccc;padding:4px;">
$ echo 'boxcar_domask,nlsky=0,nsig_boxcar=4.0' | idl -32 &gt; output.log
</pre>
<p>Alternatively, use boxsprof_domask to use the boxsprof extraction algorithm.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=375</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IRAF Tips</title>
		<link>http://okomestudio.net/biboroku/?p=373</link>
		<comments>http://okomestudio.net/biboroku/?p=373#comments</comments>
		<pubDate>Thu, 09 Apr 2009 23:59:39 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Research]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=373</guid>
		<description><![CDATA[Printing Out Help When printing out a help for an IRAF task name iraftask, you may want to save papers by multicolumn printing using a2ps. cl&#62; help iraftask &#124; type dev=text &#62; iraftask.txt cl&#62; !a2ps iraftask.txt -2 --medium=letter -o iraftask.ps &#8230; <a href="http://okomestudio.net/biboroku/?p=373">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<h2>Printing Out Help</h2>
<p>When printing out a help for an IRAF task name <tt>iraftask</tt>, you may want to save papers by multicolumn printing using <tt>a2ps</tt>.</p>
<pre style="border:1px solid #ccc;padding:4px;">cl&gt; help iraftask | type dev=text &gt; iraftask.txt
cl&gt; !a2ps iraftask.txt -2 --medium=letter -o iraftask.ps</pre>
<p>The generated .ps file should be printed out.  Note that this doesn&#8217;t appear to work well on PyRAF, in which escape sequences do not appear to be parsed.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=373</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Changing Page Size of a PostScript Document</title>
		<link>http://okomestudio.net/biboroku/?p=371</link>
		<comments>http://okomestudio.net/biboroku/?p=371#comments</comments>
		<pubDate>Thu, 09 Apr 2009 23:55:44 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=371</guid>
		<description><![CDATA[For scaling a postscript page size, do: $ psresize -Pa4 -pletter src.ps &#62; dst.ps To generate a letter-sized output as a PDF document, do: $ dvips -t letter doc.dvi -o doc.ps $ ps2pdf14 -sPAPERSIZE=letter doc.ps]]></description>
				<content:encoded><![CDATA[<p>For scaling a postscript page size, do:</p>
<pre style="border:1px solid #ccc;padding:4px;">
$ psresize -Pa4 -pletter src.ps &gt; dst.ps
</pre>
<p>To generate a letter-sized output as a PDF document, do:</p>
<pre style="border:1px solid #ccc;padding:4px;">
$ dvips -t letter doc.dvi -o doc.ps
$ ps2pdf14 -sPAPERSIZE=letter doc.ps
</pre>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=371</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reducing the Number of Pages of a PostScript Document</title>
		<link>http://okomestudio.net/biboroku/?p=369</link>
		<comments>http://okomestudio.net/biboroku/?p=369#comments</comments>
		<pubDate>Thu, 09 Apr 2009 23:53:03 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=369</guid>
		<description><![CDATA[To save papers, sometimes it is desired to to collect multiple pages into a page on printing a postscript file. Use mpage command to generate a new postscript file: $ mpage -2 -c paper.ps &#62; paper_2pg.ps $ lpr -Pprinter paper_2pg.ps]]></description>
				<content:encoded><![CDATA[<p>To save papers, sometimes it is desired to to collect multiple pages into a page on printing a postscript file.  Use <tt>mpage</tt> command to generate a new postscript file:</p>
<pre style="border:1px solid #ccc;padding:4px;">
$ mpage -2 -c paper.ps &gt; paper_2pg.ps
$ lpr -Pprinter paper_2pg.ps
</pre>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=369</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Merging Two Text Files Line by Line</title>
		<link>http://okomestudio.net/biboroku/?p=364</link>
		<comments>http://okomestudio.net/biboroku/?p=364#comments</comments>
		<pubDate>Thu, 09 Apr 2009 23:48:28 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=364</guid>
		<description><![CDATA[Say you have two text files (text1.txt and text2.txt) with data: # x y 1.0 1.0 2.0 4.0 3.0 9.0 # x z 1.0 1.0 2.0 8.0 3.0 27.0 If you wish to merge these files line by line, use &#8230; <a href="http://okomestudio.net/biboroku/?p=364">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Say you have two text files (<em>text1.txt</em> and <em>text2.txt</em>) with data:</p>
<pre style="border:1px solid #ccc;padding:4px;">
# x     y
1.0   1.0
2.0   4.0
3.0   9.0
</pre>
<pre style="border:1px solid #ccc;padding:4px;">
# x     z
1.0   1.0
2.0   8.0
3.0  27.0
</pre>
<p>If you wish to merge these files line by line, use <tt>paste</tt>:</p>
<pre style="border:1px solid #ccc;padding:4px;">
$ paste text1.txt text2.txt &gt; merged.txt
</pre>
<p>This will create a text file like this one:</p>
<pre style="border:1px solid #ccc;padding:4px;">
# x     y   # x     z
1.0   1.0   1.0   1.0
2.0   4.0   2.0   8.0
3.0   9.0   3.0  27.0
</pre>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=364</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mirror a website using wget</title>
		<link>http://okomestudio.net/biboroku/?p=360</link>
		<comments>http://okomestudio.net/biboroku/?p=360#comments</comments>
		<pubDate>Thu, 09 Apr 2009 23:44:33 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=360</guid>
		<description><![CDATA[To mirror a website (by which I here mean downloading a copy of directory hierarchy) below a certain directory level, use wget. For example, let&#8217;s say you want to mirror everything below some directory in a web site: http://site/a/b/. Then &#8230; <a href="http://okomestudio.net/biboroku/?p=360">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>To mirror a website (by which I here mean downloading a copy of directory hierarchy) below a certain directory level, use <tt>wget</tt>.  For example, let&#8217;s say you want to mirror everything below some directory in a web site: <em>http://site/a/b/</em>.  Then the directory &#8220;b&#8221; is two levels below the top most level, so you need to specify &#8220;2&#8243; for <tt>--cut-dirs</tt> option.  Hence</p>
<pre class="brush: bash; title: ; notranslate">$ wget -m -E -nH -np --cut-dirs=2 http://site/a/b/</pre>
<p>should download all the downloadable contents below <em>http://site/a/b/</em> to the current local directory.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=360</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My Favorite Firefox Plugins</title>
		<link>http://okomestudio.net/biboroku/?p=343</link>
		<comments>http://okomestudio.net/biboroku/?p=343#comments</comments>
		<pubDate>Thu, 09 Apr 2009 22:24:53 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=343</guid>
		<description><![CDATA[Note: The current version of Firefox on my box is 3.0.6 (that&#8217;s the Debian stable as of now). goo Dictionary This is an add-on for using dictionaries of English and Japanese. This will add search interfaces to the navigation toolbar &#8230; <a href="http://okomestudio.net/biboroku/?p=343">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Note: The current version of Firefox on my box is 3.0.6 (that&#8217;s the Debian stable as of now).</p>
<h2><a href="http://ext.dictionary.goo.ne.jp/addon.html">goo Dictionary</a></h2>
<p>This is an add-on for using dictionaries of English and Japanese.  This will add search interfaces to the navigation toolbar and the context menu .  The dictionaries at goo.ne.jp are quite decent, so highly recommended.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=343</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sawicki &amp; Thompson 2006, ApJ, 648, 299</title>
		<link>http://okomestudio.net/biboroku/?p=314</link>
		<comments>http://okomestudio.net/biboroku/?p=314#comments</comments>
		<pubDate>Sat, 28 Mar 2009 02:42:39 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Paper]]></category>
		<category><![CDATA[Research]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=314</guid>
		<description><![CDATA[Keck Deep Fields. III. Luminosity-dependent Evolution of the Ultraviolet Luminosity and Star Formation Rate Densities at z~4, 3, and 2 Glaxy UV luminosity density peaks at z = 1 ~ 3, sub-L* galaxies dominate the integrated UV luminosity UV luminosity &#8230; <a href="http://okomestudio.net/biboroku/?p=314">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><a href="http://adsabs.harvard.edu/abs/2006ApJ...648..299S">Keck Deep Fields. III. Luminosity-dependent Evolution of the Ultraviolet Luminosity and Star Formation Rate Densities at z~4, 3, and 2</a></p>
<ul>
<li>Glaxy UV luminosity density peaks at z = 1 ~ 3, sub-L* galaxies dominate the integrated UV luminosity</li>
<li>UV luminosity declines for z &gt; 4</li>
<li>Not enough ionizing photons for reionization?
<ul>
<li>Madau et al. (1999) criteria may be too stringent?</li>
</ul>
</li>
</ul>
<p>Check:</p>
<ul>
<li>Effective volume technique</li>
<li>Evolving faint-end slope confirmed?</li>
<li>Getting rest-frame 1700 A flux</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=314</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>File Manipulation in Linux</title>
		<link>http://okomestudio.net/biboroku/?p=308</link>
		<comments>http://okomestudio.net/biboroku/?p=308#comments</comments>
		<pubDate>Sat, 28 Mar 2009 02:24:08 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=308</guid>
		<description><![CDATA[In this page I will keep the list of useful file manipulation commands that I often forget. Making &#38; Expanding a .tar.gz or .tar.bz2 File For archiving a directory named foo as foo.tar.bz2 file: $ tar cvf - foo &#124; &#8230; <a href="http://okomestudio.net/biboroku/?p=308">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>In this page I will keep the list of useful file manipulation commands that I often forget.</p>
<h2>Making &amp; Expanding a .tar.gz or .tar.bz2 File</h2>
<p>For archiving a directory named <em>foo</em> as <em>foo.tar.bz2</em> file:</p>
<pre style="border:1px solid #ccc;padding:4px;">
$ tar cvf - foo | bzip2 -9 &gt; foo.tar.bz2
</pre>
<p>(<tt>-9</tt> is the compression level and can be omitted.) To expand this file:</p>
<pre style="border:1px solid #ccc;padding:4px;">
$ bunzip2 -c foo.tar.bz2 | tar xvf -
</pre>
<p>To use <tt>gzip</tt>, replace <tt>bzip2</tt> with <tt>gzip</tt> and <tt>bunzip2</tt> with <tt>gunzip</tt>, and change the file extension accordingly (to .gz).</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=308</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Running Scripts at Login or Logout of a KDE Session</title>
		<link>http://okomestudio.net/biboroku/?p=303</link>
		<comments>http://okomestudio.net/biboroku/?p=303#comments</comments>
		<pubDate>Sat, 28 Mar 2009 02:14:05 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=303</guid>
		<description><![CDATA[Here is the situation: You want to run a customized script when you login or logout of a KDE session. Here is the solution: You can place a custom script in the directory ~/.kde/Autostart to run when you login to &#8230; <a href="http://okomestudio.net/biboroku/?p=303">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Here is the situation:  You want to run a customized script when you login or logout of a KDE session.</p>
<p>Here is the solution: You can place a custom script in the directory <em>~/.kde/Autostart</em> to run when you login to a KDE session. Likewise, you can place the script in the directory <em>~/.kde/shutdown</em> to run when you logout of a KDE session. The latter directory does not appear to be created by default. If it does not exist, you can just create it by</p>
<pre style="border:1px solid #ccc;padding:4px;">
$ mkdir ~/.kde/shutdown
</pre>
<p>One thing about running scripts out of <em>~/.kde/shutdown</em> directory is that it does not recognize all the customization done in your BASH startup scripts, like <em>~/.bashrc</em>. You may source these files within the scripts in <em>~/.kde/shutdown</em>, but another approach is to make a script with the contents:</p>
<pre style="border:1px solid #ccc;padding:4px;">
#!/bin/bash
DO SOMETHING BEFORE LOGOUT
# Launch KDE logout interface
dcop kdesktop KDesktopIface logout
DO AFTER LOGOUT
</pre>
<p>On the KDE panel, select &#8220;Add -&gt; Special Button -&gt; None-KDE Application&#8221; to create a button pointing to this script. This way, you can run commands assuming all the customization still intact (before logout), and even after you actually logout (as if you put scripts in <em>~/.kde/shutdown</em>).</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=303</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Formatting a USB Drive with ext4 for Use with Linux</title>
		<link>http://okomestudio.net/biboroku/?p=291</link>
		<comments>http://okomestudio.net/biboroku/?p=291#comments</comments>
		<pubDate>Sat, 28 Mar 2009 01:52:13 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[hardware]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=291</guid>
		<description><![CDATA[I wish to use an external USB drive exclusively on a Linux system (in my case, Debian).  I want to use the ext4 filesystem. Note that this method wipes out the filesystem on the drive.  Install hotplug-type package such that &#8230; <a href="http://okomestudio.net/biboroku/?p=291">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I wish to use an external USB drive exclusively on a Linux system (in my case, Debian).  I want to use the ext4 filesystem.  Note that this method wipes out the filesystem on the drive.  </p>
<p>Install hotplug-type package such that upon plugging the USB drive in the device is attached to somewhere in the system.  I use KDE and it automatically prepares such an environment.  When a USB drive is plugged in, I should see a message like this one in the system log:</p>
<pre class="brush: bash; title: ; notranslate">$ sudo tail /var/log/messages
Dec 16 02:07:51 kernel: [ 3000.544361] scsi11 : usb-storage 3-2:1.0
...
Dec 16 02:07:56 mochi kernel: [ 3005.882879]  sdb: sdb1
...</pre>
<p>or I may see something like this instead (I&#8217;m using USB 3.0 adapter now):</p>
<pre class="brush: bash; title: ; notranslate">$ sudo tail -n 100 /var/log/messages | grep sd
...
May  3 12:38:33 mochi kernel: [   12.773057] sd 6:0:0:0: [sdb] Spinning up disk...
May  3 12:38:39 mochi kernel: [   18.782284] sd 6:0:0:0: [sdb] 3906963456 512-byte logical blocks: (2.00 TB/1.81 TiB)
May  3 12:38:39 mochi kernel: [   18.783052] sd 6:0:0:0: [sdb] Write Protect is off
May  3 12:38:39 mochi kernel: [   18.794337]  sdb: sdb1
May  3 12:38:39 mochi kernel: [   18.795569] sd 6:0:0:0: [sdb] Attached SCSI disk</pre>
<p>Here, I find the device is at <em>/dev/sdb</em> and there is only one partition, <em>/dev/sdb1</em>, for example.  I can also see all the disk devices as follows:</p>
<pre class="brush: bash; title: ; notranslate">$ sudo fdisk -l

Disk /dev/sda: 80.0 GB, 80026361856 bytes
240 heads, 63 sectors/track, 10337 cylinders
Units = cylinders of 15120 * 512 = 7741440 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xbd3cc0bb

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1       10338    78149633    5  Extended
/dev/sda5               1          46      340992   83  Linux
/dev/sda6              46          52       48128   83  Linux
/dev/sda7              52         698     4881408   83  Linux
/dev/sda8             698        1086     2928640   83  Linux
/dev/sda9            1086        1861     5858304   83  Linux
/dev/sda10           1861        2830     7323648   83  Linux
/dev/sda11           9305       10338     7812096   82  Linux swap / Solaris
/dev/sda12           2830        9304    48949248   83  Linux

Partition table entries are not in disk order

Disk /dev/sdb: 2000.4 GB, 2000365289472 bytes
255 heads, 63 sectors/track, 243197 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0005f107

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1      243198  1953480704    7  HPFS/NTFS
</pre>
<p>When the USB drive is new, the partition is most likely formatted in FAT or NTFS unless the drive is preformatted specifically for OS X.  Now, prepare the partition for Linux:</p>
<pre class="brush: bash; title: ; notranslate">$ sudo fdisk /dev/sdb</pre>
<p>See help for detail by pressing &#8220;m&#8221; on the fdisk command shell.  For example, press &#8220;p&#8221; to see the list of partitions in the disk.  To create a new one press &#8220;n&#8221; (probably after deleting one or more partitions by pressing &#8220;d&#8221;).  Finally press &#8220;w&#8221; to actually make changes to the drive.  To use ext4 filesystem, do:</p>
<pre class="brush: bash; title: ; notranslate">$ sudo mkfs.ext4 /dev/sdb1</pre>
<p>after exiting <em>fdisk</em>.</p>
<p>If I always mount this drive on boot, add a line like this to <em>/etc/fstab</em>:</p>
<pre class="brush: bash; title: ; notranslate">/dev/sdc1 /media/usbdrive auto user,noauto 0 0</pre>
<p>assuming <em>/media/usbdrive</em> is the mount point.  If I use KDE, this sort of thing is no longer necessary; I can easily manage external drives with Device Notifier.</p>
<h3>Update History</h3>
<p>May 3, 2012 &#8212; Updated for my current system.<br />
December 17, 2010 &#8212; Modified to use ext4 filesystem.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=291</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Olympus C-750 on Debian Etch</title>
		<link>http://okomestudio.net/biboroku/?p=285</link>
		<comments>http://okomestudio.net/biboroku/?p=285#comments</comments>
		<pubDate>Sat, 28 Mar 2009 01:42:48 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Etch]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=285</guid>
		<description><![CDATA[Note: This may be an obsolete method of using the digital camera with Debian (I would use udev but otherwise let KDE handle it as a simple USB device). I&#8217;m keeping this for record. The kernel (2.6.x) must have USB_STORAGE &#8230; <a href="http://okomestudio.net/biboroku/?p=285">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Note: This may be an obsolete method of using the digital camera with Debian (I would use udev but otherwise let KDE handle it as a simple USB device).  I&#8217;m keeping this for record.</p>
<p>The kernel (2.6.x) must have USB_STORAGE (M), USB_HID, and USB_DEVICEFS.  Options SCSI (M) and BLK_DEV_SD (M) under SCSI device support are also needed.</p>
<p>Add usb-storage to <em>/etc/modules</em> file for automatic startup on boot.  Then</p>
<pre style="border:1px solid #ccc;padding:4px;">
# apt-get install sg3-utils hotplug
# tail /var/log/messages
</pre>
<p>to see where the digital camera is located.  Use that to add an entry to <em>/etc/fstab</em>:</p>
<pre style="border:1px solid #ccc;padding:4px;">
/dev/sda1    /media/camera       vfat     noauto,user,umask=000    0    0
</pre>
<p>Connect the camera to a USB port, and turns it on.  Reboot the machine. The camera can be mounted using</p>
<pre style="border:1px solid #ccc;padding:4px;">
$ mount /media/camera
</pre>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=285</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GParted, Partition Magic Replacement</title>
		<link>http://okomestudio.net/biboroku/?p=283</link>
		<comments>http://okomestudio.net/biboroku/?p=283#comments</comments>
		<pubDate>Sat, 28 Mar 2009 00:41:40 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=283</guid>
		<description><![CDATA[For disk partitioning, my Partition Magic replacement for Linux is GParted. I rarely need this now that I don&#8217;t use Windows much any more.]]></description>
				<content:encoded><![CDATA[<p>For disk partitioning, my Partition Magic replacement for Linux is <a href="http://gparted.sourceforge.net/">GParted</a>.  I rarely need this now that I don&#8217;t use Windows much any more.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=283</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Renewing My Passport</title>
		<link>http://okomestudio.net/biboroku/?p=275</link>
		<comments>http://okomestudio.net/biboroku/?p=275#comments</comments>
		<pubDate>Tue, 24 Mar 2009 00:43:49 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Misc.]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=275</guid>
		<description><![CDATA[All the info appears to be listed here. For this one I have to visit the consulate general of Japan in person. How inconvenient.]]></description>
				<content:encoded><![CDATA[<p>All the info appears to be listed <a href="http://www.sf.us.emb-japan.go.jp/jp/m03_01_02.htm">here</a>.  For this one I have to visit the consulate general of Japan <em>in person</em>.  How inconvenient.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=275</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting a Work Permit for Canada</title>
		<link>http://okomestudio.net/biboroku/?p=272</link>
		<comments>http://okomestudio.net/biboroku/?p=272#comments</comments>
		<pubDate>Tue, 24 Mar 2009 00:39:45 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Misc.]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=272</guid>
		<description><![CDATA[This page appears to have all the information. Looks like I don&#8217;t have to travel down to LA just to submit my application, which is good.]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.canadainternational.gc.ca/los_angeles/imm/permit_work-travail_permis.aspx?lang=eng">This page</a> appears to have all the information.</p>
<p>Looks like I don&#8217;t have to travel down to LA just to submit my application, which is good.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=272</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WBC: Japan defeats USA</title>
		<link>http://okomestudio.net/biboroku/?p=269</link>
		<comments>http://okomestudio.net/biboroku/?p=269#comments</comments>
		<pubDate>Mon, 23 Mar 2009 07:21:08 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Diary]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=269</guid>
		<description><![CDATA[Japan 9, USA 4. I still think the team USA will come out on top if the game is played in the MLB style: A long season with more than 150 games or so. At the highest level, the best &#8230; <a href="http://okomestudio.net/biboroku/?p=269">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><a href="http://mlb.mlb.com/wbc/2009/news/article.jsp?ymd=20090322&amp;content_id=4049190&amp;vkey=wbc_recap&amp;team=jpn&amp;lang=1">Japan 9, USA 4</a>.</p>
<p>I still think the team USA will come out on top if the game is played in the MLB style: A long season with more than 150 games or so.  At the highest level, the best team in baseball often wins only less than 60% of the time.  The outcome wouldn&#8217;t be surprising even if the team USA were in fact <em>the</em> best team.  The effect of chance gets magnified.</p>
<p>However, it is true that you don&#8217;t have to watch MLB to appreciate the best of baseball any more.  When I was a kid, MLB seemed out of reach.  It was unthinkable that a Japanese team would play well against MLB players.</p>
<p>Not any more.</p>
<p>And it is actually kind of sad that we have lost a lofty target and goal to follow and pursue.  It is even sadder that this is happening when the popularity of baseball is actually dwindling in Japan.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=269</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple Firewall with iptables on Debian</title>
		<link>http://okomestudio.net/biboroku/?p=230</link>
		<comments>http://okomestudio.net/biboroku/?p=230#comments</comments>
		<pubDate>Mon, 23 Mar 2009 01:04:43 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=230</guid>
		<description><![CDATA[Install iptables: # apt-get install iptables First, make a set of iptables rules and save it to a file (say, /etc/firewall-rules.sh): # BEGIN /etc/firewall-rules.sh #!/bin/sh iptables -F iptables -P INPUT DROP iptables -P OUTPUT ACCEPT iptables -P FORWARD DROP iptables &#8230; <a href="http://okomestudio.net/biboroku/?p=230">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Install iptables:</p>
<pre style="border:1px solid #ccc;padding:4px;">
# apt-get install iptables
</pre>
<p>First, make a set of iptables rules and save it to a file (say, <em>/etc/firewall-rules.sh</em>):</p>
<pre style="border:1px solid #ccc;padding:4px;">
# BEGIN /etc/firewall-rules.sh
#!/bin/sh

iptables -F

iptables -P INPUT DROP
iptables -P OUTPUT ACCEPT
iptables -P FORWARD DROP

iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -i lo -j ACCEPT
iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport ssh -j ACCEPT
iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport rsync -j ACCEPT
iptables -A INPUT -j DROP
# END /etc/firewall-rules.sh
</pre>
<p>Modify <em>/etc/network/interfaces</em> such that the firewall script gets executed when the network connection gets established:</p>
<pre style="border:1px solid #ccc;padding:4px;">
iface eth0 inet dhcp
  pre-up /etc/firewall-rules.sh eth0
</pre>
<p>Do the <a href="https://www.grc.com/x/ne.dll?bh0bkyd2">security checkup with ShieldsUP! by Gibson Research Corporation</a> to see if the firewall is working.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=230</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IDL v6.0.3 on Debian Etch</title>
		<link>http://okomestudio.net/biboroku/?p=227</link>
		<comments>http://okomestudio.net/biboroku/?p=227#comments</comments>
		<pubDate>Mon, 23 Mar 2009 00:46:10 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Etch]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=227</guid>
		<description><![CDATA[(Note: This is an old installation note.) Install version 6.0 as described in the installation guide (i.e., install in /usr/local/rsi). Since v6.0 is in the archive, you need to contact the customer support to obtain a link to the download. &#8230; <a href="http://okomestudio.net/biboroku/?p=227">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>(Note: This is an old installation note.)</p>
<p>Install version 6.0 as described in the installation guide (i.e., install in <em>/usr/local/rsi</em>).  Since v6.0 is in the archive, you need to <a href="http://www.ittvis.com/idl/">contact the customer support</a> to obtain a link to the download.  Also ask for v6.0.3 patch, which is a separate download.</p>
<p>After installing IDL, you need to install the license manager. lmgrd needs accss to a temporary location, so do:</p>
<pre style="border:1px solid #ccc;padding:4px;">
# sudo mkdir /usr/tmp
</pre>
<p>Store the license file to <em>/usr/local/rsi/license/license.dat</em>.</p>
<p>Make a script that runs lmgrd:</p>
<pre style="border:1px solid #ccc;padding:4px;">
#!/bin/bash
LD_ASSUME_KERNEL=2.4.1
export LD_ASSUME_KERNEL
/usr/local/rsi/idl/bin/lmgrd &gt; /tmp/idl_lmgrd.log
</pre>
<p>Copy the above script (call it run_lmgrd) to <em>/etc/init.d</em>, and make a symlink to it in <em>/etc/rc2.d/S20run_lmgrd</em>.  After rebooting (or running the script manually), the license should be honored.</p>
<p>Obtain the <a href="http://idlastro.gsfc.nasa.gov/">IDL Astronomy User&#8217;s Library</a> (file: astron.tar.gz) and install .pro files into <em>/usr/local/lib/idl/astrolib/pro</em></p>
<p>Adding the above path to IDL_PATH enables the use.</p>
<p>Recycle and store <em>.idlenv</em> and <em>.idlstartup</em> into the user&#8217;s home directory.</p>
<p>Add lines</p>
<pre style="border:1px solid #ccc;padding:4px;">
. /usr/local/rsi/idl/bin/idl_setup.bash
. /home/taro/.idlenv
export LM_LICENSE_FILE=/usr/local/rsi/license/license.dat
</pre>
<p>to <em>~/.bashrc</em>.</p>
<p>Install the v6.0.3 patch following the supplied instruction manual.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=227</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wine on Debian Lenny</title>
		<link>http://okomestudio.net/biboroku/?p=225</link>
		<comments>http://okomestudio.net/biboroku/?p=225#comments</comments>
		<pubDate>Mon, 23 Mar 2009 00:40:43 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Lenny]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=225</guid>
		<description><![CDATA[To install Wine, do # apt-get install wine To launch a Windows Explorer-like file browser, do $ winefile in which you can manage installers and programs just like in Windows. Installing IEs4Linux Follow the instruction here.]]></description>
				<content:encoded><![CDATA[<p>To install Wine, do</p>
<pre style="border:1px solid #ccc;padding:4px;">
# apt-get install wine
</pre>
<p>To launch a Windows Explorer-like file browser, do</p>
<pre style="border:1px solid #ccc;padding:4px;">
$ winefile
</pre>
<p>in which you can manage installers and programs just like in Windows.</p>
<h2>Installing IEs4Linux</h2>
<p>Follow the instruction <a href="http://www.tatanka.com.br/ies4linux/page/Main_Page">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=225</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Microsoft Natural Ergonomic Keyboard 4000 on Debian Lenny</title>
		<link>http://okomestudio.net/biboroku/?p=221</link>
		<comments>http://okomestudio.net/biboroku/?p=221#comments</comments>
		<pubDate>Mon, 23 Mar 2009 00:34:21 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Lenny]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=221</guid>
		<description><![CDATA[Unfortunately not all the &#8220;special keys&#8221; can be enabled at this point; the zoom bar in the middle being notable example. For my own use it really doesn&#8217;t matter since I rarely make use of them. Download the .deb package &#8230; <a href="http://okomestudio.net/biboroku/?p=221">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Unfortunately not all the &#8220;special keys&#8221; can be enabled at this point; the zoom bar in the middle being notable example.  For my own use it really doesn&#8217;t matter since I rarely make use of them.</p>
<p>Download the .deb package file from the <a href="http://packages.debian.org/squeeze/xkb-data">xkb-data repository for Squeeze</a>.  Then</p>
<blockquote>
<pre>$ sudo dpkg -i xkb-data_1.7-2_all.deb</pre>
</blockquote>
<p>Now under the K menu, go to Control Center -&gt; Regional &amp; Accessibility -&gt; Keyboard Layout -&gt; Layout.  Choose Microsoft Natural Wireless Ergonomic Keyboard 7000 as the Keyboard model. Restart X.</p>
<h4>Obsolete Way</h4>
<p>An approach here is to use an APT pinning to get a later version of the xkb-data package from the testing repository.  That includes the keyboard layout data for MS Ergonomic Keyboard 7000, which we can use.</p>
<p>First, add a testing repository to <em>/etc/apt/sources.list</em>:</p>
<blockquote>
<pre>deb http://ftp.us.debian.org/debian lenny main contrib non-free
deb-src http://ftp.us.debian.org/debian lenny main contrib non-free

deb http://www.debian-multimedia.org/ lenny main

deb http://security.debian.org/ lenny/updates main contrib non-free
deb-src http://security.debian.org/ lenny/updates main contrib non-free

# For a few packages including: MS Natural Ergo Keyboard 4000
deb http://ftp.us.debian.org/debian testing main contrib non-free
</pre>
</blockquote>
<p>In <em>/etc/apt/preferences</em>, have the following lines:</p>
<blockquote>
<pre>Package: *
Pin: release v=5.0*
Pin-Priority: 700

Package: xkb-data
Pin: release a=testing
Pin-Priority: 650
</pre>
</blockquote>
<p>Here v = 5.0* means the stable version (Lenny is 5.0).  So only xkb-data will be fetched from testing, but the rest remains stable.</p>
<p>Then install the xkb-data package:</p>
<blockquote>
<pre>$ sudo apt-get update
$ sudo apt-get install xkb-data
</pre>
</blockquote>
<p>Now under the K menu go to Control Center -&gt; Regional &amp; Accessibility -&gt; Keyboard Layout -&gt; Layout.  Choose Microsoft Natural Wireless Ergonomic Keyboard 7000 as the Keyboard model.  Restart X.</p>
<p>Most special keys should be working by now.</p>
<h4>Update History</h4>
<p>March 13, 2010: Using .deb is much easier, so I obsoleted the apt-pinning method.  (Not to mention it was no longer working for me for some reason&#8230;)</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=221</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mathematica 4.2 on Debian Etch</title>
		<link>http://okomestudio.net/biboroku/?p=218</link>
		<comments>http://okomestudio.net/biboroku/?p=218#comments</comments>
		<pubDate>Sun, 22 Mar 2009 22:47:49 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Etch]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=218</guid>
		<description><![CDATA[Note: I&#8217;m yet to successfully install Mathematica 4.2 on Lenny. I might try again or it is really the time to stop using it. Symbolic math is so convenient though&#8230; Meanwhile, please let me know if you know of a &#8230; <a href="http://okomestudio.net/biboroku/?p=218">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Note: I&#8217;m yet to successfully install Mathematica 4.2 on Lenny.  I might try again or it is really the time to stop using it.  Symbolic math is so convenient though&#8230;  Meanwhile, please let me know if you know of a good open-source alternative!</p>
<p>Mount the install CD:</p>
<pre style="border:1px solid #ccc;padding:4px;">
# mount -o exec -r -t iso9660 /dev/hdc /media/cdrom
</pre>
<p>where <em>/dev/hdc</em> should be replaced by the device of your CD/DVD drive.</p>
<pre style="border:1px solid #ccc;padding:4px;">
# cd /media/cdrom/Installers/Linux
# ./MathInstaller
</pre>
<p>Choose default directory, &#8220;Linux&#8221; install type, Full install, Single machine, and default install directory.</p>
<p>When copying files is finished, you need to create a couple symlinks:</p>
<pre style="border:1px solid #ccc;padding:4px;">
# cd /usr/X11R6/lib/X11
# ln -s /usr/share/X11/XKeysymDB XKeysymDB
# ln -s /usr/share/X11/locale locale
</pre>
<p>You then need to set things up for dynamically-linked binaries.  The detailed documentation is given <a href="http://support.wolfram.com/mathematica/systems/linux/intel/dynamic.html">here</a>, and here&#8217;s a summary:</p>
<pre style="border:1px solid #ccc;padding:4px;">
# SRC=/media/cdrom/Files/SystemFiles
# DST=/usr/local/Wolfram/Mathematica/4.2/SystemFiles
# cp -r ${SRC}/Kernel/Binaries/Linux-dyn ${DST}/Kernel/Binaries
# cp -r ${SRC}/Kernel/SystemResources/Linux-dyn ${DST}/Kernel/SystemResources
# cp -r ${SRC}/FrontEnd/Binaries/Linux-dyn ${DST}/FrontEnd/Binaries
# cp -r ${SRC}/Graphics/Binaries/Linux-dyn ${DST}/Graphics/Binaries
# cp -r ${SRC}/Converters/Binaries/Linux-dyn ${DST}/Converters/Binaries
</pre>
<p>Now you need to modify some scripts.  In the directory</p>
<pre style="border:1px solid #ccc;padding:4px;">
# cd /usr/local/Wolfram/Mathematica/4.2/Executables/Linux
</pre>
<p>find scripts named <tt>math</tt>, <tt>mathematica</tt>, <tt>MathKernel</tt>, and <tt>Mathematica</tt>.  In all these files, replace the line</p>
<pre style="border:1px solid #ccc;padding:4px;">
sysid=Linux
</pre>
<p>to</p>
<pre style="border:1px solid #ccc;padding:4px;">
sysid=Linux-dyn
</pre>
<p>Also add a line</p>
<pre style="border:1px solid #ccc;padding:4px;">
export LD_ASSUME_KERNEL=2.4.1
</pre>
<p>to the same files.</p>
<p>Do the same for the similarly named scripts in the directory <em>/usr/local/bin</em>.</p>
<p>That should be it.  You will need a license number and a password to use the product.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=218</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linksys WMP54G on Debian Etch</title>
		<link>http://okomestudio.net/biboroku/?p=216</link>
		<comments>http://okomestudio.net/biboroku/?p=216#comments</comments>
		<pubDate>Sun, 22 Mar 2009 22:38:14 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Etch]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=216</guid>
		<description><![CDATA[(Note: This is for Etch and may be obsolete.) Follow the &#8220;official&#8221; instruction for etch, which is summarized as: # apt-get install module-assistant # module-assistant prepare # apt-get install rt2500-source # module-assistant auto-install rt2500-source Reboot or load right away: # &#8230; <a href="http://okomestudio.net/biboroku/?p=216">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>(Note: This is for Etch and may be obsolete.)</p>
<p>Follow the <a href="http://rt2x00.serialmonkey.com/wiki/index.php/Debian_rt2500_Howto">&#8220;official&#8221; instruction for etch</a>, which is summarized as:</p>
<pre style="border:1px solid #ccc;padding:4px;">
# apt-get install module-assistant
# module-assistant prepare
# apt-get install rt2500-source
# module-assistant auto-install rt2500-source
</pre>
<p>Reboot or load right away:</p>
<pre style="border:1px solid #ccc;padding:4px;">
# modprobe rt2500
</pre>
<p>To see which device name has been assigned, do</p>
<pre style="border:1px solid #ccc;padding:4px;">
# ifconfig -a
</pre>
<p>Then see configuring network to finish off configurinig <em>/etc/network/interfaces</em>.</p>
<p>Unfortunately, the rt2500 driver is still buggy, and may need</p>
<pre style="border:1px solid #ccc;padding:4px;">
# iwconfig wlan0 rate 54M
</pre>
<p>to make it work at its full capacity.  Write a script which runs the above command somewhere, e.g., <em>~/.kde/Autostart</em>, so that you do not have to do this manually.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=216</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linksys WET54G on Debian Lenny</title>
		<link>http://okomestudio.net/biboroku/?p=214</link>
		<comments>http://okomestudio.net/biboroku/?p=214#comments</comments>
		<pubDate>Sun, 22 Mar 2009 22:33:42 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Lenny]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=214</guid>
		<description><![CDATA[Add the following interface to /etc/network/interfaces: iface wet54g inet static address 192.168.1.10 netmask 255.255.255.0 Connect the bridge WET54G to the computer. If an Ethernet card is configured as eth0, do # ifup eth0=wet54g The WET54G web interface can be accessed &#8230; <a href="http://okomestudio.net/biboroku/?p=214">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Add the following interface to <em>/etc/network/interfaces</em>:</p>
<pre style="border:1px solid #ccc;padding:4px;">iface wet54g inet static
  address 192.168.1.10
  netmask 255.255.255.0</pre>
<p>Connect the bridge WET54G to the computer.  If an Ethernet card is configured as eth0, do</p>
<pre style="border:1px solid #ccc;padding:4px;"># ifup eth0=wet54g</pre>
<p>The WET54G web interface can be accessed at 192.168.1.226.  Keep the static IP address for later use.  Specify wireless SSID and configure security setting if necessary.  The network type should be infrastructure in normal setting.  Restart the bridge.  (Also for me WPA2 PSK and TKIP for security setting&#8230;)</p>
<p>Once the bridge is receiving the wireless connection, having</p>
<pre style="border:1px solid #ccc;padding:4px;">auto eth0
iface eth0 inet dhcp</pre>
<p>in <em>/etc/network/interfaces</em> will configure the network via DHCP on reboot.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=214</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Compiz Fusion in Dell XPS 630i (Debian Lenny)</title>
		<link>http://okomestudio.net/biboroku/?p=211</link>
		<comments>http://okomestudio.net/biboroku/?p=211#comments</comments>
		<pubDate>Sun, 22 Mar 2009 22:24:57 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Lenny]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=211</guid>
		<description><![CDATA[Note: This is a cursory note when I set up Lenny on Dell XPS 630i (the video card is nVidia GeForce 8800 GT) when Lenny was still testing. For detail I used this and that. Install the nVidia video driver &#8230; <a href="http://okomestudio.net/biboroku/?p=211">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Note: This is a cursory note when I set up Lenny on Dell XPS 630i (the video card is nVidia GeForce 8800 GT) when Lenny was still testing.  For detail I used <a href="http://www.compiz.org/How_to_compile_and_run_Compiz_for_nvidia_card_users">this</a> and <a href="http://forums.debian.net/viewtopic.php?t=26966">that</a>.</p>
<p>Install the nVidia video driver from the nVidia web site (use their installer and follow their instruction).  Then install some packages:</p>
<pre style="border:1px solid #ccc;padding:4px;">
# apt-get install compiz compiz-core compiz-gnome compiz-gtk compiz-plugins
                  compizconfig-settings-manager libcompizconfig0
                  python-compizconfig libdecoration0
# apt-get install compiz-fusion-bcop compiz-fusion-plugins-extra
                  compiz-fusion-plugins-main
                  compiz-fusion-plugins-unsupported
                  compizconfig-backend-gconf compizconfig-backend-kconfig
                  compizconfig-settings-manager libcompizconfig0
# apt-get install compiz-kde fusion-icon
</pre>
<p>Also to let the script modify <em>/etc/X11/xorg.conf</em>, do:</p>
<pre style="border:1px solid #ccc;padding:4px;">
# nvidia-xconfig --composite
# nvidia-xconfig --render-accel
# nvidia-xconfig --allow-glx-with-composite
# nvidia-xconfig --add-argb-glx-visuals
</pre>
<p>In <em>/etc/X11/xorg.conf</em>, make sure DefaultDepth is set to 24, if it isn&#8217;t already, then add the following lines below &#8220;EndSubSection&#8221; or above the first &#8220;SubSection&#8221;:</p>
<pre style="border:1px solid #ccc;padding:4px;">
Option         "AddARGBGLXVisuals" "true"
Option         "DisableGLXRootClipping" "true"
</pre>
<p>Save the file and exit the text editor. Now restart the X-server by pressing Ctrl + Alt + Del or reboot.</p>
<p>Use <tt>fusion-icon</tt> to configure.  You can use *.profile file to restore saved configuration.</p>
<p>To auto-start compiz fusion at KDE startup, open an editor, and create a file with the following contents:</p>
<pre style="border:1px solid #ccc;padding:4px;">
#!/bin/sh
/usr/bin/fusion-icon
</pre>
<p>Save the file as <em>~/.kde/Autostart/compiz_start.sh</em>.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=211</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using NSF Filesystem to Use an Old Debian Box as File Server</title>
		<link>http://okomestudio.net/biboroku/?p=208</link>
		<comments>http://okomestudio.net/biboroku/?p=208#comments</comments>
		<pubDate>Sun, 22 Mar 2009 22:17:20 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Etch]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=208</guid>
		<description><![CDATA[Note: This is an old note. I tend to use a very old and slow desktop Debian (then Etch) box as a file server for backup and extra storage. This was my attempt to do it via NSF. The documentation &#8230; <a href="http://okomestudio.net/biboroku/?p=208">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Note: This is an old note.  I tend to use a very old and slow desktop Debian (then Etch) box as a file server for backup and extra storage.  This was my attempt to do it via NSF.  The documentation has not been updated for Lenny.</p>
<p>First, kernel must be built with appropriate modules pertaining NSF, both on client and server sides.</p>
<h2>Server Configuration</h2>
<p>Make sure to have the following kernel support:</p>
<pre style="border:1px solid #ccc;padding:4px;">
NFSD     (m)
NFSD_V3  (y)
NFSD_TCP (y)
</pre>
<p>On the server side, install following packages:</p>
<pre style="border:1px solid #ccc;padding:4px;">
# apt-get install nfs-kernel-server nfs-common portmap
</pre>
<p>Edit <em>/etc/exports</em> such that the directories to be exported and the clients needing access to them are specified, e.g.,</p>
<pre style="border:1px solid #ccc;padding:4px;">
/some/dir client(rw,sync)
</pre>
<p>Note that &#8220;async&#8221; option, instead of &#8220;sync&#8221;, should be used if high performance is desired (the chance of data corruption upon server crash will be higher, though).</p>
<p>Then execute</p>
<pre style="border:1px solid #ccc;padding:4px;">
# exportfs -a
</pre>
<p>to make the change in effect.</p>
<h2>Client Configuration</h2>
<p>Make sure to have the following kernel support:</p>
<pre style="border:1px solid #ccc;padding:4px;">
NFS_FS   (m)
NFS_V3   (y)
</pre>
<p>On the client side, install following packages:</p>
<pre style="border:1px solid #ccc;padding:4px;">
# apt-get install nfs-common portmap
</pre>
<p>The remote directory <em>server:/some/dir</em> can be mounted at this point. However, most likely you may want to add a line to <em>/etc/fstab</em>:</p>
<pre style="border:1px solid #ccc;padding:4px;">
server:/some/dir /mnt/somer/dir nfs rw,hard,intr,rsize=1024,wsize=1024 0 0
</pre>
<p>To optimize the transfer rate, rsize and wsize needs to be determined by experimentation.  Use a script like this:</p>
<pre style="border:1px solid #ccc;padding:4px;">
# BEGIN transtest.sh ########################################################
#!/bin/bash

# Specify a mount point.
MNTPT=/some/dir

# Specify a file to be generated.
FNAME=${MNTPT}/testfile

# File size in MB.
let "FSIZE = 1024 * 1024 *  100"

# Block sizes to try.
BSARR=(1024 2048 4096 8192 16384 32768 65536)

# Do the measurements!
for idx in `seq 0 6`;
  do
  for i in `seq 1 3`;
    do

    BS=${BSARR[idx]}
    let "COUNT=${FSIZE}/${BS}"

    echo "##### Iteration $i at bs=${BS} and count=${COUNT} #####"

    sudo umount ${MNTPT}
    sudo mount ${MNTPT}

    echo "Writing to ${FNAME}..."
    time dd if=/dev/zero of=${FNAME} bs=${BS} count=${COUNT}

    sudo umount ${MNTPT}
    sudo mount ${MNTPT}

    echo "Reading from ${FNAME}..."
    time dd if=${FNAME} of=/dev/null bs=${BS}

    echo ""
  done
done

rm ${FNAME}

echo "Done."
# END transtest.sh ##########################################################
</pre>
<p>Change FSIZE to mean about twice the physical RAM of the server.  Run the script (which should be placed on the client machine, outside the directory tree to be mounted) as a user who can un/mount and has a write permission to the directory.  This takes a long time, so the output should be saved</p>
<pre style="border:1px solid #ccc;padding:4px;">
someone$ ./transtest.sh &gt; testout 2&gt;&amp;1
</pre>
<p>Pick the lowest rsize and wsize values which gives you the fast transfer rates.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=208</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Local Area Networking with Cross-over Cable in Debian</title>
		<link>http://okomestudio.net/biboroku/?p=202</link>
		<comments>http://okomestudio.net/biboroku/?p=202#comments</comments>
		<pubDate>Sun, 22 Mar 2009 21:55:03 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=202</guid>
		<description><![CDATA[(Note: This method (which I used often when Debian stable was Woody) is obsolete as there is what I think is a much nicer solution. I leave this note just for record.) Easiest way to transfer a large amount of &#8230; <a href="http://okomestudio.net/biboroku/?p=202">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>(Note: This method (which I used often when Debian stable was Woody) is obsolete as there is what I think is a <a href="http://nomo17k.wordpress.com/2009/03/22/using-hostnames-in-local-area-network-on-debian-lenny/">much nicer solution</a>.  I leave this note just for record.)</p>
<p>Easiest way to transfer a large amount of data between two Linux boxes is to use PC-to-PC networking using a cross-over cable.  At least one of the box (i.e., server) has to have sshd running.  First, find out which network interface corresponds to the NIC on the server.</p>
<pre style="border:1px solid #ccc;padding:4px;">
server$ sudo ifconfig -a
</pre>
<p>Let&#8217;s say eth0 is the NIC of the server.  Then assign an IP address to it by</p>
<pre style="border:1px solid #ccc;padding:4px;">
server$ sudo ifconfig eth0 192.168.0.1
</pre>
<p>Then on the client side, you do similarly:</p>
<pre style="border:1px solid #ccc;padding:4px;">
client$ sudo ifconfig -a
</pre>
<p>Say eth1 is the NIC of the client.  Then</p>
<pre style="border:1px solid #ccc;padding:4px;">
client$ sudo ifconfig eth1 192.168.0.2
</pre>
<p>Now the usual ssh session can be used between the two computers using the IP addresses assigned above.  Now with the command</p>
<pre style="border:1px solid #ccc;padding:4px;">
client$ ssh 192.168.0.1
</pre>
<p>client is connected to the server.</p>
<p>Obviously, going through the above procedure is rather tedius, so automation is in order.  First install guessnet:</p>
<pre style="border:1px solid #ccc;padding:4px;">
# apt-get install guessnet
</pre>
<p>In <em>/etc/network/interface</em>, have the lines:</p>
<pre style="border:1px solid #ccc;padding:4px;">
allow-hotplug eth0

mapping eth0
  script /usr/sbin/guessnet-ifupdown
  map home_local
  map default: dhcp_fb

iface dhcp_fb inet dhcp

iface home_local inet static
  pre-up if grep -q tg3 /proc/modules; then :; else modprobe tg3; fi
  address 192.168.0.2
  netmask 255.255.255.0
  test peer address 192.168.0.1 mac xx:xx:xx:xx:xx:xx
</pre>
<p>where tg3 should be replaced by the correct module for your system, and the MAC address in the &#8220;test peer&#8221; line should correspond to that of the NIC on the server.  In the above, eth0 is assumed to be the NIC on the client.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=202</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Hostnames in Local Area Network on Debian Lenny</title>
		<link>http://okomestudio.net/biboroku/?p=200</link>
		<comments>http://okomestudio.net/biboroku/?p=200#comments</comments>
		<pubDate>Sun, 22 Mar 2009 21:45:27 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Lenny]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=200</guid>
		<description><![CDATA[Background: I have a couple Debian Lenny boxes. They connect to the Internet via a wireless (or wired) router. The IPs are assigned dynamically via DHCP. It is fairly easy to set up a LAN with static IP addresses (e.g., &#8230; <a href="http://okomestudio.net/biboroku/?p=200">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Background: I have a couple Debian Lenny boxes.  They connect to the Internet via a wireless (or wired) router.  The IPs are assigned dynamically via DHCP.  It is fairly easy to set up a LAN with static IP addresses (e.g., 127.0.0.101, 127.0.0.102, etc.), but it is not so convenient to remember IP addresses for each computer in LAN.  When I ssh into another box, I want to use a hostname rather than an IP address.</p>
<p>There is a very easy solution!</p>
<p>In <em>/etc/dhcp3/dhclient.conf</em> of each computer, specify</p>
<pre style="border:1px solid #ccc;padding:4px;">
send host-name "johndoe";
</pre>
<p>(for a host named &#8220;johndoe&#8221;).  This way a host can be identified via a hostname, not via an IP address.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=200</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Wacom Intuos Tablet on Debian Etch</title>
		<link>http://okomestudio.net/biboroku/?p=196</link>
		<comments>http://okomestudio.net/biboroku/?p=196#comments</comments>
		<pubDate>Sun, 22 Mar 2009 21:16:12 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Etch]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=196</guid>
		<description><![CDATA[(Note: This is for Debian Etch, not Lenny. I have not tried this on Lenny.) The kernel module &#8220;wacom&#8221; from 2.6.16 should work out of the box. Install some packages: # apt-get install wacom-tools Add the following input devices to &#8230; <a href="http://okomestudio.net/biboroku/?p=196">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>(Note: This is for Debian Etch, not Lenny.  I have not tried this on Lenny.)</p>
<p>The kernel module &#8220;wacom&#8221; from 2.6.16 should work out of the box.</p>
<p>Install some packages:</p>
<pre style="border:1px solid #ccc;padding:4px;">
# apt-get install wacom-tools
</pre>
<p>Add the following input devices to <em>/etc/X11/xorg.conf</em>:</p>
<pre style="border:1px solid #ccc;padding:4px;">
Section "InputDevice"
	Identifier	"stylus"
	Driver		"wacom"
	Option		"Type"		"stylus"
	Option		"Mode"		"Absolute"
	Option		"USB"		"on"
	Option		"Threshold"	"10"
	Option		"Tilt"		"on"
	Option		"Device"	"/dev/input/wacom"
EndSection

Section "InputDevice"
	Identifier	"eraser"
	Driver		"wacom"
	Option		"Type"		"eraser"
	Option		"Mode"		"Absolute"
	Option		"USB"		"on"
	Option		"Tilt"		"on"
	Option		"Threshold"	"10"
	Option		"Device"	"/dev/input/wacom"
EndSection

Section "InputDevice"
	Identifier	"cursor"
	Driver		"wacom"
	Option		"Type"		"cursor"
	Option		"Mode"		"Relative"
	Option		"USB"		"on"
	Option		"Threshold"	"10"
	Option		"Device"	"/dev/input/wacom"
EndSection

Section "InputDevice"
	Identifier	"pad"
	Driver		"wacom"
	Option		"Device"	"/dev/input/wacom"
	Option		"Type"		"pad"
	Option		"USB"		"on"
EndSection
</pre>
<p>Add to ServerLayout:</p>
<pre style="border:1px solid #ccc;padding:4px;">
Section "ServerLayout"
	...

	InputDevice	"stylus"	"SendCoreEvents"
	InputDevice	"eraser"	"SendCoreEvents"
	InputDevice	"cursor"	"SendCoreEvents"
	InputDevice	"pad"		""
EndSection
</pre>
<h2>GIMP</h2>
<p>To use cool features like pressure sensitivity and eraser with GIMP, go to: File -&gt; Preferences -&gt; Input Devices -&gt; Configure Extended Input Devices, and set stylus, cursor, eraser, pad to &#8220;Screen.&#8221;  This should be it!</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=196</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>USB Keyboard on Linux</title>
		<link>http://okomestudio.net/biboroku/?p=194</link>
		<comments>http://okomestudio.net/biboroku/?p=194#comments</comments>
		<pubDate>Sun, 22 Mar 2009 21:08:41 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=194</guid>
		<description><![CDATA[To use a USB keyboard, the kernel support needs: Input core support: yes Keyboard support: yes USB Human Interface Device (full HID) support: yes HID input layer support: yes]]></description>
				<content:encoded><![CDATA[<p>To use a USB keyboard, the kernel support needs:</p>
<pre style="border:1px solid #ccc;padding:4px;">
Input core support: yes
Keyboard support: yes
USB Human Interface Device (full HID) support: yes
HID input layer support: yes
</pre>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=194</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Gnuplot (v4.3) from CVS on Debian Etch</title>
		<link>http://okomestudio.net/biboroku/?p=191</link>
		<comments>http://okomestudio.net/biboroku/?p=191#comments</comments>
		<pubDate>Sun, 22 Mar 2009 21:04:51 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Etch]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=191</guid>
		<description><![CDATA[(Note that this is for Debian Etch and written back in 2007. It may have become obsolete now. I&#8217;m just keeping it for record.) (See http://www.gnuplot.info/ for detail.) First, install LaTeX stuff (see other instruction) and others: # apt-get install &#8230; <a href="http://okomestudio.net/biboroku/?p=191">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>(Note that this is for Debian Etch and written back in 2007.  It may have become obsolete now.  I&#8217;m just keeping it for record.)</p>
<p>(See <a href="http://www.gnuplot.info/">http://www.gnuplot.info/</a> for detail.)</p>
<p>First, install LaTeX stuff (see other instruction) and others:</p>
<pre style="border:1px solid #ccc;padding:4px;">
# apt-get install cvs groff cm-super texinfo
</pre>
<p>The summary of building from CVS source:</p>
<pre style="border:1px solid #ccc;padding:4px;">
# mkdir /usr/local/src/gnuplot
# cd /usr/local/src/gnuplot
# export CVSROOT=:pserver:anonymous@gnuplot.cvs.sourceforge.net:/cvsroot/gnuplot
# cvs login
# cvs -z3 checkout gnuplot
# cd gnuplot
# ./prepare
</pre>
<p>(If ./prepare complains about aclocal or something else, install some packages</p>
<pre style="border:1px solid #ccc;padding:4px;">
# apt-get install automake1.9 autoconf
</pre>
<p>before you do ./prepare.)</p>
<pre style="border:1px solid #ccc;padding:4px;">
# ./configure --with-readline=gnu
# make
# make install-strip
# apt-get install gnuplot-mode
</pre>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=191</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Matrox MGA G400-TV on Debian Etch</title>
		<link>http://okomestudio.net/biboroku/?p=188</link>
		<comments>http://okomestudio.net/biboroku/?p=188#comments</comments>
		<pubDate>Sun, 22 Mar 2009 20:51:37 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Etch]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=188</guid>
		<description><![CDATA[(Note that this is for Debian Etch, as I have not tried the procedure on Lenny. It may have become obsolete now.) (For more detail, see http://marvel.sourceforge.net/) # apt-get install cvs This instruction is for kernel version 2.6.18. # mkdir &#8230; <a href="http://okomestudio.net/biboroku/?p=188">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>(Note that this is for Debian Etch, as I have not tried the procedure on Lenny.  It may have become obsolete now.)</p>
<p>(For more detail, see <a href="http://marvel.sourceforge.net/">http://marvel.sourceforge.net/</a>)</p>
<pre style="border:1px solid #ccc;padding:4px;">
# apt-get install cvs
</pre>
<p>This instruction is for kernel version 2.6.18.</p>
<pre style="border:1px solid #ccc;padding:4px;">
# mkdir /usr/local/src/matrox/mgavideo
# cd /usr/local/src/matrox/mgavideo
</pre>
<p>First, download the driver_fb source from the CVS repository (you may also use an appropriate stable version):</p>
<pre style="border:1px solid #ccc;padding:4px;">
# cvs -d:pserver:anonymous@marvel.cvs.sourceforge.net:/cvsroot/marvel login
# cvs -z3 -d:pserver:anonymous@marvel.cvs.sourceforge.net:/cvsroot/marvel co -P driver_fb
</pre>
<p>The Linux kernel source must be patched and recompiled.  Follow the README.  Here&#8217;s the summary:</p>
<pre style="border:1px solid #ccc;padding:4px;">
# cd /usr/src/linux
# emacs Makefile      # append to kernel version
# make mrproper
# make clean
# patch -p1 &lt; /usr/local/src/matrox/mgavideo/driver_fb/kernel-2.6.19.patch
# make xconfig        # if you need to change kernel options
# make-kpkg clean
# make-kpkg kernel_image
# cd ..
# dpkg -i linux-image-***.deb
</pre>
<p>Reboot and then</p>
<pre style="border:1px solid #ccc;padding:4px;">
# cd /usr/local/src/matrox/mgavideo/driver_fb
# make
</pre>
<p>In the module loading script iv, you need to comment out the following line:</p>
<pre style="border:1px solid #ccc;padding:4px;">
#/sbin/modprobe matroxfb_maven
</pre>
<p>Create a script <em>/etc/init.d/iv</em> with the contents:</p>
<pre style="border:1px solid #ccc;padding:4px;">
#!/bin/sh
cd /usr/local/src/matrox/mgavideo/driver_fb
./iv
</pre>
<p>Make the script executable and create a symlink in <em>/etc/rc2.d</em>:</p>
<pre style="border:1px solid #ccc;padding:4px;">
# chmod a+x /etc/init.d/iv
# ln -s /etc/init.d/iv /etc/rc2.d/S98iv
</pre>
<p>Reboot, and should be set.</p>
<pre style="border:1px solid #ccc;padding:4px;">
# apt-get install xawtv scantv xawtv-plugins xserver-xorg-video-mga
</pre>
<p>You may want to recycle the xawtv config file, <em>/etc/X11/xawtvrc</em> from the previous installation.  Also modify the &#8220;Device&#8221; section of <em>/etc/X11/xorg.conf</em> to specify &#8220;mga&#8221; as Driver.</p>
<p>Finally, add a line</p>
<pre style="border:1px solid #ccc;padding:4px;">
xawtv.xv: false
</pre>
<p>to <em>~/.Xresources</em> so that DVD viewing with xv is possible.</p>
<p>If you are annoyed by some garbled windows while watching TV, setting</p>
<pre style="border:1px solid #ccc;padding:4px;">
DefaultDepth 16
</pre>
<p>in the &#8220;Screen&#8221; section of <em>/etc/X11/xorg.conf</em> should solve the problem.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=188</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>EPSON Perfection 1260 on Debian Lenny</title>
		<link>http://okomestudio.net/biboroku/?p=185</link>
		<comments>http://okomestudio.net/biboroku/?p=185#comments</comments>
		<pubDate>Sun, 22 Mar 2009 20:46:29 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Lenny]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=185</guid>
		<description><![CDATA[Kernel (version 2.6.x) must be configured such that it has /proc and usb device file system support. (Or more recent info state that you need the kernel modules usbhid, ehci_hcd, and ohci_hcd; see this guide for detail.) Then install a &#8230; <a href="http://okomestudio.net/biboroku/?p=185">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Kernel (version 2.6.x) must be configured such that it has <em>/proc</em> and usb device file system support.  (Or more recent info state that you need the kernel modules usbhid, ehci_hcd, and ohci_hcd; see <a href="http://viger.altervista.org/guide/scannerusb.html">this guide</a> for detail.)</p>
<p>Then install a bunch of software</p>
<pre style="border:1px solid #ccc;padding:4px;"># apt-get install dbus hal sane
# apt-get install sane-utils xsane libpng-dev usbutils</pre>
<p>Verify the scanner is detected:</p>
<pre style="border:1px solid #cccccc;padding:4px;"># sane-find-scanner</pre>
<p>should indicate something similar to</p>
<pre style="border:1px solid #cccccc;padding:4px;">found USB scanner (vendor=0x04b8 [EPSON], product=0x011d
[EPSON Scanner], chip=LM9832/3) at libusb:003:005</pre>
<p>Add a user who needs access to the scanner to the group scanner:</p>
<pre style="border:1px solid #ccc;padding:4px;"># adduser username scanner
# exit
$ scanimage -L</pre>
<p>Make sure that the last command shows something similar to</p>
<pre style="border:1px solid #ccc;padding:4px;">device `plustek:libusb:003:005' is a Epson Perfection 1260/Photo USB
flatbed scanner</pre>
<p>This confirms that the scanner is usable.  After starting a new session,</p>
<pre style="border:1px solid #ccc;padding:4px;">$ xsane</pre>
<p>should get you going.  Note that hotplugging may not recognize the scanner at times (e.g., after rebooting).  Try unplug and plug again the USB cable if that happens.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=185</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Timezone Setting for Windows / Debian Lenny Dual Boot</title>
		<link>http://okomestudio.net/biboroku/?p=181</link>
		<comments>http://okomestudio.net/biboroku/?p=181#comments</comments>
		<pubDate>Sun, 22 Mar 2009 20:38:17 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Lenny]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=181</guid>
		<description><![CDATA[In order to coexist with a dumb system like Microsoft Windows, it may be necessary to set up Debian to use localtime instead of UTC to keep track of time. In /etc/default/rcS, change a line to have UTC=no. Then reboot. &#8230; <a href="http://okomestudio.net/biboroku/?p=181">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>In order to coexist with a dumb system like Microsoft Windows, it may be necessary to set up Debian to use localtime instead of UTC to keep track of time.</p>
<p>In <em>/etc/default/rcS</em>, change a line to have <tt>UTC=no</tt>.  Then reboot.  If you wish, the <a href="http://nomo17k.wordpress.com/2009/03/22/using-ntp-server-to-synchronize-time-on-debian-lenny/">system time can be then synchronized with the ntp</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=181</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using KDict Locally on Debian Lenny</title>
		<link>http://okomestudio.net/biboroku/?p=174</link>
		<comments>http://okomestudio.net/biboroku/?p=174#comments</comments>
		<pubDate>Sun, 22 Mar 2009 20:10:03 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Lenny]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=174</guid>
		<description><![CDATA[Online dictionaries are fantastic, but once in a while an access to a dictionary without picking up wireless becomes necessary. It may be handy to have KDict set up so that it doesn&#8217;t query a remote host. If you will &#8230; <a href="http://okomestudio.net/biboroku/?p=174">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Online dictionaries are fantastic, but once in a while an access to a dictionary without picking up wireless becomes necessary.  It may be handy to have KDict set up so that it doesn&#8217;t query a remote host.</p>
<p>If you will be using dict.org through the web, just doing</p>
<pre style="border:1px solid #ccc;padding:4px;">
# apt-get install kdict
</pre>
<p>is enough to start using KDict right away.  If you wish to use it offline, you need a daemon and some database:</p>
<pre style="border:1px solid #ccc;padding:4px;">
# apt-get install dictd
# apt-get install dict-wn
# apt-get install dict-gcide
# apt-get install dict-jargon
# apt-get install dict-moby-thesaurus
# apt-get install dict-vera
# apt-get install dict-foldoc
</pre>
<p>You may select any of dict-*; they are <a href="http://packages.debian.org/search?keywords=dict&amp;searchon=names&amp;suite=all&amp;section=all">different dictionaries</a>.  Launch <tt>kdict</tt>, go to Settings -&gt; Configure Dictionary -&gt; Server, and specify &#8220;localhost&#8221; (instead of dict.org) as the hostname in DICT Server Configuration.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=174</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ruby on Debian Lenny</title>
		<link>http://okomestudio.net/biboroku/?p=171</link>
		<comments>http://okomestudio.net/biboroku/?p=171#comments</comments>
		<pubDate>Sun, 22 Mar 2009 20:02:08 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Lenny]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=171</guid>
		<description><![CDATA[Here I will keep adding Ruby-related reminders for my Debian box. # apt-get install ruby ruby-elisp]]></description>
				<content:encoded><![CDATA[<p>Here I will keep adding Ruby-related reminders for my Debian box.</p>
<pre style="border:1px solid #ccc;padding:4px;">
# apt-get install ruby ruby-elisp
</pre>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=171</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Canon PIXMA iP1800 for Debian Lenny</title>
		<link>http://okomestudio.net/biboroku/?p=165</link>
		<comments>http://okomestudio.net/biboroku/?p=165#comments</comments>
		<pubDate>Sun, 22 Mar 2009 19:51:21 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Debian/Lenny]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[install procedure]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=165</guid>
		<description><![CDATA[This is a cheap inkjet printer that I got for my temporary printing needs. The cartridges are very expensive (&#62; $16 !!), so for heavy use this isn&#8217;t really worth my money. Anyways&#8230; Install CUPS and printing-related packages: # apt-get &#8230; <a href="http://okomestudio.net/biboroku/?p=165">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>This is a cheap inkjet printer that I got for my temporary printing needs.  The cartridges are very expensive (&gt; $16 !!), so for heavy use this isn&#8217;t really worth my money.  Anyways&#8230;</p>
<p>Install CUPS and printing-related packages:</p>
<pre><code># apt-get install cupsys cupsys-client libcupsys2
# apt-get install cupsys-driver-gimpprint cupsys-bsd
# apt-get install foomatic-db-engine foomatic-db-gimp-print foomatic-filters
# apt-get install hp-ppd linuxprinting.org-ppds printfilters-ppd
# apt-get install foomatic-filters-ppds
# apt-get install gs-gpl libpng3 ijsgutenprint</code></pre>
<p>(Note that I downloaded a few packages that are not necessary for this particular printer.  This is a generic collection of packages that I find useful to use printers in other places like my office.)</p>
<p><a href="http://home.btconnect.com/jerryf/">Download deb packages</a> of the printer driver:</p>
<pre><code>cnijfilter-common_2.70-3_i386.deb
cnijfilter-ip1800series_2.70-3_i386.deb</code></pre>
<p>and install them:</p>
<pre><code># dpkg -i cnijfilter-common_2.70-3_i386.deb cnijfilter-ip1800series_2.70-3_i386.deb</code></pre>
<p>If CUPS has been installed properly, visit the CUPS admin page (<a href="http://localhost:631/admin">http://localhost:631/admin</a>) with your browser.  You will be able to configure the printer in the standard CUPS way.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=165</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Using NTP Server to Synchronize Time on Debian Lenny</title>
		<link>http://okomestudio.net/biboroku/?p=161</link>
		<comments>http://okomestudio.net/biboroku/?p=161#comments</comments>
		<pubDate>Sun, 22 Mar 2009 19:31:06 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Debian/Lenny]]></category>
		<category><![CDATA[install procedure]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=161</guid>
		<description><![CDATA[# apt-get install ntp # /etc/init.d/ntp restart That&#8217;s it. How simple is that!]]></description>
				<content:encoded><![CDATA[<pre><code># apt-get install ntp
# /etc/init.d/ntp restart</code></pre>
<p>That&#8217;s it.  How simple is that!</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=161</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Python on Debian Lenny</title>
		<link>http://okomestudio.net/biboroku/?p=153</link>
		<comments>http://okomestudio.net/biboroku/?p=153#comments</comments>
		<pubDate>Sun, 22 Mar 2009 09:32:05 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Lenny]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=153</guid>
		<description><![CDATA[# apt-get install python ipython python-doc # apt-get install python-numpy python-scipy python-matplotlib SciPy from Source It is recommended the stable versions to be downloaded and installed from www.scipy.org. # apt-get install subversion swig python2.5-dev python-nose # apt-get install libatlas-headers libatlas-base-dev &#8230; <a href="http://okomestudio.net/biboroku/?p=153">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<pre style="border:1px solid #ccc;padding:4px;"># apt-get install python ipython python-doc
# apt-get install python-numpy python-scipy python-matplotlib</pre>
<h2>SciPy from Source</h2>
<p>It is recommended the stable versions to be downloaded and installed from <a href="http://www.scipy.org">www.scipy.org</a>.</p>
<pre style="border:1px solid #ccc;padding:4px;"># apt-get install subversion swig python2.5-dev python-nose
# apt-get install libatlas-headers libatlas-base-dev
# apt-get install libfftw3-dev libsuitesparse-dev
# apt-get install liblapack-dev gfortran</pre>
<p>For matplotlib (UNDER CONSTRUCTION),</p>
<pre style="border:1px solid #ccc;padding:4px;"># apt-get install libpng12-dev libfreetype6-dev dvipng python-dateutil python-tz

# # for gtk and gtkagg
# apt-get install python-gtk2-dev

# # for tkagg
# apt-get install tk-dev

# # for wxagg
# apt-get install python-wxgtk2.8 libwxbase2.8-dev
</pre>
<pre>and follow the installation instruction of the distribution.</pre>
<p>The following instruction is for installing from svn repository.  To install NumPy:</p>
<pre style="border:1px solid #ccc;padding:4px;"># rm -rf numpy.prev
# mv numpy numpy.prev
# svn co http://svn.scipy.org/svn/numpy/trunk numpy
# rm -rf /usr/lib/python2.5/site-packages/numpy.prev
# mv /usr/lib/python2.5/site-packages/numpy /usr/lib/python2.5/site-packages/numpy.prev
# cd numpy
# python setup.py install
# cd ..</pre>
<p>To install SciPy:</p>
<pre style="border:1px solid #ccc;padding:4px;"># rm -rf scipy.prev
# mv scipy scipy.prev
# svn co http://svn.scipy.org/svn/scipy/trunk scipy
# rm -rf /usr/lib/python2.5/site-packages/scipy.prev
# mv /usr/lib/python2.5/site-packages/scipy /usr/lib/python2.5/site-packages/scipy.prev
# cd scipy
# python setup.py install
# cd ..</pre>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=153</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Emacs on Debian Lenny</title>
		<link>http://okomestudio.net/biboroku/?p=142</link>
		<comments>http://okomestudio.net/biboroku/?p=142#comments</comments>
		<pubDate>Sun, 22 Mar 2009 09:02:01 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Lenny]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=142</guid>
		<description><![CDATA[Install basic packages: # apt-get install emacs22 aspell aspell-en # apt-get install css-mode php-elisp html-helper-mode Changing the Size of Emacs Window Use xfontsel to select a desired font. In ~/.Xresources, write lines as follow: emacs.font: -misc-fixed-medium-r-semicondensed--13-*-*-*-c-60-iso8859-1 emacs.pane.menubar.font: -misc-fixed-medium-r-semicondensed--13-*-*-*-c-60-iso8859-1 to change &#8230; <a href="http://okomestudio.net/biboroku/?p=142">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Install basic packages:</p>
<pre style="border:1px solid #ccc;padding:4px;">
# apt-get install emacs22 aspell aspell-en
# apt-get install css-mode php-elisp html-helper-mode
</pre>
<h2>Changing the Size of Emacs Window</h2>
<p>Use <tt>xfontsel</tt> to select a desired font.  In ~/.Xresources, write lines as follow:</p>
<pre style="border:1px solid #ccc;padding:4px;">
emacs.font:              -misc-fixed-medium-r-semicondensed--13-*-*-*-c-60-iso8859-1
emacs.pane.menubar.font: -misc-fixed-medium-r-semicondensed--13-*-*-*-c-60-iso8859-1
</pre>
<p>to change font setting in emacs.  To source a modified <em>~/.Xresources</em> file in the current session, do</p>
<pre style="border:1px solid #ccc;padding:4px;">
$ xrdb ~/.Xresources
</pre>
<p>and the next invocation of emacs will reflect the change.</p>
<h2>JavaScript Mode: javascript.el</h2>
<p>First, <a href="http://www.brgeight.se/downloads/emacs/javascript.el">download javascript.el</a>, and save it to <em>/usr/share/emacs/site-lisp</em>.  Add the following lines to the <em>~/.emacs</em> file in your home directory:</p>
<pre style="border:1px solid #ccc;padding:4px;">
;; for javascript mode
(add-to-list 'auto-mode-alist '("\.js\'" . javascript-mode))
(autoload 'javascript-mode "javascript" nil t)
</pre>
<p>This will enable emacs to recognize .js file as a javascript file.</p>
<h2>JavaScript Mode: js2</h2>
<p>First, <a href="http://code.google.com/p/js2-mode/downloads/list">download js2.el</a> and save it to <em>/usr/share/emacs/site-lisp</em> as <em>js2.el</em>.  Add the following lines to the <em>~/.emacs</em> file in your home directory:</p>
<pre style="border:1px solid #ccc;padding:4px;">
;; for js2 mode
(autoload 'js2-mode "js2" nil t)
(add-to-list 'auto-mode-alist '("\.js$" . js2-mode))
</pre>
<p>This will enable emacs to recognize .js file as a javascript file.  Also, in Emacs, do: <tt>M-x byte-compile-file RE js2.el RET</tt></p>
<h2>More Reliable Clipboard</h2>
<p>Add to <em>~/.emacs</em> the following lines:</p>
<pre style="border:1px solid #ccc;padding:4px;">
;; for clipboard
(setq x-select-enable-clipboard t)
(setq interprogram-paste-function 'x-cut-buffer-or-selection-value)
</pre>
<h2>Changing Title Bar</h2>
<p>Using this tip, the title bar will show the path to the file being modified.  See <a href="http://www.emacswiki.org/cgi-bin/wiki/FrameTitle#toc4">this tip</a>:</p>
<pre style="border:1px solid #ccc;padding:4px;">
$ wget http://www.emacswiki.org/cgi-bin/wiki/download/frame-cmds.el
$ mv frame-cmds.el ~/.emacs.d
</pre>
<p>Then add the following lines to <em>~/.emacs</em>:</p>
<pre style="border:1px solid #ccc;padding:4px;">
;; for frame-cmds.el
(setq frame-title-format '("" "%f"))
</pre>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=142</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>LaTeX on Debian Lenny</title>
		<link>http://okomestudio.net/biboroku/?p=138</link>
		<comments>http://okomestudio.net/biboroku/?p=138#comments</comments>
		<pubDate>Sun, 22 Mar 2009 08:16:12 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Lenny]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=138</guid>
		<description><![CDATA[Install basic packages for LaTeX: # apt-get install texlive texlive-latex-extra texlive-math-extra # apt-get install texinfo cm-super # apt-get install cjk-latex xdvik-ja dvipsk-ja latex-cjk-japanese ptex-jtex nkf # apt-get install cmap-adobe-cns1 cmap-adobe-gb1 cmap-adobe-japan1 cmap-adobe-japan2 # apt-get install gs-cjk-resource The last three lines &#8230; <a href="http://okomestudio.net/biboroku/?p=138">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Install basic packages for LaTeX:</p>
<blockquote>
<pre># apt-get install texlive texlive-latex-extra texlive-math-extra
# apt-get install texinfo cm-super

# apt-get install cjk-latex xdvik-ja dvipsk-ja latex-cjk-japanese ptex-jtex nkf
# apt-get install cmap-adobe-cns1 cmap-adobe-gb1 cmap-adobe-japan1 cmap-adobe-japan2
# apt-get install gs-cjk-resource</pre>
</blockquote>
<p>The last three lines are for using Japanese.  With \documentclass[a4j]{jarticle}, for example, we can generate a Japanese document with LaTeX. I like to make documents with international characters with UTF-8, but the Japanese documents here need to be encoded with EUC-JP before using platex command, by doing something like this:</p>
<blockquote><p>$ nkf -e doc.tex &gt; euc_doc.tex<br />
$ platex euc_doc.tex<br />
$ dvipdfmx euc_doc.dvi<br />
$ acroread euc_doc.pdf &amp;</p></blockquote>
<p>Hopefully UTF-8 can be used in Squeeze&#8230;</p>
<p>The rest of the sections are only relevant for astrophysicists.</p>
<h2>Installing AASTeX v5.2 LaTeX 2e</h2>
<pre style="border:1px solid #ccc;padding:4px;"># mkdir /usr/share/texmf/tex/latex/misc
# mkdir /usr/local/src/AASTeX
# cd /usr/local/src/AASTeX
# wget http://dopey.mcmaster.ca/AASTeX/aastex52_large.tar.gz
# gunzip -c aastex52_large.tar.gz | tar xvf -
# cd aastex52
# make install
# texconfig rehash
</pre>
<h2>Installing emulateapj.cls (ver. August 13, 2006)</h2>
<pre style="border:1px solid #ccc;padding:4px;"># mkdir /usr/share/texmf/tex/latex/misc
# mkdir /usr/local/src/emulateapj
# cd /usr/local/src/emulateapj
# wget http://hea-www.harvard.edu/~alexey/emulateapj/emulateapj.cls
# wget http://hea-www.harvard.edu/~alexey/emulateapj/apjfonts.sty
# cp emulateapj.cls /usr/share/texmf/tex/latex/misc
# cp apjfonts.sty /usr/share/texmf/tex/latex/misc
</pre>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=138</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PDF Utilities on Debian Lenny</title>
		<link>http://okomestudio.net/biboroku/?p=133</link>
		<comments>http://okomestudio.net/biboroku/?p=133#comments</comments>
		<pubDate>Sun, 22 Mar 2009 07:45:21 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Lenny]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=133</guid>
		<description><![CDATA[Programs for handling PDF files: # apt-get install acroread acroread-plugins mozilla-acroread # apt-get install xpdf gv # apt-get install pdftk To install Japanese fonts for acroread, go to a download site at Adobe get a relevant tarball. Run the install &#8230; <a href="http://okomestudio.net/biboroku/?p=133">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Programs for handling PDF files:</p>
<pre style="border:1px solid #ccc;padding:4px;">
# apt-get install acroread acroread-plugins mozilla-acroread
# apt-get install xpdf gv
# apt-get install pdftk
</pre>
<p>To install Japanese fonts for acroread, go to a <a href="http://www.adobe.com/products/acrobat/acrrasianfontpack.html">download site at Adobe</a> get a relevant tarball.  Run the install script and specify the installation direction as <em>/usr/lib</em>.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=133</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Utility Programs for Debian Lenny</title>
		<link>http://okomestudio.net/biboroku/?p=131</link>
		<comments>http://okomestudio.net/biboroku/?p=131#comments</comments>
		<pubDate>Sun, 22 Mar 2009 07:40:44 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Lenny]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=131</guid>
		<description><![CDATA[Here I simply list the apt-get commands to fetch all the small utility programs that I often use. I cut and paste these to install complete an installation to my liking! Archiving # apt-get install bzip2 zip unzip]]></description>
				<content:encoded><![CDATA[<p>Here I simply list the apt-get commands to fetch all the small utility programs that I often use.  I cut and paste these to install complete an installation to my liking!</p>
<h2>Archiving</h2>
<pre style="border:1px solid #ccc;padding:4px;">
# apt-get install bzip2 zip unzip
</pre>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=131</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Customizing &amp; Installing Linux Kernel 2.6.x on Debian Lenny</title>
		<link>http://okomestudio.net/biboroku/?p=118</link>
		<comments>http://okomestudio.net/biboroku/?p=118#comments</comments>
		<pubDate>Sun, 22 Mar 2009 07:34:31 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Lenny]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=118</guid>
		<description><![CDATA[Here is a quickie for customizing and install Linux kernel 2.6.x on Lenny. Install some packages and kernel source: $ sudo apt-get install kernel-package bzip2 g++ libqt3-mt-dev libncurses5-dev sudo fakeroot $ sudo apt-get install linux-source-2.6.26 If you do not belong &#8230; <a href="http://okomestudio.net/biboroku/?p=118">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Here is a quickie for customizing and install Linux kernel 2.6.x on Lenny.</p>
<p>Install some packages and kernel source:</p>
<blockquote>
<pre>$ sudo apt-get install kernel-package bzip2 g++ libqt3-mt-dev libncurses5-dev sudo fakeroot
$ sudo apt-get install linux-source-2.6.26</pre>
</blockquote>
<p>If you do not belong to group &#8220;src&#8221;, add yourself to the group as we work under <em>/usr/src</em>.  You also need to be able to use <em>sudo</em> or <em>su</em>.</p>
<p>Extract the source tree:</p>
<blockquote>
<pre>$ cd /usr/src
$ tar -jxf linux-source-2.6.26.tar.bz2
$ ln -s linux-source-2.6.26 linux
$ cd linux
</pre>
</blockquote>
<p>Edit the EXTRAVERSION entry in <em>Makefile</em>, as in:</p>
<blockquote>
<pre>EXTRAVERSION = .20100310.1
</pre>
</blockquote>
<p>for example to add .20100310.1 to the kernel version number.  This is convenient for keeping the existing, working kernels around when you need to recompile with different options.</p>
<p>Use <em>xconfig</em> or <em>menuconfig</em> to customize the kernel options.</p>
<blockquote>
<pre>$ make mrproper
$ make xconfig    # or make menuconfig
$ make-kpkg clean
$ fakeroot make-kpkg --initrd kernel_image
$ cd ..
$ sudo dpkg -i linux-image-2.6.26.20090322.1_2.6.26.20090322.1-10.00.Custom_i386.deb</pre>
</blockquote>
<p>Upon reboot in the GRUB menu you will find the newly installed kernel:</p>
<blockquote>
<pre>$ sudo shutdown -r now
</pre>
</blockquote>
<h2>Purging Old Kernel Image from System</h2>
<blockquote>
<pre>$ sudo dpkg -P linux-image-2.6.26.20091112.1
</pre>
</blockquote>
<p>Just specifying the kernel image to remove.  That&#8217;s it.  However it is often a good idea to keep at least one kernel image that you know for sure to be working, so that when your new custom kernel fails, you have something to fall back on to recompile it again.</p>
<h4>Update History</h4>
<p>March 13, 2010: Updated the tutorial to use <em>fakeroot</em> and <em>sudo</em> in stead of becoming root.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=118</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Sharing an X Session between a Regular User &amp; Root</title>
		<link>http://okomestudio.net/biboroku/?p=123</link>
		<comments>http://okomestudio.net/biboroku/?p=123#comments</comments>
		<pubDate>Sun, 22 Mar 2009 07:28:55 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Lenny]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=123</guid>
		<description><![CDATA[When you use su to become a superuser (root) and launch a program that has GUI on KDE, you will notice that you get an error like this: # konqueror No protocol specified konqueror: cannot connect to X server :0 &#8230; <a href="http://okomestudio.net/biboroku/?p=123">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>When you use <tt>su</tt> to become a superuser (root) and launch a program that has GUI on KDE, you will notice that you get an error like this:</p>
<pre style="border:1px solid #ccc;padding:4px;">
# konqueror
No protocol specified
konqueror: cannot connect to X server :0
</pre>
<p>In order to share an X session with a regular user, say johndoe, root needs to share an authorization cookie.  One way to achieve this is to make a BASH script (called &#8220;usex&#8221; here):</p>
<pre style="border:1px solid #ccc;padding:4px;">
#!/bin/bash
#
# Share the authorization cookie for an X session between a regular
# user and root.
#

# specify the username of X session owner from which the authorization
# cookie is copied
USRNAME=johndoe


##############################################################################
# do not modify below

xauth -f /home/${USRNAME}/.Xauthority extract - :0 | xauth merge -
export DISPLAY=:0
</pre>
<p>and run this every time you become root.  Make this script accessible at <em>/root/bin/usex</em> and add a line to execute it within <em>/root/.bashrc</em>, somewhere toward the end of the file:</p>
<pre style="border:1px solid #ccc;padding:4px;">
~/bin/usex
</pre>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=123</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>More Fonts on Debian Lenny</title>
		<link>http://okomestudio.net/biboroku/?p=115</link>
		<comments>http://okomestudio.net/biboroku/?p=115#comments</comments>
		<pubDate>Sun, 22 Mar 2009 07:01:55 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Lenny]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=115</guid>
		<description><![CDATA[Install some commonly used fonts: # apt-get install x-ttcidfont-conf msttcorefonts ttf-xfree86-nonfree If you have TrueType font files (.ttf), it is easiest to install fonts via KDE Control Center: Control Center -&#62; System Administration -&#62; Font Installer.]]></description>
				<content:encoded><![CDATA[<p>Install some commonly used fonts:</p>
<pre style="border:1px solid #ccc;padding:4px;">
# apt-get install x-ttcidfont-conf msttcorefonts ttf-xfree86-nonfree
</pre>
<p>If you have TrueType font files (.ttf), it is easiest to install fonts via KDE Control Center: Control Center -&gt; System Administration -&gt; Font Installer.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=115</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Logitech MX Revolution on Debian Lenny</title>
		<link>http://okomestudio.net/biboroku/?p=104</link>
		<comments>http://okomestudio.net/biboroku/?p=104#comments</comments>
		<pubDate>Sun, 22 Mar 2009 06:02:17 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Lenny]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=104</guid>
		<description><![CDATA[For detail, see the instruction for Ubuntu. Before starting, make sure that the uinput kernel module is available. This means that you have the kernel options CONFIG_INPUT_MISC=y and CONFIG_UINPUT=m. If you cannot load uinput with modprobe uinput, you have to &#8230; <a href="http://okomestudio.net/biboroku/?p=104">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>For detail, see the <a href="http://ubuntuforums.org/showthread.php?p=2727025">instruction for Ubuntu</a>.</p>
<p>Before starting, make sure that the uinput kernel module is available.  This means that you have the kernel options <tt>CONFIG_INPUT_MISC=y</tt> and <tt>CONFIG_UINPUT=m</tt>.  If you cannot load uinput with <tt>modprobe uinput</tt>, you have to <a href="http://nomo17k.wordpress.com/2009/03/22/customizing-installing-linux-kernel-26x-on-debian-lenny/">recompile the kernel</a>.</p>
<p>Compile from source:</p>
<pre style="border:1px solid #ccc;padding:4px;">
# apt-get install build-essential libgtk2.0-0 libgtk2.0-dev libglade2-0
# apt-get install libglade2-dev pkg-config libdaemon0 libdaemon-dev

$ mkdir /usr/local/src/btnx
$ cd /usr/local/src/btnx

$ wget http://www.ollisalonen.com/btnx/btnx-0.4.11.tar.gz
$ tar -xvvf btnx-0.4.11.tar.gz
$ cd btnx-0.4.11
$ ./configure
$ make
$ sudo make install

$ wget http://www.ollisalonen.com/btnx/btnx-config-0.4.9.tar.gz
$ tar -xvvf btnx-config-0.4.9.tar.gz
$ cd btnx-config-0.4.9
$ ./configure
$ make
$ sudo make install
</pre>
<p>Now btnx-config should be one of the menu item. In GNOME, Applications-&gt;System tools-&gt;btnx. In KDE, System-&gt;btnx. Press it to launch btnx-config.</p>
<p>Load from a backup archive for your customized configuration, if exists.</p>
<p>It doesn&#8217;t seem to be necessary to add anything to <em>/etc/X11/xorg.conf</em> to make MX Revolution work at this point.</p>
<p>If the kernel does not have necessary options, try this: Need the kernel support (&#8220;yes&#8221;) for Input Core Support (select for mouse as well), USB Human Interface Device (Full HID) Support, and HID Input Layer Support.<br />
star&lt;tt</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=104</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OpenOffice in Debian Lenny</title>
		<link>http://okomestudio.net/biboroku/?p=101</link>
		<comments>http://okomestudio.net/biboroku/?p=101#comments</comments>
		<pubDate>Sun, 22 Mar 2009 05:58:12 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Lenny]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=101</guid>
		<description><![CDATA[This is simple! # apt-get install openoffice.org Even using Japanese works out of the box.]]></description>
				<content:encoded><![CDATA[<p>This is simple!</p>
<pre style="border:1px solid #ccc;padding:4px;">
# apt-get install openoffice.org
</pre>
<p>Even using Japanese works out of the box.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=101</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Japanese in Debian Lenny</title>
		<link>http://okomestudio.net/biboroku/?p=95</link>
		<comments>http://okomestudio.net/biboroku/?p=95#comments</comments>
		<pubDate>Sun, 22 Mar 2009 04:43:40 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Lenny]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=95</guid>
		<description><![CDATA[The goal is to make the system capable for Japanese input, while the base remains English. The software of choice is Anthy and scim. First, install Japnese locales ja_JP.EUC-JP and ja_JP.UTF-8: $ sudo apt-get install locales $ sudo dpkg-reconfigure locales &#8230; <a href="http://okomestudio.net/biboroku/?p=95">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>The goal is to make the system capable for Japanese input, while the base remains English.  The software of choice is <a href="http://anthy.sourceforge.jp/">Anthy</a> and <a href="http://www.scim-im.org/">scim</a>.</p>
<p>First, install Japnese locales ja_JP.EUC-JP and ja_JP.UTF-8:</p>
<blockquote><pre>$ sudo apt-get install locales
$ sudo dpkg-reconfigure locales</pre>
</blockquote>
<p>Set the default locale for the system to en_US (or something else if you wish).</p>
<p>Install necessary Debian packages:</p>
<blockquote><pre>$ sudo apt-get install anthy anthy-el libanthy0
$ sudo apt-get install scim-tables-ja scim-anthy scim
$ sudo apt-get install skim scim-gtk2-immodule scim-modules-socket kasumi
$ sudo apt-get install ttf-kochi-mincho ttf-kochi-gothic
</pre>
</blockquote>
<p>Launch skim (for KDE):</p>
<blockquote><pre>$ skim -d -f</pre>
</blockquote>
<p>and you will see an icon in the system tray.  Right click on the system tray icon and click on Configure to launch it.  Go to FrontEnd -&gt; General SCIM -&gt; Other and change &#8220;Panel Program&#8221; to &#8220;scim-panel-kde&#8221; and &#8220;Config Module&#8221; to &#8220;kconfig&#8221; to optimize for KDE.</p>
<p>Then run <em>im-switch -c</em> and choose skim from the list.  This will make it possible to use the input method in any locale.</p>
<p>After restarting X, you should be able to use the input method.  Try visiting Google and place the focus on the search word input form.  Shift + space (and some other key combinations) will switch between the Japanese and English modes.</p>
<p>Some applications still need some environment variable set to display Japanese appropriately.  I make a little script that I will source whenever I wish to type Japanese in an application.  The application launched from the same shell will have Japanese capacity.</p>
<pre style="border:1px solid #ccc;padding:4px;">#!/bin/bash
export LC_CTYPE="ja_JP.UTF-8"
export XMODIFIERS=@im=SCIM
export GTK_IM_MODULE=scim
export QT_IM_MODULE=scim
</pre>
<h2>Emacs</h2>
<p>Install packages:</p>
<blockquote><p># sudo apt-get install emacs22 mule-ucs anthy-el emacs21-el emacs-goodies-el</p></blockquote>
<p>Add the following lines to ~/.emacs:</p>
<blockquote><p>;; Japanese with Anthy<br />
(set-language-environment &#8220;Japanese&#8221;)<br />
(set-terminal-coding-system &#8216;utf-8)<br />
(set-keyboard-coding-system &#8216;utf-8)<br />
(set-buffer-file-coding-system &#8216;utf-8)<br />
(setq default-buffer-file-coding-system &#8216;utf-8)<br />
(prefer-coding-system &#8216;utf-8)<br />
(set-default-coding-systems &#8216;utf-8)<br />
(setq file-name-coding-system &#8216;utf-8)<br />
;; Following is probably not necessary unless using without GUI.<br />
;;(load-library &#8220;anthy&#8221;)<br />
;;(setq default-input-method &#8220;japanese-anthy&#8221;)</p></blockquote>
<p>(See <a href="https://wiki.ubuntulinux.jp/UbuntuTips/Application/EmacsJapaneseSetup">here</a> for Ubuntu documentation.)</p>
<h2>Using M+ IPA Fonts</h2>
<p>If you want to have more choices on fonts, you might try <a href="http://mix-mplus-ipa.sourceforge.jp/">M + IPA fonts</a>.  The font is slightly anti-aliased and people say it looks better.  Here is the installation summary.</p>
<p><a href="http://sourceforge.jp/projects/mix-mplus-ipa/releases/">Download the font pack</a> to, say, <em>~/tmp</em>.  Then</p>
<pre style="border:1px solid #ccc;padding:4px;">$ cd ~/tmp
$ tar xvf mixfont-mplus-ipa-TrueType-20060520p1.tar.bz2
$ cd mixfont-mplus-ipa-TrueType-20060520p1/opfc-ModuleHP-1.1.1_withIPAFonts_and_Mplus/fonts
$ cp *.ttf ~/.fonts
$ fc-cache
</pre>
<p>The change takes effect after restarting X.  Choose the fonts with names starting with M+1P+IPAG, etc., to make use of them.</p>
<blockquote><p>&lt;</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=95</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Sound Applications (Amarok, Ogg, etc.) in Debian Lenny</title>
		<link>http://okomestudio.net/biboroku/?p=88</link>
		<comments>http://okomestudio.net/biboroku/?p=88#comments</comments>
		<pubDate>Sun, 22 Mar 2009 04:28:56 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Lenny]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=88</guid>
		<description><![CDATA[Amarok is my favorite audio player. For tagging ogg files, I use EasyTAG: $ sudo apt-get install amarok easytag-aac kmix In order to make Amarok adjust volume automatically for different volume level at which music are recorded, I use ReplayGain &#8230; <a href="http://okomestudio.net/biboroku/?p=88">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><a href="http://amarok.kde.org/">Amarok</a> is my favorite audio player.  For tagging ogg files, I use <a href="http://easytag.sourceforge.net/">EasyTAG</a>:</p>
<blockquote>
<pre>$ sudo apt-get install amarok easytag-aac kmix
</pre>
</blockquote>
<p>In order to make Amarok adjust volume automatically for different volume level at which music are recorded, I use ReplayGain script for Amarok.  It needs to be <a href="http://www.kde-apps.org/content/show.php?content=26073">downloaded manually</a> and installed via script manager.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=88</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Firefox (Iceweasel) on Debian Lenny</title>
		<link>http://okomestudio.net/biboroku/?p=84</link>
		<comments>http://okomestudio.net/biboroku/?p=84#comments</comments>
		<pubDate>Sun, 22 Mar 2009 04:06:33 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Lenny]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=84</guid>
		<description><![CDATA[Note that in Debian, Firefox is called iceweasel. $ sudo apt-get install iceweasel Then install some popular plugins. Java For i386: $ sudo apt-get install sun-java5-plugin sun-java5-fonts For AMD64, I have not looked up yet. Flash For i386: $ sudo &#8230; <a href="http://okomestudio.net/biboroku/?p=84">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Note that in Debian, Firefox is called <em>iceweasel</em>.</p>
<blockquote>
<pre>$ sudo apt-get install iceweasel
</pre>
</blockquote>
<p>Then install some popular plugins.</p>
<h2>Java</h2>
<p>For i386:</p>
<blockquote>
<pre>$ sudo apt-get install sun-java5-plugin sun-java5-fonts
</pre>
</blockquote>
<p>For AMD64, I have not looked up yet.</p>
<h2>Flash</h2>
<p>For i386:</p>
<blockquote>
<pre>$ sudo apt-get install flashplayer-mozilla
</pre>
</blockquote>
<p>For AMD64, the <em>flashplayer-mozilla</em> package does not exist.  You have to add the backports.org repository to <em>/etc/apt/sources.list</em> and do</p>
<blockquote>
<pre>$ sudo apt-get install flashplugin-nonfree
</pre>
</blockquote>
<p>This should do it.  Try youtube.com to see if Flash is working.</p>
<h2>MPlayer</h2>
<blockquote>
<pre>$ sudo apt-get install mozilla-mplayer
</pre>
</blockquote>
<h2>Other Tips</h2>
<h3>Speeding Up via Pipelining</h3>
<p>Visit the URL about:config with Firefox and set the following items:</p>
<pre style="border:1px solid #ccc;padding:4px;">network.http.pipelining = true
network.http.pipelining.maxrequests = 30
network.http.proxy.pipelining = true
</pre>
<h3>Send Link Bug</h3>
<p>If &#8220;Send Link&#8230;&#8221; in Firefox does not open your email client, visit the URL about:config, and add an entry:</p>
<pre style="border:1px solid #ccc;padding:4px;">network.protocol-handler.app.mailto : 'icedove'
</pre>
<p>and restart Firefox.  This sets the default emailer to Thunderbird (icedove in Debian).</p>
<h4>Update History:</h4>
<p>March 13, 2010: Added infor for AMD64 architecture.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=84</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Turning Off Auto-checking of Filesystems on Boot</title>
		<link>http://okomestudio.net/biboroku/?p=80</link>
		<comments>http://okomestudio.net/biboroku/?p=80#comments</comments>
		<pubDate>Sun, 22 Mar 2009 03:44:11 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Lenny]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=80</guid>
		<description><![CDATA[By default the filesystems will be regularly checked even if the filesystem is marked clean. Typically, this happens on every few dozen mounts on boot. This quite possibly not what you want to happen for laptop. In fact, one of &#8230; <a href="http://okomestudio.net/biboroku/?p=80">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>By default the filesystems will be regularly checked even if the filesystem is marked clean.  Typically, this happens on every few dozen mounts on boot.  This quite possibly not what you want to happen for laptop.  In fact, one of the advantages of ext3 filesystem is journaling which makes regular checks of filesystems unnecessary.  To disable the automatic checking, do as root:</p>
<pre class="brush: bash; title: ; notranslate">$ sudo tune2fs -c 0 -i 0 /dev/sdxx</pre>
<p>where <em>/dev/sdXX</em> is the partition assigned to the filesystem (e.g., <em>/dev/sdb1</em>).</p>
<h3>Update History</h3>
<p>May 2, 2012 &#8212; Minor updates.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=80</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Configuring Devices Using udev</title>
		<link>http://okomestudio.net/biboroku/?p=72</link>
		<comments>http://okomestudio.net/biboroku/?p=72#comments</comments>
		<pubDate>Sun, 22 Mar 2009 03:24:57 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Lenny]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=72</guid>
		<description><![CDATA[First, install udev if not already: # apt-get install udev In the /etc/udev directory, a text file (e.g., johndoe.rules where johndoe should be something like your username) with custom rules should be created. For making these rules, a fine tutorial &#8230; <a href="http://okomestudio.net/biboroku/?p=72">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>First, install udev if not already:</p>
<pre style="border:1px solid #ccc;padding:4px;">
# apt-get install udev
</pre>
<p>In the <i>/etc/udev</i> directory, a text file (e.g., <i>johndoe.rules</i> where johndoe should be something like your username) with custom rules should be created.  For making these rules, a <a href="http://wiki.debian.org/udev">fine tutorial</a> should be referenced.</p>
<p>After making rules, under <i>/etc/udev/rules.d</i>, a symlink named like <i>010_johndoe.rules</i> should be created and pointed to <i>../johndoe.rules</i>.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=72</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Watching DVD on Debian Lenny</title>
		<link>http://okomestudio.net/biboroku/?p=64</link>
		<comments>http://okomestudio.net/biboroku/?p=64#comments</comments>
		<pubDate>Sun, 22 Mar 2009 02:56:34 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Lenny]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=64</guid>
		<description><![CDATA[Install mplayer and some codecs (to install these, you need to add a line: deb http://www.debian-multimedia.org/ lenny main to /etc/apt/sources.list, if not already): # apt-get install mplayer libdvdread3 libdvdcss2 w32codecs Use gmplayer: $ gmplayer and set video driver to &#8220;xv&#8221; &#8230; <a href="http://okomestudio.net/biboroku/?p=64">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Install mplayer and some codecs (to install these, you need to add a line:</p>
<pre style="border:1px solid #ccc;padding:4px;">
deb http://www.debian-multimedia.org/ lenny main
</pre>
<p>to <i>/etc/apt/sources.list</i>, if not already):</p>
<pre style="border:1px solid #ccc;padding:4px;">
# apt-get install mplayer libdvdread3 libdvdcss2 w32codecs
</pre>
<p>Use gmplayer:</p>
<pre style="border:1px solid #ccc;padding:4px;">
$ gmplayer
</pre>
<p>and set video driver to &#8220;xv&#8221; for smooth DVD playback.</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=64</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>K3b on Debian Lenny</title>
		<link>http://okomestudio.net/biboroku/?p=53</link>
		<comments>http://okomestudio.net/biboroku/?p=53#comments</comments>
		<pubDate>Sun, 22 Mar 2009 02:43:08 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Lenny]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=53</guid>
		<description><![CDATA[Install k3b and utilities: # apt-get install k3b cdrdao dvd+rw-tools normalize-audio For replaygain support in making ogg files: # apt-get install vorbisgain If I don&#8217;t already belong (use groups), add my user account to the cdrom group: # adduser username &#8230; <a href="http://okomestudio.net/biboroku/?p=53">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Install <a href="http://k3b.plainblack.com/">k3b</a> and utilities:</p>
<pre style="border:1px solid #ccc;padding:4px;">
# apt-get install k3b cdrdao dvd+rw-tools normalize-audio
</pre>
<p>For replaygain support in making ogg files:</p>
<pre style="border:1px solid #ccc;padding:4px;">
# apt-get install vorbisgain
</pre>
<p>If I don&#8217;t already belong (use <tt>groups</tt>), add my user account to the cdrom group:</p>
<pre style="border:1px solid #ccc;padding:4px;">
# adduser username cdrom
</pre>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=53</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>First post!</title>
		<link>http://okomestudio.net/biboroku/?p=1461</link>
		<comments>http://okomestudio.net/biboroku/?p=1461#comments</comments>
		<pubDate>Sat, 21 Mar 2009 23:42:59 +0000</pubDate>
		<dc:creator>Taro</dc:creator>
				<category><![CDATA[Misc.]]></category>

		<guid isPermaLink="false">http://nomo17k.wordpress.com/?p=3</guid>
		<description><![CDATA[This is my first post for this blog. I used to have all my own contents in an old-fashioned &#8220;home page&#8221; type of thing, but blogs are indeed useful as I read them all the time! I&#8217;ll move much of &#8230; <a href="http://okomestudio.net/biboroku/?p=1461">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>This is my first post for this blog.  I used to have all my own contents in an old-fashioned &#8220;<a title="Taro's home page" href="http://www.physics.ucsb.edu/~taro" target="_blank">home page</a>&#8221; type of thing, but blogs are indeed useful as I read them all the time!</p>
<p>I&#8217;ll move much of my content here to call this my new home.  There might be some stuff of interests for others but I realized having them in flat ASCII text files hides them from search engines&#8217; attention&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://okomestudio.net/biboroku/?feed=rss2&#038;p=1461</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
