<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-2174891197290154044</id><updated>2026-09-21T10:49:54.745-07:00</updated><category term="admin"/><category term="tips"/><category term="develop"/><category term="linux"/><category term="mac"/><category term="java"/><category term="windows"/><category term="shell"/><category term="ubuntu"/><category term="chinese"/><category term="javascript"/><category term="bash"/><category term="python"/><category term="debian"/><category term="hints"/><category term="fun"/><category term="gwt"/><category term="china"/><category term="git"/><category term="centos"/><category term="eclipse"/><category term="batch script"/><category term="android"/><category term="hardware"/><category term="firefox"/><category term="ssh"/><category term="australia"/><category term="blogger"/><category term="mobile"/><category term="vim"/><category term="css"/><category term="typescript"/><category term="video"/><category term="powershell"/><category term="english"/><category term="font"/><category term="maven"/><category term="mediaflux"/><category term="free"/><category term="sed"/><category term="extjs"/><category term="online"/><category term="tcl"/><category term="iptables"/><category term="javafx"/><category term="ssl"/><category term="food"/><category term="printing"/><category term="string"/><category term="xml"/><category term="dicom"/><category term="html"/><category term="Housing"/><category term="ant"/><category term="book"/><category term="neovim"/><category term="dns"/><category term="google"/><category term="lxde"/><category term="movie"/><category term="mysql"/><category term="network"/><category term="tools"/><category term="awk"/><category term="debug"/><category term="education"/><category term="gnome"/><category term="list"/><category term="melbourne"/><category term="profile"/><category term="regex"/><category term="rocky"/><category term="rust"/><category term="security"/><category term="smartgwt"/><category term="thinkpad"/><category term="wine"/><category term="apache"/><category term="developer"/><category term="favorite"/><category term="game"/><category term="grep"/><category term="joke"/><category term="math"/><category term="nomachine"/><category term="nx"/><category term="openssl"/><category term="type"/><category term="windows mobile"/><category term="宋词"/><category term="苏轼"/><category term="诗词"/><category term="antivirus"/><category term="application"/><category term="gadgets"/><category term="gmail"/><category term="kids"/><category term="ldap"/><category term="lg"/><category term="live"/><category term="logging"/><category term="memory"/><category term="react"/><category term="script"/><category term="smtp"/><category term="software"/><category term="spotlight"/><category term="twiki"/><category term="virtualization"/><category term="voip"/><category term="word"/><category term="dictionary"/><category term="editor"/><category term="encryption"/><category term="gist"/><category term="github"/><category term="http"/><category term="matlab"/><category term="mf60"/><category term="modem"/><category term="mui"/><category term="music"/><category term="neuroimaging"/><category term="omero"/><category term="pdf"/><category term="redhat"/><category term="safari"/><category term="sports"/><category term="svelte"/><category term="threading"/><category term="windows phone"/><category term="zte"/><category term="老电影"/><category term="chess"/><category term="cloud"/><category term="cobol"/><category term="command"/><category term="cups"/><category term="doc"/><category term="excel"/><category term="file"/><category term="find"/><category term="html5"/><category term="j2me"/><category term="lambda"/><category term="lock"/><category term="module"/><category term="msys2"/><category term="nfs"/><category term="novel"/><category term="path"/><category term="php"/><category term="postfix"/><category term="postgresql"/><category term="programming"/><category term="recipe"/><category term="rsync"/><category term="samba"/><category term="skype"/><category term="starcraft"/><category term="static method"/><category term="str"/><category term="synchronized"/><category term="tar"/><category term="vmware"/><category term="vs code"/><category term="xargs"/><category term="xnat"/><category term="zip"/><category term="AstroNvim"/><category term="acer"/><category term="adler32"/><category term="ajax"/><category term="apparmor"/><category term="apple"/><category term="applet"/><category term="array"/><category term="aterm"/><category term="aws"/><category term="baby"/><category term="bargain"/><category term="basestring"/><category term="bitsadmin"/><category term="boolean"/><category term="brew"/><category term="building"/><category term="byte"/><category term="car"/><category term="career"/><category term="certificate"/><category term="checksum"/><category term="china，soccer"/><category term="cifs"/><category term="class method"/><category term="client"/><category term="comprehension"/><category term="concurrency"/><category term="coolpad"/><category term="crc32"/><category term="cron"/><category term="crypto"/><category term="csr"/><category term="design patterns"/><category term="dict"/><category term="disk"/><category term="diy"/><category term="dokuwiki"/><category term="dotproject"/><category term="duck typing"/><category term="ecipse"/><category term="edge"/><category term="email"/><category term="encoding"/><category term="entertainment"/><category term="enum"/><category term="equivalent"/><category term="exception"/><category term="expression"/><category term="fluxbox"/><category term="gps"/><category term="graalvm"/><category term="gradle"/><category term="graphics"/><category term="groovy"/><category term="group policy"/><category term="grub"/><category term="hex"/><category term="hotmail"/><category term="ide"/><category term="imageio"/><category term="import"/><category term="inheritance"/><category term="int"/><category term="integer"/><category term="investment"/><category term="io"/><category term="iterable"/><category term="iterator"/><category term="jai"/><category term="javacc"/><category term="jmap"/><category term="json"/><category term="kde"/><category term="kindle"/><category term="kubuntu"/><category term="latex"/><category term="lazyvim"/><category term="long"/><category term="lubuntu"/><category term="maintenance"/><category term="mate"/><category term="microsoft"/><category term="misc"/><category term="mplayerx"/><category term="mytardis"/><category term="native-image"/><category term="neovide"/><category term="nifti"/><category term="objective-c"/><category term="onedrive"/><category term="openbox"/><category term="openstack"/><category term="outlook"/><category term="overriding"/><category term="package"/><category term="piano"/><category term="proxy"/><category term="pydev"/><category term="quicktime"/><category term="reading"/><category term="s3"/><category term="screen"/><category term="server"/><category term="sfc"/><category term="sip"/><category term="smb"/><category term="sphinx"/><category term="ssd"/><category term="style"/><category term="swing"/><category term="tablet"/><category term="telstra"/><category term="textmate"/><category term="time"/><category term="tomcat"/><category term="tv"/><category term="unicode"/><category term="url"/><category term="utilities"/><category term="vba"/><category term="virtualbox"/><category term="vpn"/><category term="webdav"/><category term="wifi"/><category term="x11"/><category term="x50v"/><category term="yum"/><category term="zsh"/><title type='text'>My Tech Notes</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://notepad2.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2174891197290154044/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://notepad2.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/2174891197290154044/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>WXL</name><uri>http://www.blogger.com/profile/18374533961873126421</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>1588</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2174891197290154044.post-6261724967899229728</id><published>2024-07-29T17:29:00.000-07:00</published><updated>2024-07-29T17:29:45.995-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="develop"/><category scheme="http://www.blogger.com/atom/ns#" term="java"/><title type='text'>Java: check if a String contains only ASCII</title><content type='html'>&lt;pre&gt;
import java.nio.charset.Charset;

