<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Lance Jian</title>
    <description>The latest articles on DEV Community by Lance Jian (@lcltj).</description>
    <link>https://dev.to/lcltj</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F503265%2F549e813b-732e-41b6-bd01-997ee8da0539.jpeg</url>
      <title>DEV Community: Lance Jian</title>
      <link>https://dev.to/lcltj</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/lcltj"/>
    <language>en</language>
    <item>
      <title>Run Remote Linux GUI Application from Windows with X11 Forwarding</title>
      <dc:creator>Lance Jian</dc:creator>
      <pubDate>Fri, 08 Sep 2023 06:04:28 +0000</pubDate>
      <link>https://dev.to/lcltj/run-remote-linux-gui-application-from-windows-with-x11-forwarding-3c5b</link>
      <guid>https://dev.to/lcltj/run-remote-linux-gui-application-from-windows-with-x11-forwarding-3c5b</guid>
      <description>&lt;p&gt;This article supposed the remote Linux is Ubuntu 20.04 and above.&lt;/p&gt;

&lt;p&gt;Needed Software in Windows:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;a href="https://sourceforge.net/projects/vcxsrv/"&gt;VcXsrv&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://www.putty.org/"&gt;PuTTY&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Start PuTTY, configure SSH &amp;gt; X11 &amp;gt; Enable X11 forwarding:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--QzvOvtfQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1obwfjuqljpypzdh3f5p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--QzvOvtfQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1obwfjuqljpypzdh3f5p.png" alt="Image description" width="677" height="676"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In remote linux machine, change /etc/ssh/sshd_config:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;X11Forwarding yes
X11UseLocalhost no
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Restart remote SSH service:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl restart ssh.service
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;(Optional) Add in &lt;code&gt;~/.bashrc&lt;/code&gt; :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;LIBGL_ALWAYS_INDIRECT&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To start the remote GUI application:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Run XLaunch first in Windows&lt;/li&gt;
&lt;li&gt; Run PuTTY, login your remote machine&lt;/li&gt;
&lt;li&gt; Run &lt;code&gt;xclock&lt;/code&gt; in the command line to test if it works.&lt;/li&gt;
&lt;/ol&gt;

</description>
    </item>
    <item>
      <title>Combine Javascript Generators with yield</title>
      <dc:creator>Lance Jian</dc:creator>
      <pubDate>Tue, 05 Sep 2023 23:52:18 +0000</pubDate>
      <link>https://dev.to/lcltj/combine-generators-with-yield-j0n</link>
      <guid>https://dev.to/lcltj/combine-generators-with-yield-j0n</guid>
      <description>&lt;p&gt;It's not appropriate to call &lt;code&gt;yield anotherSaga()&lt;/code&gt; inside a saga function to combine two sagas. In general, to combine two generators,  we need to use &lt;code&gt;yield* anotherSaga()&lt;/code&gt; . Or use redux-saga's call or fork instead.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;g1&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;yield&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;yield&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;yield&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;g2&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;yield&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;yield&lt;/span&gt; &lt;span class="nx"&gt;g1&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="c1"&gt;// if not use yield* g1()&lt;/span&gt;
  &lt;span class="k"&gt;yield&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;gen&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;g2&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;gen&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;next&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt; &lt;span class="c1"&gt;// &amp;gt; {value: 1, done: false}&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;gen&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;next&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt; &lt;span class="c1"&gt;// &amp;gt; {value: g1, done: false} not as you expected &lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;gen&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;next&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt; &lt;span class="c1"&gt;// &amp;gt; {value: 5, done: false}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>Customize Your Thunderbird</title>
      <dc:creator>Lance Jian</dc:creator>
      <pubDate>Sat, 31 Oct 2020 18:24:00 +0000</pubDate>
      <link>https://dev.to/lcltj/change-thunderbird-font-size-on-macos-464o</link>
      <guid>https://dev.to/lcltj/change-thunderbird-font-size-on-macos-464o</guid>
      <description>&lt;p&gt;Thunderbird is my favourite email client in Linux. But on an 2013 MacBook Pro, using it became a pain.&lt;/p&gt;

&lt;h2&gt;
  
  
  Stop Crazy CPU Usage
&lt;/h2&gt;

