Jekyll2023-11-04T19:10:34+00:00https://www.beverlyguillermo.com/feed.xmlBeverly GuillermoRamblings.Notes on using lsof2023-11-04T00:00:00+00:002023-11-04T00:00:00+00:00https://www.beverlyguillermo.com/2023/11/04/using-lsof<p>Sometimes you want to know what applications are taking up the ports on your computer, a useful terminal cli too is <code class="language-plaintext highlighter-rouge">lsof</code>.</p>
<p>In the terminal, get instruction information by running <code class="language-plaintext highlighter-rouge">man lsof</code>. You may get the following information depending
on your computer environment.</p>
<blockquote>
<p>Lsof revision 4.91 lists on its standard output file information about files opened by processes for the following UNIX dialects:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Apple Darwin 9 and Mac OS X 10.[567]
FreeBSD 8.[234], 9.0 and 1[012].0 for AMD64-based systems Linux 2.1.72 and above for x86-based systems
Solaris 9, 10 and 11
</code></pre></div> </div>
<p>(See the DISTRIBUTION section of this manual page for information on how to obtain the latest lsof revision.)</p>
<p>An open file may be a regular file, a directory, a block special file, a character special file, an executing text reference, a
library, a stream or a network file (Internet socket, NFS file or UNIX domain socket.) A specific file or all the files in a file
system may be selected by path.</p>
<p>Instead of a formatted display, lsof will produce output that can be parsed by other programs. See the -F, option description,
and the OUTPUT FOR OTHER PROGRAMS section for more information.</p>
<p>In addition to producing a single output list, lsof will run in repeat mode. In repeat mode it will produce output, delay, then
repeat the output operation until stopped with an interrupt or quit signal. See the +|-r [t[m<fmt>]] option description for more
information.</fmt></p>
</blockquote>
<p>To find out what is listing on just the TCP ports -</p>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>lsof <span class="nt">-P</span> <span class="nt">-iTCP</span> <span class="nt">-sTCP</span>:LISTEN
</code></pre></div></div>Sometimes you want to know what applications are taking up the ports on your computer, a useful terminal cli too is lsof.Finding information about my computer backup battery using Network UPS Tool2023-09-17T00:00:00+00:002023-09-17T00:00:00+00:00https://www.beverlyguillermo.com/2023/09/17/ups-info-for-nut<h1 id="sept-2023---notes-on-using-network-ups-tool">Sept 2023 - Notes on using Network UPS Tool</h1>
<p>Finding out the UPS information connected via USB or other connected things</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>lsusb -v
</code></pre></div></div>Sept 2023 - Notes on using Network UPS ToolOn My Mind2022-05-15T00:00:00+00:002022-05-15T00:00:00+00:00https://www.beverlyguillermo.com/2022/05/15/on-my-mind<h1 id="may-2022---on-my-mind">May 2022 - On My Mind</h1>
<p>Lately, it’s all about habits and I am trying to pick healthier habits and improve my concentration. I know everyone
has lists, but it does help to write and share to have some accountability, so I may write about any of the following
topics later.</p>
<p>The follow things have been on my mind lately.</p>
<p>Topics on Distributed Computing:</p>
<ul>
<li>Conflict-free replicated data type (CRDT)</li>
<li>Automerge</li>
</ul>
<p>Improving my programming language knowledge:</p>
<ul>
<li>Rust</li>
<li>Golang</li>
<li>Scala</li>
</ul>
<p>Various other topics:</p>
<ul>
<li>Handwriting recognition</li>
</ul>May 2022 - On My MindLocal Development with Win112022-03-07T00:00:00+00:002022-03-07T00:00:00+00:00https://www.beverlyguillermo.com/2022/03/07/local-development-with-win11<h2 id="reasons">Reasons</h2>
<p>Why am I posting now? These days are stressful. I have been trying to write up my thoughts, but I didn’t want to
contribute to noise and there are many better voices out there.</p>
<p>Why was I looking at win11? Short answer, I have not used windows in a while. My last experience was trying to use
win10, and it was painful. However, in the past, I was teaching new developers and Windows machines are cheaper
versus a macbook for “almost” the same configuration. I wanted to see if it’s possible to set up a local
development environment again with win11.</p>
<p>Why was I trying with a Surface Pro 8? It’s not cheap, so why? I was able to try it out, and I am going give it
back to its owner.</p>
<h2 id="new-steps-for-local-windows-development">New steps for local windows development</h2>
<p>It was immediately obvious that I cannot set up Surface Pro 8 with only 8GB with my normal development setup.
The basic 8GB on these windows laptops cannot handle using IntelliJ and Docker together. If I was given at least 16GB
model, or even better the 32GB model, it would entirely be possible.</p>
<h2 id="notes-on-how-to-use-8gb">Notes on how to use 8GB</h2>
<p>Remember, 4GB of memory is solidly needed to run Windows. Do not get the basic 4GB Windows model at all for
development.</p>
<ul>
<li>Windows Subsystem for Linux (WSL), at this time, tries to use 8GB of memory. If we want to try WSL with 8GB, we need
to change the configuration so WSL doesn’t try to take all of the memory. The configuration file is <code class="language-plaintext highlighter-rouge">%USER_PROFILE%/.wsl_config</code>
, i.e., <code class="language-plaintext highlighter-rouge">C:/Users/[USERNAME]/.wsl_config</code>, then we can set a max memory to use, as well as swap, etc.</li>
<li>Docker is a nice to have and convenient to use. It might be easier to set up different services, like a postgres or
redis db, or different apps you might want to build.
<ul>
<li>Instead of setting up my apps in a container, I was thinking using <a href="https://github.com/asdf-vm/asdf">asdf</a> and
installing the languages locally.</li>
<li>Leave the required services, a database like postgres or mysql, to the docker container</li>
<li>A special note, Docker will use WSL and its configuration for memory. I have configured WSL to use 1gb of memory,
and 2gb of swap. It hasn’t been bad.</li>
</ul>
</li>
<li>Use a minimal editor for a better experience. Visual Studio Code or Atom, are nice IDEs but any text editor would
be better than IntelliJ. If I were to keep Intellij, I have to minimize my plugins and restrict its memory usage.</li>
</ul>
<h2 id="thinking-about-remote-development">Thinking about remote development</h2>
<p>It might not be something I’d try to teach to new developers, just learning how to code or learning a framework like
ruby on rails or django, is <em>hard</em> already. Since I’ve been using docker and worked with cloud services like AWS,
Digital Ocean, Google Cloud Platform, Azure, it might be worth setting up a remote development environment. I was
thinking a lot about how to teach using these platforms.</p>ReasonsTrying Win 112022-03-05T00:00:00+00:002022-03-05T00:00:00+00:00https://www.beverlyguillermo.com/2022/03/05/trying-win11<p>I have been developing with Mac and Linux machines forever but I wanted to try out the new Windows Subsystem for Linux
Preview, or WSL for a while. I was able to get a Surface Pro 8.</p>
<p>Disclaimer, these are <i>fragments</i> of my thoughts. I am not really planning on creating a step-by-step tutorial or
a review, but more of observation notes about things I’ve encountered and what I found useful while playing around with
Windows 11 and Surface Pro 8.</p>
<h2 id="hardware-and-software">Hardware and Software:</h2>
<ul>
<li>Surface Pro 8, Intel Evo i5, 256GB</li>
<li>Surface Slim Pen 2</li>
<li>Surface Pro Signature Keyboard Cover</li>
<li>Windows 11 Home</li>
</ul>
<p>I am fan of the pen. What surprised me though is the price and you don’t get to charge it with the table alone. You
either have to get a separate charger or get the Signature Keyboard.</p>
<p>I’ve had the Surface Pro 4 in the past, and I really liked it for what it was at the time. The Surface Pro 8 is
an improvement and I was happy about it coming with usbc.</p>
<h3 id="intellij">IntelliJ</h3>
<p>I love the debugger, profiling tools and autocompletion with Intellij. Yes, I could just use vim but for all the
languages I use, there is an Intellij plugin that is super useful. It <i>IS</i> a memory hog though and I found that
syncing my settings that I’ve used with my mac or linux really halts the surface that I had.</p>
<ul>
<li><a href="https://www.jetbrains.com">Website</a></li>
<li><a href="https://www.jetbrains.com/help/idea/tuning-the-ide.html#configure-platform-properties">Need to increase max memory to the VM</a></li>
<li><a href="https://www.jetbrains.com/help/idea/how-to-use-wsl-development-environment-in-product.html">Using WSL</a></li>
</ul>
<h3 id="netlimiter">NetLimiter</h3>
<p>I love little snitch on my Mac. I am all right with the net-tools on Linux. I just wanted to try Netlimiter because
it would give me a better understanding of my Windows apps and their communications out of my network.</p>
<ul>
<li><a href="https://www.netlimiter.com/">Website</a></li>
</ul>
<h3 id="krita">Krita</h3>
<p>Having a Surface, I wanted to try out the pen with some drawing app. Krita is open-source, has lot of tools, and it’s
interface is not bad.</p>
<ul>
<li><a href="https://krita.org/en/">Website</a></li>
</ul>
<h3 id="windows-subsystem-for-linux-preview-microsoft-store">Windows Subsystem for Linux Preview (Microsoft Store)</h3>
<p>The tool I really wanted to try out from Microsoft. It was so easy to setup.</p>
<ul>
<li><a href="https://docs.microsoft.com/en-us/windows/wsl/install-manual">WSL2</a></li>
</ul>
<h3 id="linux-distribution-microsoft-store">Linux Distribution (Microsoft Store)</h3>
<p>Some available distributions:</p>
<ul>
<li>Ubuntu (Installed)</li>
<li>Debian</li>
<li>openSUSE</li>
<li>Kali</li>
</ul>
<h3 id="powertoys-via-microsoft-store">PowerToys via Microsoft Store</h3>
<ul>
<li><a href="https://github.com/microsoft/PowerToys">Git</a> - help remap Caps Lock to Escape and vice versa</li>
</ul>
<h3 id="docker-desktop-for-windows">Docker Desktop For Windows</h3>
<p>I really wanted to use Docker. It uses WSL, and WSL was the only way for Docker to run on Windows 11 Home. I would
wonder if the having Windows 11 Pro would give me better performance.</p>
<ul>
<li><a href="https://docs.docker.com/desktop/windows/install/">Website</a></li>
</ul>
<h2 id="accessing-the-wsl-folders">Accessing the WSL Folders</h2>
<p>Running docker, it was best for any source files to be in the WSL folders’ home directory. I found out you can access
from Windows Explorer or IDE, using:</p>
<p><code class="language-plaintext highlighter-rouge">\\wsl$\[DISTRIBUTION]\home\[USERNAME]</code></p>
<h2 id="ubuntu">Ubuntu</h2>
<p>These are some specific ubuntu things. After running <code class="language-plaintext highlighter-rouge">apt-get update</code> and <code class="language-plaintext highlighter-rouge">apt-get upgrade</code>.</p>
<h3 id="fish">Fish</h3>
<p>Adding fish shell… just to see what it was like in WSL</p>
<ul>
<li><a href="https://fishshell.com">Website</a></li>
</ul>
<h2 id="notes">Notes</h2>
<p>I think I started trying to configure the Surface around 13:00pm ET, and spent quite a while on Krita and then setting
up the development environment.</p>
<ul>
<li>18:56pm: I had everything installed that I wanted, and the memory is already at 90% on startup. I read that this is
expected on Windows 11? So I pushed on to try some coding.</li>
<li>21:20pm: I spent an hour with docker desktop and trying to pull an image, for some reason it locked up. Restarting
the Surface fixed it.</li>
<li>21:50pm: I don’t think that 8GB is really enough to do any kind of development work. Maybe 16gb would work, but I
found that if I have my editor and docker it may work. I probably couldn’t have a lot of browser tabs though. :P</li>
</ul>I have been developing with Mac and Linux machines forever but I wanted to try out the new Windows Subsystem for Linux Preview, or WSL for a while. I was able to get a Surface Pro 8.Life, part 22018-05-04T03:17:37+00:002018-05-04T03:17:37+00:00https://www.beverlyguillermo.com/2018/05/04/where-to-start<p>If you’ve read this far, thanks for doing it!</p>If you’ve read this far, thanks for doing it!