<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.2.3" -->
<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/"
	>

<channel>
	<title>Dryice Liu's Blog &#187; freebsd</title>
	<link>http://dryice.name/blog</link>
	<description></description>
	<pubDate>Tue, 31 Aug 2010 12:01:11 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.3</generator>
	<language>en</language>
			<item>
		<title>I&#8217;m still alive, so does this blog</title>
		<link>http://dryice.name/blog/freebsd/im-still-alive-so-does-this-blog/</link>
		<comments>http://dryice.name/blog/freebsd/im-still-alive-so-does-this-blog/#comments</comments>
		<pubDate>Tue, 31 Aug 2010 12:01:11 +0000</pubDate>
		<dc:creator>dryice</dc:creator>
		
		<category><![CDATA[misc]]></category>

		<category><![CDATA[freebsd]]></category>
<category>blog</category><category>freebsd</category>
		<guid isPermaLink="false">http://dryice.name/blog/freebsd/im-still-alive-so-does-this-blog/</guid>
		<description><![CDATA[I just realized that it has been nearly 2 years that I haven&#8217;t wrote anything on my blog. So just an announcement that I&#8217;m still alive  And so does this blog.
Thanks to everyone that come to visit or even leave a comment. It&#8217;s really good to know someone is still visiting my small space.
The [...]]]></description>
			<content:encoded><![CDATA[<p>I just realized that it has been nearly 2 years that I haven&#8217;t wrote anything on my blog. So just an announcement that I&#8217;m still alive <img src='http://dryice.name/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> And so does this blog.</p>
<p>Thanks to everyone that come to visit or even leave a comment. It&#8217;s really good to know someone is still visiting my small space.</p>
<p>The reason I stopped writing blog is because I&#8217;ve get involved in a really really big project, and got quite busy. The project is still not finished, but is in a good shape. I think I&#8217;ll get sometime to update this blog.</p>
<p>The reason I came to visit my own blog is because I was looking for an <a href="http://dryice.name/blog/freebsd/using-a-ram-disk-as-tmp-on-freebsd/"> old article </a>. And the reason I looked for that old article is because I&#8217;ve got myself a new PC. With the summer getting hotter and hotter, my old AMD3000+ machine halts several times a day. I know switching to a bigger fan might help, but, well, it is getting slow and the halting is an good excuse for a new one <img src='http://dryice.name/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>So I go get myself an I5-750 machine, with 4G RAM. It&#8217;s much faster than the old one. It is so fast that a buildworld in a FreeBSD on FreeBSD virtualbox client is faster than the real 3000+ machine. I also got myself a Dell 2410 and setup a two-monitor desktop. Finally I can have two 1024&#215;1200 window sitting side by side, it looks really nice <img src='http://dryice.name/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>So much for the news. I&#8217;ll get back and update my blog because again, I found it&#8217;s a good for future work if I wrote the tips down.</p>
<p>Enjoy the life and live with passion.</p>
<p><hints id="hah_hints"></hints></p>
<p class="akst_link"><a href="http://dryice.name/blog/?p=874&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_874" class="akst_share_link" rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://dryice.name/blog/freebsd/im-still-alive-so-does-this-blog/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Using FreeBSD as a network bridge and use dummynet to shape the traffic</title>
		<link>http://dryice.name/blog/freebsd/using-freebsd-as-a-network-bridge-and-use-dummynet-to-shape-the-traffic/</link>
		<comments>http://dryice.name/blog/freebsd/using-freebsd-as-a-network-bridge-and-use-dummynet-to-shape-the-traffic/#comments</comments>
		<pubDate>Thu, 12 Jun 2008 12:02:00 +0000</pubDate>
		<dc:creator>dryice</dc:creator>
		
		<category><![CDATA[freebsd]]></category>

		<guid isPermaLink="false">http://dryice.name/blog/uncategorized/using-freebsd-as-a-network-bridge-and-use-dummynet-to-shape-the-traffic/</guid>
		<description><![CDATA[Here&#8217;s a quick note/tutorial about how to setup FreeBSD 7.0 as a network bridge and use dummynet to shape the traffic, There is a pretty good tutorial  on the net but I found it&#8217;s rather outdated. So here is mine.
First of all we&#8217;ll need to setup FreeBSD as a network bridge.
ifconfig bridge create
This should [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a quick note/tutorial about how to setup FreeBSD 7.0 as a network bridge and use dummynet to shape the traffic, There is <a href="http://www.scalabledesign.com/articles/dummynet.html" aiotitle="a pretty good tutorial" target="_blank">a pretty good tutorial</a>  on the net but I found it&#8217;s rather outdated. So here is mine.</p>
<p>First of all we&#8217;ll need to setup FreeBSD as a network bridge.</p>
<div class="bash" style="font-family: monospace;font-size: 110%; color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">ifconfig bridge create</div>
<p>This should return &#8220;bridge0&#8243; if this is the first bridge you created.</p>
<p>And we&#8217;ll add the two interface used on the bridge. It&#8217;s &#8220;rl0&#8243; and &#8220;vr0&#8243; in my case:</p>
<div class="bash" style="font-family: monospace;font-size: 110%; color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">ifconfig bridge0 addm rl0 addm vr0 up</div>
<p>Now bring the bridge up. Note the two interface need to be up too.</p>
<div class="bash" style="font-family: monospace;font-size: 110%; color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">ifconfig rl0 up<br />
ifconfig vr0 up<br />
ifconfig bridge0 up</div>
<p>If you want an IP address of the box, assign it to the bridge</p>
<div class="bash" style="font-family: monospace;font-size: 110%; color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">ifconfig bridge0 inet <span style="color: #000000;">192.168</span><span style="color: #000000;">.2</span><span style="color: #000000;">.9</span> netmask <span style="color: #000000;">255.255</span><span style="color: #000000;">.255</span><span style="color: #000000;">.0</span></div>
<p>Now the bridge should work. To make dummynet work, we&#8217;ll need to recompile the kernel:<br />
add</p>
<div style="font-family: monospace;font-size: 110%; color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">options IPFIREWALL<br />
options IPFIREWALL_DEFAULT_TO_ACCEPT<br />
options DUMMYNET<br />
options HZ=1000</div>
<p>to the kernel config file and rebuild it. Then add</p>
<div style="font-family: monospace;font-size: 110%; color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">firewall_enable=&quot;YES&quot;<br />
firewall_type=&quot;open&quot;</div>
<p>to /etc/rc.conf.</p>
<p>Make sure you have <strong>filewall_type=&#8221;open&#8221;</strong> in /etc/rc.conf and/or <strong>options IPFIREWALL_DEFAULT_TO_ACCEPT</strong> in your kernel config file before you do the reboot if you are doing this remotely. Or you&#8217;ll block yourself out.</p>
<p>Now enable ifpw on the bridge</p>
<div class="bash" style="font-family: monospace;font-size: 110%; color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">sysctl net.<span style="color: #c20cb9; font-weight: bold;">link</span>.bridge.<span style="color: #007800;">ipfw=</span><span style="color: #000000;">1</span></div>
<p>OK, we can now add a pipe:</p>
<div class="bash" style="font-family: monospace;font-size: 110%; color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">ipfw <span style="color: #000000;">1000</span> add pipe <span style="color: #000000;">1</span> ip from any to any bridged</div>
<p>Note the &#8220;1000&#8243; in the command line. Do a</p>
<div class="bash" style="font-family: monospace;font-size: 110%; color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">ifpw list</div>
<p>first and choose a good place for the pipe.</p>
<p>Now it&#8217;s time to shape the traffic. To add some delay:</p>
<div class="bash" style="font-family: monospace;font-size: 110%; color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">ipfw pipe <span style="color: #000000;">1</span> config delay 5ms</div>
<p>or add some package lost:</p>
<div class="bash" style="font-family: monospace;font-size: 110%; color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">ipfw pipe <span style="color: #000000;">1</span> config plr <span style="color: #000000;">0.1</span></div>
<p>Reference:</p>
<p><a href="http://www.scalabledesign.com/articles/dummynet.html">A nice tutorial</a></p>
<p><a href="http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/network-bridging.html" aiotitle="The FreeBSD hand book about bridging" target="_blank">The FreeBSD hand book about bridging </a></p>
<p><a href="http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/firewalls-ipfw.html" aiotitle="The FreeBSD hand book about IPFW">The FreeBSD hand book about IPFW </a></p>
<p><a href="http://www.freebsd.org/cgi/man.cgi?query=dummynet&amp;sektion=4">dummynet(4) </a></p>
<p><a href="http://www.freebsd.org/cgi/man.cgi?query=ipfw&amp;sektion=8&amp;apropos=0&amp;manpath=FreeBSD+7.0-RELEASE">ipfw(8)</a></p>
<p><hints id="hah_hints"></hints></p>
<p class="akst_link"><a href="http://dryice.name/blog/?p=869&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_869" class="akst_share_link" rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://dryice.name/blog/freebsd/using-freebsd-as-a-network-bridge-and-use-dummynet-to-shape-the-traffic/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Never think your password is complicated enough</title>
		<link>http://dryice.name/blog/freebsd/never-think-your-password-is-complicated-enough/</link>
		<comments>http://dryice.name/blog/freebsd/never-think-your-password-is-complicated-enough/#comments</comments>
		<pubDate>Mon, 21 Apr 2008 07:57:12 +0000</pubDate>
		<dc:creator>dryice</dc:creator>
		
		<category><![CDATA[freebsd]]></category>

		<guid isPermaLink="false">http://dryice.name/blog/freebsd/never-think-your-password-is-complicated-enough/</guid>
		<description><![CDATA[Last week I was asked to help a friend to check out his server that has been hacked. First I was thinking some kind of PHP leak or SQL injection. But I was wrong. The crack uses some kind of SSH user/password scanner and got his root password.
I find this out because the cracker created [...]]]></description>
			<content:encoded><![CDATA[<p>Last week I was asked to help a friend to check out his server that has been hacked. First I was thinking some kind of PHP leak or SQL injection. But I was wrong. The crack uses some kind of SSH user/password scanner and got his root password.</p>
<p>I find this out because the cracker created a new user on his server, and runs the password scanner on his server to gain access to more servers.</p>
<p>The cracker deleted the C source code of the scanner, but left some shell scrip running. And here is how it works: The scanner got a pretty large username/password match database, and the scanner will run through this database against all the computers online. Pretty simple, hmmm? And with some simple tricks, like scan those machines has SSH connection with the current machine, it get pretty efficient.</p>
<p>The thing scares me most is that they&#8217;ve got a really large database. Not only the usual words in dictionary or simply phases like &#8220;letmein&#8221;, I saw things like &#8220;mima&#8221; which is the Chinese pronunciation of &#8220;password&#8221;. There are also some password that I think from other langnuages.</p>
<p>And my friend confirmed his sys admin used to use some really simple password. So, use SSH2 key auth whenever you got a chance, and when you have to use a password, nomatter on SSH or not, never think your password is complicated enough.</p>
<p><hints id="hah_hints"></hints></p>
<p class="akst_link"><a href="http://dryice.name/blog/?p=868&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_868" class="akst_share_link" rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://dryice.name/blog/freebsd/never-think-your-password-is-complicated-enough/feed/</wfw:commentRss>
		</item>
		<item>
		<title>File based virtual user settings for Vsftpd on FreeBSD</title>
		<link>http://dryice.name/blog/freebsd/file-based-virtual-user-settings-for-vsftpd-on-freebsd/</link>
		<comments>http://dryice.name/blog/freebsd/file-based-virtual-user-settings-for-vsftpd-on-freebsd/#comments</comments>
		<pubDate>Sun, 16 Mar 2008 12:00:17 +0000</pubDate>
		<dc:creator>dryice</dc:creator>
		
		<category><![CDATA[freebsd]]></category>

		<guid isPermaLink="false">http://dryice.name/blog/freebsd/file-based-virtual-user-settings-for-vsftpd-on-freebsd/</guid>
		<description><![CDATA[I&#8217;ve done this before with the help of a very good blog entry. But when I tried to do the same thing today I can&#8217;t find that page. So I decide to write this down, in case I&#8217;ll need it later.
The most problem of setting up Vsftpd with file based virtual user on FreeBSD is [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve done this before with the help of a very good blog entry. But when I tried to do the same thing today I can&#8217;t find that page. So I decide to write this down, in case I&#8217;ll need it later.</p>
<p>The most problem of setting up Vsftpd with file based virtual user on FreeBSD is that we don&#8217;t have pam_userdb. So we&#8217;ll use  /usr/ports/security/pam_pwdfile instead.</p>
<p>So after installing the vsftpd and pam_pwdfile ports, do the following:</p>
<p>(1) in /etc/pam.d, make a file named &#8220;vsftpd&#8221; and put the following lines in it:</p>
<div class="php" style="font-family: monospace;font-size: 110%; color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">auth required /usr/local/lib/pam_pwdfile.so pwdfile /etc/vsftpd_login.db<br />
account required /usr/lib/pam_permit.so</div>
<p>(2) make a password file with the apache htpasswd utility:</p>
<div style="font-family: monospace;font-size: 110%; color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">htpasswd -c -b /etc/vsftpd_login.db USERNAME PASSWORD</div>
<p>(3) make a local user with &#8220;nologin&#8221; as the shell and disable password login.  I use &#8220;vsftp&#8221; for this.</p>
<p>(4) in /usr/local/etc/vsftpd.conf, disable anonymous access and enable local user access, and then add the following:</p>
<div class="php" style="font-family: monospace;font-size: 110%; color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">/usr/chroot_local_user=YES<br />
guest_enable=YES<br />
guest_username=vsftp<br />
<span style="color: #ff0000">listen=YES<br />
background=YES</span><br />
pam_service_name=vsftpd</p>
<p>user_config_dir=/usr/local/etc/vsftpd<br />
virtual_use_local_privs=YES</div>
<p>Note the value of &#8220;guest_usrname&#8221; is the local user name you made in step (3)</p>
<p>(5) make a directory /usr/local/etc/vsftpd, and write user specific configurations in a file named after the user&#8217;s login name. For example, someone with full write access will have something like this:</p>
<div class="php" style="font-family: monospace;font-size: 110%; color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">anon_mkdir_write_enable=YES<br />
anon_other_write_enable=YES<br />
anon_upload_enable=YES<br />
write_enable=YES</div>
<p>(6) It should be OK now, add vsftpd_enable=&#8221;YES&#8221;  into /etc/rc.conf as usual, and restart vsftpd to see if everything works fine.</p>
<p><hints id="hah_hints"></hints></p>
<p class="akst_link"><a href="http://dryice.name/blog/?p=856&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_856" class="akst_share_link" rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://dryice.name/blog/freebsd/file-based-virtual-user-settings-for-vsftpd-on-freebsd/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Copy file in the order of their name</title>
		<link>http://dryice.name/blog/freebsd/copy-file-in-the-order-of-their-name/</link>
		<comments>http://dryice.name/blog/freebsd/copy-file-in-the-order-of-their-name/#comments</comments>
		<pubDate>Wed, 30 Jan 2008 10:11:57 +0000</pubDate>
		<dc:creator>dryice</dc:creator>
		
		<category><![CDATA[python]]></category>

		<category><![CDATA[misc]]></category>

		<category><![CDATA[freebsd]]></category>

		<guid isPermaLink="false">http://dryice.name/blog/freebsd/copy-file-in-the-order-of-their-name/</guid>
		<description><![CDATA[Last weekend I got myself a small MP3 player called Q12. 
I really like this small one cause I can carry it everywhere and save me some time while I&#8217;m walking or waiting.
It support file/folder visiting of the files, and not support MP3 tag and organized with artiste, album, etc like Apple IPod. This is [...]]]></description>
			<content:encoded><![CDATA[<p>Last weekend I got myself a small MP3 player called Q12. <img src="http://img2.zol.com.cn/product/14_450x337/391/ceg3c2zMZkig.jpg" title="Q12" alt="Q12" height="375" width="253" /></p>
<p>I really like this small one cause I can carry it everywhere and save me some time while I&#8217;m walking or waiting.</p>
<p>It support file/folder visiting of the files, and not support MP3 tag and organized with artiste, album, etc like Apple IPod. This is the reason I prefer it over the <a href="http://www.sandisk.com/Products/Default.aspx?CatID=1363" target="_blank">Sandisk Clip.</a> Because most of the time I&#8217;ll use it to listen podcasts or audio books.</p>
<p>However there is a problem: It won&#8217;t sort the files. I just can&#8217;t find any options to sort the files in the menu system or the user user manual. Then I thought it might sort the files by their access time, or create time, so I wrote <a href="http://dryice.name/blog/wp-content/uploads/2008/01/mp3reorgpy.gz" title="mp3 reorg">mp3 reorg</a> , which will change the atime/ctime of all the files so the fils should appear earlier will get an earlier atime/ctime. However it turns out this little mp3 don&#8217;t obey that too, they just read the FAT table and don&#8217;t do any sort! Finially I have to wrote another one, <a href="http://dryice.name/blog/wp-content/uploads/2008/01/mp3copypy.gz" title="mp3 copy">mp3 copy</a>, to copy the files in the order I want.</p>
<p>Just put them here in case anyone could find them useful. Note &#8220;create time&#8221; is a dos/windows only thing, we don&#8217;t have this on (most) Unix systems. If your mp3 use atime (access time) or ctime (changed time), you could use the &#8220;mp3reorg&#8221; script on Unix platform too, just comment out the lines with &#8220;win32&#8243; in it. The &#8220;mp3 copy&#8221; script works cross platform, though.</p>
<p><hints id="hah_hints"></hints></p>
<p class="akst_link"><a href="http://dryice.name/blog/?p=863&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_863" class="akst_share_link" rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://dryice.name/blog/freebsd/copy-file-in-the-order-of-their-name/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Notes on moving mail system to a new server</title>
		<link>http://dryice.name/blog/freebsd/notes-on-moving-mail-system-to-a-new-server/</link>
		<comments>http://dryice.name/blog/freebsd/notes-on-moving-mail-system-to-a-new-server/#comments</comments>
		<pubDate>Fri, 18 Jan 2008 15:12:01 +0000</pubDate>
		<dc:creator>dryice</dc:creator>
		
		<category><![CDATA[freebsd]]></category>

		<guid isPermaLink="false">http://dryice.name/blog/freebsd/notes-on-moving-mail-system-to-a-new-server/</guid>
		<description><![CDATA[Well I did this some time ago, I still think writing things done may help if I encounter this again.
To move the mail server to another server, and lost mails as less as possible, here is my steps:
- Set your DNS server so your domains get a lower TTL. Do this as early as possible [...]]]></description>
			<content:encoded><![CDATA[<p>Well I did this some time ago, I still think writing things done may help if I encounter this again.</p>
<p>To move the mail server to another server, and lost mails as less as possible, here is my steps:</p>
<p>- Set your DNS server so your domains get a lower TTL. Do this as early as possible if you have a high TTL before.</p>
<p>- Setup mail server on the new server, use the same settings on the old server, and make sure everything works.</p>
<p>- Sync all the mails from the old server to new server. This takes a long time</p>
<p>- Sync again, this should take a shorter time</p>
<p>- Stop the old mail server</p>
<p>- Do a final Sync</p>
<p>- Start the new mail server</p>
<p>- Update your DNS so the mx record point to the new server</p>
<p>- Done. Check the status and make sure things are OK.</p>
<p>Some note:</p>
<p>- This is for situations that we only have one mail server. If we already have a backup mail server, things will be different.</p>
<p>- We don&#8217;t use the priority of mx record here, cause we don&#8217;t want in-consistency between the two servers</p>
<p>- Most mail servers will retry for at least 24 hours if they can&#8217;t deliver a mail (either because we close down the old mail server or their DNS is not updated yet and can&#8217;t find the new server) so as long as TTL is small enough, we are good and no mail should be lost.</p>
<p><hints id="hah_hints"></hints></p>
<p class="akst_link"><a href="http://dryice.name/blog/?p=853&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_853" class="akst_share_link" rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://dryice.name/blog/freebsd/notes-on-moving-mail-system-to-a-new-server/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Using a RAM disk as /tmp on FreeBSD</title>
		<link>http://dryice.name/blog/freebsd/using-a-ram-disk-as-tmp-on-freebsd/</link>
		<comments>http://dryice.name/blog/freebsd/using-a-ram-disk-as-tmp-on-freebsd/#comments</comments>
		<pubDate>Tue, 11 Dec 2007 07:35:53 +0000</pubDate>
		<dc:creator>dryice</dc:creator>
		
		<category><![CDATA[freebsd]]></category>

		<guid isPermaLink="false">http://dryice.name/blog/freebsd/using-a-ram-disk-as-tmp-on-freebsd/</guid>
		<description><![CDATA[Since I switched my old server to my desktop, I got a desktop with 4G RAM, and I&#8217;m running, of cause FreeBSD-amd64 on it.
However after several days of usage I found I can only use 2G~3G memory on  typical days. The rest are free or intact. This might because I&#8217;m still using the config [...]]]></description>
			<content:encoded><![CDATA[<p>Since I switched my old server to my desktop, I got a desktop with 4G RAM, and I&#8217;m running, of cause FreeBSD-amd64 on it.</p>
<p>However after several days of usage I found I can only use 2G~3G memory on  typical days. The rest are free or intact. This might because I&#8217;m still using the config files I tweaked for my old notebook, where I have only 256M memory. I was thinking once to switch back to FreeBSD-i386 to get the Binaries like Google Earth or win32-codecs, or something that couldn&#8217;t compile on amd64 like audio/beep or textproc/sdcv.</p>
<p>But I&#8217;ve got another idea: I could use the extra RAM to build a RAM disk, and mount it on /tmp. Thus I could take advantage of this much faster /tmp. Of cause all the content on a RAM disk is lost if I do a reboot, but I already have</p>
<div style="font-family: monospace;font-size: 110%; color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">clear_tmp_enable=&quot;YES&quot; &nbsp; &nbsp;# Clear /tmp at startup.</div>
<p>in my /etc/rc.conf so I got nothing to lose.</p>
<p>And it turns to be easier to setup than I thought. Just add one line</p>
<div style="font-family: monospace;font-size: 110%; color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">md &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/tmp &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;mfs &nbsp; &nbsp; rw,noatime,-s512M 0 0</div>
<p>into /etc/fstab and do a reboot. Among other things the &#8220;-s&#8221; option tells how big I want the RAM disk to be. And I think 512M is good for me. Also a RAM disk won&#8217;t take all the 512M memory all the time. This is just the max size of the RAM disk. And when I have only a little files in /tmp, it takes only a little RAM. Check md(4) for all the details.</p>
<p><hints id="hah_hints"></hints></p>
<p class="akst_link"><a href="http://dryice.name/blog/?p=859&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_859" class="akst_share_link" rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://dryice.name/blog/freebsd/using-a-ram-disk-as-tmp-on-freebsd/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Use XKbdOptions instead of Xmodmap in Xorg7.3</title>
		<link>http://dryice.name/blog/freebsd/use-xkbdoptions-instead-of-xmodmap-in-xorg73/</link>
		<comments>http://dryice.name/blog/freebsd/use-xkbdoptions-instead-of-xmodmap-in-xorg73/#comments</comments>
		<pubDate>Tue, 18 Sep 2007 04:13:59 +0000</pubDate>
		<dc:creator>dryice</dc:creator>
		
		<category><![CDATA[freebsd]]></category>

		<guid isPermaLink="false">http://dryice.name/blog/freebsd/use-xkbdoptions-instead-of-xmodmap-in-xorg73/</guid>
		<description><![CDATA[I&#8217;ve upgraded my desktop machine to Xorg 7.3 recently, and one thing annoyed me: My xmodmap settings that make the capslock key another Ctrl key won&#8217;t work.
Searching the web and mailists and I found some reports that for people don&#8217;t use Xmodmap, the CapsLock key and the NumLock key won&#8217;t update the LED on the [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve upgraded my desktop machine to Xorg 7.3 recently, and one thing annoyed me: My xmodmap settings that make the capslock key another Ctrl key won&#8217;t work.</p>
<p>Searching the web and mailists and I found some reports that for people don&#8217;t use Xmodmap, the CapsLock key and the NumLock key won&#8217;t update the LED on the keyboard on Xorg7.3. Checking my box and I found I also get this problem. I guess this is something related, comes with the Xorg7.3.</p>
<p>Fortunately, besides Xmodmap, we have another option to set the CapsLock to Ctrl, or switch CapsLock and Ctrl. For me, I added</p>
<div style="font-family: monospace;font-size: 110%; color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">Option &nbsp; &nbsp; &quot;XkbOptions&quot; &quot;ctrl:nocaps&quot;</div>
<p>in the &#8220;InputDevice&#8221; section of my xorg.conf file, and now I can use the CapsLock as Ctrl key as before.</p>
<p>For people  who want to switch these two, use &#8220;ctrl:swapcaps&#8221; instead. If you want to try it out, you can also use the <strong>setxkbmap</strong>  command, for example:</p>
<div class="bash" style="font-family: monospace;font-size: 110%; color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">setxkbmap -layout us -option ctrl:nocaps</div>
<p>Check the man page for more options.</p>
<p><hints id="hah_hints"></hints></p>
<p class="akst_link"><a href="http://dryice.name/blog/?p=850&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_850" class="akst_share_link" rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://dryice.name/blog/freebsd/use-xkbdoptions-instead-of-xmodmap-in-xorg73/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Quake like terminal with Fvwm</title>
		<link>http://dryice.name/blog/freebsd/quake-like-terminal-with-fvwm/</link>
		<comments>http://dryice.name/blog/freebsd/quake-like-terminal-with-fvwm/#comments</comments>
		<pubDate>Fri, 07 Sep 2007 10:35:03 +0000</pubDate>
		<dc:creator>dryice</dc:creator>
		
		<category><![CDATA[freebsd]]></category>

		<guid isPermaLink="false">http://dryice.name/blog/freebsd/quake-like-terminal-with-fvwm/</guid>
		<description><![CDATA[&#160;
Contents

Why
What do we want
Accessible with a single key stroke
Available on all virtual desktops
No Title, No border
Transparent background
Not shown on task-bar, task switch, or Alt-Tab
And finally, nice animation

&#160;
Why

Well we already have many quake like terminals already:


Kuake
Yakuake
Tilda
Stjerm



But what if you don&#8217;t like loading the whole KDE libraries to get
this? Or, what if all those programs lacks some [...]]]></description>
			<content:encoded><![CDATA[<p class="contents topic">&nbsp;</p>
<p class="topic-title first"><a title="contents" id="contents" name="contents"></a>Contents</p>
<ul class="simple">
<li><a href="#why" title="id1" class="reference" id="id1" name="id1">Why</a></li>
<li><a href="#what-do-we-want" title="id2" class="reference" id="id2" name="id2">What do we want</a></li>
<li><a href="#accessible-with-a-single-key-stroke" title="id3" aiotitle="id3" class="reference" id="id3" name="id3">Accessible with a single key stroke</a></li>
<li><a href="#available-on-all-virtual-desktops" title="id4" class="reference" id="id4" name="id4">Available on all virtual desktops</a></li>
<li><a href="#no-title-no-border" title="id5" class="reference" id="id5" name="id5">No Title, No border</a></li>
<li><a href="#transparent-background" title="id6" class="reference" id="id6" name="id6">Transparent background</a></li>
<li><a href="#not-shown-on-task-bar-task-switch-or-alt-tab" title="id7" class="reference" id="id7" name="id7">Not shown on task-bar, task switch, or Alt-Tab</a></li>
<li><a href="#and-finally-nice-animation" title="id8" class="reference" id="id8" name="id8">And finally, nice animation</a></li>
</ul>
<p class="section">&nbsp;</p>
<h1><a href="#id1" title="why" class="toc-backref" id="why" name="why">Why</a></h1>
<dl class="docutils">
<dt>Well we already have many quake like terminals already:</dt>
<dd>
<ul class="first last simple">
<li><a href="http://www.nemohackers.org/kuake.php" class="reference">Kuake</a></li>
<li><a href="http://extragear.kde.org/apps/yakuake/" class="reference">Yakuake</a></li>
<li><a href="http://tilda.sourceforge.net/" class="reference">Tilda</a></li>
<li><a href="http://home.gna.org/stjerm/" class="reference">Stjerm</a></li>
</ul>
</dd>
</dl>
<p>But what if you don&#8217;t like loading the whole KDE libraries to get<br />
this? Or, what if all those programs lacks some features you really<br />
like, like a transparent background to your root window with a nice<br />
tint color?</p>
<p>Today we&#8217;ll turn a general purpose terminal, like the <a href="http://www.os-cillation.com/index.php?id=42&amp;L=5" class="reference">Terminal</a><br />
program for the <a href="http://www.xfce.org/" class="reference">Xfce</a> project, or <a href="http://software.schmorp.de/pkg/rxvt-unicode.html" class="reference">rxvt-unicode</a>, to a quake like<br />
terminal, with <a href="http://www.fvwm.org" class="reference">Fvwm</a>.</p>
<p>I think I don&#8217;t need to give too much introduction to <a href="http://www.fvwm.org" class="reference">Fvwm</a>: If you<br />
are reading this, there is a good chance that you are already using<br />
it <img src='http://dryice.name/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p class="section">&nbsp;</p>
<h1><a href="#id2" title="what-do-we-want" class="toc-backref" id="what-do-we-want" name="what-do-we-want">What do we want</a></h1>
<p>First of all we&#8217;ll need to find out what do we want from a Quake like<br />
terminal. Here&#8217;s the list:</p>
<ul class="simple">
<li><a href="#accessible-with-a-single-key-stroke" class="reference">Accessible with a single key stroke</a></li>
<li><a href="#available-on-all-virtual-desktops" class="reference">Available on all virtual desktops</a></li>
<li><a href="#no-title-no-border" class="reference">No title, No border</a></li>
<li><a href="#transparent-background" class="reference">Transparent background</a></li>
<li><a href="#not-shown-on-task-bar-task-switch-or-alt-tab" class="reference">Not shown on task-bar, task switch, or Alt-Tab</a></li>
<li><a href="#and-finally-nice-animation" class="reference">And finally, nice animation</a></li>
</ul>
<p>In this article we&#8217;ll use the <a href="http://www.os-cillation.com/index.php?id=42&amp;L=5" class="reference">Terminal</a> program as an example. And<br />
we&#8217;ll set its title to &#8221; quick_terminal&#8221;.</p>
<p>Ready? Let&#8217;s rock!</p>
<p class="section">&nbsp;</p>
<h1><a href="#id3" title="accessible-with-a-single-key-stroke" class="toc-backref" id="accessible-with-a-single-key-stroke" name="accessible-with-a-single-key-stroke">Accessible with a single key stroke</a></h1>
<p>To make the quick terminal Accessible via a single key stroke, we&#8217;ll<br />
need two things:</p>
<ol class="arabic simple">
<li>If the terminal is not running, start one</li>
<li>If the terminal is already running, make it at the right place and focus on it</li>
</ol>
<p>Here&#8217;s the code:</p>
<div style="font-family: monospace;font-size: 110%; color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">DestroyFunc raise_or_fire_quick_terminal<br />
AddToFunc raise_or_fire_quick_terminal<br />
+ I None (&quot;quick_terminal&quot;, CurrentDesk) Exec exec Terminal -T quick_terminal<br />
+ I All (&quot;quick_terminal&quot;, CurrentDesk) Iconify Off<br />
+ I All (&quot;quick_terminal&quot;, CurrentDesk) Resize 800p 600p<br />
+ I All (&quot;quick_terminal&quot;, CurrentDesk) Move 112p 85p<br />
+ I All (&quot;quick_terminal&quot;, CurrentDesk) Raise<br />
+ I All (&quot;quick_terminal&quot;, CurrentDesk) Focus<br />
+ I Break</p>
<p>DestroyFunc hide_quick_terminal<br />
AddToFunc hide_quick_terminal<br />
+ I All (&quot;quick_terminal&quot;) Iconify On<br />
+ I Next Raise<br />
+ I Break</p>
<p>DestroyFunc show_or_hide_quick_terminal<br />
AddToFunc show_or_hide_quick_terminal<br />
+ I ThisWindow (&quot;quick_terminal&quot;) hide_quick_terminal<br />
+ I ThisWindow (!&quot;quick_terminal&quot;) raise_or_fire_quick_terminal<br />
+ I NoWindow raise_or_fire_quick_terminal</div>
<p>We&#8217;ll explain this line by line.</p>
<p>The first two line is how we define functions: <em>AddToFunc</em> says to add<br />
the following command to a function, with the function name following<br />
it. If the function does not exists, then create one. The<br />
<em>DestroyFunc</em> is a safe keeper: It removes any, if there is any,<br />
functions with the same name. There&#8217;s no overload kind of thing in<br />
<a href="http://www.fvwm.org" class="reference">Fvwm</a> configure file. You may wonder why not just a &#8220;DefineFunc&#8221;. The<br />
answer is that <a href="http://www.fvwm.org" class="reference">Fvwm</a> configuration is really flexible: You can add<br />
instructions to one function in different places.</p>
<p>Then we come to the line:</p>
<div style="font-family: monospace;font-size: 110%; color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">+ I None (&quot;quick_terminal&quot;, CurrentDesk) Exec exec Terminal -T quick_terminal</div>
<p>There&#8217;s a lot to talk about if you are new to <a href="http://www.fvwm.org" class="reference">Fvwm</a> configuration<br />
files:</p>
<p>The <em>+ I</em> at the beginning says the command in this line will be<br />
invoked <strong>Immediately</strong>. This is what we need most of the time.</p>
<p>The <em>None (&#8221;"quick_terminal&#8221;, CurrentDesk)</em> follows is a condition<br />
statement in <a href="http://www.fvwm.org" class="reference">Fvwm</a>. It means &#8220;Run the following command when there&#8217;s<br />
no window has the title &#8220;quick_terminal&#8221; in the current desk&#8221;. <em>None</em><br />
is the verb here, &#8220;when there is no&#8230; do&#8230;&#8221;. And the stuff between<br />
the brackets are the conditions. We are going to make our terminal across<br />
all the virtual desktops of <a href="http://www.fvwm.org" class="reference">Fvwm</a>, so we add <em>CurrentDest</em> here, to be<br />
more efficient: <a href="http://www.fvwm.org" class="reference">Fvwm</a> won&#8217;t need to search all the desktops for this<br />
title name now.</p>
<p>Then <em>Exec exec Terminal -T quick_terminal</em>. <em>Exec</em> is a general<br />
command in the Unix world, and it means what you are thinking <img src='http://dryice.name/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . We<br />
use double Exec to make sure the following command returns<br />
immediately. This is recommended in the Fvwm manual. And finally, the<br />
command we want to run: <em>Terminal -T quick_terminal</em>. This starts a<br />
<a href="http://www.os-cillation.com/index.php?id=42&amp;L=5" class="reference">Terminal</a> instance with the title set to <em>quick_terminal</em>. You can<br />
replace this with whatever terminal program you like, for example,<br />
<em>urxvt -T quake_terminal</em>.</p>
<p>The following several lines are easy to understand:</p>
<div style="font-family: monospace;font-size: 110%; color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">+ I All (&quot;quick_terminal&quot;, CurrentDesk) Iconify Off<br />
+ I All (&quot;quick_terminal&quot;, CurrentDesk) Resize 800p 600p<br />
+ I All (&quot;quick_terminal&quot;, CurrentDesk) Move 112p 85p<br />
+ I All (&quot;quick_terminal&quot;, CurrentDesk) Raise<br />
+ I All (&quot;quick_terminal&quot;, CurrentDesk) Focus<br />
+ I Break</div>
<p>First we release our quick_terminal from <em>Iconify</em> status. So the window<br />
is not minimized anymore. Then we <em>Resize</em> it and <em>Move</em> it to a location<br />
we like. I&#8217;m assuming you are using a 1024&#215;768 screen and this will<br />
bring the terminal in the middle of your screen, with 800&#215;600<br />
pixels. The <em>Raise</em> command makes the terminal window appears on top<br />
of all the other windows, and the <em>Focus</em> command will put the<br />
keyboard focus to this window, so what we types next, will be<br />
transferred to our quick_terminal. The final <em>Break</em> command is,<br />
well, a break, like in any other programming languages. We&#8217;ll talk<br />
more about this later.</p>
<p>The following <em>hide_quick_terminal</em> command is rather simple: We<br />
first set the <em>Iconify</em> status of our quick_terminal on, so it<br />
disappears and lost the keyboard focus. Then we use <em>Next Raise</em> to<br />
set the keyboard focus to the window we are working on before calling<br />
our quick terminal. <em>Next</em> here is another conditional command in<br />
<a href="http://www.fvwm.org" class="reference">Fvwm</a>. We don&#8217;t use any conditions (stuffs between brackets) here so<br />
it just selects the next window in the stack.</p>
<p>The last function, <em>show_or_hide_quick_terminal</em>, calls the two<br />
functions above in different conditions: <em>ThisWindow</em> is another<br />
conditional command. It tests if the current windows matches the<br />
conditions following. So the first two line of this function says: If<br />
I&#8217;m working on a window named &#8220;quick_terminal&#8221;, call<br />
<em>hide_quick_terminal</em>, else call <em>raise_or_fire_quick_terminal</em>. The<br />
final <em>NoWindow</em> conditional command matches when we are not on any<br />
window. This is useful when, for example, you just started <a href="http://www.fvwm.org" class="reference">Fvwm</a> and<br />
haven&#8217;t got any program running.</p>
<p>OK. We&#8217;ve got all these set. The final step would be, make our primary<br />
function, <em>show_or_hide_quick_terminal</em>, be invoked with a simple<br />
key stroke. We&#8217;ll use the F1 key, as an example:</p>
<div style="font-family: monospace;font-size: 110%; color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">Key F1 A N show_or_hide_quick_terminal</div>
<p>Here <em>Key</em> starts a key binding. <em>F1</em> is the key we want. The<br />
following <em>A</em> and <em>N</em> needs some explanation: <em>A</em> defines the context<br />
of this key binding. That is, where this key binding is available? on<br />
an application window? a root window? or the side bar (border) of a<br />
window? We use <em>A</em> here so it&#8217;s available in all conditions. Then the<br />
modifier <em>N</em>. If you want <em>Ctrl-F1</em>, <em>Alt-F1</em>, or <em>Shift-F1</em> instead<br />
of just <em>F1</em>, you can put <em>C</em>, <em>A</em>, or <em>S</em> here, accordingly. This<br />
time we think the quick terminal is so useful that we just want an<br />
<em>F1</em>, so we put a <em>N</em> here, which means &#8220;no modifier&#8221;".</p>
<p>And here&#8217;s why we add a <em>Break</em> statement at the end of the first two<br />
functions: <em>show_or_hide_quick_terminal</em> is the function get<br />
called. If we don&#8217;t add a break some where, all the three statements<br />
in it will be called one by one. Say if we are on the <em>quick_terminal</em><br />
window. The first condition matches, and <em>hide_quick_terminal</em> get<br />
called. And now we are at another window, and the second condition<br />
matches, so <em>raise_or_fire_quick_terminal</em> get called too, and our<br />
window re-appears. That&#8217;s definitely not what we want.</p>
<p class="section">&nbsp;</p>
<h1><a href="#id4" title="available-on-all-virtual-desktops" class="toc-backref" id="available-on-all-virtual-desktops" name="available-on-all-virtual-desktops">Available on all virtual desktops</a></h1>
<p>This is easy with <a href="http://www.fvwm.org" class="reference">Fvwm</a>:</p>
<div style="font-family: monospace;font-size: 110%; color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">Style &quot;quick_terminal&quot; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Sticky</div>
<p><em>Style</em> is the Fvwm command controlling how a window<br />
behaves. Following by the window name (title) and the<br />
behavior. <em>Sticky</em> is the style this time. It means the window will<br />
be available on all virtual desktops.</p>
<p class="section">&nbsp;</p>
<h1><a href="#id5" title="no-title-no-border" class="toc-backref" id="no-title-no-border" name="no-title-no-border">No Title, No border</a></h1>
<p>Here is the code:</p>
<div style="font-family: monospace;font-size: 110%; color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">Style &quot;quick_terminal&quot; !Title, !Handles, !Borders<br />
Style &quot;quick_terminal&quot; BorderWidth 0, HandleWidth 0</div>
<p>The first line makes the <em>quick_terminal</em> window has no title bar, no<br />
handles, and no borders, as you can guess from the name. Handles is<br />
the tiny triangle on the lower-right corner that you can drag to<br />
resize the window. As we want a fixed width and height of this quick<br />
window, and to make sure there&#8217;s no borders anyway, we turn this off<br />
for our terminal.</p>
<p>The second line is a safe keeper, again. In case you have some<br />
settings that turns on Handles and/or Borders for all the windows,<br />
this will make the width zero.</p>
<p class="section">&nbsp;</p>
<h1><a href="#id6" title="transparent-background" class="toc-backref" id="transparent-background" name="transparent-background">Transparent background</a></h1>
<p>This is really not a window manager&#8217;s work. Well, at least until<br />
<a href="http://compiz.org/" class="reference">Compiz</a> and <a href="http://wiki.beryl-project.org/" class="reference">Beryl</a> comes out.</p>
<p>All I have to say is to choose a terminal emulator program that have<br />
good transparent background support. There are a lot: <a href="http://www.os-cillation.com/index.php?id=42&amp;L=5" class="reference">Terminal</a>,<br />
<a href="http://software.schmorp.de/pkg/rxvt-unicode.html" class="reference">rxvt-unicode</a>, <a href="http://aterm.sourceforge.net/" class="reference">aterm</a>, <a href="http://www.eterm.org/" class="reference">eterm</a>, etc. I may talk about how to set your<br />
background window to be compatible with these programs in a later<br />
article.</p>
<p class="section">&nbsp;</p>
<h1><a href="#id7" title="not-shown-on-task-bar-task-switch-or-alt-tab" class="toc-backref" id="not-shown-on-task-bar-task-switch-or-alt-tab" name="not-shown-on-task-bar-task-switch-or-alt-tab">Not shown on task-bar, task switch, or Alt-Tab</a></h1>
<p><a href="http://www.fvwm.org" class="reference">Fvwm</a> uses the <em>FvwmTaskBar</em> module for the MS windows like &#8220;task<br />
bar&#8221;. If you don&#8217;t like it and don&#8217;t use it, fine, nothing will appear<br />
on the task bar, cause there is no task bar <img src='http://dryice.name/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>If you are using task bar, here&#8217;s how to hide our terminal from it:</p>
<div style="font-family: monospace;font-size: 110%; color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">Style &quot;quick_terminal&quot; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; WindowListSkip<br />
*FvwmTaskBar UseSkipList</div>
<p>The first line add style <em>WindowListSkip</em> to our terminal. This<br />
prevent the window from appearing in the menu that the <em>WindowList</em><br />
command created. This is the menu that most people bind to Alt-Tab.</p>
<p>And the second line, is a <a href="http://www.fvwm.org" class="reference">Fvwm</a> option line for <em>FvwmTaskBar</em>. This<br />
tells <em>FvwmTaskBar</em> not to show the window with a <em>WindowListSkip</em> style,<br />
on the task bar.</p>
<p>With these two lines, our always available terminal won&#8217;t pollute our<br />
window switching window and task bar.</p>
<p class="section">&nbsp;</p>
<h1><a href="#id8" title="and-finally-nice-animation" class="toc-backref" id="and-finally-nice-animation" name="and-finally-nice-animation">And finally, nice animation</a></h1>
<p>Hmmm, want to look cool? Let&#8217;s add some animation here <img src='http://dryice.name/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> We&#8217;ll make a<br />
pull-down animation cause this is what all the other quake like<br />
terminals have. And you&#8217;ll find out soon that <a href="http://www.fvwm.org" class="reference">Fvwm</a> can do much more.</p>
<p>The Fvwm module that handles animation is FvwmAnimatie. To start it,<br />
add the following line to your Fvwm configuration file:</p>
<div style="font-family: monospace;font-size: 110%; color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">Module FvwmAnimate</div>
<p>With this started, there is a good chance that you can find an<br />
&#8220;animation&#8221; item on your &#8220;settings&#8221; menu. If not, go to your Fvwm<br />
Console and issue the command:</p>
<div style="font-family: monospace;font-size: 110%; color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">Popup MenuFvwmAnimate</div>
<p>then the menu popups up, where you can choose the animation effects, line width,<br />
delay times, etc. Because we haven&#8217;t turn animation on for our little<br />
command when we make our terminal <a href="#accessible-with-a-single-key-stroke" class="reference">Accessible with a single key<br />
stroke</a>, you can&#8217;t see the effect right now. Just make sure the<br />
effect is <tt class="docutils literal"><span class="pre">Frame</span></tt> here.</p>
<p>Now we need to add two:</p>
<div style="font-family: monospace;font-size: 110%; color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">+ I SendToModule FvwmAnimate animate</div>
<p>statements to those two functions. This means &#8220;send an <em>animate</em><br />
command to the <em>FvwmAnimate</em> module&#8221;. And it takes 8 parameters: x1,<br />
y1, w1, h1, x2, y2, w2, h2. The first four defines a rectangle where<br />
the animation starts, and the last four defines a rectangle where the<br />
animation ends.</p>
<p>For us, we need to add:</p>
<div style="font-family: monospace;font-size: 110%; color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">+ I SendToModule FvwmAnimate animate 112 300 800 0 112 300 800 600</div>
<p>before:</p>
<div style="font-family: monospace;font-size: 110%; color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">+ I All (&quot;quick_terminal&quot;, CurrentDesk) Iconify Off</div>
<p>in function <tt class="docutils literal"><span class="pre">raise_or_fire_quick_terminal</span></tt> and:</p>
<div style="font-family: monospace;font-size: 110%; color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">+ I SendToModule FvwmAnimate animate 112 300 800 600 112 300 800 0</div>
<p>before:</p>
<div style="font-family: monospace;font-size: 110%; color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">+ I All (&quot;quick_terminal&quot;) Iconify On</div>
<p>in function <tt class="docutils literal"><span class="pre">hide_quick_terminal</span></tt>.</p>
<p>Now we are all set. Restart your <a href="http://www.fvwm.org" class="reference">Fvwm</a> and press F1. Do you see the<br />
magic? Use your imagination here, for example, you can make a<br />
rectangle rolls out from the upper left corner when you want the<br />
terminal. And this, is left for you as an exercise <img src='http://dryice.name/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><hints id="hah_hints"></hints></p>
<p class="akst_link"><a href="http://dryice.name/blog/?p=846&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_846" class="akst_share_link" rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://dryice.name/blog/freebsd/quake-like-terminal-with-fvwm/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Why the FreeBSD ports system rocks</title>
		<link>http://dryice.name/blog/uncategorized/why-the-freebsd-ports-system-rocks/</link>
		<comments>http://dryice.name/blog/uncategorized/why-the-freebsd-ports-system-rocks/#comments</comments>
		<pubDate>Mon, 03 Sep 2007 02:19:15 +0000</pubDate>
		<dc:creator>dryice</dc:creator>
		
		<category><![CDATA[freebsd]]></category>

		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://dryice.name/blog/uncategorized/why-the-freebsd-ports-system-rocks/</guid>
		<description><![CDATA[
Well I need to handle some PHP upgrade on a Debian server some days ago, and it turns out to be a nightmire&#8230;
Debian is famous for its &#8220;apt-get&#8221; package management system, and I thought it would be easy. However, it turns out all the packages are binary and have exact version numbers in dependency. To [...]]]></description>
			<content:encoded><![CDATA[<p><hints id="hah_hints"></hints></p>
<p>Well I need to handle some PHP upgrade on a Debian server some days ago, and it turns out to be a nightmire&#8230;</p>
<p>Debian is famous for its &#8220;apt-get&#8221; package management system, and I thought it would be easy. However, it turns out all the packages are binary and have exact version numbers in dependency. To make it worse, the previous sysadmin uses both sarge and etch packages. Now if you want to install something from sarge, it complains some dependence in etch is too high and won&#8217;t continue, and if you want to install something from etch, well, some dependences got a version too low.</p>
<p>And I tried the &#8220;smart&#8221; &#8220;apt-get dist-upgrade&#8221; command, and it removed my bind9! All sites going down because of this. And to make it worse, I can&#8217;t install it again because of the sarge/etch mix. And finially I have to deinstall many packages and re-install them, and stick to sarge.</p>
<p>I know this is not a pure problem on Debian, the previous sysadmin should be blamed mostly, but, hi, the binary package system with hard coded version numbers makes all these possible&#8230; And I have to say, compile from the source rocks! The FreeBSD ports system rocks!</p>
<p class="akst_link"><a href="http://dryice.name/blog/?p=843&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_843" class="akst_share_link" rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://dryice.name/blog/uncategorized/why-the-freebsd-ports-system-rocks/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
