<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.10.0">Jekyll</generator><link href="https://spacewalker162.github.io//feed.xml" rel="self" type="application/atom+xml" /><link href="https://spacewalker162.github.io//" rel="alternate" type="text/html" /><updated>2025-03-31T02:30:00+02:00</updated><id>https://spacewalker162.github.io//feed.xml</id><title type="html">Yufei Zhou</title><subtitle>Researcher in Space &amp; Plasma Physics</subtitle><author><name>yufei</name><email>yufei.zhou@hit.edu.cn; hgjd162@gmail.com</email></author><entry><title type="html">Sync Between My Laptop and Desktop</title><link href="https://spacewalker162.github.io//posts/2024/joifwjhfwiwfd" rel="alternate" type="text/html" title="Sync Between My Laptop and Desktop" /><published>2024-10-25T00:00:00+02:00</published><updated>2024-10-25T00:00:00+02:00</updated><id>https://spacewalker162.github.io//posts/2024/syncThings</id><content type="html" xml:base="https://spacewalker162.github.io//posts/2024/joifwjhfwiwfd"><![CDATA[<p>Some notes on remote access.
<!--more--></p>

<h2 id="introduction">Introduction</h2>
<p>Since I am working with an increasing number of computers, it is increasingly
important to efficiently transfer/sync files and applications/programs across
this network of computers.</p>

<p>Previously I used my laptop as the major computer for daily work, including
searching, reading, researching, writing and so on. Heavy computational work
is assigned to several desktops in my lab. A large database is attached to the
local network in the lab to facilitate fast access and analysis of data.
Occasionally, I also do some light data analysis on my laptop.</p>

<p>In this scenario, common programs such as <code class="language-plaintext highlighter-rouge">python</code> (anaconda with some
additional modules), <code class="language-plaintext highlighter-rouge">vim</code> and <code class="language-plaintext highlighter-rouge">tmux</code> are installed on these computers. SSH is used
for remote control and occasional transfer of files. <code class="language-plaintext highlighter-rouge">git</code> is used for syncing
scripts. <code class="language-plaintext highlighter-rouge">rsync</code> is used to transfer large amount of files.</p>

<p>Recently I have bought a new desktop for my home so I have a large screen
to view images (why not TV screen?). Therefore, I prefer the
desktop over the laptop at home. However, when not at home I need to use the laptop. Here comes a need for syncing between these two computers. The ideal solution is very simple, thanks to them both being with MacOS, which is to use <code class="language-plaintext highlighter-rouge">icloud</code> synchronization. Yet given the limited funding and the readily available large storage in the lab, I am using <a href="https://syncthing.net">syncthing</a> to make the storage in lab a cloud storage node/server and syncing from it to my laptop and desktop at home.</p>]]></content><author><name>yufei</name><email>yufei.zhou@hit.edu.cn; hgjd162@gmail.com</email></author><category term="web-dev" /><summary type="html"><![CDATA[Some notes on remote access.]]></summary></entry><entry><title type="html">Remote Access</title><link href="https://spacewalker162.github.io//posts/2024/fowpkfwijf" rel="alternate" type="text/html" title="Remote Access" /><published>2024-06-10T00:00:00+02:00</published><updated>2024-06-10T00:00:00+02:00</updated><id>https://spacewalker162.github.io//posts/2024/RemoteAccess</id><content type="html" xml:base="https://spacewalker162.github.io//posts/2024/fowpkfwijf"><![CDATA[<p>Some notes on remote access.
<!--more--></p>

<h2 id="samba">samba</h2>
<p>Samba can be used to share file systems.</p>

<h1 id="server-setup">Server Setup</h1>
<p>To set up samba service on a Linux machine, follow
<a href="https://adrianmejia.com/how-to-set-up-samba-in-ubuntu-linux-and-access-it-in-mac-os-and-windows/">this</a></p>

