Linux https://yyhh.org/notebook/linux en Backup Discourse with External PostgreSQL Server https://yyhh.org/blog/2018/01/backup-discourse-external-postgresql-server <span>Backup Discourse with External PostgreSQL Server</span> <span><a title="View user profile." href="/user/huahai" lang="" about="/user/huahai" typeof="schema:Person" property="schema:name" datatype="">Huahai</a></span> <span>Sun, 01/21/2018 - 05:58</span> <div class="field field--name-field-notebook field--type-entity-reference field--label-hidden field__items"> <div class="field__item"><div about="/notebook/linux" id="taxonomy-term-16" class="taxonomy-term vocabulary-notebook"> <a href="/notebook/linux"> <div class="field field--name-name field--type-string field--label-hidden field__item">Linux</div> </a> <div class="content"> </div> </div> </div> </div> <div class="field field--name-body field--type-text-with-summary field--label-hidden field__item"><div class="tex2jax_process"><p><a href="https://www.discourse.org/">Discourse</a> is a modern forum software that is quite popular in the technology circle. One can install a Discourse server easily with the recommended method of using docker. All the services&nbsp;needed by the Discourse server, e.g.&nbsp;Postgresql and Redis,&nbsp;will be running inside a docker container, which is fine for a small installation. However, if one has already an&nbsp;external Postgresql server running, e.g. on AWS RDS, and would like to use that instead, Discourse may have trouble doing backups, and you may receive an email from Discourse:</p> <blockquote><p>[2018-01-21 03:39:44] pg_dump: server version: 9.6.5; pg_dump version: 9.5.10</p> <p>[2018-01-21 03:39:44] pg_dump: aborting because of server version mismatch</p> <p>[2018-01-21 03:39:44] EXCEPTION: pg_dump failed</p> </blockquote> <p>&nbsp;</p> <p>The main problem is that the Postgresql client in&nbsp;Discourse docker image is old, currently at version 9.5, whereas most of the world has moved on to version 9.6, and some even to version 10.&nbsp;</p> <p>The Discourse people are not very helpful on their forum regarding this issue. So here's a solution:</p> <p>We need to update the Postgresql version in the Discourse docker container to whatever version your external Postgresql server is. Fortunately, it is fairly simple. First, get into the running container:</p> <pre> <code class="language-bash">sudo ./launcher enter app</code></pre><p>Then update postgresql to the version you want, e.g.</p> <pre> <code class="language-bash">apt-get install postgresql-9.6</code></pre><p>Now link pg_dump to the right version:</p> <pre> <code class="language-bash">ln -s /usr/lib/postgresql/9.6/bin/pg_dump /usr/bin/pg_dump</code></pre><p>After this, you should be able to perform backup successfully in the UI.&nbsp;&nbsp;</p> </div></div> <section> <h2>Add new comment</h2> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=187&amp;2=comment_node_blog&amp;3=comment_node_blog" token="XcMmQYM7Q3mYqYC3aQG6ZfroXIoHWKIA_7gz6HJruL8"></drupal-render-placeholder> </section> <strong class="node_view"></strong> Sun, 21 Jan 2018 05:58:15 +0000 Huahai 187 at https://yyhh.org FreeIPA in AWS EC2 https://yyhh.org/blog/2017/12/freeipa-aws-ec2 <span>FreeIPA in AWS EC2</span> <span><a title="View user profile." href="/user/huahai" lang="" about="/user/huahai" typeof="schema:Person" property="schema:name" datatype="">Huahai</a></span> <span>Thu, 12/07/2017 - 23:34</span> <div class="field field--name-field-notebook field--type-entity-reference field--label-hidden field__items"> <div class="field__item"><div about="/notebook/linux" id="taxonomy-term-16" class="taxonomy-term vocabulary-notebook"> <a href="/notebook/linux"> <div class="field field--name-name field--type-string field--label-hidden field__item">Linux</div> </a> <div class="content"> </div> </div> </div> <div class="field__item"><div about="/notebook/aws" id="taxonomy-term-42" class="taxonomy-term vocabulary-notebook"> <a href="/notebook/aws"> <div class="field field--name-name field--type-string field--label-hidden field__item">AWS</div> </a> <div class="content"> </div> </div> </div> <div class="field__item"><div about="/notebook/freeipa" id="taxonomy-term-41" class="taxonomy-term vocabulary-notebook"> <a href="/notebook/freeipa"> <div class="field field--name-name field--type-string field--label-hidden field__item">FreeIPA</div> </a> <div class="content"> </div> </div> </div> </div> <div class="field field--name-body field--type-text-with-summary field--label-hidden field__item"><div class="tex2jax_process"><div data-oembed-url="http://www.juliosblog.com/content/images/2016/06/freeipa_logo_by_pookstar.png"> <div style="max-width:320px;margin:auto;"> <!-- You're using demo endpoint of Iframely API commercially. Max-width is limited to 320px. Please get your own API key at https://iframely.com. --><div style="max-width: 608px;"> <div style="left: 0; width: 100%; height: 0; position: relative; padding-bottom: 37.4753%;"> <iframe allowfullscreen="" src="https://cdn.iframe.ly/OfIsixz" style="border: 0; top: 0; left: 0; width: 100%; height: 100%; position: absolute;" tabindex="-1"></iframe></div> </div> </div> </div> <p>FreeIPA is the open source version of RedHat's identity management solution, which nicely integrates several open sources services that are important for managing an intranet: 389 LDAP Directory Server, MIT Kerboros, NTP, DNS, SSSD and others.&nbsp;</p> <p>Most of my servers are virtual machines in AWS EC2. To manage such a cloud based intranet using freeIPA, some additional configuration is necessary. Here's how I got it to work.</p> <h2>DNS</h2> <p>The main problem of enabling freeIPA in EC2, is that every machine&nbsp;in EC2 has at least two kinds of&nbsp;of IP addresses. One is internal to the VPC only, e.g. the default VPC use IP addresses starting from <span style="font-family:Courier New,Courier,monospace;">172.31.*.*</span>; Another kinds&nbsp;of IP addresses are public IP addresses, which are different from the internal ones. A default install of freeIPA server and clients in EC2 will not work due to this dual IP addresses.</p> <p>To install freeIPA, we first need to configure individual <span style="color:null;">hosts' </span><span style="color:#e74c3c;">/etc/hosts</span>, <span style="color:#e74c3c;">/etc/hostname</span> files, so they point to the full qualified DNS name of the hosts. After that, we are ready to add these names to DNS servers.</p> <h3>Route53</h3> <p>We will bypass freeIPA's own DNS services, and use AWS Route53 DNS service. We need to setup three hosted zones for our network. One zone for the external IPs, one for internal IPs, and finally one for reverse lookup.</p> <p>For internal and external hosted zones, in addition to the <span style="color:#e74c3c;">A</span> records that map DNS names to IPs, we also need to add <span style="color:#e74c3c;">TXT</span> and <span style="color:#e74c3c;">SRV</span> records that allow freeIPA to discover services. Eg. for the external zone:&nbsp;</p> <table __gwtcellbasedwidgetimpldispatchingblur="true" __gwtcellbasedwidgetimpldispatchingfocus="true" cellspacing="0"> <tbody> <tr __gwt_row="4" __gwt_subrow="0"> <td align="right"> <p>_kerberos.example.com.</p> </td> <td> <p>TXT</p> </td> <td> <p>"EXAMPLE.COM"</p> </td> <td> <p>-</p> </td> <td> <p>-</p> </td> <td> <p>300</p> </td> </tr> </tbody> </table> <table __gwtcellbasedwidgetimpldispatchingblur="true" __gwtcellbasedwidgetimpldispatchingfocus="true" cellspacing="0"> <tbody> <tr __gwt_row="5" __gwt_subrow="0"> <td align="right"> <p>_kerberos-master._tcp.example.com.</p> </td> <td> <p>SRV</p> </td> <td> <p>0 100 88 ipa.example.com.</p> </td> <td> <p>-</p> </td> <td> <p>-</p> </td> <td> <p>300</p> </td> </tr> </tbody> </table> <table __gwtcellbasedwidgetimpldispatchingblur="true" __gwtcellbasedwidgetimpldispatchingfocus="true" cellspacing="0"> <tbody> <tr __gwt_row="6" __gwt_subrow="0"> <td align="right"> <p>_kerberos._tcp.example.com.</p> </td> <td> <p>SRV</p> </td> <td> <p>0 100 88 ipa.example.com.</p> </td> <td> <p>-</p> </td> <td> <p>-</p> </td> <td> <p>300</p> </td> </tr> </tbody> </table> <table __gwtcellbasedwidgetimpldispatchingblur="true" __gwtcellbasedwidgetimpldispatchingfocus="true" cellspacing="0"> <tbody> <tr __gwt_row="7" __gwt_subrow="0"> <td align="right"> <p>_kpasswd._tcp.example.com.</p> </td> <td> <p>SRV</p> </td> <td> <p>0 100 464 ipa.example.com.</p> </td> <td> <p>-</p> </td> <td> <p>-</p> </td> <td> <p>300</p> </td> </tr> </tbody> </table> <table __gwtcellbasedwidgetimpldispatchingblur="true" __gwtcellbasedwidgetimpldispatchingfocus="true" cellspacing="0"> <tbody> <tr __gwt_row="8" __gwt_subrow="0"> <td align="right"> <p>_ldap._tcp.example.com.</p> </td> <td> <p>SRV</p> </td> <td> <p>0 100 389 ipa.example.com.</p> </td> <td> <p>-</p> </td> <td> <p>-</p> </td> <td> <p>300</p> </td> </tr> </tbody> </table> <table __gwtcellbasedwidgetimpldispatchingblur="true" __gwtcellbasedwidgetimpldispatchingfocus="true" cellspacing="0"> <tbody> <tr __gwt_row="9" __gwt_subrow="0"> <td align="right"> <p>_kerberos-master._udp.example.com.</p> </td> <td> <p>SRV</p> </td> <td> <p>0 100 88 ipa.example.com.</p> </td> <td> <p>-</p> </td> <td> <p>-</p> </td> <td> <p>300</p> </td> </tr> </tbody> </table> <table __gwtcellbasedwidgetimpldispatchingblur="true" __gwtcellbasedwidgetimpldispatchingfocus="true" cellspacing="0"> <tbody> <tr __gwt_row="10" __gwt_subrow="0"> <td align="right"> <p>_kerberos._udp.example.com.</p> </td> <td> <p>SRV</p> </td> <td> <p>0 100 88 ipa.example.com.</p> </td> <td> <p>-</p> </td> <td> <p>-</p> </td> <td> <p>300</p> </td> </tr> </tbody> </table> <table __gwtcellbasedwidgetimpldispatchingblur="true" __gwtcellbasedwidgetimpldispatchingfocus="true" cellspacing="0"> <tbody> <tr __gwt_row="11" __gwt_subrow="0"> <td align="right"> <p>_kpasswd._udp.example.com.</p> </td> <td> <p>SRV</p> </td> <td> <p>0 100 464 ipa.example.com.</p> </td> <td> <p>-</p> </td> <td> <p>-</p> </td> <td> <p>300</p> </td> </tr> </tbody> </table> <table __gwtcellbasedwidgetimpldispatchingblur="true" __gwtcellbasedwidgetimpldispatchingfocus="true" cellspacing="0"> <tbody> <tr __gwt_row="12" __gwt_subrow="0"> <td align="right"> <p>_ntp._udp.example.com.</p> </td> <td> <p>SRV</p> </td> <td> <p>0 100 123 ipa.example.com.</p> </td> <td> <p>-</p> </td> <td> <p>-</p> </td> <td> <p>300</p> </td> </tr> </tbody> </table> <table __gwtcellbasedwidgetimpldispatchingblur="true" __gwtcellbasedwidgetimpldispatchingfocus="true" cellspacing="0" style="width: 453px;"> <tbody> <tr __gwt_row="13" __gwt_subrow="0"> <td align="right"> <p>ipa.example.com.</p> </td> <td> <p>A</p> </td> <td style="width: 324px;"> <p>99.99.99.99</p> </td> <td> <p>-</p> </td> <td> <p>-</p> </td> <td> <p>300</p> </td> </tr> </tbody> </table> <p>&nbsp;</p> <p>Here we will install the freeIPA server on a machine with external IP <span style="font-family:Courier New,Courier,monospace;">99.99.99.99</span>, and the DNS name for the server is<span style="font-family:Courier New,Courier,monospace;"> ipa.example.com</span>.</p> <p>Similar records need to be added the internal zone as well, just use the internal IP addresses.</p> <p>Finally, the private reverse look up zone, named&nbsp;<span style="color:#e74c3c;"><span style="font-family:Courier New,Courier,monospace;">31.172.in-addr.arpa.</span>,</span> has records like these:</p> <table __gwtcellbasedwidgetimpldispatchingblur="true" __gwtcellbasedwidgetimpldispatchingfocus="true" cellspacing="0"> <tbody> <tr __gwt_row="4" __gwt_subrow="0"> <td align="right"> <p>88.123.31.172.in-addr.arpa.</p> </td> <td> <p><span style="color:#e74c3c;">PTR</span></p> </td> <td> <p>ipa.example.com</p> </td> <td> <p>-</p> </td> <td> <p>-</p> </td> <td> <p>300</p> </td> </tr> </tbody> </table> <p>Where <span style="font-family:Courier New,Courier,monospace;">172.31.123.88</span> is the internal IP address of the freeIPA server.&nbsp;</p> <p>We need to do these for all servers managed by freeIPA. It's a bit of work if there are not many machines. For large deployment, one may want to investigate automatized solution with AWS&nbsp;APIs.</p> <h3>Test DNS</h3> <p>On a machine outside the VPC</p> <pre> <code class="language-shell">$ dig +short ipa.example.com</code></pre><p>Should return the external IP of the machine.</p> <p>Doing the same on an internal machine should return the internal IP of the machine.</p> <p>Finally, test reverse lookup on an internal machine</p> <pre> <code class="language-shell">$ dig +short -x 172.31.123.88</code></pre><p>Should return the DNS name of the machine.</p> <h2>FreeIPA Server Install</h2> <p>I normally use Debian servers,&nbsp; but there's currently no stable&nbsp; freeIPA server available in Debian Stretch, so I installed a Fedora, which supports freeIPA natively.</p> <p>Use a small EC2 instance that will be dedicated to running a freeIPA server.</p> <pre> <code class="language-shell"># yum install freeipa-server # ipa-server-install</code></pre><p>And say "no" to DNS. The installation should be successful if all instructions are followed.</p> <h2>FreeIPA&nbsp; Client</h2> <p>Since most of my machines are Debian, I had to install Debian freeIPA clients on them. Ubuntu Xenial universe repo has a version of freeIPA&nbsp;&nbsp;client that is compatible with Debian Strech. So I installed them.</p> <pre> <code class="language-shell"># apt install freeipa-client # /etc/init.d/ntp stop # ipa-client-install</code></pre><p>Notice that we must stop NTP daemon&nbsp;first if it's already running. Otherwise, the client installation will fail, because the freeIPA client expects to run its own NTP service that synchronizes with the freeIPA server.&nbsp;</p> <p>After a successful installation, the client is still not ready to use, because&nbsp;the Ubuntu installer configured <span style="color:#e74c3c;">/etc/sssd/sssd.conf</span> is currently broken:&nbsp;nss, pam,&nbsp; and ssh needs to be added. Otherwise, the client cannot be connected to. A working example of <span style="color:#e74c3c;">/etc/sssd/sssd.conf</span>&nbsp;looks like this:</p> <pre> <code class="language-ini">[domain/example.com] cache_credentials = True krb5_store_password_if_offline = True ipa_domain = example.com id_provider = ipa auth_provider = ipa access_provider = ipa ipa_hostname = aclient.example.com chpass_provider = ipa ipa_server = _srv_, ipa.example.com ldap_tls_cacert = /etc/ipa/ca.crt [sssd] services = nss, sudo, pam, ssh domains = example.com [nss] homedir_substring = /home [pam] [sudo] [autofs] [ssh] [pac] [ifp] [secrets] </code></pre><p>Restart sssd or simply reboot. Everything should work as expected.</p> <pre> <code class="language-shell">$ kinit admin $ ssh admin@ipa.example.com</code></pre><p>Should login to the freeIPA server as admin user.&nbsp;</p> <pre> <code class="language-shell">$ ssh admin@aclient.example.com</code></pre><p>Should login to the client machine as admin user.</p> <p>Congratulation, now you have single sign on (SSO) for your intranet in AWS EC2!</p> <p>[update: 10/23/208]</p> <h2>Cross Cloud Intranet</h2> <p>With minor modification, this same setup can be used to manage you Intranet with hosts spanning multiple cloud platforms!</p> <p>For example, you can have some hosts reside on Google Cloud Platform (GCP) while the IPA server lives in AWS. To do that, the <span style="background-color:#e74c3c;">public</span> IP addresses of these ex-AWS hosts need to be entered in <span style="color:#e74c3c;">both</span> external and internal DNS realms in Route53. GCP nicely supports this setup because you can reserve as many static public IP addresses as you want in GCP.</p> <p>For example, you can have a host on GCP with a public address 35.22.31.33, for which you assign a domain name "gcp1.example.com" in Route53. Then you run <span style="color:#e74c3c;">hostname gcp1.example.com</span> on this GCP host. After that, you should be able to install freeIPA client on it to enroll into your Intranet.</p> <p>After install freeIPA client, another important modification, is to add the following directive in <span style="color:#e74c3c;">/etc/krb5.conf</span><span style="color:null;"> of all your ex-AWS hosts:</span></p> <pre> <code> [libdefaults] ignore_acceptor_hostname = true </code></pre><p>This directive tells Kerberos service of an accepting host to not verify its own hostname, because an ex-AWS host's attempt to discover its own hostname will yield a name that is different from the one you assigned in Route53. With this change, you should be able to access your ex-AWS hosts as if they are part of your Intranet. Your SSO should work on these ex-AWS hosts as well.</p> </div></div> <ul class="links inline"><li class="comment-add"><a href="/blog/2017/12/freeipa-aws-ec2#comment-form" title="Share your thoughts and opinions." hreflang="en">Add new comment</a></li></ul><section> <a id="comment-233"></a> <article data-comment-user-id="0" class="js-comment comment"> <mark class="hidden" data-comment-timestamp="1535264254"></mark> <footer class="attribution"> <article typeof="schema:Person" about="/user/0"> <div class="field field--name-user-picture field--type-image field--label-hidden field__item"> <img src="/sites/default/files/styles/thumbnail/public/default_images/default-user-image.png?itok=hWWOuuKw" width="100" height="100" alt="Profile picture for user Johnebyne" title="Anonymous user" typeof="foaf:Image" /> </div> </article> <div class="comment-submitted"> <p class="commenter-name"> <span lang="" typeof="schema:Person" property="schema:name" datatype="">Reena DeBerry</span> </p> <p class="comment-time"> Tue, 05/08/2018 - 22:19 </p> </div> </footer> <div class="comment-text"> <div class="comment-arrow"></div> <h3><a href="/comment/233#comment-233" class="permalink" rel="bookmark" hreflang="en">Having issues installing ipa replica on an EC2 instance</a></h3> <div class="content"> <div class="field field--name-comment-body field--type-text-long field--label-hidden field__item"><div class="tex2jax_process"><p>Thanks for the write up, but i am still a little confused, that being said your write has the most info than any other article so far. So, thank you..... I am getting the error below using Route 53 and would appreciate any help.</p> <p>ipa.ipapython.install.cli.install_tool(CompatServerReplicaInstall): ERROR    The host name some.domain.dot.com does not match the primary host name ip-00-00-00-0.ec2.internal. Please check /etc/hosts or DNS name resolution<br /> ipa.ipapython.install.cli.install_tool(CompatServerReplicaInstall): ERROR    The ipa-replica-install command failed. See /var/log/ipareplica-install.log for more information<br />  </p> <p>Reena</p> <p>I can send a screen shot of my route 53 setup, but i will need to do it privately..</p> </div></div> <drupal-render-placeholder callback="comment.lazy_builders:renderLinks" arguments="0=233&amp;1=default&amp;2=en&amp;3=" token="fWjFXqbEoti3SR6SWZhzXOw3ZTlyKLnvpM9UEvDW_00"></drupal-render-placeholder> </div> </div> </article> <div class="indented"><a id="comment-326"></a> <article data-comment-user-id="1" class="js-comment comment"> <mark class="hidden" data-comment-timestamp="1535264967"></mark> <footer class="attribution"> <article typeof="schema:Person" about="/user/huahai"> <div class="field field--name-user-picture field--type-image field--label-hidden field__item"> <img src="/sites/default/files/styles/thumbnail/public/pictures/2017-11/huahai.jpg?itok=ZwjJWYAc" width="88" height="100" alt="Profile picture for user Huahai" typeof="foaf:Image" /> </div> </article> <div class="comment-submitted"> <p class="commenter-name"> <a title="View user profile." href="/user/huahai" lang="" about="/user/huahai" typeof="schema:Person" property="schema:name" datatype="">Huahai</a> </p> <p class="comment-time"> Sun, 08/26/2018 - 07:27 </p> </div> <p class="visually-hidden">In reply to <a href="/comment/233#comment-233" class="permalink" rel="bookmark" hreflang="en">Having issues installing ipa replica on an EC2 instance</a> by <span lang="" typeof="schema:Person" property="schema:name" datatype="">Reena DeBerry</span></p> </footer> <div class="comment-text"> <div class="comment-arrow"></div> <h3><a href="/comment/326#comment-326" class="permalink" rel="bookmark" hreflang="en">It&#039;s not just about Route53 settings</a></h3> <div class="content"> <div class="field field--name-comment-body field--type-text-long field--label-hidden field__item"><div class="tex2jax_process"><p>As mentioned in the article, you will need to change the hostname on the node as well.&nbsp;</p> <p>Basically, do the following:</p> <p>1. Run this command:&nbsp;</p> <p>$ sudo hostname &lt;your desired internal DNS name&gt;</p> <p>2. Edit the file <strong>/etc/hostname</strong>&nbsp;and replace AWS internal name with your desired internal DNS name</p> <p>3. Edit the file <strong>/etc/hosts</strong>&nbsp;and replace AWS internal name with your&nbsp; desired internal DNS name</p> </div></div> <drupal-render-placeholder callback="comment.lazy_builders:renderLinks" arguments="0=326&amp;1=default&amp;2=en&amp;3=" token="KSEBO9C8pWBOnezmdxYCSqktV2guMzZ3phoxSdnh5Vg"></drupal-render-placeholder> </div> </div> </article> </div> <h2>Add new comment</h2> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=184&amp;2=comment_node_blog&amp;3=comment_node_blog" token="vj77P6xK5_a-o8LGq2U45hUQ-475PUdfXisUzMdSe8s"></drupal-render-placeholder> </section> <strong class="node_view"></strong> Thu, 07 Dec 2017 23:34:08 +0000 Huahai 184 at https://yyhh.org Thinkpad Hotkeys in KDE4 https://yyhh.org/blog/2010/12/thinkpad-hotkeys-kde4 <span>Thinkpad Hotkeys in KDE4</span> <span><a title="View user profile." href="/user/huahai" lang="" about="/user/huahai" typeof="schema:Person" property="schema:name" datatype="">Huahai</a></span> <span>Wed, 12/01/2010 - 22:00</span> <div class="field field--name-field-notebook field--type-entity-reference field--label-hidden field__items"> <div class="field__item"><div about="/notebook/linux" id="taxonomy-term-16" class="taxonomy-term vocabulary-notebook"> <a href="/notebook/linux"> <div class="field field--name-name field--type-string field--label-hidden field__item">Linux</div> </a> <div class="content"> </div> </div> </div> </div> <div class="field field--name-body field--type-text-with-summary field--label-hidden field__item"><div class="tex2jax_process"><p>I have kept my Thinkpad X61 laptop up to date with Debian sid for a few years. The KDE4 in Debian sid is at version <b>4.4.5</b> at this moment, and I think it is mature enough for me to switch the laptop power management from <a href="/blog/2007/10/thinkpad-x61-hotkeys-solution-debian-linux">my own hacked up solution</a> to a KDE integrated one. My old solution still works for the most part, but there are some glitches after repeated supsend-resume cycles. As the system keeps evolving, I suspect more things would break. </p> <p>Power management in KDE4 is handled by PowerDevil, which is disabled if powersaved is running (my old solution relied on powersaved). First I uninstalled powersaved and reboot, sure enough, all Fn hotkeys stops working. Now I go to KDE <b>System Settings -&gt; Advanced -&gt; Power Management</b>, and see the PowerDevil seems to be in a health state. The problem is that the hotkey presses are intercepted by ACPI so KDE does not receive these events. To stop the interruption, I edit <b>/etc/modules</b> as root and comment out <b>thinkpad_acpi</b> module, reboot. Now the Fn hotkeys should be registered in KDE, all we need to do is to make them do things we want.  </p> <p>To set up global hotkeys, we go to <b>System Settings -&gt; Input Actions</b>, I add a new group called <i>My Shortcuts</i> and enabled it. Right-click <i>My Shortcuts</i>, <b>New-&gt;Global Shortcut-&gt;DBus Command</b>, I create a new entry <i>Hibernate</i>, and in the <b>Action</b> tab fill in needed dbus information for hibernating the system with PowerDevil (See screenshot). Basically, this is similar to issuing a console command "qdbus org.kde.powerdevil /modules/powerdevil suspend 4". Here, the parameter 4 is for hibernate (suspend to disk), 2 is for sleep (suspend to memory), and 1 for lock screen.  In the <b>Trigger</b> tab, click the button, and press Fn+F12, notice that KDE recognizes this key as a Suspend key. Now click <b>Apply</b>, the Fn+F12 hotkey is setup. Now try Fn+F12, the system should hibernate. So far, the hibernate-resume cycles seem to be clean and problem free for me. I am using 2.6.36 kernel.  </p> <p>Overall, this seems to be easy enough. No scripts, no hacks. </p> <p><img src="http://farm6.static.flickr.com/5082/5224299173_5c53303d52.jpg" alt="hibernate-snapshot2" height="378" width="500" /></p> </div></div> <section> <h2>Add new comment</h2> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=109&amp;2=comment_node_blog&amp;3=comment_node_blog" token="TxYyihpOqLMbtsPxyHNU32Wjtb3wJ42FE0CHldw5_wg"></drupal-render-placeholder> </section> <strong class="node_view"></strong> Wed, 01 Dec 2010 22:00:29 +0000 Huahai 109 at https://yyhh.org Suspending to RAM on Debian laptop https://yyhh.org/blog/2008/04/suspending-ram-debian-laptop <span>Suspending to RAM on Debian laptop</span> <span><a title="View user profile." href="/user/huahai" lang="" about="/user/huahai" typeof="schema:Person" property="schema:name" datatype="">Huahai</a></span> <span>Fri, 04/18/2008 - 00:39</span> <div class="field field--name-field-notebook field--type-entity-reference field--label-hidden field__items"> <div class="field__item"><div about="/notebook/linux" id="taxonomy-term-16" class="taxonomy-term vocabulary-notebook"> <a href="/notebook/linux"> <div class="field field--name-name field--type-string field--label-hidden field__item">Linux</div> </a> <div class="content"> </div> </div> </div> </div> <div class="field field--name-body field--type-text-with-summary field--label-hidden field__item"><div class="tex2jax_process"><p>I am tracking Debian sid on my Thinkpad laptop, a few months ago it started to use <i>pm-utils</i> and broke suspending to RAM (sleep) functionality. Basically, the machine would go to sleep then immediately resume.<br /> It turned out that this problem can be easily fixed by creating a file <i>/etc/pm/config.d/local</i>, and put in a line </p> <div class="codeblock"> SUSPEND_MODULES="e1000" </div> <p>The reason is that <i>pm-utils</i> by default does not unload Ethernet card module <i>e1000</i>, so the machine would be waken up by Ethernet card activities.</p> </div></div> <section> <h2>Add new comment</h2> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=90&amp;2=comment_node_blog&amp;3=comment_node_blog" token="gBhFN4mLngFM_-jnJoA5YpEg7kKxnmdXaIJw-P4LAas"></drupal-render-placeholder> </section> <strong class="node_view"></strong> Thu, 17 Apr 2008 23:39:37 +0000 Huahai 90 at https://yyhh.org How to load context of text files into DB2 https://yyhh.org/blog/2007/12/how-load-context-text-files-db2 <span>How to load context of text files into DB2</span> <span><a title="View user profile." href="/user/yunyao" lang="" about="/user/yunyao" typeof="schema:Person" property="schema:name" datatype="">yunyao</a></span> <span>Sat, 12/29/2007 - 00:48</span> <div class="field field--name-field-notebook field--type-entity-reference field--label-hidden field__items"> <div class="field__item"><div about="/notebook/software" id="taxonomy-term-24" class="taxonomy-term vocabulary-notebook"> <a href="/notebook/software"> <div class="field field--name-name field--type-string field--label-hidden field__item">Software</div> </a> <div class="content"> </div> </div> </div> <div class="field__item"><div about="/notebook/linux" id="taxonomy-term-16" class="taxonomy-term vocabulary-notebook"> <a href="/notebook/linux"> <div class="field field--name-name field--type-string field--label-hidden field__item">Linux</div> </a> <div class="content"> </div> </div> </div> </div> <div class="field field--name-body field--type-text-with-summary field--label-hidden field__item"><div class="tex2jax_process"><p>The task is fairly simply --- I need to load the content of some text files into DB2. There are many ways to do so, but since I only need to this only once (hopefully), I want to find an easy way without writing any external code. </p> <p>So here is the solution:</p> <p>(1) create a table containing a CLOB (VARCHAR should work as well, if we know the maxium size of the files in advance) column. For example:</p> <blockquote><p> create table test (docid INTEGER GENERATED BY DEFAULT AS IDENTITY,doc CLOB)</p> </blockquote> <p>(2) put the files to be loaded into one directory and create a .del file based on their names. The content in the .del file should based on the table you have just created. For instance, a .del file for the example table created in (1) should look like the following:</p> <blockquote><p> 1,"doc1.txt"</p> <p> 2, "doc2, txt"</p> <p> ..... </p> </blockquote> <p>where the first value is the id, and the second value is the name of a file to be loaded. </p> <p>(3) load the content </p> <blockquote><p> import from test.del of del lobs from /home/dirName/ modified by lobsinfile replace into test</p> </blockquote> <p>Depends on the exact nature of your task, you may add additional modifiers to the import command. But the above three steps should be adequate in many cases.</p> <p>Finally, just to make sure that the files are properly loaded into the database, we can export part of the table and view the content:</p> <blockquote><p> export to myfile.del of del lobs to outDirName lobfile lobs1, lobs2 modified by lobsinfile select * from test where docid &lt; 10</p> </blockquote> </div></div> <section> <h2>Add new comment</h2> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=70&amp;2=comment_node_blog&amp;3=comment_node_blog" token="UauoObVsGuvE38s8eqQc5UgTUJSeKDc7HtArR66fwVA"></drupal-render-placeholder> </section> <strong class="node_view"></strong> Sat, 29 Dec 2007 00:48:01 +0000 yunyao 70 at https://yyhh.org Reference to Individual Email Message in Plain Text File https://yyhh.org/blog/2007/12/reference-individual-email-message-plain-text-file <span>Reference to Individual Email Message in Plain Text File</span> <span><a title="View user profile." href="/user/huahai" lang="" about="/user/huahai" typeof="schema:Person" property="schema:name" datatype="">Huahai</a></span> <span>Thu, 12/13/2007 - 22:40</span> <div class="field field--name-field-notebook field--type-entity-reference field--label-hidden field__items"> <div class="field__item"><div about="/notebook/vim" id="taxonomy-term-17" class="taxonomy-term vocabulary-notebook"> <a href="/notebook/vim"> <div class="field field--name-name field--type-string field--label-hidden field__item">Vim</div> </a> <div class="content"> </div> </div> </div> <div class="field__item"><div about="/notebook/linux" id="taxonomy-term-16" class="taxonomy-term vocabulary-notebook"> <a href="/notebook/linux"> <div class="field field--name-name field--type-string field--label-hidden field__item">Linux</div> </a> <div class="content"> </div> </div> </div> <div class="field__item"><div about="/notebook/gtd" id="taxonomy-term-31" class="taxonomy-term vocabulary-notebook"> <a href="/notebook/gtd"> <div class="field field--name-name field--type-string field--label-hidden field__item">GTD</div> </a> <div class="content"> </div> </div> </div> </div> <div class="field field--name-body field--type-text-with-summary field--label-hidden field__item"><div class="tex2jax_process"><p>A lot of people implement <a href="http://saw.themurdaughs.com/gtd-with-gmail-whitepaper">GTD methodology entirely with Gmail</a>. I don't feel comfortable doing that because gmail is not that secure. And I think depending on a network service is a bad idea for a GTD system. So I still download all my emails to my local computers. As <a href="http://yyhh.org/blog/2007/12/simple-gtd-list-solution-desktop-web-and-possibly-mobile">my plain text based GTD implementation</a> was taking shape, I realized that I needed to refer to individual email messages in my local mail folders, both in the "Projects/Next-Action" list and as reference materials. For example, in my list, there would be an item "think about Johon's request", and it should include a link to the email message containing John's request. Ideally, invoking this link should open up this email message in <em>kmail</em>, my email reader. Also, I would like the creation of such a link in my list to be semi-automatic. </p> <p>The first problem is to find the unique id for the email message. Although there's an Message-ID field in standard email format, kmail does not make it easy to use that field. It turns out that just using the unique filename of email messages is sufficient. Kmail by default uses <em>maildir</em> format to store emails, and maildir stores each message as an individual file with a unique name. This situation makes linking to email messages as easy as linking to files. Now the question is, how do I know what filename an individual email message is saved as?</p> <p>The answer is I don't know, kmail does not reveal that information. At least I don't know the filename when the email is first saved in my email folder. But, the good news is, I don't need to know the filename when the email is in my inbox. Because, as GTD methodology decrees, stuff in inbox should not be permanent, but is to be moved into either projects/next-action list or reference collection. Now, when I process my inbox, and move a message into my GTD email folder, I can figure out what name it is saved in. No, I am not suggesting using kmail's "save-as" method. That's still too much work, because I then have to open a file browser, choose a filename for the email to save as, and manually put a link to that file in my list. Besides, kmail can only "save-as" mbox format, and it sucks.</p> <p>What I now end up with is a neat solution. Basically, all I need to do, is to drag a message into my local GTD mail folder in kmail. And a link to the saved message will be automatically inserted into my plain-text project/next-action list or my reference file, depending on a dialog selection. This screen shot shows an email being dragged into GTD folder in kmail: <img src="http://i274.photobucket.com/albums/jj251/huahaiy/kmail-drag-gtd.png" /></p> <p>A dialog then shows up:<img src="http://i274.photobucket.com/albums/jj251/huahaiy/kmail-drag-gtd-dialog.png" />. </p> <p>After making a selection, a reference to the email message is inserted in vim, which looks like this:<br /></p><div class="codeblock">&lt;mail:~/Mail/GTD/cur/1197479411.14855.WSF8K:2,S&gt;</div> <p>This implementation depends on <a href="http://inotify-tools.sourceforge.net/">inotify-tools</a>, which utilizes newer Linux kernel's <em>inotify</em> capability. It watches GTD mail folder. When an email message is moved into this folder, a script records its filename, and inserts a link to the email in my project/next-action list. This solution also depends on <em>vim</em> with server mode support, so other program can send commands to it. I always start my projects/next-action editing session in server mode, with special server names, such as "active_projects":<br /></p><div class="codeblock">gvim --servername "active_projects" projects.taskpaper</div> <p> Finally, a vim plug-in <a href="http://www.vim.org/scripts/script.php?script_id=293">utl.vim</a> is needed to invoke any URL in plain text.</p> <p>All these components are glued together with a simple shell script <em>~/bin/email2gtd.sh</em>:<br /></p><div class="codeblock"> <font face="monospace"><br /><font color="#a0b0c0"><i>#!/bin/bash</i></font><br /><font color="#a0b0c0"><i># waiting for email message being dropped in GTD mail folder, then insert</i></font><br /><font color="#a0b0c0"><i># a reference to the email in one of the available vim server buffers,</i></font><br /><font color="#a0b0c0"><i># depending on user selection in dialog prompt</i></font><br /><font color="#a0b0c0"><i>#</i></font><br /><font color="#a0b0c0"><i># author: Huahai Yang, 12/13/2007 11:22:36 AM (PST)  </i></font><br /><font color="#a0b0c0"><i>#</i></font><br /><font color="#007020"><b>while</b></font> <font color="#5b3674"><i>email</i></font>=<font color="#1060a0">$(</font><font color="#70a0d0"><i>inotifywait -e moved_to ~/Mail/GTD/cur --format </i></font><font color="#408010">"</font><font color="#4070a0">%f</font><font color="#408010">"</font><font color="#1060a0">)</font><font color="#408010">;</font> <font color="#4c8f2f"><b>do</b></font> <p>  <font color="#a0b0c0"><i># the list of available vim servers</i></font><br />   <font color="#5b3674"><i>servers</i></font>=<font color="#408010">(</font> <font color="#1060a0">$(</font><font color="#70a0d0"><i>vim --serverlist</i></font><font color="#1060a0">)</font> <font color="#408010">)</font></p> <p>  <font color="#a0b0c0"><i># the number of available vim servers</i></font><br />   <font color="#5b3674"><i>num</i></font>=<font color="#1060a0">${#</font><font color="#1060a0">servers</font><font color="#1060a0">[</font>@<font color="#1060a0">]</font><font color="#1060a0">}</font></p> <p>  <font color="#4c8f2f"><b>if</b></font> <font color="#70a0d0"><i>[[</i></font> <font color="#1060a0">$num</font> <font color="#4c8f2f"><b>-eq</b></font> <font color="#40a070">0</font> <font color="#70a0d0"><i>]]</i></font><font color="#408010">;</font> <font color="#4c8f2f"><b>then</b></font><br />     kdialog --msgbox <font color="#408010">"</font><font color="#4070a0">There is no vim server running.</font><font color="#408010">"</font><br />   <font color="#4c8f2f"><b>else</b></font><br />     <font color="#a0b0c0"><i># construct dialog choices</i></font><br />     <font color="#5b3674"><i>choices</i></font>=<font color="#408010">""</font><br />     <font color="#007020"><b>for</b></font> id <font color="#007020"><b>in</b></font> <font color="#1060a0">$(</font><font color="#70a0d0"><i>seq </i></font><font color="#40a070">0</font><font color="#70a0d0"><i> </i></font><font color="#1060a0">$((</font><font color="#1060a0">$num</font><font color="#70a0d0"><i> - </i></font><font color="#40a070">1</font><font color="#1060a0">))</font><font color="#1060a0">)</font><font color="#408010">;</font> <font color="#4c8f2f"><b>do</b></font><br />       <font color="#5b3674"><i>choices</i></font>=<font color="#1060a0">${</font><font color="#1060a0">choices</font><font color="#1060a0">}</font><font color="#408010">"</font><font color="#4070a0"> </font><font color="#408010">"</font><font color="#1060a0">${</font><font color="#1060a0">servers</font><font color="#1060a0">[</font><font color="#1060a0">$id</font><font color="#1060a0">]</font><font color="#1060a0">}</font><font color="#408010">"</font><font color="#4070a0"> </font><font color="#408010">"</font><font color="#1060a0">${</font><font color="#1060a0">servers</font><font color="#1060a0">[</font><font color="#1060a0">$id</font><font color="#1060a0">]</font><font color="#1060a0">}</font><font color="#408010">"</font><font color="#4070a0"> off</font><font color="#408010">"</font><br />     <font color="#4c8f2f"><b>done</b></font></p> <p>    <font color="#5b3674"><i>server</i></font>=<font color="#1060a0">$(</font><font color="#70a0d0"><i>kdialog --title </i></font><font color="#408010">"</font><font color="#4070a0">Insert email reference</font><font color="#408010">"</font><font color="#70a0d0"><i> \</i></font><br /><font color="#70a0d0"><i>        --radiolist </i></font><font color="#408010">"</font><font color="#4070a0">Please select which vim server to insert into:</font><font color="#408010">"</font><font color="#70a0d0"><i> \</i></font><br /><font color="#70a0d0"><i>        </i></font><font color="#1060a0">$choices</font><font color="#1060a0">)</font></p> <p>    <font color="#a0b0c0"><i># insert the email reference to the end of the current line</i></font><br />     vim --servername <font color="#408010">"</font><font color="#1060a0">$server</font><font color="#408010">"</font> \<br />         --remote-send <font color="#408010">"</font><font color="#4070a0">&lt;ESC&gt;A&lt;mail:~/Mail/GTD/cur/</font><font color="#408010">"</font><font color="#1060a0">${</font><font color="#1060a0">email</font><font color="#1060a0">}</font><font color="#408010">"</font><font color="#4070a0">&gt;&lt;ESC&gt;</font><font color="#408010">"</font><br />   <font color="#4c8f2f"><b>fi</b></font><br /><font color="#4c8f2f"><b>done</b></font><br /></p></font> </div> <p>This script should run in the background. I personally run it from <em>~/.kde/Autostart</em> so it is automatically loaded when I log in. It watches the <em>~/Mail/GTD</em> folder I created in kmail, and insert a reference to an email to available vim server when the email is moved to the folder. </p> <p>Finally, I set up utl.vim plug-in so that it knows how to invoke a reference to email message. After installing utl.vim, I added the following function in my <em>.vimrc</em>, so that utl.vim can handle my "mail:" style URL:</p> <div class="codeblock"> <font face="monospace"><br /><font color="#a0b0c0"><i>" lauch kmail to handle reference to email message</i></font><br /><font color="#007020"><b>fu</b></font>! Utl_AddressScheme_mail<font color="#408010">(</font>auri<font color="#408010">)</font><br />   <font color="#007020"><b>exe</b></font> <font color="#4070a0">"!kmail --view "</font> <font color="#408010">.</font> UtlUri_unescape<font color="#408010">(</font> UtlUri_opaque<font color="#408010">(</font>a:auri<font color="#408010">)</font> <font color="#408010">)</font><br />   <font color="#007020"><b>return</b></font> <font color="#4070a0">''</font><br /><font color="#007020"><b>endfu</b></font><br /></font> </div> <p>Now when cursor is on an email link, hit <em>\gu</em> will open up the message in kmail.<a href="http://i274.photobucket.com/albums/jj251/huahaiy/gtd-email-reference.png"><img src="http://i274.photobucket.com/albums/jj251/huahaiy/gtd-email-reference.png" width="720" /></a></p> </div></div> <section> <h2>Add new comment</h2> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=69&amp;2=comment_node_blog&amp;3=comment_node_blog" token="lJT5kKeln39os46v1KdycSqBSDznPWWSvHnhJphOBS8"></drupal-render-placeholder> </section> <strong class="node_view"></strong> Thu, 13 Dec 2007 22:40:50 +0000 Huahai 69 at https://yyhh.org An Mac Look for my KDE Desktop https://yyhh.org/blog/2007/12/mac-look-my-kde-desktop <span>An Mac Look for my KDE Desktop</span> <span><a title="View user profile." href="/user/huahai" lang="" about="/user/huahai" typeof="schema:Person" property="schema:name" datatype="">Huahai</a></span> <span>Wed, 12/05/2007 - 10:04</span> <div class="field field--name-field-notebook field--type-entity-reference field--label-hidden field__items"> <div class="field__item"><div about="/notebook/linux" id="taxonomy-term-16" class="taxonomy-term vocabulary-notebook"> <a href="/notebook/linux"> <div class="field field--name-name field--type-string field--label-hidden field__item">Linux</div> </a> <div class="content"> </div> </div> </div> </div> <div class="field field--name-body field--type-text-with-summary field--label-hidden field__item"><div class="tex2jax_process"><p>Although I have never laid my hands on an Apple computer, I have seen people going crazy about them. I remember seeing some kids shouting hysterically in front of Apple store on the release day of Tiger a few years ago. The user interface of Apple's OS is said to be one of the selling points. So when I was feeling tired of Mepis Linux's default look last night, I decided to try an OS X look for a change. It turned out to be relatively easy to do.</p> <p><img id="__mce_tmp" src="http://farm3.static.flickr.com/2063/2088772436_89e4266cbc_z.jpg" alt="" /></p> <p><strong>KDE widget</strong> Basically, getting an OS X Tiger look and feel on KDE involves installing a theme that imitates its look and feel. There is a KDE theme called <a href="http://baghira.sourceforge.net/">Baghira</a>that does just that. It's so popular that Debian sid has it in the pool, so</p> <div class="codeblock"><code>apt-get install kwin-baghira</code></div> <p>as root should get it installed. Once it's installed, launch <em>KDE Control Center -&gt; Appearance and Themes -&gt; Style</em>, and change <em>Widget Style</em> to Baghira. Also, go one step up to <em>Colors</em>, and change <em>Color Scheme</em> to <em>Aqua Blue</em>. Now you should get Tiger look and feel for all the KDE widgets. This theme can be further configured using a tool called <em>bab</em>. One can launch bab from from command line and find it in the system tray. Right click it to open configuration screen. <strong></strong></p> <p><strong>Compiz window decoration</strong> Since I use compiz-fusion as my default window manager, Baghira theme's own kwin decoration settings does not work. Of course, compiz-fusion can use kwin as window decorator, but it's less stable than <em>emerald</em>, compiz's own window decorator. It would be great if emerald has an OS X looking theme. Sure enough, there are quite a few emerald themes that can do that. Launch <em>emerald-theme-manager</em> tool, one can download GPL or non GPL'ed themes. I tried them one by one, and found at least three OS X imitators. In the end I chose "dreamtiger-baghira" as it matches Baghira theme. <strong></strong></p> <p><strong>OS X style menubar</strong> One can set up an OS X style menubar on top of screen in KDE Control Center -&gt; Desktop -&gt; Behavior. I did that, but the old KDE panel was still around and it was not possible to remove it. So I removed all of the panel's content, and set it to auto hide at a corner so it won't bother me any more. Following <a href="http://baghira.sourceforge.net/OS_Clone-en.php">Baghira theme's instruction</a>, I added Baghira's Starter to the menubar. Now the menu of KDE application with current mouse focus will show up in the menubar. This behavior took some used to, but I think I am liking it because it makes application windows look cleaner and takes less screen space. There are some caveats using OS X style menubar in KDE. Icons in system tray does not scale, so their bottoms are cropped off. This is not a big deal since I hide most of the system tray icons. Another issue, is that full screen mode in VirtualBox is no longer really full screen because the menubar is always visible. This is a bit annoying especially if you want to do a presentation or playing full screen games in the virtual machine. I have yet to find a way to hide the menubar. Also, I have been using a Mac like docker, <a href="http://www.xiaprojects.com/index.php?section=All&amp;project=KXDocker">kxdocker</a>, for years, so there's no need to change here. <strong></strong></p> <p><strong>GTK application</strong> Baghira theme does not apply to GTK applications, which I have plenty: firefox, synaptic, openoffice, gvim, etc. To have a consistent look across all applications, I needed to set up OS X like theme for GTK application too. Again, there are several GTK themes can do that. I chose to download <a href="http://www.gnome-look.org/content/show.php/OSX-Tiger+theme?content=56577">OSX-Tiger</a> theme because it's small. I unpacked it and moved the unpacked directory to <em>/usr/share/themes</em>. Since a full installation of gnome desktop wasn't something I wanted to do, I needed a small tool to let GTK applications aware of and use this theme. A command line tool called <em>switch2</em> can be installed from Debian pool (package name is <em>gtk-theme-switch</em>) to do that:</p> <div class="codeblock"><code>switch2 /usr/share/themes/OSX-theme</code></div> <p><strong>Icons</strong> It doesn't help if one uses an OS X theme without OS X like icons. I chose to install <a href="http://www.kde-look.org/content/show.php?content=16564">OS-L</a> icon set. It includes a script to build the icon set, one can then pick it in KDE Control Center -&gt; Appearance &amp; themes -&gt; Icons. <strong></strong></p> <p><strong>Fonts</strong> To do a full blown imitation of OS X look, matching fonts are required. Unfortunately, we have to use the real thing here. Download <a href="http://www.osx-e.com/downloads/misc/macfonts.html">Mac fonts</a>, unpack and put the directory under <em>/usr/share/fonts/truetype</em>. To easily achieve font consistence across all GUI applications, I changed <em>/etc/fonts/local.conf</em> to make these Mac fonts as X server's preferred fonts. My <em>/etc/fonts/local.conf</em>is here:</p> <div class="codeblock"><span style="font-family: monospace;"> <span style="color: #06287e;"><em>&lt;</em></span><span style="color: #06287e;"><em>fontconfig</em></span><span style="color: #06287e;"><em>&gt;</em></span><br /> &nbsp;&nbsp;<span style="color: #a0b0c0;"><em>&lt;!</em></span><span style="color: #a0b0c0;"><em>-- Disable anti-alias for Chinese fonts less or equal to 12px --</em></span><span style="color: #a0b0c0;"><em>&gt;</em></span><br /> &nbsp;&nbsp;<span style="color: #06287e;"><em>&lt;</em></span><span style="color: #06287e;"><em>match</em></span><span style="color: #06287e;"><em>&nbsp;</em></span><span style="color: #e5a00d;"><em>target</em></span>=<span style="color: #4070a0;">"font"</span><span style="color: #06287e;"><em>&gt;</em></span><br /> &nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #06287e;"><em>&lt;</em></span><span style="color: #06287e;"><em>test</em></span><span style="color: #06287e;"><em>&nbsp;</em></span><span style="color: #e5a00d;"><em>qual</em></span>=<span style="color: #4070a0;">"any"</span><span style="color: #06287e;"><em>&nbsp;</em></span><span style="color: #e5a00d;"><em>name</em></span>=<span style="color: #4070a0;">"family"</span><span style="color: #06287e;"><em>&nbsp;</em></span><span style="color: #e5a00d;"><em>compare</em></span>=<span style="color: #4070a0;">"eq"</span><span style="color: #06287e;"><em>&gt;</em></span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #06287e;"><em>&lt;</em></span><span style="color: #06287e;"><em>string</em></span><span style="color: #06287e;"><em>&gt;</em></span>WenQuanYi Bitmap Song<span style="color: #5b3674;"><em>&lt;/string&gt;</em></span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #06287e;"><em>&lt;</em></span><span style="color: #06287e;"><em>string</em></span><span style="color: #06287e;"><em>&gt;</em></span>AR PL Mingti2L Big5<span style="color: #5b3674;"><em>&lt;/string&gt;</em></span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #06287e;"><em>&lt;</em></span><span style="color: #06287e;"><em>string</em></span><span style="color: #06287e;"><em>&gt;</em></span>AR PL KaitiM Big5<span style="color: #5b3674;"><em>&lt;/string&gt;</em></span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #06287e;"><em>&lt;</em></span><span style="color: #06287e;"><em>string</em></span><span style="color: #06287e;"><em>&gt;</em></span>AR PL KaitiM GB<span style="color: #5b3674;"><em>&lt;/string&gt;</em></span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #06287e;"><em>&lt;</em></span><span style="color: #06287e;"><em>string</em></span><span style="color: #06287e;"><em>&gt;</em></span>AR PL SungtiL Big5<span style="color: #5b3674;"><em>&lt;/string&gt;</em></span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #06287e;"><em>&lt;</em></span><span style="color: #06287e;"><em>string</em></span><span style="color: #06287e;"><em>&gt;</em></span>AR PL New Sung<span style="color: #5b3674;"><em>&lt;/string&gt;</em></span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #06287e;"><em>&lt;</em></span><span style="color: #06287e;"><em>string</em></span><span style="color: #06287e;"><em>&gt;</em></span>AR PL ShanHeiSun Uni<span style="color: #5b3674;"><em>&lt;/string&gt;</em></span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #06287e;"><em>&lt;</em></span><span style="color: #06287e;"><em>string</em></span><span style="color: #06287e;"><em>&gt;</em></span>AR PL ZenKai Uni<span style="color: #5b3674;"><em>&lt;/string&gt;</em></span><br /> &nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #5b3674;"><em>&lt;/test&gt;</em></span><br /> &nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #06287e;"><em>&lt;</em></span><span style="color: #06287e;"><em>test</em></span><span style="color: #06287e;"><em>&nbsp;</em></span><span style="color: #e5a00d;"><em>name</em></span>=<span style="color: #4070a0;">"pixelsize"</span><span style="color: #06287e;"><em>&nbsp;</em></span><span style="color: #e5a00d;"><em>compare</em></span>=<span style="color: #4070a0;">"less_eq"</span><span style="color: #06287e;"><em>&gt;</em></span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #06287e;"><em>&lt;</em></span><span style="color: #06287e;"><em>double</em></span><span style="color: #06287e;"><em>&gt;</em></span>12<span style="color: #5b3674;"><em>&lt;/double&gt;</em></span><br /> &nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #5b3674;"><em>&lt;/test&gt;</em></span><br /> &nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #06287e;"><em>&lt;</em></span><span style="color: #06287e;"><em>edit</em></span><span style="color: #06287e;"><em>&nbsp;</em></span><span style="color: #e5a00d;"><em>name</em></span>=<span style="color: #4070a0;">"antialias"</span><span style="color: #06287e;"><em>&gt;</em></span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #06287e;"><em>&lt;</em></span><span style="color: #06287e;"><em>bool</em></span><span style="color: #06287e;"><em>&gt;</em></span>false<span style="color: #5b3674;"><em>&lt;/bool&gt;</em></span><br /> &nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #5b3674;"><em>&lt;/edit&gt;</em></span><br /> &nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #06287e;"><em>&lt;</em></span><span style="color: #06287e;"><em>edit</em></span><span style="color: #06287e;"><em>&nbsp;</em></span><span style="color: #e5a00d;"><em>name</em></span>=<span style="color: #4070a0;">"hinting"</span><span style="color: #06287e;"><em>&gt;</em></span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #06287e;"><em>&lt;</em></span><span style="color: #06287e;"><em>bool</em></span><span style="color: #06287e;"><em>&gt;</em></span>true<span style="color: #5b3674;"><em>&lt;/bool&gt;</em></span><br /> &nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #5b3674;"><em>&lt;/edit&gt;</em></span><br /> &nbsp;&nbsp;<span style="color: #5b3674;"><em>&lt;/match&gt;</em></span><br /> &nbsp;&nbsp;<span style="color: #06287e;"><em>&lt;</em></span><span style="color: #06287e;"><em>alias</em></span><span style="color: #06287e;"><em>&gt;</em></span><br /> &nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #06287e;"><em>&lt;</em></span><span style="color: #06287e;"><em>family</em></span><span style="color: #06287e;"><em>&gt;</em></span>serif<span style="color: #5b3674;"><em>&lt;/family&gt;</em></span><br /> &nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #06287e;"><em>&lt;</em></span><span style="color: #06287e;"><em>prefer</em></span><span style="color: #06287e;"><em>&gt;</em></span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #06287e;"><em>&lt;</em></span><span style="color: #06287e;"><em>family</em></span><span style="color: #06287e;"><em>&gt;</em></span>AppleGaramond<span style="color: #5b3674;"><em>&lt;/family&gt;</em></span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #06287e;"><em>&lt;</em></span><span style="color: #06287e;"><em>family</em></span><span style="color: #06287e;"><em>&gt;</em></span>DejaVu Serif<span style="color: #5b3674;"><em>&lt;/family&gt;</em></span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #06287e;"><em>&lt;</em></span><span style="color: #06287e;"><em>family</em></span><span style="color: #06287e;"><em>&gt;</em></span>Bitstream Vera Serif<span style="color: #5b3674;"><em>&lt;/family&gt;</em></span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #06287e;"><em>&lt;</em></span><span style="color: #06287e;"><em>family</em></span><span style="color: #06287e;"><em>&gt;</em></span>Times New Roman<span style="color: #5b3674;"><em>&lt;/family&gt;</em></span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #06287e;"><em>&lt;</em></span><span style="color: #06287e;"><em>family</em></span><span style="color: #06287e;"><em>&gt;</em></span>Times<span style="color: #5b3674;"><em>&lt;/family&gt;</em></span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #06287e;"><em>&lt;</em></span><span style="color: #06287e;"><em>family</em></span><span style="color: #06287e;"><em>&gt;</em></span>AR PL New Sung<span style="color: #5b3674;"><em>&lt;/family&gt;</em></span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #06287e;"><em>&lt;</em></span><span style="color: #06287e;"><em>family</em></span><span style="color: #06287e;"><em>&gt;</em></span>AR PL ShanHeiSun Uni<span style="color: #5b3674;"><em>&lt;/family&gt;</em></span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #06287e;"><em>&lt;</em></span><span style="color: #06287e;"><em>family</em></span><span style="color: #06287e;"><em>&gt;</em></span>AR PL Mingti2L Big5<span style="color: #5b3674;"><em>&lt;/family&gt;</em></span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #06287e;"><em>&lt;</em></span><span style="color: #06287e;"><em>family</em></span><span style="color: #06287e;"><em>&gt;</em></span>AR PL SungtiL GB<span style="color: #5b3674;"><em>&lt;/family&gt;</em></span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #06287e;"><em>&lt;</em></span><span style="color: #06287e;"><em>family</em></span><span style="color: #06287e;"><em>&gt;</em></span>SimSun<span style="color: #5b3674;"><em>&lt;/family&gt;</em></span><br /> &nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #5b3674;"><em>&lt;/prefer&gt;</em></span><br /> &nbsp;&nbsp;<span style="color: #5b3674;"><em>&lt;/alias&gt;</em></span><br /> &nbsp;&nbsp;<span style="color: #06287e;"><em>&lt;</em></span><span style="color: #06287e;"><em>alias</em></span><span style="color: #06287e;"><em>&gt;</em></span><br /> &nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #06287e;"><em>&lt;</em></span><span style="color: #06287e;"><em>family</em></span><span style="color: #06287e;"><em>&gt;</em></span>sans-serif<span style="color: #5b3674;"><em>&lt;/family&gt;</em></span><br /> &nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #06287e;"><em>&lt;</em></span><span style="color: #06287e;"><em>prefer</em></span><span style="color: #06287e;"><em>&gt;</em></span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #06287e;"><em>&lt;</em></span><span style="color: #06287e;"><em>family</em></span><span style="color: #06287e;"><em>&gt;</em></span>Lucida Grande<span style="color: #5b3674;"><em>&lt;/family&gt;</em></span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #06287e;"><em>&lt;</em></span><span style="color: #06287e;"><em>family</em></span><span style="color: #06287e;"><em>&gt;</em></span>DejaVu Sans<span style="color: #5b3674;"><em>&lt;/family&gt;</em></span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #06287e;"><em>&lt;</em></span><span style="color: #06287e;"><em>family</em></span><span style="color: #06287e;"><em>&gt;</em></span>Bitstream Vera Sans<span style="color: #5b3674;"><em>&lt;/family&gt;</em></span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #06287e;"><em>&lt;</em></span><span style="color: #06287e;"><em>family</em></span><span style="color: #06287e;"><em>&gt;</em></span>Arial<span style="color: #5b3674;"><em>&lt;/family&gt;</em></span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #06287e;"><em>&lt;</em></span><span style="color: #06287e;"><em>family</em></span><span style="color: #06287e;"><em>&gt;</em></span>Verdana<span style="color: #5b3674;"><em>&lt;/family&gt;</em></span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #06287e;"><em>&lt;</em></span><span style="color: #06287e;"><em>family</em></span><span style="color: #06287e;"><em>&gt;</em></span>Helvetica<span style="color: #5b3674;"><em>&lt;/family&gt;</em></span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #06287e;"><em>&lt;</em></span><span style="color: #06287e;"><em>family</em></span><span style="color: #06287e;"><em>&gt;</em></span>AR PL New Sung<span style="color: #5b3674;"><em>&lt;/family&gt;</em></span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #06287e;"><em>&lt;</em></span><span style="color: #06287e;"><em>family</em></span><span style="color: #06287e;"><em>&gt;</em></span>AR PL ShanHeiSun Uni<span style="color: #5b3674;"><em>&lt;/family&gt;</em></span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #06287e;"><em>&lt;</em></span><span style="color: #06287e;"><em>family</em></span><span style="color: #06287e;"><em>&gt;</em></span>AR PL kaitiM Big5<span style="color: #5b3674;"><em>&lt;/family&gt;</em></span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #06287e;"><em>&lt;</em></span><span style="color: #06287e;"><em>family</em></span><span style="color: #06287e;"><em>&gt;</em></span>AR PL kaitiM GB<span style="color: #5b3674;"><em>&lt;/family&gt;</em></span><br /> &nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #5b3674;"><em>&lt;/prefer&gt;</em></span><br /> &nbsp;&nbsp; <span style="color: #5b3674;"><em>&lt;/alias&gt;</em></span><br /> &nbsp;&nbsp; <span style="color: #06287e;"><em>&lt;</em></span><span style="color: #06287e;"><em>alias</em></span><span style="color: #06287e;"><em>&gt;</em></span><br /> &nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #06287e;"><em>&lt;</em></span><span style="color: #06287e;"><em>family</em></span><span style="color: #06287e;"><em>&gt;</em></span>monospace<span style="color: #5b3674;"><em>&lt;/family&gt;</em></span><br /> &nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #06287e;"><em>&lt;</em></span><span style="color: #06287e;"><em>prefer</em></span><span style="color: #06287e;"><em>&gt;</em></span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #06287e;"><em>&lt;</em></span><span style="color: #06287e;"><em>family</em></span><span style="color: #06287e;"><em>&gt;</em></span>DejaVu Sans Mono<span style="color: #5b3674;"><em>&lt;/family&gt;</em></span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #06287e;"><em>&lt;</em></span><span style="color: #06287e;"><em>family</em></span><span style="color: #06287e;"><em>&gt;</em></span>Bitstream Vera Sans Mono<span style="color: #5b3674;"><em>&lt;/family&gt;</em></span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #06287e;"><em>&lt;</em></span><span style="color: #06287e;"><em>family</em></span><span style="color: #06287e;"><em>&gt;</em></span>Courier New<span style="color: #5b3674;"><em>&lt;/family&gt;</em></span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #06287e;"><em>&lt;</em></span><span style="color: #06287e;"><em>family</em></span><span style="color: #06287e;"><em>&gt;</em></span>Courier<span style="color: #5b3674;"><em>&lt;/family&gt;</em></span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #06287e;"><em>&lt;</em></span><span style="color: #06287e;"><em>family</em></span><span style="color: #06287e;"><em>&gt;</em></span>AR PL New Sung<span style="color: #5b3674;"><em>&lt;/family&gt;</em></span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #06287e;"><em>&lt;</em></span><span style="color: #06287e;"><em>family</em></span><span style="color: #06287e;"><em>&gt;</em></span>AR PL ShanHeiSun Uni<span style="color: #5b3674;"><em>&lt;/family&gt;</em></span><br /> &nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #5b3674;"><em>&lt;/prefer&gt;</em></span><br /> &nbsp;&nbsp;<span style="color: #5b3674;"><em>&lt;/alias&gt;</em></span><br /> <span style="color: #5b3674;"><em>&lt;/fontconfig&gt;</em></span><br /> </span></div> <p>Here, I chose "AppleGaramond" as the default serif font, "Lucida Grande" as the default san-serif font. I kept my original monospace font intact since I like it. For menu and toolbar fonts, I changed them to "Lucida MAC" in KDE Control Center -&gt; Appearance &amp; Themes -&gt; Fonts. They make menus look very clear to read. <strong></strong></p> <p><strong>Firefox</strong> Firefox doesn't respect KDE's font size setting so its UI font often looks much bigger than other applications. We have to manually set its UI fonts to have consistency. Create a file <em>~/.mozilla/firefox/xyzxyz.default/chrome/userChrome.css</em> (or just copy the example from the same directory, replace "xyzxyz" with the actual directory name), and change the font size. Finally, get a Mac-looking compatible firefox theme should make firefox looks better. There are many options, I chose <a href="https://addons.mozilla.org/en-US/firefox/addon/3174">macfox II</a> for its clean look. <strong></strong></p> <p><strong>Update: 12/06/2007 09:42:07 AM (EST)</strong> It turned out I don't like "AppleGaramond", it's too much newspaper like. I eventually rolled back to "DejaVu Serif" as my default serif font (mostly used in Web content viewing). Also, Baghira theme crashes <a href="http://basket.kde.org/">basket note pads</a> application. I sent a bug report to basket developer, haven't heard back yet.</p> </div></div> <section> <h2>Add new comment</h2> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=63&amp;2=comment_node_blog&amp;3=comment_node_blog" token="clr_HQ11yS5v4itXWifQN_6BuYNOX4KSeCmj_7_PbP4"></drupal-render-placeholder> </section> <strong class="node_view"></strong> Wed, 05 Dec 2007 10:04:21 +0000 Huahai 63 at https://yyhh.org Use Vim as Info Page Browser https://yyhh.org/blog/2007/11/use-vim-info-page-browser <span>Use Vim as Info Page Browser</span> <span><a title="View user profile." href="/user/huahai" lang="" about="/user/huahai" typeof="schema:Person" property="schema:name" datatype="">Huahai</a></span> <span>Thu, 11/29/2007 - 07:56</span> <div class="field field--name-field-notebook field--type-entity-reference field--label-hidden field__items"> <div class="field__item"><div about="/notebook/vim" id="taxonomy-term-17" class="taxonomy-term vocabulary-notebook"> <a href="/notebook/vim"> <div class="field field--name-name field--type-string field--label-hidden field__item">Vim</div> </a> <div class="content"> </div> </div> </div> <div class="field__item"><div about="/notebook/linux" id="taxonomy-term-16" class="taxonomy-term vocabulary-notebook"> <a href="/notebook/linux"> <div class="field field--name-name field--type-string field--label-hidden field__item">Linux</div> </a> <div class="content"> </div> </div> </div> </div> <div class="field field--name-body field--type-text-with-summary field--label-hidden field__item"><div class="tex2jax_process"><p>In <a href="http://yyhh.org/blog/2007/11/use-vim-read-manual-page">this post</a>, I set up vim as a manual page viewer, using <a href="http://vim.sourceforge.net/scripts/script.php?script_id=489">ManPageView</a> plugin. It turned out that the same plugin can be used to view info pages as well. All one needs to to is to add ".i" suffix to the command that you are seeking help on. For example, ":Man sed.i" will show the info page for sed. With this information, we can set up vim as info page browser, just add these lines in <i>~/.bashrc</i>:</p> <div class="codeblock"> <code><br /> vinfo() {<br /> /usr/bin/vim -c "Man $@.i" -c 'silent! only' -c 'nmap q :q'<br /> }<br /> alias info='vinfo'<br /></code> </div> <p>Now open a terminal, type <em>info whatever</em> will show the info page of whatever you are seeking help on, if it exists, with nice syntax highlighting and easy to use key bindings. One caveat is that you would get an blank page if the info page does not exist, instead of getting the top level info directory as with the real info command. However, real info command doesn't have syntax highlighting and familiar key-bindings, so I stick with vim.</p> </div></div> <section> <h2>Add new comment</h2> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=61&amp;2=comment_node_blog&amp;3=comment_node_blog" token="GSLbem0gl6N-sNGpiLl28nZerkmogopmMIVEX6p_mEM"></drupal-render-placeholder> </section> <strong class="node_view"></strong> Thu, 29 Nov 2007 07:56:06 +0000 Huahai 61 at https://yyhh.org Reverse/Forward Search with Latex-Suite in Vim https://yyhh.org/blog/2007/11/reverse-forward-search-latex-suite-vim <span>Reverse/Forward Search with Latex-Suite in Vim</span> <span><a title="View user profile." href="/user/huahai" lang="" about="/user/huahai" typeof="schema:Person" property="schema:name" datatype="">Huahai</a></span> <span>Thu, 11/22/2007 - 17:19</span> <div class="field field--name-field-notebook field--type-entity-reference field--label-hidden field__items"> <div class="field__item"><div about="/notebook/vim" id="taxonomy-term-17" class="taxonomy-term vocabulary-notebook"> <a href="/notebook/vim"> <div class="field field--name-name field--type-string field--label-hidden field__item">Vim</div> </a> <div class="content"> </div> </div> </div> <div class="field__item"><div about="/notebook/linux" id="taxonomy-term-16" class="taxonomy-term vocabulary-notebook"> <a href="/notebook/linux"> <div class="field field--name-name field--type-string field--label-hidden field__item">Linux</div> </a> <div class="content"> </div> </div> </div> <div class="field__item"><div about="/notebook/latex" id="taxonomy-term-18" class="taxonomy-term vocabulary-notebook"> <a href="/notebook/latex"> <div class="field field--name-name field--type-string field--label-hidden field__item">LaTeX</div> </a> <div class="content"> </div> </div> </div> </div> <div class="field field--name-body field--type-text-with-summary field--label-hidden field__item"><div class="tex2jax_process"><p>When editing a long Latex document, it is beneficial to be able to point from current location in DVI back to Tex, and vice visa. This is what called reverse/forward search between DVI and Latex. With <a href="http://vim-latex.sourceforge.net/">Latex-Suite in Vim</a>, this functionality is already implemented, and there's no need to specify "\usepackage scrltx" in the Tex file. However, it's not fully configured by default. Forward search with "\ls" works, but inverse search by "Ctrl-Left click" in xdiv is not enabled. To turn it on, edit <i>~/.vim/ftplugin/tex/texrc</i>, change the line "TexLet g:Tex_UseEditorSettingInDVIViewer = 0" to "TexLet g:Tex_UseEditorSettingInDVIViewer = 1".</p> </div></div> <section> <h2>Add new comment</h2> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=60&amp;2=comment_node_blog&amp;3=comment_node_blog" token="rI8aai8OwEs1om8PIDJPJrPgdN5g2XSdPSAdvzWJxSI"></drupal-render-placeholder> </section> <strong class="node_view"></strong> Thu, 22 Nov 2007 17:19:37 +0000 Huahai 60 at https://yyhh.org kmail hangs due to missing loopback interface https://yyhh.org/blog/2007/11/kmail-hangs-due-missing-loopback-interface <span>kmail hangs due to missing loopback interface</span> <span><a title="View user profile." href="/user/huahai" lang="" about="/user/huahai" typeof="schema:Person" property="schema:name" datatype="">Huahai</a></span> <span>Thu, 11/22/2007 - 01:50</span> <div class="field field--name-field-notebook field--type-entity-reference field--label-hidden field__items"> <div class="field__item"><div about="/notebook/linux" id="taxonomy-term-16" class="taxonomy-term vocabulary-notebook"> <a href="/notebook/linux"> <div class="field field--name-name field--type-string field--label-hidden field__item">Linux</div> </a> <div class="content"> </div> </div> </div> </div> <div class="field field--name-body field--type-text-with-summary field--label-hidden field__item"><div class="tex2jax_process"><p>My <i>/etc/network/interfaces</i> got deleted when I removed <i>mepis-network</i> package. Everything was fine, except that kmail would hang since IP address 127.0.0.1 doesn't exist. It took me half an hour to figure it out. Had to create the file with these lines in it: </p> <p>auto lo<br /> iface lo inet loopback</p> <p>Now things went back to normal.</p> </div></div> <section> <h2>Add new comment</h2> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=59&amp;2=comment_node_blog&amp;3=comment_node_blog" token="FA1SV0Tug4AtPYN3pz3oLZI6e9eNeZvOGyHOqcqZ1n4"></drupal-render-placeholder> </section> <strong class="node_view"></strong> Thu, 22 Nov 2007 01:50:08 +0000 Huahai 59 at https://yyhh.org