public boolean isAscii(String v) {
    Charset.forName(&quot;US-ASCII&quot;).newEncoder().canEncode(v);
}
&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://notepad2.blogspot.com/feeds/6261724967899229728/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://notepad2.blogspot.com/2024/07/java-check-if-string-contains-only-ascii.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2174891197290154044/posts/default/6261724967899229728'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2174891197290154044/posts/default/6261724967899229728'/><link rel='alternate' type='text/html' href='http://notepad2.blogspot.com/2024/07/java-check-if-string-contains-only-ascii.html' title='Java: check if a String contains only ASCII'/><author><name>WXL</name><uri>http://www.blogger.com/profile/18374533961873126421</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2174891197290154044.post-9095095692344568802</id><published>2024-06-11T22:21:00.000-07:00</published><updated>2024-06-11T22:21:29.544-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="develop"/><category scheme="http://www.blogger.com/atom/ns#" term="eclipse"/><title type='text'>Eclipse: Disable auto escaping when pasting</title><content type='html'>&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;ol&gt;&lt;li&gt;In the &lt;strong&gt;preferences&lt;/strong&gt; menu deselect: &lt;strong&gt;Java&lt;/strong&gt; &amp;gt; &lt;strong&gt;Editor&lt;/strong&gt; &amp;gt; &lt;strong&gt;Typing&lt;/strong&gt; &amp;gt; &lt;strong&gt;Escape text when pasting into a string literal&lt;/strong&gt;&lt;/li&gt;&lt;li&gt;Disable smart insert mode: &lt;strong&gt;Edit&lt;/strong&gt; &amp;gt; &lt;strong&gt;Smart Insert Mode [Ctrl+Shift+Insert]&lt;/strong&gt;&lt;/li&gt;&lt;/ol&gt;
</content><link rel='replies' type='application/atom+xml' href='http://notepad2.blogspot.com/feeds/9095095692344568802/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://notepad2.blogspot.com/2024/06/eclipse-disable-auto-escaping-when.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2174891197290154044/posts/default/9095095692344568802'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2174891197290154044/posts/default/9095095692344568802'/><link rel='alternate' type='text/html' href='http://notepad2.blogspot.com/2024/06/eclipse-disable-auto-escaping-when.html' title='Eclipse: Disable auto escaping when pasting'/><author><name>WXL</name><uri>http://www.blogger.com/profile/18374533961873126421</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2174891197290154044.post-4266841960850301848</id><published>2024-06-11T21:37:00.000-07:00</published><updated>2024-06-11T21:37:48.190-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="admin"/><category scheme="http://www.blogger.com/atom/ns#" term="shell"/><title type='text'>Shell scripts to count files and sum up file sizes </title><content type='html'>&lt;script src=&quot;https://gist.github.com/xtman/b9dd1c35c6f657867c46ce8c6cda18be.js&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;https://gist.github.com/xtman/328e6084216e918f89fa1fdec6ab859a.js&quot;&gt;&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://notepad2.blogspot.com/feeds/4266841960850301848/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://notepad2.blogspot.com/2024/06/shell-scripts-to-count-files-and-sum-up.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2174891197290154044/posts/default/4266841960850301848'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2174891197290154044/posts/default/4266841960850301848'/><link rel='alternate' type='text/html' href='http://notepad2.blogspot.com/2024/06/shell-scripts-to-count-files-and-sum-up.html' title='Shell scripts to count files and sum up file sizes '/><author><name>WXL</name><uri>http://www.blogger.com/profile/18374533961873126421</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2174891197290154044.post-6911084432233439531</id><published>2024-03-23T15:54:00.000-07:00</published><updated>2024-03-23T16:17:39.746-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="admin"/><category scheme="http://www.blogger.com/atom/ns#" term="tips"/><category scheme="http://www.blogger.com/atom/ns#" term="windows"/><title type='text'>Fix Windows 10 Update KB5034441 Error 0x80070643</title><content type='html'>&lt;p&gt;The reason &lt;b&gt;KB5034441&lt;/b&gt; failed to install with error &lt;b&gt;0x80070643&lt;/b&gt; is that there is not sufficient space in WinRE recovery partition. The &lt;b&gt;solution&lt;/b&gt; is:&lt;/p&gt;