<h1 id="mount-on-linux">Mount on Linux</h1>
<p>If the samba service has setting <code class="language-plaintext highlighter-rouge">public = yes</code>, we can access it as guest. To do so, option <code class="language-plaintext highlighter-rouge">guest</code> is used. In case of using <code class="language-plaintext highlighter-rouge">/etc/fstab</code> for mounting, it requires <code class="language-plaintext highlighter-rouge">sudo</code> which set the owner of the mounted file system <code class="language-plaintext highlighter-rouge">root</code>. To assign an desired user as the owner, use option <code class="language-plaintext highlighter-rouge">uid</code>. Therefore, add this line to <code class="language-plaintext highlighter-rouge">/etc/fstab</code></p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>//server/pub    /home/yufei/Documents/remoteDatabase    cifs    guest,uid=&lt;your-uid&gt;    0   0
</code></pre></div></div>

<p>where <code class="language-plaintext highlighter-rouge">&lt;your-uid&gt;</code> should be replaced by the intended owner’s <code class="language-plaintext highlighter-rouge">uid</code>, which can be obtained through <code class="language-plaintext highlighter-rouge">id &lt;username&gt;</code>.</p>

<p>The file systems specified in <code class="language-plaintext highlighter-rouge">/etc/fstab</code> will be mounted upon computer
boot</p>

<p>They can also be mounted manually through commands like</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>mount /home/yufei/Documents/remoteDatabase
</code></pre></div></div>

<h1 id="mount-on-macos">Mount on MacOS</h1>
<p>To mount as a guest user, add this line to <code class="language-plaintext highlighter-rouge">/etc/fstab</code></p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>//guest@server/pub    /home/yufei/Documents/remoteDatabase    smbfs    automounted    0   0
</code></pre></div></div>

<p>To mount an other intended username on the samba server, use</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>//username@server/pub    /home/yufei/Documents/remoteDatabase    smbfs    automounted    0   0
</code></pre></div></div>

<p>Since <code class="language-plaintext highlighter-rouge">mount_smbfs</code> on MacOS does not provide the option <code class="language-plaintext highlighter-rouge">uid</code>, to make <code class="language-plaintext highlighter-rouge">yufei</code> the intended owner, we need to run</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo -u yufei mount /home/yufei/Documents/remoteDatabase
</code></pre></div></div>

<h2 id="ssh">SSH</h2>
<p>to-do</p>]]></content><author><name>yufei</name><email>yufei.zhou@hit.edu.cn; hgjd162@gmail.com</email></author><category term="web-dev" /><summary type="html"><![CDATA[Some notes on remote access.]]></summary></entry><entry><title type="html">Softwares I use for productivity</title><link href="https://spacewalker162.github.io//posts/2024/fjiwokwf" rel="alternate" type="text/html" title="Softwares I use for productivity" /><published>2024-06-06T00:00:00+02:00</published><updated>2024-06-06T00:00:00+02:00</updated><id>https://spacewalker162.github.io//posts/2024/softwares_I_use</id><content type="html" xml:base="https://spacewalker162.github.io//posts/2024/fjiwokwf"><![CDATA[<!--more-->

<h2 id="remote-working">Remote Working</h2>
<p>#<code class="language-plaintext highlighter-rouge">ssh</code></p>

<p>#<code class="language-plaintext highlighter-rouge">samba</code>
for data sharing and retrieving</p>

<h2 id="data-analysis">Data Analysis</h2>
<p><code class="language-plaintext highlighter-rouge">python</code></p>

<h2 id="analytical-analysis">Analytical Analysis</h2>
<p><code class="language-plaintext highlighter-rouge">mathematica</code></p>

<h2 id="text">Text</h2>
<p>#<code class="language-plaintext highlighter-rouge">vim</code>
an editor, with plugins including <code class="language-plaintext highlighter-rouge">YouCompleteMe</code></p>

<p>#<code class="language-plaintext highlighter-rouge">latex</code>
for typesetting</p>

<h2 id="terminal-tools">Terminal Tools</h2>
<p>#<code class="language-plaintext highlighter-rouge">fzf</code>
    a general-purpose command-line fuzzy finder. Check its <a href="https://github.com/junegunn/fzf?tab=readme-ov-file">github page</a>.</p>

