<?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>zecojbox</title>
	<atom:link href="http://zecoj.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://zecoj.com</link>
	<description>box filled with useless rubbish</description>
	<lastBuildDate>Sat, 04 Feb 2012 12:09:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>TomatoUSB + Optware + rrdtool + dygraphs = cool bandwidth monitor</title>
		<link>http://zecoj.com/2012/02/04/tomatousb-optware-rrdtool-dygraphs-cool-bandwidth-monitor/</link>
		<comments>http://zecoj.com/2012/02/04/tomatousb-optware-rrdtool-dygraphs-cool-bandwidth-monitor/#comments</comments>
		<pubDate>Sat, 04 Feb 2012 03:07:51 +0000</pubDate>
		<dc:creator>zecoj</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[opensource]]></category>

		<guid isPermaLink="false">http://zecoj.com/?p=4068</guid>
		<description><![CDATA[I recently upgraded my Buffalo WHR-HP-G54 to an ASUS RT-N16 as I needed gigabit ethernet; and usb ports + wifi &#8230; <a href="http://zecoj.com/2012/02/04/tomatousb-optware-rrdtool-dygraphs-cool-bandwidth-monitor/" class="more-link">Learn more</a>]]></description>
			<content:encoded><![CDATA[<p>I recently upgraded my <a href="http://zecoj.com/2008/09/03/whr-hp-g54-and-sd-card-mod/">Buffalo WHR-HP-G54</a> to an ASUS RT-N16 as I needed gigabit ethernet; and usb ports + wifi N are all welcoming upgrades to the aging buffalo. As an inevitability, I installed <a href="http://tomatousb.org/" target="_blank">TomatoUSB</a> and plugged in a 4GB USB stick. Now, TomatoUSB itself is a very good system with loads of features but you can extend  even more by adding <a href="http://www.nslu2-linux.org/wiki/Optware/HomePage" target="_blank">Optware</a>. I will not go into the installation as there already is a <a href="http://tomatousb.org/tut:optware-installation" target="_blank">very good guide</a> to follow.</p>
<p>Once you have the USB stick mounted and Optware up and running, you can do lots of nifty things. For example, I installed zsh, screen, vim and a whole bunch of other essential stuff. A few examples can be found <a href="http://www.nslu2-linux.org/wiki/Optware/Packages">here.</a></p>
<p>One particular interest I had when found out about optware was the extension of tomato&#8217;s visual bandwidth log graphs. I said extension because the original one comes with tomato has a max 24 hour window. However, occasionally I want to see what happened in the previous week or even month. So first, I thought of rrdtool and rrdgraph. Now rrdtool is a good database for this purpose, however rrdgraph proved to be too resource intensive for the little cpu.</p>
<p>So I searched around and found <a href="http://dygraphs.com/" target="_blank">dygraphs</a>. This is a perfect solution as all you need is to feed the data in csv format and the graphing would be done on the <em>client&#8217;s</em> browser. Have a look at my example here (1 week window), you can click&amp;drag the cursor to zoom in and double click to zoom out.</p>
<p><a href="http://zecoj.com/files/bwg/rrdtool_dygraphs.html"><img class="alignnone" src="http://dl.dropbox.com/u/7959866/zecoj.com/rrdtool_dygraphs.png" alt="" width="609" height="313" /></a></p>
<p>Cool? If you&#8217;re interested, let&#8217;s start. Assuming you already have a persistent storage (jffs,usb/sd card, etc.) setup at <code>/opt</code>, first, ssh to your router, then:</p>
<blockquote><p><code># ipkg update<br />
# ipkg install perl rrdtool<br />
# wget http://zecoj.com/files/bwg/rrdtool.txt -O /opt/bin/rrdtool.sh<br />
# chmod +x </code><code>/opt/bin/rrdtool.sh<br />
# cru a bwlog "*/1 * * * * /opt/bin/rrdtool.sh"<br />
</code></p></blockquote>
<p>That will install rrdtool, perl and download my rrdtool collector script, put it in the crontab to be executed every 1 minute. Now, create a directory somewhere in your <code>/opt</code> to store the necessary files, mine is at <code>/opt/share/www/cgi-bin</code>.</p>
<blockquote><p><code># pwd<br />
/opt/share/www/cgi-bin<br />
# wget http://zecoj.com/files/bwg/bandwidth.txt -O bandwidth.cgi<br />
# chmod 755 bandwidth.cgi<br />
# wget http://zecoj.com/files/bwg/dygraph-combined.js<br />
# chmod 644 </code><code>dygraph-combined.js<br />
# rm -rf /tmp/var/wwwext/cgi-bin<br />
# ln -s /opt/share/www/cgi-bin /tmp/var/wwwext/.</code></p></blockquote>
<p>You should also append the these into <code>/opt/.autorun</code>. This will tell tomato to run these command right after mounting my usb stick.</p>
<blockquote><p><code># echo '</code><code>cru a bwlog "*/1 * * * * /opt/bin/rrdtool.sh"' </code><code>&gt;&gt; /opt/.autorun</code>.<br />
<code># echo 'rm -rf /tmp/var/wwwext/cgi-bin' &gt;&gt; /opt/.autorun<br />
# echo '</code><code>ln -s /opt/share/www/cgi-bin /tmp/var/wwwext/.' </code><code>&gt;&gt; /opt/.autorun</code></p></blockquote>
<p>What just happened is we got the files we need, save them somewhere that will not disappear as the router restart, link them to the router&#8217;s cgi-bin directory. Now, assuming the router&#8217;s ip is <code>192.168.0.1</code>, you can test everything by going to: <a href="http://192.168.0.1/ext/cgi-bin/bandwidth.cgi" target="_blank">http://192.168.0.1/ext/cgi-bin/bandwidth.cgi</a> there you should already see a few data points collected by rrdtool.sh earlier. Download some big files, leave it running for a while (the page will auto refresh every minute) and you should see more pretty data come up :)</p>
]]></content:encoded>
			<wfw:commentRss>http://zecoj.com/2012/02/04/tomatousb-optware-rrdtool-dygraphs-cool-bandwidth-monitor/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>mynetfone.com.au usage meter</title>
		<link>http://zecoj.com/2010/04/02/mynetfonecomau-usage-meter/</link>
		<comments>http://zecoj.com/2010/04/02/mynetfonecomau-usage-meter/#comments</comments>
		<pubDate>Fri, 02 Apr 2010 07:45:14 +0000</pubDate>
		<dc:creator>zecoj</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[miscellaneous]]></category>

		<guid isPermaLink="false">http://zecoj.com/2010/04/02/mynetfonecomau-usage-meter/</guid>
		<description><![CDATA[I&#8217;ve recently join MyNetFone for Naked ADSL2+ and VoIP. However there&#8217;s no tool for checking usage quota except for using &#8230; <a href="http://zecoj.com/2010/04/02/mynetfonecomau-usage-meter/" class="more-link">Learn more</a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve recently join <a href="http://www.mynetfone.com.au" title="MyNetFone" target="_blank">MyNetFone</a> for Naked ADSL2+ and VoIP. However there&#8217;s no tool for checking usage quota except for using their website. Googled around a bit and found <a href="http://netusage.iau5.com/" title="Net Usage Item" target="_blank">this</a>. Works alright but I don&#8217;t want to open up Firefox just to see my quota. So I hacked up a quick and dirty solution for the problem. You can dip this in <a href="http://conky.sourceforge.net/" title="conky" target="_blank">conky</a> or the likes if you want. The code is <a href="http://zecoj.com/files/mnfquota.txt" target="_blank">here</a>.</p>
<blockquote><p><code>-$ ./mnfquota<br />
Peak:           9975 MB<br />
Off Peak:       14435 MB<br />
Days left:      20<br />
</code></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://zecoj.com/2010/04/02/mynetfonecomau-usage-meter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WHR-HP-G54 and SD card mod</title>
		<link>http://zecoj.com/2008/09/03/whr-hp-g54-and-sd-card-mod/</link>
		<comments>http://zecoj.com/2008/09/03/whr-hp-g54-and-sd-card-mod/#comments</comments>
		<pubDate>Wed, 03 Sep 2008 09:13:08 +0000</pubDate>
		<dc:creator>zecoj</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[miscellaneous]]></category>
		<category><![CDATA[opensource]]></category>
		<category><![CDATA[personal]]></category>

		<guid isPermaLink="false">http://zecoj.com/2008/09/03/whr-hp-g54-and-sd-card-mod/</guid>
		<description><![CDATA[I just got a Buffalo wireless router WHR-HP-G54 a few days ago. It&#8217;s small, covers a good range (has a &#8230; <a href="http://zecoj.com/2008/09/03/whr-hp-g54-and-sd-card-mod/" class="more-link">Learn more</a>]]></description>
			<content:encoded><![CDATA[<p>I just got a Buffalo wireless router WHR-HP-G54 a few days ago. It&#8217;s small, covers a good range (has a built-in internal amplifier), has decent memory 4MB ROM/16MB RAM and it can be modded to have an sd/mmc card for storage.</p>
<p>First thing was to load <a href="http://www.polarcloud.com/tomato">tomato</a> (I got tired of dd-wrt&#8217;s QoS and wanted something different). Soon later I found out what this baby really wants is <a href="http://openwrt.org/">openwrt</a>. So I gave <em>her</em> <a href="http://downloads.openwrt.org/whiterussian/0.9/">the WhiteRussian</a> ;) Yesterday, I bought a 1GB MicroSD card (with an SD adapter) and bring the router into operation room. I&#8217;m not going through the process for it&#8217;s been described a lot on the web (<a href="http://www.dd-wrt.com/wiki/index.php/SD/MMC_mod">dd-wrt&#8217;s wiki</a> and <a href="http://wiki.openwrt.org/OpenWrtDocs/Customizing/Hardware/MMC#line-309">openwrt&#8217;s wiki</a>). This <a href="http://www.dd-wrt.com/wiki/index.php/How_to_open_my_router">page</a> shows you how to open the router, however you won&#8217;t have to slice and poke holes through the label, just peel it off and stick it back in afterward ;)</p>
<p>Here&#8217;s my pin layout:</p>
<blockquote><p><code>SD#      GPIO#<br />
--------------<br />
1 CS       7<br />
2 DI       6<br />
3 VSS      - ground<br />
4 VDD      - power<br />
5 CLK      3<br />
6 VSS2     - ground<br />
7 DO       5</code></p></blockquote>
<p><strong>1st try</strong>: I decided to hardwire the cables into the MicroSD-to-SD adapter but it didn&#8217;t work. Probably the problem was with the soldering. Loading the mmc module gives this error in dmesg.</p>
<blockquote><p><code>[INFO] mmc_hardware_init: initializing GPIOs<br />
[INFO] mmc_card_init: the period of a 380KHz frequency lasts 524 CPU cycles<br />
[INFO] mmc_card_init: powering card on. sending 80 CLK<br />
[INFO] mmc_card_init: 80 CLK sent in 44136 CPU cycles<br />
[INFO] mmc_card_init: resetting card (CMD0)<br />
[FATAL] mmc_card_init: invalid response from card: ff found, waiting for 01<br />
[INFO] mmc_card_init: the period of a 380KHz frequency lasts 524 CPU cycles<br />
[INFO] mmc_card_init: powering card on. sending 80 CLK<br />
[INFO] mmc_card_init: 80 CLK sent in 43306 CPU cycles<br />
[INFO] mmc_card_init: resetting card (CMD0)<br />
[FATAL] mmc_card_init: invalid response from card: ff found, waiting for 01<br />
[ERROR] mmc_init: got an error calling mmc_card_init: 01<br />
[ERROR] mmc_check_media: change detected but was not able to initialize new card: ffffffff</code></p></blockquote>
<p><strong>2nd try</strong>: The damn thing got short circuited, it won&#8217;t even power on! The problem was again from bad soldering on the MicroSD adapter (when will I learn?). Removed all the wires though, it powered on OK. Some discouraging comments from my wife made me give it up and went to bed.</p>
<p><strong>3rd try:</strong> I searched and found an old USB SD reader from the closet. Used the soldering iron to remove the SD socket from the poor reader and restart my wiring and soldering. To my surprise it worked on the first attempt.</p>
<blockquote><p><code>root@zrouter:~# dmesg |grep mmc<br />
mmc: starting module with: SD_DI=0x40, SD_DO=0x20, SD_CLK=0x8, SD_CS=0x80<br />
mmca: p1</code></p></blockquote>
<p>&#8230;and tahdah</p>
<blockquote><p><code>root@zrouter:~# df -h<br />
Filesystem              Size Used Available Use% Mounted on<br />
rootfs                                     2.8M 2.8M                0  100% /<br />
/dev/root               2.8M 2.8M                0  100% /<br />
/dev/mmc/disc0/part1     955.7M 4.8M   902.3M      1% /mmc</code></p></blockquote>
<p>Now I have a router with Cisco-grade firmware and 1GB of storage! If you ever want to try this mod then consider the following:</p>
<ul>
<li>A good night sleep, you need it, I learned it the hard way</li>
<li>An SD reader socket. Don&#8217;t try hard-wiring, doesn&#8217;t worth it and it may ruin your card (that&#8217;s why I got a MicroSD and an adapter but still&#8230;)</li>
<li>Wires (6 of &#8216;em), you can strip the network cable but I found that they&#8217;re too hard, so I used ones inside an old PC.</li>
<li> A fine temperature-controlled precision soldering iron is highly recommended. I was such a cheap ass to get one so I used an old one from <a href="http://zecoj.com/2007/05/29/poormans-remote-for-20d/">this</a>. The thing was too hot (60W), too long, and the handle is not even heat-insulated (well it is but not that good). I almost lost a tiny resister because the solder was too hot. It worked but not without a fight.</li>
<li>Also, you should glue the wire (the tip that comes out from the solder point) to the board. The solder points are tiny and it won&#8217;t survive some gentle yankings :p</li>
</ul>
<p>Oh, I almost forgot, here&#8217;s the final product (it&#8217;s not that well lit, I had to use a desk lamp):</p>
<p><a href="http://dl.dropbox.com/u/7959866/zecoj.com/IMG_7535.JPG"><img class="alignnone" title="whr-hp-g54 mainboard" src="http://dl.dropbox.com/u/7959866/zecoj.com/IMG_7535_thumb.JPG" alt="" width="500" height="407" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://zecoj.com/2008/09/03/whr-hp-g54-and-sd-card-mod/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>icons for xfce panel&#8217;s wavelan plugin</title>
		<link>http://zecoj.com/2007/06/17/icons-for-xfce-panels-wavelan-plugin/</link>
		<comments>http://zecoj.com/2007/06/17/icons-for-xfce-panels-wavelan-plugin/#comments</comments>
		<pubDate>Sun, 17 Jun 2007 14:59:42 +0000</pubDate>
		<dc:creator>zecoj</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[opensource]]></category>
		<category><![CDATA[slackware]]></category>

		<guid isPermaLink="false">http://zecoj.com/2007/06/17/icons-for-xfce-panels-wavelan-plugin/</guid>
		<description><![CDATA[I went back to Xfce as my desktop for over a year now and only recently, I found a panel &#8230; <a href="http://zecoj.com/2007/06/17/icons-for-xfce-panels-wavelan-plugin/" class="more-link">Learn more</a>]]></description>
			<content:encoded><![CDATA[<p>I went back to Xfce as my desktop for over a year now and only recently, I found a panel plugin for displaying the wifi signal strength from the <a href="http://goodies.xfce.org/">Xfce Goodies Project</a> called <a href="http://goodies.xfce.org/releases/xfce4-wavelan-plugin/xfce4-wavelan-plugin-0.5.4.tar.gz">xfce4-wavelan-plugin</a>. It&#8217;s a perfect little application with only one problem. The status icon is too ugly.</p>
<p><center><img src='http://zecoj.com/wp/wp-content/uploads/2007/06/old.png' alt='the old xfce4-wavelan-plugin icon' /></center></p>
<p>So I googled a little, found out a great replacement from the <em>GNOME Network Monitor Applet</em>. Downloaded the source code, extracted the icons, added an extra bar for xfce4-wavelan-plugin has a &#8220;5-step increment&#8221;. And tah-dah!</p>
<p><center><img src='http://zecoj.com/wp/wp-content/uploads/2007/06/new.png' alt='and the new one' /></center></p>
<p>Grab the icons <a href="http://zecoj.com/data/stuff/wavelan_icons.tar.gz">here</a>. Extract to <strong>xfce4-wavelan-plugin-*/panel-plugin/.</strong> and do the usual steps.</p>
<p>Cheers.</p>
]]></content:encoded>
			<wfw:commentRss>http://zecoj.com/2007/06/17/icons-for-xfce-panels-wavelan-plugin/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>slackware-current changelog rss feed</title>
		<link>http://zecoj.com/2007/05/19/slackware-current-changelog-rss-feed/</link>
		<comments>http://zecoj.com/2007/05/19/slackware-current-changelog-rss-feed/#comments</comments>
		<pubDate>Sat, 19 May 2007 08:34:31 +0000</pubDate>
		<dc:creator>zecoj</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[opensource]]></category>
		<category><![CDATA[slackware]]></category>

		<guid isPermaLink="false">http://zecoj.com/2007/05/19/slackware-current-changelog-rss-feed/</guid>
		<description><![CDATA[Having some free time and being too used to Google Reader, I want an rss feed that can tell me &#8230; <a href="http://zecoj.com/2007/05/19/slackware-current-changelog-rss-feed/" class="more-link">Learn more</a>]]></description>
			<content:encoded><![CDATA[<p>Having some free time and being too used to Google Reader, I want an rss feed that can tell me the updates of slackware-current without having to check out <a href="http://www.slackware.com/changelog/current.php?cpu=i386">slackware&#8217;s page</a>, I wrote a <a href="http://zecoj.com/slackcur.pl">perl script</a> that does this for me. Also, friends at <a href="http://forum.vnoss.org/forum.php">VnOSS</a> put them on the server and had it run 4 times a day for us slackers. Now go ahead and add it to your reader: <a href="http://people.vnoss.org/swcurrent.xml">http://people.vnoss.org/swcurrent.xml</a></p>
]]></content:encoded>
			<wfw:commentRss>http://zecoj.com/2007/05/19/slackware-current-changelog-rss-feed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>mrxvt &amp; xvnkb</title>
		<link>http://zecoj.com/2007/05/15/mrxvt-xvnkb/</link>
		<comments>http://zecoj.com/2007/05/15/mrxvt-xvnkb/#comments</comments>
		<pubDate>Tue, 15 May 2007 15:27:38 +0000</pubDate>
		<dc:creator>zecoj</dc:creator>
				<category><![CDATA[miscellaneous]]></category>
		<category><![CDATA[opensource]]></category>
		<category><![CDATA[personal]]></category>

		<guid isPermaLink="false">http://zecoj.com/2007/05/15/mrxvt-xvnkb/</guid>
		<description><![CDATA[I just found the almost-perfect tabbed terminal called mrxvt (previously called materm). It has tabs (with built-in widget so it &#8230; <a href="http://zecoj.com/2007/05/15/mrxvt-xvnkb/" class="more-link">Learn more</a>]]></description>
			<content:encoded><![CDATA[<p>I just found the almost-perfect tabbed terminal called <a href="http://materm.sourceforge.net/wiki/">mrxvt</a> (previously called materm). It has tabs (with built-in widget so it doesn&#8217;t require gtk/qt crap), configurable keyboard shortcuts, and so much more. The only thing, well two things, that it sucks at is Unicode support and problem with XIM, which creates problem with <a href="http://xvnkb.sourceforge.net/">xvnkb</a>. Unicode? Well, that I can live without. In fact I can&#8217;t recall the last time I need to use Unicode in a terminal and in such case, urxvt &#038; xterm are here.</p>
<p>Now, on to problem with XIM. I&#8217;ve submitted the bug to mrxvt developers but so far no help yet. Talked to xvnkb&#8217;s author, good friend he is but he was too busy to help. The problem was this: on versions 0.4.x it works just fine, but the pretty stuff comes with 0.5.x so I want that. On mrxvt v0.5.2, xvnkb&#8217;s just not working. I use xvnkb_ctrl to bind keyboard shortcuts but disable (-d) and enable (-e) just didn&#8217;t work.</p>
<p>Played with it for a while and found out, xvnkb GUI does work. Weird? But I don&#8217;t want to use that ugly and unfriendly GUI, I want my shortcuts! Keep playing and found that the GUI was only <em>toggling</em> while what I did with my shortcut was to disable and enable:</p>
<blockquote><p>
xvnkb_ctrl -d<br />
xvnkb_ctrl -e</p></blockquote>
<p>So I tried this to disable, enable it first and then toggle:</p>
<blockquote><p>xvnkb_ctrl -e&#038;&#038;xvnkb_ctrl -t</p></blockquote>
<p>Surprisingly, it worked like a charm. :) So that was the problem. No, that was how I fixed the problem. I still don&#8217;t know what the problem really is. And I don&#8217;t need to. Hey, I solved it.</p>
]]></content:encoded>
			<wfw:commentRss>http://zecoj.com/2007/05/15/mrxvt-xvnkb/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>g++ error</title>
		<link>http://zecoj.com/2007/03/20/g-error/</link>
		<comments>http://zecoj.com/2007/03/20/g-error/#comments</comments>
		<pubDate>Tue, 20 Mar 2007 08:57:09 +0000</pubDate>
		<dc:creator>zecoj</dc:creator>
				<category><![CDATA[miscellaneous]]></category>

		<guid isPermaLink="false">http://zecoj.com/2007/03/20/g-error/</guid>
		<description><![CDATA[04:08 nslam: aaa&#124;work, ba&#8217;c oi 04:08 nslam: em cha.y 04:08 nslam: printf(&#8220;%d\n&#8221;,sizeof(double)); 04:08 nslam: no&#8217; ba&#8217;o lo^~i la` 04:09 nslam: &#8230; <a href="http://zecoj.com/2007/03/20/g-error/" class="more-link">Learn more</a>]]></description>
			<content:encoded><![CDATA[<blockquote><p>
04:08 nslam: aaa|work, ba&#8217;c oi<br />
04:08 nslam: em cha.y<br />
04:08 nslam: printf(&#8220;%d\n&#8221;,sizeof(double));<br />
04:08 nslam: no&#8217; ba&#8217;o lo^~i la`<br />
04:09 nslam: ./test.cc: line 8: syntax error near unexpected token `&#8221;%d\n&#8221;,sizeof&#8217;<br />
04:09 nslam: ./test.cc: line 8: `printf(&#8220;%d\n&#8221;,sizeof(double));&#8217;<br />
04:09 nslam: aaa|work, la` sao ba&#8217;c?<br />
04:09 aaa|work: nguye^n file test.cc ra sao<br />
04:10 nslam: #include &#8220;stdlib.h&#8221;<br />
04:10 nslam: #include <stdio.h><br />
04:10 nslam: #include<br />
<math.h>
04:10 nslam: main(){<br />
04:10 nslam: printf(&#8220;%d\n&#8221;,sizeof(double));<br />
04:10 nslam: }<br />
04:10 nslam: va^.y ddo&#8217; bac<br />
04:11 nslam: aaa|work, ba&#8217;c co&#8217; ca&#8217;ch na`o fix ho^ng?<br />
04:12 aaa|work: thu+? rename test.cc => test.c xem sao L0Lz<br />
04:13 nslam: cu~ng ru+&#8217;a bac o+i<br />
04:13 b1nhb00ng: cha? co&#8217; gi` sai ca? :-/<br />
04:13 b1nhb00ng: reinstall gpp &#038;&#038; reboot :))<br />
04:13 aaa|work: hahaha<br />
04:20 nslam: sao gio+` ca&#8217;c ba&#8217;c?:-o<br />
04:20 b1nhb00ng: tho^i dde^? em co`m bai ro^`i gu+?i a.out cho nha&#8217;<br />
04:21 *** [J] chuoi|work [n=Banana@210.245.35.13]<br />
04:23 *** [Q] mschuoi [Read error: 104 (Connection reset by peer)]<br />
04:26 *** [Q] nslam [Remote closed the connection]<br />
04:26 *** [J] nslam [n=nslam@home.hcmuns.edu.vn]<br />
04:26 * nslam dda.p tru&#8217;ng da^y nguo^`n<br />
04:28 *** [Q] aaa|work [Read error: 145 (Connection timed out)]<br />
04:31 NamNT: nslam: thay &#8220;stdlib.h&#8221; ba(`ng <stdlib.h><br />
04:33 nslam: nhu+ va^.y thi` no&#8217; ba&#8217;o lo^~i na`y<br />
04:33 nslam: ./test.cc: line 8: syntax error near unexpected token `&#8221;%d&#8221;\n,&#8217;<br />
04:33 nslam: ./test.cc: line 8: `printf(&#8220;%d&#8221;\n, sizeof(double));&#8217;<br />
04:33 nslam: :D<br />
04:33 NamNT: &#8220;%d\n&#8221;<br />
04:33 NamNT: kho^ng pha?i &#8220;%d&#8221;\n<br />
04:33 nslam: ah, em nha^`m<br />
04:34 nslam: ho^`i na~y del, ro^`i the^m va`o lo^.n cho^~D:<br />
04:35 nslam: nhu+ng cu~ng ru+&#8217;a ba&#8217;c oi<br />
04:36 NamNT: ?<br />
04:36 nslam: lo^~i va^~n la` o+? cho^~ &#8220;%d\n&#8221;<br />
04:36 b1nhb00ng: vo^lys<br />
04:37 * chuoi|work tha^&#8217;y dhson ddang va(.t lo^ng &#8230; chm<br />
04:37 chuoi|work: L0Lz<br />
04:38 ntdt: sizeof(double) kho^ng pha?i la` 1 so^&#8217; double :))<br />
04:39 NamNT: ho^ hO^<br />
04:39 NamNT: nslam: paste la.i doa.n code nguye^n ve.n vo^ da^u do&#8217; di<br />
04:39 nslam: em paste vo^ dda^y ha<br />
04:40 b1nhb00ng: vnoss.net/p/<br />
04:40 chuoi|work: cha(&#8216;c edit ca&#8217;i file = MSWord<br />
04:40 chuoi|work: :D<br />
04:40 b1nhb00ng: unexpected paragraph-character :)))<br />
04:41 *** [J] mschuoi [n=typn@unaffiliated/chairuou]<br />
04:41 *** [M] Mode change by ChanServ [+o mschuoi]<br />
04:41 nslam: http://vnoss.net/p/351 [26]<br />
04:42 nslam: em paste ro^`i ddo&#8217;<br />
04:42 ntdt: ./a.out<br />
04:42 ntdt: 8<br />
04:42 ntdt: lolz<br />
04:43 ntdt: 8 bytes la` size cu?a double<br />
04:43 NamNT: 64bit la` 8 byte dung roai<br />
04:44 ntdt: cha(&#8216;c ma&#8217;y ku nslam bi. ddie^n ro^`i<br />
04:44 nslam: ca&#8217;i ddoa.n em vie^&#8217;t sai cho^~ na`o va^.y ca&#8217;c ba&#8217;c?<br />
04:44 NamNT: nslam: cha(&#8216;c la` vie^&#8217;t code trong windows<br />
04:44 NamNT: chuyen qua linux<br />
04:44 NamNT: bi. ^M<br />
04:44 ntdt: cha? co&#8217; gi` sai :))<br />
04:44 nslam: em la`m va^`y<br />
04:44 nslam: touch test.cc<br />
04:44 nslam: ro^`i vim test.cc<br />
04:44 NamNT: nslam: dos2unix test.cc<br />
04:44 b1nhb00ng: ^M no&#8217; cu~ng cha? ba&#8217;o o+? line ddo&#8217;<br />
04:45 nslam: NamNT, em edit tre^n Debian ma`<br />
04:46 NamNT: nslam: compile ra sao vay?<br />
04:47 nslam: ./test.cc<br />
04:47 NamNT: ?<br />
04:47 NamNT: hehehe<br />
04:47 NamNT: :-))<br />
04:47 b1nhb00ng: :)))<br />
04:47 * NamNT ho?i 1 ca^u ngo+&#8217; nga^?n<br />
04:47 NamNT: ma` ho^?ng de` tru&#8217;ng ngay cho^~ hie^?m<br />
04:47 * b1nhb00ng rofl!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!<br />
04:47 nslam: ua?, chu+&#8217; pha?i la`m sao ba&#8217;c?:-o<br />
04:47 nslam: em ho^ng nho+&#8217;:D<br />
04:48 NamNT: nslam: gcc -o test test.cc<br />
04:48 NamNT: sau do&#8217; cha.y ./test<br />
04:48 * b1nhb00ng ddi lau nu+o+&#8217;c ma(&#8216;t<br />
04:48 b1nhb00ng: nslam: gpp test.cc &#038;&#038; ./a.out<br />
04:48 * chuoi|work la(.m kbd dda^.p dda^.p vo^ &#8230; kho^ng khi&#8217; la(n lo^.n cuo`i sa(`ng sa(.c<br />
04:49 b1nhb00ng: la^u la(&#8216;m ro^`i mo+&#8217;i ddc cu+o+`i mo^.t la^`n dda~ the^&#8217; na`y<br />
04:49 ntdt: rofl<br />
04:49 nslam: no&#8217; ra va^`y ne<br />
04:49 b1nhb00ng: xin phe&#8217;p ca&#8217;c ba&#8217;c, em ddi blog ca&#8217;i na`y
</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://zecoj.com/2007/03/20/g-error/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Canon EOS 20d shutter count</title>
		<link>http://zecoj.com/2007/01/31/canon-eos-20d-shutter-count/</link>
		<comments>http://zecoj.com/2007/01/31/canon-eos-20d-shutter-count/#comments</comments>
		<pubDate>Tue, 30 Jan 2007 17:12:26 +0000</pubDate>
		<dc:creator>zecoj</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[miscellaneous]]></category>
		<category><![CDATA[personal]]></category>

		<guid isPermaLink="false">http://zecoj.com/2007/01/31/canon-eos-20d-shutter-count/</guid>
		<description><![CDATA[Ok, so I got a used DSLR. What I didn&#8217;t pay attention to was the fact that the shutter has &#8230; <a href="http://zecoj.com/2007/01/31/canon-eos-20d-shutter-count/" class="more-link">Learn more</a>]]></description>
			<content:encoded><![CDATA[<p>Ok, so I got a used DSLR. What I didn&#8217;t pay attention to was the fact that the shutter has a certain life cycle. According to sources on&#8230;google, the EOS 20D has a life expectancy of 100,000 shots. Small number I thought. So I searched and searched, and after a while with good keywords comes <a href="http://digital-photography-school.com/forum/showthread.php?t=196">this guide</a>.</p>
<blockquote><p>For the EOS Canon users. You can see how many times the shutter actuated using a hex editor and a RAW file.</p>
<p>Tools needed:<br />
- Hex Editor (XVI32 Preferred You can download it here FOR FREE!)<br />
- RAW Image file from your camera</p>
<p>Baiscly what your doing is getting the number located at 95D and 95E and converting it from HEX to DECIMAL. If you do not know exactly how to do this. I will show you below</p>
<p>Step By Step Documentation using Xvi32.</p>
<p>1.) Load Xvi32<br />
2.) Go to Tools>Options>Data Inspector (it&#8217;s a TAB)<br />
3.) Click &#8220;big-endian (MOTOROLA)&#8221;<br />
4.) Click &#8220;OK&#8221; Button to exit out of the options<br />
5.) Go to File>Open>&#8221;CHOOSE YOUR RAW IMAGE FILE&#8221; then click open<br />
6.) Go to Address>Goto (Or CTRL+G)<br />
7.) Click &#8220;Hexadecimal&#8221; then TYPE &#8220;95D&#8221; into the box below<br />
8.) Click &#8220;OK&#8221;<br />
9.) Then go to TOOLS>DECODE NUMBER<br />
10.) LOOK at &#8220;XX XX As Word&#8221; (XX Being your numbers located in 95D,E).<br />
11.) The number next to it is your Actuation number.</p></blockquote>
<p>Good deal, so I took a picture, copied the raw file over gphoto2, fired up <a href="http://www.linuxcommand.org/man_pages/xxd1.html">xxd</a> and do some processing. And I got 10414 as my shutter count. Subtracting around one thousand shots I&#8217;ve taken since I bought the camera, I thought I got a pretty good deal ;)</p>
<p>Some people say life&#8217;s too short to worry about shutter break-down. But it&#8217;s nice to know where you&#8217;re at anyways. So, if you have a 20d and run Linux, try this at home<br />
<code>echo $((0x`xxd YOUR_RAW_FILE_HERE.CR2|head -150|grep "0000950:"|cut --characters=42,43,45,46`))</code></p>
<p>PS: There are some guides said you can just read the EXIF tag off the JPEG file from some reader and/or flickr but from personal experiences I do not find this to be correct. I tried with two consecutive files and the shutter counts differ greatly. So be warned :)</p>
]]></content:encoded>
			<wfw:commentRss>http://zecoj.com/2007/01/31/canon-eos-20d-shutter-count/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>stardict violates copyright laws?</title>
		<link>http://zecoj.com/2006/12/14/stardict-violates-copyright-laws/</link>
		<comments>http://zecoj.com/2006/12/14/stardict-violates-copyright-laws/#comments</comments>
		<pubDate>Thu, 14 Dec 2006 01:34:06 +0000</pubDate>
		<dc:creator>zecoj</dc:creator>
				<category><![CDATA[miscellaneous]]></category>
		<category><![CDATA[opensource]]></category>

		<guid isPermaLink="false">http://zecoj.com/2006/12/14/stardict-violates-copyright-laws/</guid>
		<description><![CDATA[I&#8217;ve never noticed this until recently when I learned that to download dictionary databases for stardict, you have to pay &#8230; <a href="http://zecoj.com/2006/12/14/stardict-violates-copyright-laws/" class="more-link">Learn more</a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve never noticed this until recently when I learned that to <a href="http://www.stardict.org/download.php">download</a> dictionary databases for <a href="http://stardict.sourceforge.net/">stardict</a>, you have to pay at least $5 to become a level-one user. From the <a href="http://stardict.sourceforge.net/">homepage</a>:</p>
<blockquote><p>If you like StarDict, you can consider to upgrade to level 1 user for $5, this will help StarDict develop further.<br />
I am going to go abroad in 2008 and study operating system then, this need much money, so I hope I can earn some money from StarDict, but I will keep StarDict open source. Your help will be appreciated!</p></blockquote>
<p>First off, the dictionaries are hosted on <a href="http://heanet.dl.sourceforge.net/sourceforge/stardict/">SourceForge mirrors</a> and you can actually download them without the five-bucks hassle there. However, the origins of some of these dictionaries (such as Merriam-Webster&#8217;s Collegiate, Oxford ALD, Longman DCE, Collins Cobuild, Duden, etc.) are questionable. And should putting such materials on SourceForge for public download be considered a violation of copyright laws?</p>
<p>I use stardict everyday, it&#8217;s small, useful and very well-written. And I consider author&#8217;s situation and motive to be very understandable and sympathetic. But shouldn&#8217;t asking for donation instead of selling the dictionaries he/she does not own more appropriate?</p>
]]></content:encoded>
			<wfw:commentRss>http://zecoj.com/2006/12/14/stardict-violates-copyright-laws/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