&lt;h3&gt;Manually resize your WinRE recovery partition by 250 MB&lt;/h3&gt;
&lt;ol&gt;
  &lt;li&gt;Open a Command Prompt window (cmd) as &lt;b&gt;Administrator&lt;/b&gt;.
  &lt;li&gt;Check WindowsRE status:&lt;pre&gt;reagentc /info&lt;/pre&gt;&lt;br/&gt;If the WinRE is installed, there should be a “Windows RE location” with a path to the WinRE directory. An example is, “Windows RE location: [file://%3f/GLOBALROOT/device/harddisk0/partition4/Recovery/WindowsRE]\\?\GLOBALROOT\device\harddisk0\partition4\Recovery\WindowsRE.” Here, the number after “harddisk” and “partition” is the index of the disk and partition WinRE is on.&lt;/li&gt;
  &lt;li&gt;Disable the WindowsRE: &lt;pre&gt;reagentc /disable&lt;/pre&gt;&lt;/li&gt;
  &lt;li&gt;Shrink the OS partition and prepare the disk for a new recovery partition.
    &lt;ul&gt;
      &lt;li&gt;Run&lt;pre&gt;diskpart&lt;/pre&gt;&lt;/li&gt;
      &lt;li&gt;Run&lt;pre&gt;list disk&lt;/pre&gt;&lt;/li&gt;
      &lt;li&gt;Select the OS disk (This should be the same disk index as WinRE.), run &lt;pre&gt;sel disk OS_DISK_INDEX&lt;/pre&gt; e.g. &lt;pre&gt;sel disk 0&lt;/pre&gt; if disk 0 is the OS disk.&lt;/li&gt;
      &lt;li&gt;Find the OS Primary partition, run &lt;pre&gt;list part&lt;/pre&gt;&lt;/li&gt;
      &lt;li&gt;Select the OS Primary partition, run &lt;pre&gt;sel part OS_PARTITION_INDEX&lt;/pre&gt;&lt;/li&gt;
      &lt;li&gt;Shrink the OS Primary partition by 250MB, run &lt;pre&gt;shrink desired=250 minimum=250&lt;/pre&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Delete the WinRE recovery partition
    &lt;ul&gt;
      &lt;li&gt;In diskpart, select WinRE partition, run &lt;pre&gt;sel part WinRE_PARTITION_INDEX&lt;/pre&gt;&lt;/li&gt;
      &lt;li&gt;Delete the WinRE partition, run &lt;pre&gt;delete partition override&lt;/pre&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Create a new WinRE recovery partition.
    &lt;ul&gt;
      &lt;li&gt;First, check if the disk partition style is a GUID Partition Table (GPT) or a Master Boot Record (MBR).  To do that, run &lt;pre&gt;list disk&lt;/pre&gt;. Check if there is an asterisk character (*) in the “Gpt” column.  If there is an asterisk character (*), then the drive is GPT. Otherwise, the drive is MBR.&lt;li&gt;
      &lt;li&gt;If your disk is GPT, run &lt;pre&gt;create partition primary id=de94bba4-06d1-4d40-a16a-bfd50179d6ac&lt;/pre&gt; followed by the command &lt;pre&gt;gpt attributes =0x8000000000000001&lt;/pre&gt;&lt;/li&gt;
      &lt;li&gt;If your disk is MBR, run &lt;pre&gt;create partition primary id=27&lt;/pre&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Format the new WinRE recovery partition, run &lt;pre&gt;format quick fs=ntfs label=&quot;Windows RE tools&quot;&lt;/pre&gt;&lt;br/&gt;To confirm that the WinRE partition is created, run &lt;pre&gt;list vol&lt;/pre&gt;&lt;br/&gt;Exit from diskpart, run &lt;pre&gt;exit&lt;/pre&gt;&lt;/li&gt;
  &lt;li&gt;Re-enable WinRE, run &lt;pre&gt;reagentc /enable&lt;/pre&gt; &lt;br/&gt;To confirm where WinRE is installed, run &lt;pre&gt;reagentc /info&lt;/pre&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Now you should be able to install &lt;b&gt;KB5034441&lt;/b&gt; via Windows Update&lt;/p&gt;
&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;
&lt;h3&gt;See also&lt;/h3&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://learn.microsoft.com/en-us/windows/release-health/status-windows-10-21H2#3231msgdesc&quot;&gt;The January 2024 Windows RE update might fail to install&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/add-update-to-winre?view=windows-11#extend-the-windows-re-partition&quot;&gt;Script to Extend the Windows RE Partition&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://support.microsoft.com/en-au/topic/kb5028997-instructions-to-manually-resize-your-partition-to-install-the-winre-update-400faa27-9343-461c-ada9-24c8229763bf&quot;&gt;KB5028997: Instructions to manually resize your partition to install the WinRE update&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=t-8gFRrEiCU&quot;&gt;A Youtube video shows how to this 0x80070643 error&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content><link rel='replies' type='application/atom+xml' href='http://notepad2.blogspot.com/feeds/6911084432233439531/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://notepad2.blogspot.com/2024/03/fix-windows-10-update-kb5034441-error.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2174891197290154044/posts/default/6911084432233439531'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2174891197290154044/posts/default/6911084432233439531'/><link rel='alternate' type='text/html' href='http://notepad2.blogspot.com/2024/03/fix-windows-10-update-kb5034441-error.html' title='Fix Windows 10 Update KB5034441 Error 0x80070643'/><author><name>WXL</name><uri>http://www.blogger.com/profile/18374533961873126421</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2174891197290154044.post-4976764393636377329</id><published>2023-04-26T20:01:00.003-07:00</published><updated>2023-04-26T20:01:40.907-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="admin"/><category scheme="http://www.blogger.com/atom/ns#" term="bash"/><category scheme="http://www.blogger.com/atom/ns#" term="hints"/><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><category scheme="http://www.blogger.com/atom/ns#" term="shell"/><category scheme="http://www.blogger.com/atom/ns#" term="tips"/><title type='text'>Compress sparse files preserving their holes</title><content type='html'>use &lt;b&gt;-S&lt;/b&gt; option for &lt;b&gt;tar&lt;/b&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;tar -Sczvf sparse_file.tar.gz sparse_file&lt;/code&gt;&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://notepad2.blogspot.com/feeds/4976764393636377329/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://notepad2.blogspot.com/2023/04/compress-sparse-files-preserving-their.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2174891197290154044/posts/default/4976764393636377329'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2174891197290154044/posts/default/4976764393636377329'/><link rel='alternate' type='text/html' href='http://notepad2.blogspot.com/2023/04/compress-sparse-files-preserving-their.html' title='Compress sparse files preserving their holes'/><author><name>WXL</name><uri>http://www.blogger.com/profile/18374533961873126421</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2174891197290154044.post-1878703806378020574</id><published>2023-04-26T16:05:00.002-07:00</published><updated>2023-04-26T16:05:08.527-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="bash"/><category scheme="http://www.blogger.com/atom/ns#" term="hints"/><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><category scheme="http://www.blogger.com/atom/ns#" term="mac"/><category scheme="http://www.blogger.com/atom/ns#" term="shell"/><category scheme="http://www.blogger.com/atom/ns#" term="tips"/><title type='text'>Find FIFO (named pipe) in Linux</title><content type='html'>&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt; find ./ -type p &lt;/code&gt;&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://notepad2.blogspot.com/feeds/1878703806378020574/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://notepad2.blogspot.com/2023/04/find-fifo-named-pipe-in-linux.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2174891197290154044/posts/default/1878703806378020574'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2174891197290154044/posts/default/1878703806378020574'/><link rel='alternate' type='text/html' href='http://notepad2.blogspot.com/2023/04/find-fifo-named-pipe-in-linux.html' title='Find FIFO (named pipe) in Linux'/><author><name>WXL</name><uri>http://www.blogger.com/profile/18374533961873126421</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2174891197290154044.post-723831644510507528</id><published>2023-04-26T16:04:00.002-07:00</published><updated>2023-04-26T20:08:13.748-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="admin"/><category scheme="http://www.blogger.com/atom/ns#" term="bash"/><category scheme="http://www.blogger.com/atom/ns#" term="hints"/><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><category scheme="http://www.blogger.com/atom/ns#" term="mac"/><category scheme="http://www.blogger.com/atom/ns#" term="shell"/><category scheme="http://www.blogger.com/atom/ns#" term="tips"/><title type='text'>Find sparse files in Linux</title><content type='html'>&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;find ./ -type f -printf &quot;%S\t%p\n&quot; | awk &#39;$1 &amp;lt; 1.0 {print}&#39;

find ./ -type f -printf &quot;%S\t%p\n&quot; | awk &#39;$1 &amp;lt; 1.0 {print $2}&#39;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;

To find and remove the sparse files:
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;find ./ -type f -printf &quot;%S\t%p\n&quot; | awk &#39;$1 &amp;lt; 1.0 {print $2}&#39; | xargs rm -f&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;

To find and compress the sparse files:
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;find ./ -type f -printf &quot;%S\t%p\n&quot; | awk &#39;$1 &amp;lt; 1.0 {print $2}&#39; | xargs -I {} sh -c &quot;tar -Sczvf {}.tar.gz {}; rm -f {}&quot;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;

</content><link rel='replies' type='application/atom+xml' href='http://notepad2.blogspot.com/feeds/723831644510507528/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://notepad2.blogspot.com/2023/04/find-sparse-files-in-linux.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2174891197290154044/posts/default/723831644510507528'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2174891197290154044/posts/default/723831644510507528'/><link rel='alternate' type='text/html' href='http://notepad2.blogspot.com/2023/04/find-sparse-files-in-linux.html' title='Find sparse files in Linux'/><author><name>WXL</name><uri>http://www.blogger.com/profile/18374533961873126421</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2174891197290154044.post-7493389535048775278</id><published>2023-03-21T19:03:00.006-07:00</published><updated>2023-03-21T19:03:55.204-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="excel"/><category scheme="http://www.blogger.com/atom/ns#" term="hints"/><category scheme="http://www.blogger.com/atom/ns#" term="tips"/><title type='text'>Excel custom formatting cells for file sizes (GB and TB)</title><content type='html'>&lt;pre&gt;&lt;code&gt;
[&lt;1000000]0.00,&quot; KB&quot;;[&lt;1000000000]0.00,,&quot; MB&quot;;0.00,,,&quot; GB&quot;
[&lt;1000000000]0.00,,&quot; MB&quot;;[&lt;1000000000000]0.0,,,&quot; GB&quot;;0.0,,,,&quot; TB&quot;
&lt;/code&gt;&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://notepad2.blogspot.com/feeds/7493389535048775278/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://notepad2.blogspot.com/2023/03/excel-custom-formatting-cells-for-file.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2174891197290154044/posts/default/7493389535048775278'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2174891197290154044/posts/default/7493389535048775278'/><link rel='alternate' type='text/html' href='http://notepad2.blogspot.com/2023/03/excel-custom-formatting-cells-for-file.html' title='Excel custom formatting cells for file sizes (GB and TB)'/><author><name>WXL</name><uri>http://www.blogger.com/profile/18374533961873126421</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2174891197290154044.post-6706686667159510426</id><published>2023-03-14T23:14:00.001-07:00</published><updated>2023-03-14T23:14:04.541-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="admin"/><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><category scheme="http://www.blogger.com/atom/ns#" term="mac"/><category scheme="http://www.blogger.com/atom/ns#" term="ssh"/><category scheme="http://www.blogger.com/atom/ns#" term="tips"/><title type='text'>SSH public key authentication rejected with debug message: no mutual signature algorithm</title><content type='html'>&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;ssh user@remote-server -vvvv&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;debug1: no mutual signature algorithm&lt;/pre&gt;
&lt;br&gt;&lt;br&gt;&lt;br&gt;
&lt;h3&gt;Cause&lt;/h3&gt;
&lt;p&gt;The RSA SHA-1 hash algorithm is being quickly deprecated across operating systems and SSH clients because of various security vulnerabilities, with many of these technologies now outright denying the use of this algorithm.&lt;/p&gt;
&lt;h3&gt;Solution&lt;/h3&gt;
Generate SSH key using ED25519 algorithm:
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;ssh-keygen -t ed25519&lt;/code&gt;&lt;/pre&gt;
&lt;br&gt;&lt;br&gt;&lt;br&gt;
&lt;h3&gt;See also&lt;/h3&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://confluence.atlassian.com/bitbucketserverkb/ssh-rsa-key-rejected-with-message-no-mutual-signature-algorithm-1026057701.html&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;SSH-RSA key rejected with message &quot;no mutual signature algorithm&quot;&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://chuyeow.wtf/2007/02/28/debugging-ssh-public-key-authentication-problems&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;Debugging SSH public key authentication problems&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content><link rel='replies' type='application/atom+xml' href='http://notepad2.blogspot.com/feeds/6706686667159510426/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://notepad2.blogspot.com/2023/03/ssh-public-key-authentication-rejected.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2174891197290154044/posts/default/6706686667159510426'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2174891197290154044/posts/default/6706686667159510426'/><link rel='alternate' type='text/html' href='http://notepad2.blogspot.com/2023/03/ssh-public-key-authentication-rejected.html' title='SSH public key authentication rejected with debug message: no mutual signature algorithm'/><author><name>WXL</name><uri>http://www.blogger.com/profile/18374533961873126421</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2174891197290154044.post-9002625791288095498</id><published>2023-03-07T17:56:00.004-08:00</published><updated>2023-03-07T17:57:48.129-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="admin"/><category scheme="http://www.blogger.com/atom/ns#" term="hints"/><category scheme="http://www.blogger.com/atom/ns#" term="tips"/><category scheme="http://www.blogger.com/atom/ns#" term="windows"/><title type='text'>Install RSAT Active Directory Administrative Center on Windows 10 (22H2)</title><content type='html'>Run &lt;b&gt;PowerShell&lt;/b&gt; as &lt;b&gt;Administrator&lt;/b&gt; and paste the commands below:
&lt;pre&gt;
&lt;code class=&quot;language-powershell&quot;&gt;
$currentWU = Get-ItemProperty -Path &quot;HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU&quot; -Name &quot;UseWUServer&quot; | select -ExpandProperty UseWUServer
Set-ItemProperty -Path &quot;HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU&quot; -Name &quot;UseWUServer&quot; -Value 0
Restart-Service wuauserv
Get-WindowsCapability -Name Rsat.ActiveDirectory.DS-LDS.Tools -Online | Add-WindowsCapability –Online
Set-ItemProperty -Path &quot;HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU&quot; -Name &quot;UseWUServer&quot; -Value $currentWU
Restart-Service wuauserv
&lt;/code&gt;
&lt;/pre&gt;
&lt;br&gt;&lt;br&gt;&lt;br&gt;
&lt;h3&gt;see also&lt;/h3&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://community.spiceworks.com/topic/2318889-rsat-tools-install-failed&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;RSAT Tools install failed&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content><link rel='replies' type='application/atom+xml' href='http://notepad2.blogspot.com/feeds/9002625791288095498/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://notepad2.blogspot.com/2023/03/install-rsat-active-directory.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2174891197290154044/posts/default/9002625791288095498'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2174891197290154044/posts/default/9002625791288095498'/><link rel='alternate' type='text/html' href='http://notepad2.blogspot.com/2023/03/install-rsat-active-directory.html' title='Install RSAT Active Directory Administrative Center on Windows 10 (22H2)'/><author><name>WXL</name><uri>http://www.blogger.com/profile/18374533961873126421</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2174891197290154044.post-4650016504037500651</id><published>2023-02-27T02:38:00.001-08:00</published><updated>2023-02-27T02:38:02.828-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="hints"/><category scheme="http://www.blogger.com/atom/ns#" term="neovim"/><category scheme="http://www.blogger.com/atom/ns#" term="tips"/><title type='text'>Neovim: option list</title><content type='html'>&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://neovim.io/doc/user/quickref.html#option-list&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;Quick Reference: Neovim options&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br&gt;&lt;br&gt;&lt;br&gt;
&lt;h3&gt;see also&lt;/h3&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://neovim.io/doc/user/quickref.html&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;Neovim: Quick Ref&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content><link rel='replies' type='application/atom+xml' href='http://notepad2.blogspot.com/feeds/4650016504037500651/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://notepad2.blogspot.com/2023/02/neovim-option-list.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2174891197290154044/posts/default/4650016504037500651'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2174891197290154044/posts/default/4650016504037500651'/><link rel='alternate' type='text/html' href='http://notepad2.blogspot.com/2023/02/neovim-option-list.html' title='Neovim: option list'/><author><name>WXL</name><uri>http://www.blogger.com/profile/18374533961873126421</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2174891197290154044.post-5625070485388955212</id><published>2023-02-23T20:27:00.002-08:00</published><updated>2023-02-23T20:27:26.964-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="develop"/><category scheme="http://www.blogger.com/atom/ns#" term="hints"/><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="regex"/><category scheme="http://www.blogger.com/atom/ns#" term="tips"/><title type='text'>Java: remove unsafe html tags</title><content type='html'>&lt;pre&gt;&lt;code class=&quot;language-java&quot;&gt;
public class HtmlTagRemover {
    public static String removeUnsafeTags(String html) {
        // Define the regular expression pattern to match unsafe tags
        String unsafeTagsPattern = &quot;&amp;lt;(script|iframe|object|embed)[^&amp;gt;]*&amp;gt;.*?&amp;lt;/\\1&amp;gt;&quot;;

        // Remove the unsafe tags from the HTML string
        String safeHtml = html.replaceAll(unsafeTagsPattern, &quot;&quot;);

        return safeHtml;
    }

    public static void main(String[] args) {
        String html = &quot;&amp;lt;b&amp;gt;Safe HTML&amp;lt;/b&amp;gt;&amp;lt;script&amp;gt;alert(&#39;XSS&#39;)&amp;lt;/script&amp;gt;&quot;;
        String safeHtml = removeUnsafeTags(html);
        System.out.println(safeHtml);
    }
}
&lt;/code&gt;&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://notepad2.blogspot.com/feeds/5625070485388955212/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://notepad2.blogspot.com/2023/02/java-remove-unsafe-html-tags.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2174891197290154044/posts/default/5625070485388955212'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2174891197290154044/posts/default/5625070485388955212'/><link rel='alternate' type='text/html' href='http://notepad2.blogspot.com/2023/02/java-remove-unsafe-html-tags.html' title='Java: remove unsafe html tags'/><author><name>WXL</name><uri>http://www.blogger.com/profile/18374533961873126421</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2174891197290154044.post-996325644043896621</id><published>2023-02-23T20:21:00.004-08:00</published><updated>2023-02-23T20:21:22.442-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="hints"/><category scheme="http://www.blogger.com/atom/ns#" term="neovim"/><category scheme="http://www.blogger.com/atom/ns#" term="python"/><category scheme="http://www.blogger.com/atom/ns#" term="tips"/><title type='text'>Install pre-requisites for flake8 (python language server) on Linux</title><content type='html'>&lt;ul&gt;
  &lt;li&gt;Install pip:&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;sudo apt install python3-pip&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
  &lt;li&gt;Check python version:&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;python3 --version&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code class=&quot;language-plain&quot;&gt;Python 3.10.6&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
  &lt;li&gt;Install virtualenv:&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;sudo apt install python3.10-virtualenv&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;/ul&gt;


</content><link rel='replies' type='application/atom+xml' href='http://notepad2.blogspot.com/feeds/996325644043896621/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://notepad2.blogspot.com/2023/02/install-pre-requisites-for-flake8.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2174891197290154044/posts/default/996325644043896621'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2174891197290154044/posts/default/996325644043896621'/><link rel='alternate' type='text/html' href='http://notepad2.blogspot.com/2023/02/install-pre-requisites-for-flake8.html' title='Install pre-requisites for flake8 (python language server) on Linux'/><author><name>WXL</name><uri>http://www.blogger.com/profile/18374533961873126421</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2174891197290154044.post-4609033434698014896</id><published>2023-02-23T20:13:00.006-08:00</published><updated>2023-02-23T20:14:02.312-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="hints"/><category scheme="http://www.blogger.com/atom/ns#" term="shell"/><category scheme="http://www.blogger.com/atom/ns#" term="tips"/><category scheme="http://www.blogger.com/atom/ns#" term="zsh"/><title type='text'>My zsh prompt setup</title><content type='html'>Add following line to &lt;b&gt;~/.zshrc&lt;/b&gt;: &lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;PROMPT=&#39;%F{red}%*%f %F{blue}%1~%f %# &#39;&lt;/code&gt;&lt;/pre&gt;
&lt;br&gt;&lt;br&gt;&lt;br&gt;
More details about ZSH prompt: &lt;a href=&quot;https://zsh.sourceforge.io/Doc/Release/Prompt-Expansion.html&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;https://zsh.sourceforge.io/Doc/Release/Prompt-Expansion.html&lt;/a&gt;
 </content><link rel='replies' type='application/atom+xml' href='http://notepad2.blogspot.com/feeds/4609033434698014896/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://notepad2.blogspot.com/2023/02/my-zsh-prompt-setup.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2174891197290154044/posts/default/4609033434698014896'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2174891197290154044/posts/default/4609033434698014896'/><link rel='alternate' type='text/html' href='http://notepad2.blogspot.com/2023/02/my-zsh-prompt-setup.html' title='My zsh prompt setup'/><author><name>WXL</name><uri>http://www.blogger.com/profile/18374533961873126421</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2174891197290154044.post-5236679128172526782</id><published>2023-02-22T03:47:00.006-08:00</published><updated>2023-05-06T22:56:23.598-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="hints"/><category scheme="http://www.blogger.com/atom/ns#" term="lazyvim"/><category scheme="http://www.blogger.com/atom/ns#" term="neovim"/><category scheme="http://www.blogger.com/atom/ns#" term="tips"/><title type='text'>Setup Neovim and LazyVim</title><content type='html'>&lt;h3&gt;I. Install Neovim&lt;/h3&gt;
&lt;ul&gt;
  &lt;li&gt;Download nightly build from &lt;a href=&quot;https://github.com/neovim/neovim/releases/tag/nightly&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;https://github.com/neovim/neovim/releases/tag/nightly&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;Alternatively, build from source: &lt;a href=&quot;https://github.com/neovim/neovim/wiki/Building-Neovim&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;https://github.com/neovim/neovim/wiki/Building-Neovim&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
&lt;h3&gt;II. Install LazyVim&lt;/h3&gt;
&lt;ul&gt;
  &lt;li&gt;Follow the instructions to install LazyVim: &lt;a href=&quot;https://www.lazyvim.org/installation&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;https://www.lazyvim.org/installation&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;Install &lt;b&gt;fd&lt;/b&gt;, &lt;b&gt;ripgrep&lt;/b&gt;, &lt;b&gt;fzf&lt;/b&gt;, &lt;b&gt;lazygit&lt;/b&gt;:
    &lt;ul&gt;
      &lt;li&gt;Mac OS: &lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;brew install fd ripgrep fzf lazygit&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
      &lt;li&gt;Linux: &lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;apt install fd-find ripgrep fzf lazygit&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
&lt;h3&gt;III. Configuration&lt;/h3&gt;
&lt;ul&gt;
  &lt;li&gt;Install toggleterm.nvim. Create file: &lt;b&gt;~/.config/nvim/lua/plugins/toggleterm.lua&lt;/b&gt;:
    &lt;pre&gt;&lt;code class=&quot;language-lua&quot;&gt;-- ~/.config/nvim/lua/plugins/toggleterm.lua
return {
  {
    &quot;akinsho/toggleterm.nvim&quot;,
    tag = &quot;2.4.0&quot;,
    keys = {
      { &quot;&amp;lt;leader&amp;gt;th&quot;, &quot;&amp;lt;cmd&amp;gt;ToggleTerm size=15 direction=horizontal&amp;lt;cr&amp;gt;&quot;, desc = &quot;Open a horizontal terminal&quot; },
      { &quot;&amp;lt;leader&amp;gt;tt&quot;, &quot;&amp;lt;cmd&amp;gt;ToggleTerm&amp;lt;cr&amp;gt;&quot;, desc = &quot;Toggle terminal&quot; },
      { &quot;&amp;lt;F7&amp;gt;&quot;, &quot;&amp;lt;cmd&amp;gt;ToggleTerm&amp;lt;cr&amp;gt;&quot;, desc = &quot;Toggle terminal&quot; },
      { &quot;&amp;lt;F7&amp;gt;&quot;, &quot;&amp;lt;cmd&amp;gt;ToggleTerm&amp;lt;cr&amp;gt;&quot;, mode= &quot;t&quot;, desc = &quot;Toggle terminal&quot; },
    },
    opts = {
      --[[ things you want to change go here]]
    },
  },
}&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
  &lt;li&gt;Set options in &lt;b&gt;~/.config/nvim/lua/config/options.lua&lt;/b&gt;:
    &lt;pre&gt;&lt;code class=&quot;language-lua&quot;&gt;-- ~/.config/nvim/lua/config/options.lua
vim.opt.relativenumber = false -- Relative line numbers
vim.opt.shiftwidth = 4 -- Size of an indent
vim.opt.tabstop = 4 -- Number of spaces tabs count for
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
  &lt;li&gt;Install nightfox colorscheme. Create file: &lt;b&gt;~/.config/nvim/lua/plugins/colorscheme.lua&lt;/b&gt;:
    &lt;pre&gt;&lt;code class=&quot;language-lua&quot;&gt;-- ~/.config/nvim/lua/plugins/colorscheme.lua
return {
  -- add nightfox colorscheme
  { &quot;EdenEast/nightfox.nvim&quot; },

  -- Configure LazyVim to load nightfox
  {
    &quot;LazyVim/LazyVim&quot;,
    opts = {
      colorscheme = &quot;carbonfox&quot;,
    },
  }
}&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br&gt;&lt;br&gt;&lt;br&gt;
&lt;h3&gt;See also&lt;/h3&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/LazyVim/LazyVim&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;LazyVim GitHub&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.lazyvim.org/configuration&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;LazyVim Configuration&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content><link rel='replies' type='application/atom+xml' href='http://notepad2.blogspot.com/feeds/5236679128172526782/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://notepad2.blogspot.com/2023/02/setup-neovim-and-lazyvim.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2174891197290154044/posts/default/5236679128172526782'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2174891197290154044/posts/default/5236679128172526782'/><link rel='alternate' type='text/html' href='http://notepad2.blogspot.com/2023/02/setup-neovim-and-lazyvim.html' title='Setup Neovim and LazyVim'/><author><name>WXL</name><uri>http://www.blogger.com/profile/18374533961873126421</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2174891197290154044.post-4983177927086304407</id><published>2023-02-21T02:02:00.002-08:00</published><updated>2023-02-21T02:02:20.640-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="hints"/><category scheme="http://www.blogger.com/atom/ns#" term="neovim"/><category scheme="http://www.blogger.com/atom/ns#" term="tips"/><category scheme="http://www.blogger.com/atom/ns#" term="vim"/><title type='text'>My favourite VIM/Neovim colorschemes</title><content type='html'>&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/EdenEast/nightfox.nvim&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;Nightfox (dark &amp; light)&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/NLKNguyen/papercolor-theme&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;PaperColor (light &amp; dark)&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/morhetz/gruvbox&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;gruvbox (dark &amp; light)&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/jsit/toast.vim&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;toast (light &amp; dark)&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/joshdick/onedark.vim&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;onedark (dark)&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br&gt;&lt;br&gt;&lt;br&gt;
&lt;h3&gt;See also&lt;/h3&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://vimcolorschemes.com/top&quot;&gt;https://vimcolorschemes.com/top&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content><link rel='replies' type='application/atom+xml' href='http://notepad2.blogspot.com/feeds/4983177927086304407/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://notepad2.blogspot.com/2023/02/my-favourite-vimneovim-colorschemes.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2174891197290154044/posts/default/4983177927086304407'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2174891197290154044/posts/default/4983177927086304407'/><link rel='alternate' type='text/html' href='http://notepad2.blogspot.com/2023/02/my-favourite-vimneovim-colorschemes.html' title='My favourite VIM/Neovim colorschemes'/><author><name>WXL</name><uri>http://www.blogger.com/profile/18374533961873126421</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2174891197290154044.post-7446471800944202537</id><published>2023-02-17T01:34:00.000-08:00</published><updated>2023-02-17T01:34:00.992-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="hints"/><category scheme="http://www.blogger.com/atom/ns#" term="mac"/><category scheme="http://www.blogger.com/atom/ns#" term="tips"/><title type='text'>Mac OS: fix duplicated Open With entries</title><content type='html'>&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain user;killall Finder;echo &quot;Open With has been rebuilt, Finder will relaunch&quot;&lt;/code&gt;&lt;/pre&gt;
&lt;br&gt;&lt;br&gt;&lt;br&gt;
&lt;h3&gt;see also&lt;/h3&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://osxdaily.com/2013/01/22/fix-open-with-menu-mac-os-x/&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;Remove Duplicates from the “Open With” Right-Click Menu in Mac OS X&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content><link rel='replies' type='application/atom+xml' href='http://notepad2.blogspot.com/feeds/7446471800944202537/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://notepad2.blogspot.com/2023/02/mac-os-fix-duplicated-open-with-entries.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2174891197290154044/posts/default/7446471800944202537'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2174891197290154044/posts/default/7446471800944202537'/><link rel='alternate' type='text/html' href='http://notepad2.blogspot.com/2023/02/mac-os-fix-duplicated-open-with-entries.html' title='Mac OS: fix duplicated Open With entries'/><author><name>WXL</name><uri>http://www.blogger.com/profile/18374533961873126421</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2174891197290154044.post-6057843815171061536</id><published>2023-02-16T22:44:00.004-08:00</published><updated>2023-02-16T22:56:42.105-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="hints"/><category scheme="http://www.blogger.com/atom/ns#" term="neovide"/><category scheme="http://www.blogger.com/atom/ns#" term="neovim"/><category scheme="http://www.blogger.com/atom/ns#" term="tips"/><title type='text'>Compile Neovide from source on Mac OS</title><content type='html'>&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.rust-lang.org/tools/install&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;Install the latest version of Rust.&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;Install CMake. Using homebrew: &lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;brew install cmake&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
  &lt;li&gt;Check out the source code: &lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;git clone https://github.com/neovide/neovide&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
  &lt;li&gt;Compile and install the binary: &lt;b&gt;neovide&lt;/b&gt; into &lt;b&gt;~/.cargo/bin&lt;/b&gt;:&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;cd neovide
cargo install --path .&lt;/code&gt;&lt;/pre&gt;The resulting binary is to be found under ~/.cargo/bin.&lt;/li&gt;
  &lt;li&gt;In case you want a nice application bundle:&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;cargo install cargo-bundle
cargo bundle --release&lt;/code&gt;&lt;/pre&gt;Copy ./target/release/bundle/osx/neovide.app to ~/Applications and enjoy.&lt;/li&gt;
&lt;/ul&gt;
&lt;br&gt;&lt;br&gt;&lt;br&gt;
&lt;h3&gt;See also&lt;/h3&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://neovide.dev/installation.html&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;Neovide Installation&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content><link rel='replies' type='application/atom+xml' href='http://notepad2.blogspot.com/feeds/6057843815171061536/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://notepad2.blogspot.com/2023/02/compile-neovide-from-source-on-mac-os.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2174891197290154044/posts/default/6057843815171061536'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2174891197290154044/posts/default/6057843815171061536'/><link rel='alternate' type='text/html' href='http://notepad2.blogspot.com/2023/02/compile-neovide-from-source-on-mac-os.html' title='Compile Neovide from source on Mac OS'/><author><name>WXL</name><uri>http://www.blogger.com/profile/18374533961873126421</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2174891197290154044.post-1621638001163170938</id><published>2023-02-16T04:07:00.008-08:00</published><updated>2023-02-19T14:36:57.559-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="hints"/><category scheme="http://www.blogger.com/atom/ns#" term="neovim"/><category scheme="http://www.blogger.com/atom/ns#" term="tips"/><title type='text'>NeoVim: Clean Up Everything (Config, Plugins, Cache ...)</title><content type='html'>&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# linux/macos (unix)
rm -rf ~/.config/nvim
rm -rf ~/.local/share/nvim
rm -rf ~/.local/state/nvim
rm -rf ~/.cache/nvim
&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;
# windows
rd -r ~\AppData\Local\nvim
rd -r ~\AppData\Local\nvim-data
&lt;/code&gt;&lt;/pre&gt;
&lt;br&gt;&lt;br&gt;&lt;br&gt;
&lt;h3&gt;see also&lt;/h3&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://nvchad.com/quickstart/install&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;NvChad Install/Uninstall&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://astronvim.github.io/#%EF%B8%8F-installation&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;AstroNvim Installation&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content><link rel='replies' type='application/atom+xml' href='http://notepad2.blogspot.com/feeds/1621638001163170938/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://notepad2.blogspot.com/2023/02/neovim-clean-up-everything-config.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2174891197290154044/posts/default/1621638001163170938'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2174891197290154044/posts/default/1621638001163170938'/><link rel='alternate' type='text/html' href='http://notepad2.blogspot.com/2023/02/neovim-clean-up-everything-config.html' title='NeoVim: Clean Up Everything (Config, Plugins, Cache ...)'/><author><name>WXL</name><uri>http://www.blogger.com/profile/18374533961873126421</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2174891197290154044.post-1174540516536242062</id><published>2023-02-15T13:58:00.003-08:00</published><updated>2023-02-15T14:28:25.841-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="brew"/><category scheme="http://www.blogger.com/atom/ns#" term="grep"/><category scheme="http://www.blogger.com/atom/ns#" term="hints"/><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><category scheme="http://www.blogger.com/atom/ns#" term="mac"/><category scheme="http://www.blogger.com/atom/ns#" term="tips"/><title type='text'>Use GNU grep to count the length of substring between two words</title><content type='html'>&lt;b&gt;Note:&lt;/b&gt; the command below requires GNU grep, it is available on Linux by default. On Mac OS, you need to install it manually using &lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;brew install grep&lt;/code&gt;&lt;/pre&gt; and command is called &lt;b&gt;ggrep&lt;/b&gt; instead of &lt;b&gt;grep&lt;/b&gt;.
&lt;br&gt;&lt;br&gt;&lt;br&gt;

&lt;h3&gt;Get the substring between two words&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;echo &quot;&amp;lt;person&amp;gt;&amp;lt;name&amp;gt;abc&amp;lt;/name&amp;gt;&amp;lt;/person&amp;gt;&quot; | grep -o -P &#39;(?&amp;lt;=&amp;lt;name&amp;gt;).*(?=&amp;lt;/name&amp;gt;)&#39;&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;
Output should be:
&lt;pre&gt;abc&lt;/pre&gt;
&lt;br&gt;&lt;br&gt;&lt;br&gt;
&lt;h3&gt;Count the length of substring&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;echo &quot;&amp;lt;person&amp;gt;&amp;lt;name&amp;gt;abc&amp;lt;/name&amp;gt;&amp;lt;/person&amp;gt;&quot; | grep -o -P &#39;(?&amp;lt;=&amp;lt;name&amp;gt;).*(?=&amp;lt;/name&amp;gt;)&#39; | wc -c&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;
Output should be:
&lt;pre&gt;3&lt;/pre&gt;
&lt;h3&gt;Count substring lengths for each line&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;cat multi-lines.txt | while read line; do echo $line | grep -o -P &#39;(?&amp;lt;=&amp;lt;name&amp;gt;).*(?=&amp;lt;/name&amp;gt;)&#39; | wc -c; done&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;
&lt;br&gt;&lt;br&gt;&lt;br&gt;
&lt;h3&gt;see also&lt;/h3&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://stackoverflow.com/questions/13242469/how-to-use-sed-grep-to-extract-text-between-two-words&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;How to use sed/grep to extract text between two words?&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://apple.stackexchange.com/questions/193288/how-to-install-and-use-gnu-grep-in-macos&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;How to install and use GNU Grep in macOS&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</content><link rel='replies' type='application/atom+xml' href='http://notepad2.blogspot.com/feeds/1174540516536242062/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://notepad2.blogspot.com/2023/02/use-gnu-grep-to-count-length-of.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2174891197290154044/posts/default/1174540516536242062'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2174891197290154044/posts/default/1174540516536242062'/><link rel='alternate' type='text/html' href='http://notepad2.blogspot.com/2023/02/use-gnu-grep-to-count-length-of.html' title='Use GNU grep to count the length of substring between two words'/><author><name>WXL</name><uri>http://www.blogger.com/profile/18374533961873126421</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2174891197290154044.post-4286454229026232663</id><published>2023-02-15T13:44:00.000-08:00</published><updated>2023-02-15T13:44:02.221-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="admin"/><category scheme="http://www.blogger.com/atom/ns#" term="grep"/><category scheme="http://www.blogger.com/atom/ns#" term="hints"/><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><category scheme="http://www.blogger.com/atom/ns#" term="mac"/><category scheme="http://www.blogger.com/atom/ns#" term="tips"/><title type='text'>Use grep to count number of occurs of a specific element in a single line XML text</title><content type='html'>For example, I can input.txt below, three lines of XML text, I want to count the number of &lt;b&gt;id&lt;/b&gt; elements for each line:
&lt;pre&gt;&amp;lt;result&amp;gt;&amp;lt;id&amp;gt;1&amp;lt;/id&amp;gt;&amp;lt;id&amp;gt;5&amp;lt;/id&amp;gt;&amp;lt;id&amp;gt;7&amp;lt;/id&amp;gt;&amp;lt;/result&amp;gt;
&amp;lt;result&amp;gt;&amp;lt;id&amp;gt;71&amp;lt;/id&amp;gt;&amp;lt;/result&amp;gt;
&amp;lt;result&amp;gt;&amp;lt;id&amp;gt;15&amp;lt;/id&amp;gt;&amp;lt;id&amp;gt;33&amp;lt;/id&amp;gt;&amp;lt;/result&amp;gt;
&lt;/pre&gt;
&lt;br&gt;&lt;br&gt;&lt;br&gt;
I use &lt;b&gt;grep -o&lt;/b&gt;:
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;cat input.txt | while read line; do echo $line | grep -o &#39;&amp;lt;id&amp;gt;&#39; | wc -l; done&lt;/code&gt;&lt;/pre&gt;
&lt;br&gt;&lt;br&gt;&lt;br&gt;
The output should be:
&lt;pre&gt;3
1
2
&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://notepad2.blogspot.com/feeds/4286454229026232663/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://notepad2.blogspot.com/2023/02/use-grep-to-count-number-of-occurs-of.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2174891197290154044/posts/default/4286454229026232663'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2174891197290154044/posts/default/4286454229026232663'/><link rel='alternate' type='text/html' href='http://notepad2.blogspot.com/2023/02/use-grep-to-count-number-of-occurs-of.html' title='Use grep to count number of occurs of a specific element in a single line XML text'/><author><name>WXL</name><uri>http://www.blogger.com/profile/18374533961873126421</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2174891197290154044.post-3545444717480435124</id><published>2023-02-08T14:05:00.004-08:00</published><updated>2023-02-08T14:05:25.200-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="develop"/><category scheme="http://www.blogger.com/atom/ns#" term="hints"/><category scheme="http://www.blogger.com/atom/ns#" term="regex"/><category scheme="http://www.blogger.com/atom/ns#" term="rust"/><category scheme="http://www.blogger.com/atom/ns#" term="tips"/><title type='text'>Regular Expression Capture Groups</title><content type='html'>&lt;ul&gt;
&lt;li&gt;Capture groups:
&lt;pre&gt;&lt;code class=&quot;language-rust&quot;&gt;
use regex::Regex;

let re = Regex::new(r&quot;(\w+)&quot;).unwrap();
let text = &quot;Hello world&quot;;

for cap in re.captures_iter(text) {
    println!(&quot;Match: {}&quot;, &amp;amp;cap[1]);
}
&lt;/code&gt;
&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;Named capture groups:
&lt;pre&gt;&lt;code class=&quot;language-rust&quot;&gt;
use regex::Regex;

let re = Regex::new(r&quot;(?&amp;lt;word&amp;gt;\w+)&quot;).unwrap();
let text = &quot;Hello world&quot;;

for cap in re.captures_iter(text) {
    println!(&quot;Match: {}&quot;, &amp;amp;cap[&quot;word&quot;]);
}
&lt;/code&gt;
&lt;/pre&gt;
&lt;/li&gt;&lt;/ul&gt;</content><link rel='replies' type='application/atom+xml' href='http://notepad2.blogspot.com/feeds/3545444717480435124/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://notepad2.blogspot.com/2023/02/regular-expression-capture-groups.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2174891197290154044/posts/default/3545444717480435124'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2174891197290154044/posts/default/3545444717480435124'/><link rel='alternate' type='text/html' href='http://notepad2.blogspot.com/2023/02/regular-expression-capture-groups.html' title='Regular Expression Capture Groups'/><author><name>WXL</name><uri>http://www.blogger.com/profile/18374533961873126421</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2174891197290154044.post-3215724550625607494</id><published>2023-02-02T23:03:00.006-08:00</published><updated>2023-02-02T23:12:51.981-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="admin"/><category scheme="http://www.blogger.com/atom/ns#" term="blogger"/><category scheme="http://www.blogger.com/atom/ns#" term="develop"/><category scheme="http://www.blogger.com/atom/ns#" term="hints"/><category scheme="http://www.blogger.com/atom/ns#" term="html"/><category scheme="http://www.blogger.com/atom/ns#" term="javascript"/><category scheme="http://www.blogger.com/atom/ns#" term="tips"/><title type='text'>Enable code syntax highlighting in blogger site using highlightjs</title><content type='html'>&lt;ul&gt;
  &lt;li&gt;&lt;b&gt;Template&lt;/b&gt; -&amp;gt; &lt;b&gt;Edit HTML&lt;/b&gt;&lt;/li&gt;
  &lt;li&gt;Insert the following inside &amp;lt;head&amp;gt; tag:
    &lt;pre&gt;    &lt;code class=&quot;language-html&quot;&gt;
    &amp;lt;!-- BEGIN: Syntax Highlighting with highlight.js --&amp;gt;
    &amp;lt;link crossorigin=&#39;anonymous&#39; href=&#39;https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.7.0/styles/agate.min.css&#39; integrity=&#39;sha512-wI7oXtzNHj/bqfLA3P6x3XYbcwzsnIKaPLfjjX8ZAXhc65+kSI6sh8gLOOByOKImokAjHUQR0xAJQ/xZTzwuOA==&#39; referrerpolicy=&#39;no-referrer&#39; rel=&#39;stylesheet&#39;/&amp;gt;
    &amp;lt;script crossorigin=&#39;anonymous&#39; integrity=&#39;sha512-bgHRAiTjGrzHzLyKOnpFvaEpGzJet3z4tZnXGjpsCcqOnAH6VGUx9frc5bcIhKTVLEiCO6vEhNAgx5jtLUYrfA==&#39; referrerpolicy=&#39;no-referrer&#39; src=&#39;https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.7.0/highlight.min.js&#39;/&amp;gt;
    &amp;lt;script&amp;gt;hljs.highlightAll();&amp;lt;/script&amp;gt;
    &amp;lt;!-- END: Syntax Highlighting with highlight.js --&amp;gt;
    &amp;lt;!-- BEGIN: CSS for code in pre and code --&amp;gt;
    &amp;lt;style type=&#39;text/css&#39;&amp;gt;
        pre {
            font-family: monospace;
            font-size: 1 em;
            background: #333;
            color: #33cc33;
            tab-size: 4;
            padding: 5px;
            border: 1px dotted grey;
            border-radius: 5px;
            line-height: 2.0;
            overflow-x: auto;
            white-space: pre-wrap;
        }

        code {
            white-space: pre-wrap;
            overflow-x: scroll;    
            font-family: monospace;
            font-size: 1em;
        }
    &amp;lt;/style&amp;gt;
    &amp;lt;!-- END: CSS for code in pre and code --&amp;gt;
    &lt;/code&gt;
    &lt;/pre&gt;
  &lt;/li&gt;
  &lt;li&gt;Click save icon to save the template&lt;/li&gt;
  &lt;li&gt;Use it in your blog post:
    &lt;pre&gt;&lt;code class=&quot;language-plaintext&quot;&gt;&amp;lt;pre&amp;gt;&amp;lt;code class=&quot;language-html&quot;&amp;gt;...&amp;lt;/code&amp;gt;&amp;lt;/pre&amp;gt;&lt;/code&gt;&lt;/pre&gt;
    &lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
&lt;h3&gt;See also&lt;/h3&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://highlightjs.org/usage/&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;How to use highlightjs?&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.w3schools.com/tags/att_script_integrity.asp&quot; rel=&quot;nofollow&quot;&gt;What is &lt;b&gt;integrity&lt;/b&gt; attribute for script and link tags in HTML?&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.srihash.org/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;How to generate SRI(Subresource Integrity) hash?&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content><link rel='replies' type='application/atom+xml' href='http://notepad2.blogspot.com/feeds/3215724550625607494/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://notepad2.blogspot.com/2023/02/enable-code-syntax-highlighting-in.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2174891197290154044/posts/default/3215724550625607494'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2174891197290154044/posts/default/3215724550625607494'/><link rel='alternate' type='text/html' href='http://notepad2.blogspot.com/2023/02/enable-code-syntax-highlighting-in.html' title='Enable code syntax highlighting in blogger site using highlightjs'/><author><name>WXL</name><uri>http://www.blogger.com/profile/18374533961873126421</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2174891197290154044.post-1105737838558074534</id><published>2023-01-26T17:34:00.009-08:00</published><updated>2023-02-02T19:08:51.184-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="AstroNvim"/><category scheme="http://www.blogger.com/atom/ns#" term="hints"/><category scheme="http://www.blogger.com/atom/ns#" term="neovim"/><category scheme="http://www.blogger.com/atom/ns#" term="tips"/><category scheme="http://www.blogger.com/atom/ns#" term="vim"/><title type='text'>Customize AstroNvim</title><content type='html'>&lt;h3&gt;Enable user customisation&lt;/h3&gt;
&lt;pre&gt;cp -r ~/.config/nvim/lua/user_example ~/.config/nvim/lua/user&lt;/pre&gt;
&lt;br&gt;&lt;br&gt;&lt;br&gt;
&lt;h3&gt;Install new plugins&lt;/h3&gt;
&lt;pre&gt;nvim ~/.config/nvim/lua/user/init.lua&lt;/pre&gt;
&lt;pre&gt;
&lt;code class=&quot;language-plaintext&quot;&gt;
  plugins = {
    init = { 
      -- You can also add new plugins here as well:
      -- Add plugins, the packer syntax without the &quot;use&quot;
      { &quot;bryant-the-coder/astron.nvim&quot; }, -- astron colorscheme
    },
  },
&lt;/code&gt;
&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-plaintext&quot;&gt;:PackerSync&lt;/code&gt;&lt;/pre&gt;
&lt;br&gt;&lt;br&gt;&lt;br&gt;
&lt;h3&gt;Change colorscheme&lt;/h3&gt;
&lt;pre&gt;nvim ~/.config/nvim/lua/user/init.lua&lt;/pre&gt;
&lt;pre&gt;
 -- Set colorscheme to use
 -- colorscheme = &quot;default_theme&quot;,
 colorscheme = &quot;astron&quot;,
&lt;/pre&gt;
&lt;br&gt;&lt;br&gt;&lt;br&gt;
&lt;h3&gt;Disable relativenumber option&lt;/h3&gt;
&lt;pre&gt;nvim ~/.config/nvim/lua/user/init.lua&lt;/pre&gt;
&lt;pre&gt;relativenumber = false,&lt;/pre&gt;
&lt;br&gt;&lt;br&gt;&lt;br&gt;
&lt;h3&gt;See also&lt;/h3&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://vi.stackexchange.com/questions/38519/add-a-custom-plugin-to-astrovim&quot;&gt;Add custome plugin to AstroNvim&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content><link rel='replies' type='application/atom+xml' href='http://notepad2.blogspot.com/feeds/1105737838558074534/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://notepad2.blogspot.com/2023/01/customize-astronvim.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2174891197290154044/posts/default/1105737838558074534'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2174891197290154044/posts/default/1105737838558074534'/><link rel='alternate' type='text/html' href='http://notepad2.blogspot.com/2023/01/customize-astronvim.html' title='Customize AstroNvim'/><author><name>WXL</name><uri>http://www.blogger.com/profile/18374533961873126421</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2174891197290154044.post-4176173359491506152</id><published>2023-01-24T16:47:00.011-08:00</published><updated>2023-02-16T04:04:28.043-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="develop"/><category scheme="http://www.blogger.com/atom/ns#" term="editor"/><category scheme="http://www.blogger.com/atom/ns#" term="neovim"/><category scheme="http://www.blogger.com/atom/ns#" term="rust"/><category scheme="http://www.blogger.com/atom/ns#" term="tips"/><category scheme="http://www.blogger.com/atom/ns#" term="vim"/><title type='text'>Setup Neovim for Rust Development</title><content type='html'>&lt;ol&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/neovim/neovim/wiki/Installing-Neovim&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;Install Neovim&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://astronvim.github.io/&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;Install AstroNvim&lt;/a&gt;
    &lt;ul&gt;
      &lt;li&gt;After installed AstroNvim, you can &lt;a href=&quot;http://notepad2.blogspot.com/2023/01/customize-astronvim.html&quot;&gt;customise&lt;/a&gt; it&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Install rust LSP&lt;br/&gt;In Neovim, execute command: &lt;pre&gt;:LspInstall rust&lt;/pre&gt;&lt;/li&gt;
  &lt;li&gt;Install rust language parser (tree-sitter)&lt;br/&gt;In Neovim, execute command: &lt;pre&gt;:TSInstall rust&lt;/pre&gt;&lt;/li&gt;
  &lt;li&gt;Install lua language parser (tree-sitter)&lt;br/&gt;In Neovim, execute command: &lt;pre&gt;:TSInstall lua&lt;/pre&gt; This is useful for editting the Neovim config (lua) files (*.lua)&lt;/li&gt;
&lt;/ol&gt;
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;
&lt;h3&gt;See also&lt;/h3&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=vdn_pKJUda8&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;[Video] How I configure Neovim on my Mac to make it amazing&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://astronvim.github.io/&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;Get started with AstroNvim&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://rusty-ferris.pages.dev/blog/using-nvim-for-rust-development/&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;Using Neovim for Rust Development&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://rsdlt.github.io/posts/rust-nvim-ide-guide-walkthrough-development-debug/&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;Rust and Neovim - A Thorough Guide and Walkthrough&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://nvchad.com/quickstart/install&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;NvChad Install&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content><link rel='replies' type='application/atom+xml' href='http://notepad2.blogspot.com/feeds/4176173359491506152/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://notepad2.blogspot.com/2023/01/setup-neovim-for-rust-development.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2174891197290154044/posts/default/4176173359491506152'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2174891197290154044/posts/default/4176173359491506152'/><link rel='alternate' type='text/html' href='http://notepad2.blogspot.com/2023/01/setup-neovim-for-rust-development.html' title='Setup Neovim for Rust Development'/><author><name>WXL</name><uri>http://www.blogger.com/profile/18374533961873126421</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>