<p>#<code class="language-plaintext highlighter-rouge">bat</code>
    better version of <code class="language-plaintext highlighter-rouge">cat</code></p>]]></content><author><name>yufei</name><email>yufei.zhou@hit.edu.cn; hgjd162@gmail.com</email></author><category term="softwares" /><summary type="html"><![CDATA[]]></summary></entry><entry><title type="html">Powerline fonts</title><link href="https://spacewalker162.github.io//posts/2024/mnfkwifr" rel="alternate" type="text/html" title="Powerline fonts" /><published>2024-06-03T00:00:00+02:00</published><updated>2024-06-03T00:00:00+02:00</updated><id>https://spacewalker162.github.io//posts/2024/powerline-for-vim</id><content type="html" xml:base="https://spacewalker162.github.io//posts/2024/mnfkwifr"><![CDATA[<p>Powerline is a beautiful plugin for vim. Similar theme is also available for tmux. To have them, it is also necessary to install the <a href="https://github.com/powerline/fonts?tab=readme-ov-file">fonts</a>, which is omitted by other blogs most of the time.
<!--more--></p>]]></content><author><name>yufei</name><email>yufei.zhou@hit.edu.cn; hgjd162@gmail.com</email></author><category term="vim" /><category term="powerline" /><summary type="html"><![CDATA[Powerline is a beautiful plugin for vim. Similar theme is also available for tmux. To have them, it is also necessary to install the fonts, which is omitted by other blogs most of the time.]]></summary></entry><entry><title type="html">About Apple Products</title><link href="https://spacewalker162.github.io//posts/2023/AAP" rel="alternate" type="text/html" title="About Apple Products" /><published>2023-11-27T00:00:00+01:00</published><updated>2023-11-27T00:00:00+01:00</updated><id>https://spacewalker162.github.io//posts/2023/appleProducts</id><content type="html" xml:base="https://spacewalker162.github.io//posts/2023/AAP"><![CDATA[<p>I have been using apple products for several years. Here I present some notes about them.
<!--more--></p>
<h2 id="universal-clipboard">Universal Clipboard</h2>
<p>This function is amazing for it allows me to copy something on one device, such
as iphone, ipad, or mac, and paste it on another. My ipad, due to some unknown
reason, fail to connect to my iphone and mac. I solve this issue when it
occurs by restart the ipad.</p>]]></content><author><name>yufei</name><email>yufei.zhou@hit.edu.cn; hgjd162@gmail.com</email></author><category term="apple" /><category term="software" /><summary type="html"><![CDATA[I have been using apple products for several years. Here I present some notes about them.]]></summary></entry><entry><title type="html">Meeting Requirements by Journals – Some Tips</title><link href="https://spacewalker162.github.io//posts/2023/MRBJST" rel="alternate" type="text/html" title="Meeting Requirements by Journals – Some Tips" /><published>2023-11-21T00:00:00+01:00</published><updated>2023-11-21T00:00:00+01:00</updated><id>https://spacewalker162.github.io//posts/2023/meetingRequirementsOfJournals</id><content type="html" xml:base="https://spacewalker162.github.io//posts/2023/MRBJST"><![CDATA[<p>In publication of scientific papers, different journals have various requirements. Here I list some tips regarding the problem I have encountered.
<!--more--></p>
<h2 id="introduction">Introduction</h2>
<p>The following tips can be programmed. For example, I have written a script file <code class="language-plaintext highlighter-rouge">publicationTools.py</code> to incorporate the utilities to tackle the problems.</p>

<h2 id="tex-file-should-not-contain-private-macro">Tex file should not contain private macro</h2>
<p>Journals such as <em>Annales Geophysicae</em> require the submitted tex file only contain macros defined by the journal. The program <code class="language-plaintext highlighter-rouge">de-macro</code>, which is a part of texlive, come in handy. To use it, follow</p>