&lt;p&gt;Due to some internal problems, my thunderbird CPU usage went up to 40% during idle time. Found this solution and worked:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://rainbow.chard.org/2013/02/19/thunderbird-high-cpu/"&gt;https://rainbow.chard.org/2013/02/19/thunderbird-high-cpu/&lt;/a&gt; and &lt;a href="https://www.reddit.com/r/Thunderbird/comments/49ur6w/finally_got_thunderbird_to_stop_freezing_and/"&gt;https://www.reddit.com/r/Thunderbird/comments/49ur6w/finally_got_thunderbird_to_stop_freezing_and/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Open "Preferences" &amp;gt; "General" &amp;gt; "Config Editor...", set &lt;code&gt;mail.db.idle_limit&lt;/code&gt; from &lt;code&gt;300000&lt;/code&gt; to &lt;code&gt;300000000&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Open "Preferences" &amp;gt; "General", turn off indexing service.&lt;/p&gt;

&lt;h2&gt;
  
  
  Set the Default Sort Order
&lt;/h2&gt;

&lt;p&gt;Open "Preferences" &amp;gt; "General" &amp;gt; "Config Editor..." again.&lt;/p&gt;

&lt;p&gt;If you wanted to sort all mail by Thread, Descending (newest at top), the preferences in the config editor will look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mailnews.default_sort_order:    default     integer      2
mailnews.default_sort_type:     default     integer     22
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Change the Font Size
&lt;/h2&gt;

&lt;p&gt;This works on Thunderbird 78.4.0.&lt;/p&gt;

&lt;p&gt;First, go to "Help" &amp;gt; "Troubleshooting Information", click the button "Show in Finder" next to "Profile Folder". It will open the profiles folder.&lt;/p&gt;

&lt;p&gt;Find the folder named &lt;code&gt;xxxxxx.default-release&lt;/code&gt;, create a new folder &lt;code&gt;chrome&lt;/code&gt; along side with the &lt;code&gt;Mail&lt;/code&gt; folder.&lt;/p&gt;

&lt;p&gt;Inside the &lt;code&gt;chrome&lt;/code&gt; folder, create a file &lt;code&gt;userChrome.css&lt;/code&gt; with following content:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="c"&gt;/*
* Do not remove the @namespace line -- it's required for correct functioning
*/&lt;/span&gt;
&lt;span class="k"&gt;@namespace&lt;/span&gt; &lt;span class="sx"&gt;url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul")&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c"&gt;/* Set font size in folder pane */&lt;/span&gt;
&lt;span class="nf"&gt;#folderTree&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nt"&gt;treechildren&lt;/span&gt;&lt;span class="nd"&gt;::-moz-tree-cell-text&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;font-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1.2rem&lt;/span&gt; &lt;span class="cp"&gt;!important&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c"&gt;/* You can also use em, pt or other units here.*/&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c"&gt;/* Set font size in thread pane */&lt;/span&gt;
&lt;span class="nf"&gt;#threadTree&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nt"&gt;treechildren&lt;/span&gt;&lt;span class="nd"&gt;::-moz-tree-cell-text&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;font-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1.2rem&lt;/span&gt; &lt;span class="cp"&gt;!important&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c"&gt;/* Set height for cells in folder pane */&lt;/span&gt;
&lt;span class="nf"&gt;#folderTree&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nt"&gt;treechildren&lt;/span&gt;&lt;span class="nd"&gt;::-moz-tree-row&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="nl"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;22px&lt;/span&gt; &lt;span class="cp"&gt;!important&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="c"&gt;/* Set height for cells in thread pane */&lt;/span&gt;
&lt;span class="nf"&gt;#threadTree&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nt"&gt;treechildren&lt;/span&gt;&lt;span class="nd"&gt;::-moz-tree-row&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="nl"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;22px&lt;/span&gt; &lt;span class="cp"&gt;!important&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This code is from &lt;a href="https://superuser.com/questions/175135/how-can-i-change-the-font-size-of-a-thunderbird-thread-list-on-a-mac"&gt;https://superuser.com/questions/175135/how-can-i-change-the-font-size-of-a-thunderbird-thread-list-on-a-mac&lt;/a&gt;, modified a little to suit my need.&lt;/p&gt;

&lt;p&gt;Next, you need to open "Preferences" &amp;gt; "General" &amp;gt; "Config Editor...", accept the warning dialog.&lt;/p&gt;

&lt;p&gt;Search for &lt;code&gt;toolkit.legacyUserProfileCustomizations.stylesheets&lt;/code&gt; and double click it to set its value to &lt;code&gt;true&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Finally, restart your Thunderbird.&lt;/p&gt;

&lt;p&gt;More readings:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="http://kb.mozillazine.org/Pane_and_menu_fonts"&gt;Pane and menu fonts&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://kb.mozillazine.org/UserChrome.css"&gt;userChrome.css&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>thunderbird</category>
    </item>
  </channel>
</rss>