<ol>
  <li>
    <p>dump all private macros in a file named as <code class="language-plaintext highlighter-rouge">&lt;defs-file&gt;-private</code> where <code class="language-plaintext highlighter-rouge">&lt;defs-file&gt;</code> represents a string you can choose as you wish. Remember to put <code class="language-plaintext highlighter-rouge">\usepackage{&lt;defs-file&gt;-private}</code> in the preamble of tex file.</p>
  </li>
  <li>
    <p>run</p>

    <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code> de-macro with_private_macro.tex
</code></pre></div>    </div>
  </li>
</ol>

<h2 id="typing-abstract-and-figure-and-table-captions-into-some-submission-portal">Typing abstract and figure and table captions into some submission portal</h2>
<p>In submission, journals usually require this while tex code should be replaced
with some form of code defined by the journal. For example, Nature series journals represent italic text with <code class="language-plaintext highlighter-rouge">&lt;i&gt;text&lt;\i&gt;</code> and subscript with <code class="language-plaintext highlighter-rouge">R&lt;sub&gt;E&lt;\sub&gt;</code>.</p>

<p>To transform systematically tex code into these journal-specific code, one can
use pandoc. In the case of Nature journals, we can use</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>pandoc --from latex --to html4 --no-highlight input.tex
</code></pre></div></div>

<p>followed by some additional translations such as from <code class="language-plaintext highlighter-rouge">&lt;em&gt;</code> to <code class="language-plaintext highlighter-rouge">&lt;i&gt;</code>.</p>]]></content><author><name>yufei</name><email>yufei.zhou@hit.edu.cn; hgjd162@gmail.com</email></author><category term="web-dev" /><summary type="html"><![CDATA[In publication of scientific papers, different journals have various requirements. Here I list some tips regarding the problem I have encountered.]]></summary></entry><entry><title type="html">A story about purchasing fishes.</title><link href="https://spacewalker162.github.io//posts/2023/asabf" rel="alternate" type="text/html" title="A story about purchasing fishes." /><published>2023-08-31T00:00:00+02:00</published><updated>2023-08-31T00:00:00+02:00</updated><id>https://spacewalker162.github.io//posts/2023/confucius_buying_fishes</id><content type="html" xml:base="https://spacewalker162.github.io//posts/2023/asabf"><![CDATA[<p>The Master and his disciples visited the fish fair with the intention of acquiring fish.
<!--more-->
The Master said, Today our mission is to purchase fishes. Each of us shall prepare an individual fish. And now let’s engage in a challenge: venture through the fair and purchase the finest fish. Remember, once you pass by a fish, you cannot return to claim those you’ve previously passed over.</p>

<p>Zilu took the lead. He opted to pass by the initial fine fish, trusting in the abundance ahead and anticipating even better options. This mindset guided him until the far end of the fair came into view. Zilu firmly resolved to choose his fish from this concluding stretch, yet with every wallet extraction, he hesitated, the available fish never matching the excellence he had witnessed earlier. Ultimately, he departed empty-handed, reconciling with the pangs of hunger for the day.</p>

<p>Yanhui assumed the second. Having learned the lesson from Zilu, he procured the first fish he encountered and traversed the fair with unwavering commitment.</p>

<p>Charting a distinct course, Zigong, the wealthiest of the disciples, disregarded the prior methods. Upon his return, the Master inquired about his plethora of fish purchases. Zigong’s response was swift: he had acquired all the fishes he deemed of high quality. One would grace his table today, while the rest would find a home in his pond, destined for future feasts.</p>

<p>The fourth entrant to the fair was Zihui, armed with a prowess in mathematics and economics. Drawing from this expertise, he meticulously calculated his optimal <a href="/files/miscellaneous/purchasing_fishes.pdf">strategy</a> to secure the finest fish.</p>]]></content><author><name>yufei</name><email>yufei.zhou@hit.edu.cn; hgjd162@gmail.com</email></author><category term="web-dev" /><summary type="html"><![CDATA[The Master and his disciples visited the fish fair with the intention of acquiring fish.]]></summary></entry><entry><title type="html">Push to github</title><link href="https://spacewalker162.github.io//posts/2023/pghjlew" rel="alternate" type="text/html" title="Push to github" /><published>2023-08-05T00:00:00+02:00</published><updated>2023-08-05T00:00:00+02:00</updated><id>https://spacewalker162.github.io//posts/2023/githubPush</id><content type="html" xml:base="https://spacewalker162.github.io//posts/2023/pghjlew"><![CDATA[<p>Problems I encountered when pushing to github.
<!--more--></p>

<h2 id="network-connection">network connection</h2>
<p>error message:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>    Failed to connect to github.com port 443: Timed out
</code></pre></div></div>

<p>The solution is to use proxy:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>    git config --global http.proxy http://127.0.0.1:7890
    git config --global https.proxy http://127.0.0.1:7890
</code></pre></div></div>

<h2 id="https-connection">HTTPS connection</h2>
<p>account password for authentication is no longer supported. To push via https, use a personal access token in place of password when asked to type in. Personal access token can be generated at the website through <code class="language-plaintext highlighter-rouge">settings → developers settings → Personal access tokens (classic) → generate new token</code>.</p>

<h2 id="ssh-connection">SSH connection</h2>
<p>follow the procedure described at https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent</p>]]></content><author><name>yufei</name><email>yufei.zhou@hit.edu.cn; hgjd162@gmail.com</email></author><category term="web-dev" /><summary type="html"><![CDATA[Problems I encountered when pushing to github.]]></summary></entry><entry><title type="html">How to maintain a notebook with Lyx/latex</title><link href="https://spacewalker162.github.io//posts/2023/HMNWLL" rel="alternate" type="text/html" title="How to maintain a notebook with Lyx/latex" /><published>2023-08-05T00:00:00+02:00</published><updated>2023-08-05T00:00:00+02:00</updated><id>https://spacewalker162.github.io//posts/2023/maintainNotes</id><content type="html" xml:base="https://spacewalker162.github.io//posts/2023/HMNWLL"><![CDATA[<p>This post details how I maintain with Lyx/latex my notebook, with each chapter dedicated to a subject of interest.
<!--more--></p>

<h2 id="purpose">Purpose</h2>
<p>The wanted notebook is a pdf file with hyperlinked cross-references and citations. Each chapter has its own bibliography. The maintaining and updating work should be simple and clear. Since my notes on physics and mathematics usually contain a lot of long equations, Lyx is used to visualize these equations for the ease of initial coding and subsequent modifications.</p>

<h2 id="directory-structure">Directory Structure</h2>
<p>The directory structure is shown <a href="/files/miscellaneous/notebook_tree.txt">here</a></p>

<p><code class="language-plaintext highlighter-rouge">zhou.sty</code> contains the definitions I use for almost all works with latex.
<code class="language-plaintext highlighter-rouge">Notes</code> contains all my notebooks, such as <code class="language-plaintext highlighter-rouge">NotesComputerTech</code> and <code class="language-plaintext highlighter-rouge">NotesTheoreticalPhysics</code>.
<code class="language-plaintext highlighter-rouge">/Notes/definitions/myNotes.cls</code> and <code class="language-plaintext highlighter-rouge">/Notes/definitions/myNotes.layout</code> define the layout/documentclass <code class="language-plaintext highlighter-rouge">myNotes</code> which is used for all my notebooks. These two layout/documentclass files are copied to the <code class="language-plaintext highlighter-rouge">layouts</code> in the user directory of Lyx (see in the software <code class="language-plaintext highlighter-rouge">Lyx → about lyx</code>).</p>

<p>Take <code class="language-plaintext highlighter-rouge">NotesTheoreticalPhysics</code> for example. It contains the main <code class="language-plaintext highlighter-rouge">NotesTheoreticalPhysics.lyx</code> file and chapters of <code class="language-plaintext highlighter-rouge">ClassicalMechanics</code>, <code class="language-plaintext highlighter-rouge">Electrodynamics</code>, <code class="language-plaintext highlighter-rouge">FluidMechanics</code>, <code class="language-plaintext highlighter-rouge">PlasmaPhysics</code> and so on. Each chapter contains a main lyx file and the associated <code class="language-plaintext highlighter-rouge">figures</code> and <code class="language-plaintext highlighter-rouge">preamble.txt</code>. The chapter lyx file can run independently to produce a pdf file. In the <code class="language-plaintext highlighter-rouge">NotesTheoreticalPhysics.lyx</code> file, all chapters are included/input.</p>

<p>The <code class="language-plaintext highlighter-rouge">preamble.txt</code> at notebook level input all preambles at chapter level. To generate these preambles automatically, run the python script <code class="language-plaintext highlighter-rouge">preambleConfig.py</code>.</p>

<h2 id="lyx-and-layoutdocumentclass-file">Lyx and layout/documentclass file</h2>
<p>To make the change in layout/documentclass file take effect in Lyx, run in Lyx <code class="language-plaintext highlighter-rouge">tools → reconfigure</code> and restart the software.</p>

<h2 id="bibliography">Bibliography</h2>
<p>By default, <code class="language-plaintext highlighter-rouge">myNotes.cls</code> uses the package <code class="language-plaintext highlighter-rouge">bibunits</code> to divide bibliographies across chapters, with</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>    \bibliographyunit[\chapter]
    \defaultbibliography{/Users/yufei/Documents/MyFiles/myLib}
    \defaultbibliographystyle{plain}
</code></pre></div></div>

<p>hard-coded into the <code class="language-plaintext highlighter-rouge">cls</code> file. To put a bibliography in a chapter, use <code class="language-plaintext highlighter-rouge">\putbib</code>. The native lyx utilities to divide bibliographies should be avoided, as they are broken at large!. 
To make <code class="language-plaintext highlighter-rouge">bibunits</code> work with <code class="language-plaintext highlighter-rouge">hyperref</code>, the code in this <a href="/files/miscellaneous/bibunits_hyperref.txt">file</a> is put in the class file.
Lyx does not work well with <code class="language-plaintext highlighter-rouge">bibunits</code> as it does not automatically run <code class="language-plaintext highlighter-rouge">bibtex</code> on the separate bib files generated by <code class="language-plaintext highlighter-rouge">bibunits</code>. To make it so, the following line is added to the class file.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>    \renewcommand{\@bibunitname}{\jobname.\the\@bibunitauxcnt}
</code></pre></div></div>

<h2 id="texstudio-run">TexStudio run</h2>
<p>In TexStudio automatically run bibtex on bib files generated by
<code class="language-plaintext highlighter-rouge">bibunits</code>, use <code class="language-plaintext highlighter-rouge">latexmk</code> instead of <code class="language-plaintext highlighter-rouge">xelatex</code>. I have modified the <code class="language-plaintext highlighter-rouge">latexmk</code> command to</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>    latexmk -xelatex -silent -synctex=1 -interaction=nonstopmode
</code></pre></div></div>]]></content><author><name>yufei</name><email>yufei.zhou@hit.edu.cn; hgjd162@gmail.com</email></author><category term="web-dev" /><summary type="html"><![CDATA[This post details how I maintain with Lyx/latex my notebook, with each chapter dedicated to a subject of interest.]]></summary></entry><entry><title type="html">A Map of Celestial Bodies in the Solar System</title><link href="https://spacewalker162.github.io//posts/2023/nasaOrbits" rel="alternate" type="text/html" title="A Map of Celestial Bodies in the Solar System" /><published>2023-06-18T00:00:00+02:00</published><updated>2023-06-18T00:00:00+02:00</updated><id>https://spacewalker162.github.io//posts/2023/nasaOrbits</id><content type="html" xml:base="https://spacewalker162.github.io//posts/2023/nasaOrbits"><![CDATA[<p>see <a href="https://solarsystem.nasa.gov/asteroids-comets-and-meteors/overview/">here</a>.
<!--more--></p>]]></content><author><name>yufei</name><email>yufei.zhou@hit.edu.cn; hgjd162@gmail.com</email></author><category term="science" /><summary type="html"><![CDATA[see here.]]></summary></entry></feed>