<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Sjoerd de haan on Medium]]></title>
        <description><![CDATA[Stories by Sjoerd de haan on Medium]]></description>
        <link>https://medium.com/@desjoerdhaan?source=rss-67d3f3438a1e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*uVaIEoiREmc8J1L87I2kHg.jpeg</url>
            <title>Stories by Sjoerd de haan on Medium</title>
            <link>https://medium.com/@desjoerdhaan?source=rss-67d3f3438a1e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 17:30:11 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@desjoerdhaan/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Classifying nano particles with deep learning]]></title>
            <link>https://medium.com/@desjoerdhaan/classifying-nano-particles-with-deep-learning-8b8c57820123?source=rss-67d3f3438a1e------2</link>
            <guid isPermaLink="false">https://medium.com/p/8b8c57820123</guid>
            <category><![CDATA[biotechnology]]></category>
            <category><![CDATA[physics]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[chemistry]]></category>
            <category><![CDATA[nanotechnology]]></category>
            <dc:creator><![CDATA[Sjoerd de haan]]></dc:creator>
            <pubDate>Tue, 13 Feb 2024 05:41:13 GMT</pubDate>
            <atom:updated>2026-11-06T14:05:06.073Z</atom:updated>
            <content:encoded><![CDATA[<h4>Using Brownian motion to infer particle shape</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*y0-fD9Wn_UzCvM6W" /><figcaption>Photo by <a href="https://unsplash.com/@flyd2069?utm_source=medium&amp;utm_medium=referral">FlyD</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Updated version available at <a href="https://datadrivenlabconsulting.com/blog/nanoparticle-classification-deep-learning.html">https://datadrivenlabconsulting.com/blog/nanoparticle-classification-deep-learning.html</a></p><h3>Introduction</h3><p>Gold and Silver nano particles have many useful applications. The first I dealt with them, I was doing an assignment for a nano-science based bio tech company.</p><p>That company was using nano particles to detect diseases like viruses and bacteria, with called Surface Enhanced Raman Spectroscopy (SERS).</p><figure><img alt="Suspensions of gold nanoparticles. The colors change as the size of gold nanoparticles increase. Aleksandar Kondinski, CC BY-SA 4.0 i, via Wikimedia Commons." src="https://cdn-images-1.medium.com/proxy/1*3OadS339HnVTLsk3m3aY2g.png" /><figcaption>Figure 1: Suspensions of gold nanoparticles. The colors change as the size of gold nanoparticles increase. Aleksandar Kondinski, <a href="https://creativecommons.org/licenses/by-sa/4.0">CC BY-SA 4.0 i</a>, via Wikimedia Commons.</figcaption></figure><h3>Surface Enhanced Raman Spectroscopy</h3><p>Raman spectroscopy is a technique from analytical chemistry, known to be very selective when it comes to molecular composition.</p><p>Typical applications of Raman spectroscopy include cocaine detection. Like many molecules, cocaine produces a characteristic spike that is visible on the spectrogram.</p><figure><img alt="Spectrum of cocaine for three different agents. Source (Kranenburg et al. 2021)" src="https://cdn-images-1.medium.com/proxy/1*m2MMNne1riG4ZGqkyD8mTg.png" /><figcaption>Figure 2: Spectrum of cocaine for three different agents. Source (Kranenburg et al. 2021)</figcaption></figure><p>Ordinary Raman spectroscopy could be used to detect bacteria, in principle. In practise the concentrations of the associated molecules are so low, the signals overshadowed by other effects.</p><p>This is where SERS and the nano particles come in. When struck with light of certain frequencies, nanoparticles can induce a plasmon resonance. This resonance can give rise to a strong magnification (1000–100 000x) of parts of the Raman spectrum.</p><p>Several academic papers describe how they used Surface Enhanced Raman Spectroscopy to distinguish bacterial species from colonies grown on a Petri dish. The nature of SERS enhancement depends however on the characteristics of the nano particles than are being used.</p><h4>Quality control of nano particles</h4><p>The spectrum obtained through SERS is highly sensitive to the characteristics of the nano particles, like shape and size. It is known that nanoparticle shape has a strong influence on optical properties such as plasmon resonance and Raman enhancement.</p><p>It is crucial to monitor and control the monitor the properties of the nano particles being used in experiments and products.</p><p>This is however easier said than down however. You can’t take pick up a few nano particles with a pair of tweezers and place them under the microscope. It is very challenging to perform direct measurements on the shape and size of nano particles directly.</p><h4>Nano Tracking Analysis</h4><p>It is way easier to infer the properties of nano particles in an indirect ways.</p><p>One way suspending nano particles in a liquid and track them while they perform a random walk. This method, called Nano Tracking Analysis (NTA) (Dragovic et al. 2011) (Gross et al. 2016), can reveal details like the size of a nano particles. The shape of the particles remains inaccessible.</p><h3>Nano Tracking Analysis with Deep Learning</h3><p>In a recent paper Hiroaki Fukuda, Hiromi Kuramochi, Yasushi Shibuta, Takanori Ichik (Fukuda et al. 2023) outline a method based on deep learning to distinguish between rod and spherical shaped gold nano particles.</p><p>The authors motivate this approach noticing that the random walk of the particles is not only effected by the size of the particle, but also by it’s shape. (Hanasaki and Isono 2012)</p><h4>Experimental setup</h4><p>The experimenters used two commercially available types of gold nanoparticles: spherically shaped AuNA (Citrate capping, 80 nm diameter, Sigma-Aldrich) and rod shaped AuNR (Citrate capping, 40 nm diameter × 180 nm length, Nanopartz).</p><p>The experimental setup is as follows:</p><ol><li>The nano particles go into a microfluidic channel and are irradiated with a laser from the side of the channel.</li><li>The scattered light is focused by an objective lens below the channel</li><li>The focused bundle of light goes into the retina of a high sensitivity camera that captures 100 frames per second.</li></ol><p>See fig. 3 for an overview of the setup.</p><figure><img alt="Image from Fukuda et al. (2023) (CC BY license)" src="https://cdn-images-1.medium.com/proxy/1*ohnOrowzIVRR9kjtI26fbQ.jpeg" /><figcaption>Figure 3: Image from Fukuda et al. (2023) (CC BY license)</figcaption></figure><h4>Processing</h4><p>The particles are tracked and their location is recorded; see fig. 4</p><figure><img alt="a) Random walks of several particles are tracked. b) Trajectory of individual particles. c) Dataset from the experiment. Image from Fukuda et al. (2023) (CC BY license)." src="https://cdn-images-1.medium.com/proxy/1*btwonBYmH-bQXT9kyRhzlQ.jpeg" /><figcaption>Figure 4: a) Random walks of several particles are tracked. b) Trajectory of individual particles. c) Dataset from the experiment. Image from Fukuda et al. (2023) (CC BY license).</figcaption></figure><p>In this way the authors obtained a dataset with trajectories of 5000 AuNP and 5000 AuNR particles with 100 time steps of 10 ms.</p><p>The authors trained several discriminative deep learning models to classify the trajectories as belonging to either AuNP (sphere) or AuNR (rod).</p><h4>Results</h4><p>The most successful model was an LSTM model feeding on 100 frames. This model achieved an accuracy of 80%.</p><p>The accuracy keeps increasing with the number of frames (fig. 5), indicating that some progress could be made there by adding more frames or by working with a faster camera.</p><figure><img alt="Image from Fukuda et al. (2023) (CC BY license)" src="https://cdn-images-1.medium.com/proxy/1*gJDvVeMfkxMucSmeVw6QCA.png" /><figcaption>Figure 5: Image from Fukuda et al. (2023) (CC BY license)</figcaption></figure><p>The model performs considerably better on macroscopic level. Tasked to predict the ratio of rods vs spherical particles in a mixture, error levels range from 0.3% and 5.2%; depending on ratio between sphere- and rod-shaped particles. The correlation plot in fig. 6 reflects this.</p><figure><img alt="Predicted vs actual fraction of non-spehrical particles. Image from Fukuda et al. (2023) (CC BY license)." src="https://cdn-images-1.medium.com/proxy/1*lqFc7PIT_leJpkoU78xyFA.png" /><figcaption>Figure 6: Predicted vs actual fraction of non-spehrical particles. Image from Fukuda et al. (2023) (CC BY license).</figcaption></figure><h3>Conclusion</h3><p>The Brownian motion of nano particles is affected by particle shape. Even at time scales as large as 10 ms, a deep learning classifier can can discern spherical particles from rod shaped particles with some precision at the single particle level. When it comes to establishing the relative proportion of the shapes of particles the errors are considerably lower, ranging from 0.3$ to 5.2%, depending on the ratio.</p><p>A limitation to this work is that a trained classifier can be used only for the particles it is trained on. In applications like quality control, it is not known ab initio what sort or particles may be observed in a system. For example when trying to detect contamination.</p><p>This method can used directly to measure concentrations of nano particles that are profiled in advanced.</p><h3>References</h3><p>Fukuda, Hiroaki, Hiromi Kuramochi, Yasushi Shibuta, and Takanori Ichiki. 2023. “Analysis of Brownian Motion Trajectories of Non-Spherical Nanoparticles Using Deep Learning.” <em>APL Machine Learning</em> 1 (4): 046104. <a href="https://doi.org/10.1063/5.0160979">https://doi.org/10.1063/5.0160979</a>.</p><p>Hanasaki, Itsuo, and Yoshitada Isono. 2012. “Detection of Diffusion Anisotropy Due to Particle Asymmetry from Single-Particle Tracking of Brownian Motion by the Large-Deviation Principle.” <em>Physical Review E</em> 85 (5): 051134. <a href="https://doi.org/10.1103/PhysRevE.85.051134">https://doi.org/10.1103/PhysRevE.85.051134</a>.</p><p>Kranenburg, Ruben F., Joshka Verduin, Renee de Ridder, Yannick Weesepoel, Martin Alewijn, Marcel Heerschop, Peter H. J. Keizers, Annette van Esch, and Arian C. van Asten. 2021. “Performance Evaluation of Handheld Raman Spectroscopy for Cocaine Detection in Forensic Case Samples.” <em>Drug Testing and Analysis</em> 13 (5): 1054–67. <a href="https://doi.org/10.1002/dta.2993">https://doi.org/10.1002/dta.2993</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8b8c57820123" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[On the dynamics of machine learning innovation]]></title>
            <link>https://medium.com/@desjoerdhaan/on-the-dynamics-of-machine-learning-innovation-4df4716a44de?source=rss-67d3f3438a1e------2</link>
            <guid isPermaLink="false">https://medium.com/p/4df4716a44de</guid>
            <category><![CDATA[innovation]]></category>
            <category><![CDATA[investing]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Sjoerd de haan]]></dc:creator>
            <pubDate>Sun, 11 Feb 2024 07:09:20 GMT</pubDate>
            <atom:updated>2026-11-06T14:12:23.139Z</atom:updated>
            <content:encoded><![CDATA[<h4>Why small teams can now develop LLM foundational models</h4><p>Updated version available at <a href="https://datadrivenlabconsulting.com/blog/ml-labs-common-pitfall.html">https://datadrivenlabconsulting.com/blog/ml-labs-common-pitfall.html</a></p><figure><img alt="Eq benchmark" src="https://cdn-images-1.medium.com/proxy/1*MCWQp4G3UmsvH-GRyPgNmg.png" /><figcaption>Figure 1: Eq benchmark</figcaption></figure><ul><li><a href="#shaking-the-emotional-intelligence-benchmark">Dynamics of machine learning innovation</a></li><li><a href="#shaking-the-emotional-intelligence-benchmark">Shaking the emotional intelligence benchmark</a></li><li><a href="#dynamics-of-machine-learning-innovation">Dynamics of machine learning innovation</a></li><li><a href="#ensemble-learning">Ensemble learning</a></li><li><a href="#diffusion-of-knowledge">Diffusion of knowledge</a></li><li><a href="#the-myth-of-compute-power">The myth of compute power</a></li><li><a href="#from-kaggle-to-the-real-world">From Kaggle to the real world</a></li><li><a href="#conclusion">Conclusion</a></li></ul><p>Seven months ago, Sam Altman was asked this question</p><blockquote>“Can a small team of smart engineers build a foundational model?”</blockquote><p>Altman answered negative. It is impossible, but one should should try.</p><p>Seven months later, a small team at <a href="https://shinoji-research.com/">Shinoji research</a> beats GTP-4 on the <a href="https://eqbench.com/">emotional intelligence benchmark</a>. Fine-tuning Mistral, an open source LLM developed by startup Mistral AI, they beated chatGTP spending just $400 on compute.</p><h3>Dynamics of machine learning innovation</h3><p>The non-verbal message of Sam Altman in the video, seems to indicate that does not believe what he is saying.</p><p>At least I did not believe this 7 months ago.</p><figure><img alt="X post announcing senku-70b model" src="https://cdn-images-1.medium.com/proxy/1*4cD5Zq-3eO5V6wcOL-Ah9Q.jpeg" /><figcaption>Figure 2: X post announcing senku-70b model</figcaption></figure><p>In order to understand where I come from, you do not need intricate knowledge on LLMs. Rather you need to play close attention to the dynamics around innovation in machine learning.</p><p>The dynamics around innovations in machine learning differ in some ways from previous eras of discovery and innovation.</p><p>This is both exiting and significant in several ways:</p><ol><li>From the perspective of the history of science, there are differences in how discovery and technological development unrolls compared to other episodes in history</li><li>If you are working in the field of machine learning, it is useful to understand where the field is going</li><li>If you are not working in machine learning, it can be helpful to place the developments in perspective</li><li>If you are investing in technology as a leader, policy maker, stock investor, venture capitalist, public funding organisation, or in in any other capacity, it can be beneficial to understand the dynamics of research and innovation in machine learning.</li></ol><h3>Shaking the emotional intelligence benchmark</h3><figure><img alt="Eq leaderboard with senku-70b model" src="https://cdn-images-1.medium.com/proxy/1*h-JIwSHReLZteLI6NP8Gyw.png" /><figcaption>Figure 3: Eq leaderboard with senku-70b model</figcaption></figure><p>The <a href="https://eqbench.com/">Emotional Intelligence Benchmark for Large Language Models</a> (Paech 2023) measures LLMs abilities to understand complex emotions.</p><p>Unexpectedly, a small company with no more than a few people forced it’s way to the top of the benchmark.</p><p><a href="https://shinoji-research.com/">Shinoji research</a> is a small research company in finance. The website talks about Crypto, FTX, statistics and topic like financial independence. The website looks more like the homepage of a developer than as a company website. Also it does not seem to specialize in LLMs but in it’s application in trade.</p><h3>Dynamics of machine learning innovation</h3><h4>Ensemble learning</h4><p>When it comes to practical problems, no no-one beets the crowd. At least not in machine learning. To support this, let’s look at Kaggle. For problems that are not highly specialized, it’s always a surprise who is going to turn up on top of the leader board. Good progress contributions are not necessarily made by highly specialized research teams, but can come from individuals.</p><p>I like to refer this to ensemble learning. If you put many teams to work, you can expect outliers or unexpected results.</p><h4>Diffusion of knowledge</h4><p>Expert knowledge in machine learning gets mainstream through papers, tutorials, libraries, notebooks, code and courses.</p><p>Whole areas that were specialized domains in academics until a few years ago are now part of mainstream machine. Think forecasting, neural networks, natural language processing, Gaussian processes, neural differential equations, reinforcement learning, causal machine learning. It’s all under our hands with open source packages and material.</p><h4>The myth of compute power</h4><p>Compute power can greatly accelerate research in machine learning, but it’s importance should not be overstated.</p><p>In 2018 I listened to Jeremy Howard. He argued against the trend for huge compute in machine learning research. It was not just a theoretical talk. With a small group of students he entered a competition to train imagenet from scratch as fast as possible. With modest equipment and clever tricks they were Fastest on publicly available infrastructure, fastest on GPUs, and fastest on a single machine. Their secret: do not rely on massive compute, but be creative.</p><p>The post is available on <a href="https://www.fast.ai/posts/2018-04-30-dawnbench-fastai.html">https://www.fast.ai/posts/2018-04-30-dawnbench-fastai.html</a></p><h3>From Kaggle to the real world</h3><p>How does this apply to LLMs? 1. The world of LLMs is like a large ensemble; larger than any Kaggle competition. So many players are contributing openly to the space, that we can expect quick developments. 2. LLMs is no rocket science. The basic building blocks of LLMs are are actively used by a large group of academics and practitioners for many years. There are lots of tools, knowledge and experience around. 3. The availability of massive compute might have allowed Open AI make the initial move; clever engineering is quickly catching up. Many players are incentivised to find solution that require less compute, and they are actively pursuing this; not just as a scientific pursuit, but as a serious business.</p><p>The Mistral model enabled the developers from Shioji to appear on top of the benchmark for a short time. It was developed by Mistral AI, a French AI startup that is back with at leas half a billion dollars to date.</p><p>Although the real world is more complex than a Kaggle competition, we see that the same principles apply; even when we add economic competition.</p><h3>Conclusion</h3><p>Large players, startups, and some practitioners of machine learning have incentives to mystify machine learning and AI.</p><p>Instead of sketching a world full of chances, they portray machine learning an exclusive world. A world were excellence and merit prevail and where the winner takes all.</p><p>Looking the dynamics in machine learning over 10 years, I witnessed another side of machine learning. I saw an episode unfolding where new technology became available to a large group of people; empowering them to build all sorts of applications.</p><p>Paech, Samuel J. 2023. “EQ-Bench: An Emotional Intelligence Benchmark for Large Language Models.” <em>arXiv.org</em>. <a href="https://arxiv.org/abs/2312.06281v2.">https://arxiv.org/abs/2312.06281v2.</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4df4716a44de" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What to work on in machine learning in 2024?]]></title>
            <link>https://medium.com/@desjoerdhaan/what-to-work-on-in-machine-learning-in-2024-5d3561266c1d?source=rss-67d3f3438a1e------2</link>
            <guid isPermaLink="false">https://medium.com/p/5d3561266c1d</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[careers]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[science]]></category>
            <dc:creator><![CDATA[Sjoerd de haan]]></dc:creator>
            <pubDate>Fri, 09 Feb 2024 03:26:00 GMT</pubDate>
            <atom:updated>2024-02-09T03:26:00.661Z</atom:updated>
            <content:encoded><![CDATA[<h4>Pick a growing field. Go for impact</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qBO0JfilRchNqgP3" /><figcaption>Photo by <a href="https://unsplash.com/@rebusas?utm_source=medium&amp;utm_medium=referral">Evaldas Grižas</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Are you working on large language models, a chatbot or an ai assistant?</p><p>Probably you feel excited; happy to work in this area. Indeed it is an exciting time to work in machine learning. Machine learning has a lot of potential.</p><p>So how much impact are you realizing with your work? Let me ask you some questions…</p><blockquote>❓ Are you working on a nice to have?</blockquote><blockquote>Yes? → Go for more impact!</blockquote><blockquote>❓ Are you working on foundational models?</blockquote><blockquote>Yes? → 1000’s and 1000’s of people are lifting the scores of foundational models every day. Are you sure they need you? Now? in 5 years?</blockquote><blockquote>❓ Are you bringing substantial improvement to the lives of a (small) group of people?</blockquote><blockquote>No? → You can!</blockquote><p>Science and technology is an area that has improved our lives tremendously. It continues to do so, and machine learning can accelerate that.</p><p>🚧 The application of machine learning in science and technology takes a lot of work; especially compared to areas like web shopping, web advertisement or social media.</p><p>👷 With so many machine learning models appearing every day, there is a fast need for people that bring those models to applications in science and technology.</p><h3>What area to choose?</h3><p>These are some exciting areas you could study:</p><ul><li>Causal machine learning; e.g. for speeding up medical trials</li><li>Analytical chemistry; e.g. identifying diseases, forensics, testing medicine</li><li>Cyber security; e.g. protect democracy</li><li>Gene editing; precision medicine</li><li>Cell therapy; e.g. stem cell therapy</li><li>Microbiome therapy; use microbe communities in our gut for treatment</li><li>Ai drug discovery</li><li>Environmental biotech en bio-fuels; e.g. using microbes to catalyze reactions and save polluting chemicals</li><li>Structural biology; understanding diseases, structure-driven drug discovery</li></ul><p>📈 These areas are meaningful, highly complex and full of hard problems. And most will grow exponentially of the next 20 years.</p><h3>Conclusion</h3><p>👩🏿‍🔬 Here are four reasons to start working on applications of machine learning in science:</p><ul><li>Work on something useful for society</li><li>The science behind the applications of machine learning is often more interesting than improving LLM’s</li><li>It may happen we have too many people working at AI assistants at some point.</li><li>Some areas in science and technology will grow exponentially in the next 20 years, thanks to machine learning</li></ul><p>Feel free to leave a comment if you know more interesting areas.</p><p>If you interested in science and machine learning, feel free to <a href="https://www.linkedin.com/in/sjoerddehaan/">connect to me on LinkedIN</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5d3561266c1d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Organizing knowledge into trees]]></title>
            <link>https://medium.com/@desjoerdhaan/organizing-knowledge-into-trees-b98921cbf201?source=rss-67d3f3438a1e------2</link>
            <guid isPermaLink="false">https://medium.com/p/b98921cbf201</guid>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[publishing]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[shel]]></category>
            <category><![CDATA[visualization]]></category>
            <dc:creator><![CDATA[Sjoerd de haan]]></dc:creator>
            <pubDate>Thu, 08 Feb 2024 07:17:28 GMT</pubDate>
            <atom:updated>2024-02-08T07:31:39.243Z</atom:updated>
            <content:encoded><![CDATA[<h3>Visualize data as trees</h3><h4>How to emphasize ideas visually</h4><blockquote>Part 1: Present ideas — not data</blockquote><h3>Present information visually</h3><p>Below is a list of 100+ applications that contains a wealth of information. I curated it over 24 years of using Linux.</p><p>I could just dump the list, but then the interesting stories behind the lines will not come across.</p><p>In this article I show you how to organize your data graphically, to make the ideas behind it stand out.</p><p>I also show you how to automate this process partially, so that you can replicate the process with your own data.</p><h4>A treasure of 25 years of Linux use</h4><p>In the last 24 years I have been using Linux in different areas of my personal life and work. During this period I was a student, a researcher and a data scientists working for companies.</p><p>Along the way I tried many applications and workflows. Everything that stuck is gathered in this list.</p><p>The list contains many insights that I have gathered over time. It reflects my vision on editing, command line work, system administration, publishing and data science, and programming.</p><p>I want to convert into a visual structure that to reveal the lessons hidden behind the lines.</p><p>This is a part of the list:</p><pre>graphic_packages:<br>  - alsa-utils # advanced linux sound system architecture<br>  - bemenu # application launcher<br>  - code # microsoft code ide<br>  - feh # image viewer<br>  - firefox # browser<br>  - foot # terminal emulator<br>  - geeqie # image viewer<br>  - gnote # tomboy alternative<br>  - jre-openjdk # Java 21 full runtime environment<br>  - keepassxc # password manager<br>  - libreoffice-fresh-en-gb # english language<br>  - libreoffice-fresh-nl # dutch language<br>  - libreoffice-fresh # open source office suite<br>  - pamixer # pulse audio command-line mixer<br>  - pulseaudio-alsa # alsa configuration for pulseaudio<br>  - qt5-wayland # qt5-api for wayland<br>  - qtikz # tikz diagram editor<br>  - sof-firmware # sound firmware for laptops after 2019<br>  - swaybg # background for sway window manager<br>  - swayidle # idle management for wayland<br>  - swaylock # screen locker for wayland<br>  - sway # wayland tilling window manager<br>  - texmaker # latex editor<br>  - vimb # keyboard browser<br>  - xdot # interactive graphviz viewer<br>  - xorg-xwayland # display server protocol alternative for x<br>  - zathura-djvu # djvu document viewer<br>  - zathura # document viewer with vi keybindings<br>  - zathura-pdf-mupdf # mupdf is faster than poppler<br>  - zathura-ps # ps document viewer</pre><h4>Need for a tool</h4><p>It is no coincidence that the list is in YAML format, as it is part my Ansible script for provisioning development machines.</p><p>Since the list keeps evolving, I am looking for a tool that</p><ul><li>Let me represent data in different ways</li><li>Let me filter data based on the idea I want to single out</li><li>Let me creates a hierarchy concepts that makes the data easy to digest</li><li>Let me re-generate visuals after my data has change</li></ul><p>The last part adds an interesting possibility.</p><p>I regularly commit the list of applications into a versioning system. A visualization tool makes it possible to visualize how my application usage and opinions change over time.</p><h4>The vision driving this</h4><p>You might ask why do I put in all this effort? Just for sharing the packages that I use?</p><p>During the 10 years that I worked in data science,I perceived workflow as one of the greatest challenges. There is a myriad of tools and standards are often lacking.</p><p>I have spent a lot of time searching, learning and trying tools. This resulted in a set of strongly opinionated workflows that I want to share with the community.</p><p>Not only do I want let others benefit from using it, I want to enables others to contribute, make it their own, or modify it.</p><p>The work in this article is one of many step towards that goal.</p><blockquote>Part II: Creating a tool</blockquote><h3>Hierarchy</h3><p>This is a tree hierarchy, made with Mermaid:</p><pre>flowchart TD<br>    dev[My development system]<br>    edit[Editing]<br>    pub[Publishing]<br>    media[Media viewers]<br>    desktop[Desktop envrionment]<br>    cmd[Command line]<br>    dev --&gt; edit<br>    dev --&gt; pub<br>    dev --&gt; media<br>    dev --&gt; desktop<br>    dev --&gt; cmd</pre><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*KOI9M-vruWqdNwNhT9jA2w.png" /></figure><p>Figure 1: Concepts organised in a tree.</p><p>The hierarchy provides a stage on which the packages can be presented themselves. Each package is attached to a concept; as a leaf to a tree.</p><p>The tree makes it easy to navigate the data and bring the concepts to live. Mermaid offers a convenient language to describe diagrams. You can try it out in the online editor <a href="https://mermaid.live/">here</a></p><p>Let’s develop a quick script to fill the tree with leaves</p><h3>Filling the tree with leaves</h3><p>First we add some software packages under the concept edit:</p><pre>flowchart TD<br>   dev[My development system]<br>    edit[Editing]<br>        edit --&gt; vim[Neovim]<br>        edit --&gt; vscode[Vs code]<br>        edit --&gt; office[Libre office]<br>    pub[Publishing]<br>    media[Media viewers]<br>    desktop[Desktop envrionment]<br>    cmd[Command line]<br>    dev --&gt; edit<br>    dev --&gt; pub<br>    dev --&gt; media<br>    dev --&gt; desktop<br>    dev --&gt; cmd</pre><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*h29QwiuwyMaTaJEUzFdJnw.png" /></figure><p>Figure 2: Leafs added to the tree.</p><p>Let’s automate this!</p><h3>A script to fill the diagram</h3><p>If I add a tag to the corresponding lines in the YAML file, I can use these to generate nodes and connections automatically.</p><p>Let’s start with adding a @edit to some lines in a YAML file:</p><pre>shell_tools:<br>  - neovim # editor @edit<br>  - vscode # ide @edit<br>  - libreoffice # office suite @edit</pre><h4>Script for adding notes</h4><p>I choose AWK as scripting language for generating new leafs.</p><p>Awk is a domain language for manipulating text files line by line. It geared toward processing records.</p><p>Let’s check the description that my system gives:</p><pre>whatis awk</pre><pre>awk (1p)             - pattern scanning and processing language</pre><p>This one liner extracts the tags @edit:</p><pre>awk &#39;/^\s*-.*@/{split($0, parts, &quot;@&quot;, seps); print $0&quot;  --&gt; &quot; parts[2]}&#39; shell.yaml</pre><pre>- neovim # editor @edit  --&gt; edit<br>  - vscode # ide @edit  --&gt; edit<br>  - libreoffice # office suite @edit  --&gt; edit</pre><p>Great, it works for n=1</p><p>Let’s extract the package name too:</p><pre>awk &#39;/^\s*-.*@/{split($0, parts, &quot;@&quot;, seps); print $0&quot;  --&gt; &quot; parts[2]}&#39; shell.yaml</pre><pre>- neovim # editor @edit  --&gt; edit<br>  - vscode # ide @edit  --&gt; edit<br>  - libreoffice # office suite @edit  --&gt; edit</pre><p>We can wrap it up in a small awk script that creates a node and an arrow for each package:</p><pre>/^\s*-.*@/ {<br>  split($0, parts, &quot;@&quot;, seps)<br>  key = parts[2]<br>  patsplit($0, seps, &quot;- | #&quot;, packageparts)<br>  package = packageparts[1]<br>  print key &quot; --&gt; &quot; package &quot;[&quot; package &quot;]&quot;<br>}</pre><p>The script in action:</p><pre>awk -f line-to-node.awk shell.yaml</pre><pre>edit --&gt; neovim[neovim]<br>edit --&gt; vscode[vscode]<br>edit --&gt; libreoffice[libreoffice]</pre><p>Let’s add these newly generated nodes to the diagram:</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*ZlaPbZvdb2c344-zAFG6fw.png" /></figure><p>My packages are scattered over several files. In total it may be 120 packges if I include vim plugins:</p><pre>wc -l *.yml<br>  32 graphic-tools.yml<br> 102 shell-tools.yml<br>   2 user-vars.yml<br>   0 vars.yml<br>  37 vim-vars.yml<br> 173 total</pre><p>I don’t want to publish a large graph, but only a subset; like all package under “desktop”.</p><p>That means I have to filter on a subset of tags.</p><h4>Filtering lines</h4><p>Here is some test data that I want to filter based on tag:</p><pre>#filter-test.yaml<br>some_apps:<br>  - neovim # editor @edit<br>  - vscode # ide @edit @ide<br>  - pycharm # ide @ide @edit<br>  - libreoffice # office suite @edit<br>  - firefox # @browser @desktop<br>  - chromium # @desktop @other @browser</pre><p>This script selects only the lines with include tags @ide or @browser:</p><pre>#filter-keys.awk<br>BEGIN {<br>  key_pattern = (&quot;^\\s*-\\s*([[:alnum:]_-]*).*@(&quot; keys &quot;).*&quot;)<br>  gsub(&quot;;&quot;, &quot;|&quot;, key_pattern)<br>  print &quot;matching against: &quot; key_pattern<br>}<br>$0 ~ key_pattern {print &quot;+ &quot; $0}<br>$0 !~ key_pattern {print &quot;- &quot; $0}</pre><p>Here you see it working:</p><pre>awk -f filter-keys.awk -v keys=&quot;browser;ide&quot; filter-test.yaml</pre><pre>matching against: ^\s*-\s*(\w*).*@(browser|ide).*<br>- some_apps:<br>-   - neovim # editor @edit @mermaid-support<br>+   - vscode # ide @edit @ide<br>+   - pycharm # ide @ide @edit<br>-   - libreoffice # office suite @edit<br>+   - firefox # @browser @desktop<br>+   - chromium # @desktop @other @browser</pre><p>A the plus / minus sign in front of the line means include / exclude.</p><h4>Extracting tags</h4><p>Now let us extract package and tag, in addition to filtering lines:</p><pre># extract-keys.awk <br>BEGIN {<br>  key_pattern = (&quot;^\\s*-\\s*([[:alnum:]_-]*).*@(&quot; keys &quot;).*&quot;)<br>  gsub(&quot;;&quot;, &quot;|&quot;, key_pattern)<br>  print &quot;matching against: &quot; key_pattern<br>}<br>$0 ~ key_pattern {<br>  print gensub(key_pattern, &quot;\\1&quot;, 1, $0)<br>}</pre><pre>awk -f extract-keys.awk -v keys=&quot;browser;ide&quot; filter-test.yaml</pre><pre>matching against: ^\s*-\s*([[:alnum:]_-]*).*@(browser|ide).*<br>vscode @ide<br>pycharm @ide<br>firefox @browser<br>chromium @browser</pre><h4>Putting everything together</h4><p>The final script reads like this:</p><pre>#generate-nodes.awk<br>BEGIN {<br>  key_pattern = (&quot;^\\s*-\\s*([[:alnum:]_-]*).*@(&quot; keys &quot;).*&quot;)<br>  gsub(&quot;;&quot;, &quot;|&quot;, key_pattern)<br>}<br>$0 ~ key_pattern {<br>  package = gensub(key_pattern, &quot;\\1&quot;, 1, $0)<br>  tag = gensub(key_pattern, &quot;\\2&quot;, 1, $0)<br>  print tag &quot; --&gt; &quot; package &quot;[&quot; package &quot;]&quot;<br>}</pre><p>It generates a node and a link for each package:</p><pre>awk -f generate-nodes.awk -v keys=&quot;browser;ide&quot; filter-test.yaml</pre><pre>ide --&gt; vscode[vscode]<br>ide --&gt; pycharm[pycharm]<br>browser --&gt; firefox[firefox]<br>browser --&gt; chromium[chromium]</pre><h3>Using the script</h3><p>Let me put the script to use right away.</p><p>If you are new to Mermaid, you might wonder which software I use that integrates with Mermaid.</p><p>I went through my list with software and add the tag ‘mermaid-support’ to each item that integrates Mermaid (possibly through a plugin).</p><p>First I selected applications with Mermaid support, using sed:</p><pre>sed -n &#39;/@mermaid-support/p&#39; *.yml</pre><p>This is the result:</p><pre>- chatgpt-shell-cli # command line for chat gtp  @mermaid-support @terminal-interface @ai-assistant<br>      - quarto-cli-bin # litereate programming publishing tool @publishing @mermaid-support<br>  - code # open source IDE @edit @ide @graphic-interface @mermaid-support<br>  - jupyterlab # interactive computign serverf @mermaid-support @datascience @web-interface<br>  - neovim # editor @mermaid-support @edit @terminal-interface<br>  - nodejs # needed for jupyter extensions @mermaid-support @programming-language @terminal-interface<br>  - pandoc # convert documents @mermaid-support @publishing @terminal-interface<br>  - pandoc-crossref # pandoc filter for cross-references @mermaid-support @terminal-interface<br>  - pelican # static site generator @mermaid-support @publishing @web-interface<br>  - vi # editor @mermaid-support<br>  - vim # editor  @mermaid-support</pre><p>This is the hierarchy of concepts I want to fill:</p><pre>flowchart TD<br>   root[Mermaid support]<br>    edit[Editing]<br>    publishing[Publishing]<br>    datascience[Data science]<br>    programming-language[Programming language]<br>    ai-assistant[Ai assistant]<br>    root --&gt; edit<br>    root--&gt; publishing<br>    root --&gt; datascience<br>    root --&gt; ai-assistant<br>    root --&gt; programming-language</pre><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*2tns7hQ8wir41ROX1PxEdg.png" /></figure><p>Figure 3: Concepts for Mermaid diagram</p><p>To generate the leaves, I use</p><pre>sed -n &#39;/@mermaid-support/p&#39; *.yml | awk -f generate-nodes.awk -v keys=&quot;edit;programming-language;publishing;datascience;ai-assistant&quot;</pre><pre>flowchart TD<br>   root[Mermaid support]<br>    edit[Editing]<br>    publishing[Publishing]<br>    datascience[Data science]<br>    programming-language[Programming language]<br>    ai-assistant[Ai assistant]<br>    root --&gt; edit<br>    root--&gt; publishing<br>    root --&gt; datascience<br>    root --&gt; ai-assistant<br>    root --&gt; programming-language<br>ai-assistant --&gt; chatgpt-shell-cli[chatgpt-shell-cli]<br>publishing --&gt; quarto-cli-bin[quarto-cli-bin]<br>datascience --&gt; rstudio-desktop-bin[rstudio-desktop-bin]<br>edit --&gt; code[code]<br>datascience --&gt; jupyterlab[jupyterlab]<br>edit --&gt; neovim[neovim]<br>programming-language --&gt; nodejs[nodejs]<br>publishing --&gt; pandoc[pandoc]<br>publishing --&gt; pandoc-crossref[pandoc-crossref]<br>publishing --&gt; pelican[pelican]<br>programming-language --&gt; python[python]</pre><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*T2PZeUbjFIKLIfGrIBh4Aw.png" /></figure><p>Figure 4: Programs that support Mermaid diagrams; directly or through plugins.</p><p>Let me also add a diagram that provides another perspective:</p><pre>flowchart TD<br>   root[Mermaid support]<br>    terminal-interface[Terminal interface]<br>    web-interface[Web interface]<br>    graphic-interface[Graphical inteface]<br>    root --&gt; terminal-interface<br>    root--&gt; web-interface<br>    root --&gt; graphic-interface<br>terminal-interface --&gt; chatgpt-shell-cli[chatgpt-shell-cli]<br>graphic-interface --&gt; rstudio-desktop-bin[rstudio-desktop-bin]<br>graphic-interface --&gt; code[code]<br>web-interface --&gt; jupyterlab[jupyterlab]<br>terminal-interface --&gt; neovim[neovim]<br>terminal-interface --&gt; nodejs[nodejs]<br>terminal-interface --&gt; pandoc[pandoc]<br>terminal-interface --&gt; pandoc-crossref[pandoc-crossref]<br>web-interface --&gt; pelican[pelican]</pre><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*00ZTXQZV6T-_9wyZ-hFcrg.png" /></figure><p>Figure 5: Programs organized by interface type</p><p>These two diagrams show the same data in different ways. The second diagram instantly shows that there are many terminal applications that support Mermaid diagrams.</p><p>If you look carefully you can also spot that one application is missing in the second diagram. I forgot to add the tag terminal-inteface to python. This shows there is still manual work in the process.</p><h3>Conclusion</h3><p>Some ideas are best conveyed visually. Tree diagrams work particularly well when we place ideas into a hierarchy.</p><p>I showed you how to use mermaid to make tree diagrams and how to use awk to partly automate the process. The advantages of automation include</p><ul><li>Focus on different ideas within the same dataset with little extra effort</li><li>Easily update visualizations when the data changes</li><li>Easily experiment with different hierarchies for organizing your data</li></ul><p>In my case, I can create articles and talks about different aspects of my development system. Depending on the topic, I can create a hierarchy that conveys the central idea best.</p><p>What to do after reading this article? You might want to</p><ul><li>Represent your data as a graph</li><li>Try out Mermaid for visualizations <a href="https://mermaid.live/">here</a></li><li>Experiment with different ways to organize your data</li><li>Consider automating part of your visualization process</li></ul><p>Feel free to adapt my script for your needs.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b98921cbf201" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A brave solopreneur shared his Saas idea on medium]]></title>
            <link>https://medium.com/@desjoerdhaan/a-brave-solopreneur-shared-his-saas-idea-on-medium-253f4d34cad3?source=rss-67d3f3438a1e------2</link>
            <guid isPermaLink="false">https://medium.com/p/253f4d34cad3</guid>
            <category><![CDATA[moat]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[saas]]></category>
            <category><![CDATA[solopreneur]]></category>
            <dc:creator><![CDATA[Sjoerd de haan]]></dc:creator>
            <pubDate>Mon, 05 Feb 2024 02:48:59 GMT</pubDate>
            <atom:updated>2024-02-05T02:50:11.722Z</atom:updated>
            <content:encoded><![CDATA[<h4>How he thought me a great deal about solopreneuring, moats and building out in the open.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_v6oLMCfL8xDoG60" /><figcaption>Photo by <a href="https://unsplash.com/@nathananderson?utm_source=medium&amp;utm_medium=referral">Nathan Anderson</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Solopreneur <a href="https://medium.com/u/c4a298b66f16">Austin Starks</a> shared his Saas idea on medium.</p><p><a href="https://medium.com/@austin-starks/genetic-algorithm-as-a-service-a-lucrative-ai-saas-business-idea-fe35858f0c87">Genetic Algorithm as a Service: A Lucrative AI SaaS Business Idea.</a></p><p>The idea is to</p><ol><li>Offer a platform that can manage all your prompts for your, including performance scores</li><li>Use genetic algorithms to improve prompt score automatically without manual prompt engineering</li><li>Use the product as a feature for the entrepreneur’s existing product</li></ol><p>This is what I’d like to say:</p><h3>Let’s learn together</h3><p>It is really cool <a href="https://medium.com/u/c4a298b66f16">Austin Starks</a>, that you share an original startup idea on medium.</p><p>I totally like the way you are thinking, and<strong> I love to explore the idea a bit further, here on Medium and learn from it.</strong></p><h3>A matter of moat</h3><p>With startup ideas, I often hear this question asked:</p><blockquote>how are you going to defend against the big players that can just copy your product as a feature?</blockquote><p>In startup jargon, this is referred to a <strong>moat</strong>.</p><p>I feel the moat question is a valid question, and also a very interesting question to explore. Why?</p><blockquote>You may dismiss any idea with the argument</blockquote><blockquote>“it can be copied”</blockquote><blockquote>Can you also convert the moat question into something positive?</blockquote><p>You would be shooting yourself into the foot if you dismiss a great idea without any thought.</p><p>Let me share my view on the “moat question”…</p><h3><strong>Your idea can easily be copied</strong></h3><p>If a genetic algorithms work to optimize prompts, then it will be worth a lot of money for large players like Azure and Open AI. They will have no problem copying it.</p><blockquote>Your <strong>idea can be copied. This should not stop you</strong></blockquote><p>Still your idea is has a lot of value. Here is why:</p><h3>Why having no moat may not be a bad thing</h3><ol><li><strong>Solopreneur vs VC startup <br></strong>Usually VC inverters ask about your moat. If you go down the VC road, you need to grow enormously. An acquisition for a few millions would be a bad outcome for a VC investor. With no moat you are “vulnerable” to this scenario. For you as a solopreneur, earning a few millions would not be a bad outcome.</li><li><strong>Turn a feature into a product</strong> <br>The product that you propose would be a useful feature for your main product. Since you may develop it anyway, why not turn it into a product?</li><li><strong>Diversif</strong>y <br>By taking several bets (main product &amp; derived products), you can de-risk. Now you have two ideas which could work out.</li><li><strong>Pivot</strong><br>Innovative businesses rarely become successful with there very first idea. Most startups piviot to whatever works best. Still we like to create a sense of control by planning far ahead. Plans, however, rarely turn out the way we plan. Dismissing a good idea “just” because it can be copied may not be helpful. Unless indeed… you are about to invest millions as a VC investor.</li><li><strong>Synergy effects of building out in the open<br></strong>You are building your main product out in the open. By taking up a connected idea and by building that idea out in the open too, you get a positive synergy between the two ideas. The audience of one idea may be turn out as customer, partner, or inspirator for the other idea.</li><li><strong>Worst case scenario<br></strong>Someone may take your idea and develop it into a great Saas; even better then you could have done. In that case, would you have lost? No; you would happily buy this service for your main product. At a fraction of the cost it would take to develop it on your own.</li></ol><h3>Conclusion</h3><p>If you are a solopreneur and you are building out in the open, like @Austin starks, then it is smart to</p><ol><li><strong>Diversify your product offering early on</strong></li><li><strong>Focus on your best bet at a later stage</strong></li><li><strong>Dream up features into derived products</strong></li><li><strong>Share the idea to generate opportunities</strong></li></ol><p>What are some of the opportunities that you can generate by sharing a related startup idea?</p><ol><li><strong>Feedback; e.g. product already exists and you save a lot of costs not having to develop it yourself</strong></li><li><strong>Synergy; e.g. more audience for your existing product</strong></li><li><strong>Partners; e.g. someone helps you with the feature that you need</strong></li><li><strong>A new product to offer, in case you decide to build the product</strong></li></ol><p>I’d say that sharing ideas for related products is an excellent idea.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=253f4d34cad3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Rclone — The Swiss army knife of cloud storage]]></title>
            <link>https://medium.com/@desjoerdhaan/rclone-the-swiss-army-knife-of-cloud-storage-a08b906f6e12?source=rss-67d3f3438a1e------2</link>
            <guid isPermaLink="false">https://medium.com/p/a08b906f6e12</guid>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[nas]]></category>
            <category><![CDATA[cloud-storage]]></category>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[Sjoerd de haan]]></dc:creator>
            <pubDate>Tue, 12 Dec 2023 02:57:48 GMT</pubDate>
            <atom:updated>2023-12-12T02:57:48.699Z</atom:updated>
            <content:encoded><![CDATA[<h3>Rclone — The Swiss army knife of cloud storage</h3><h4>How to manage all your storage with ease</h4><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*ZHnKua4lK_1NyD7Gm8KGtQ.png" /></figure><h3>What is rclone?</h3><p>Rclone is a command-line program to manage files on cloud storage.</p><p>It supports over 70 cloud storage products, like:</p><ul><li>S3 object stores</li><li>Microsoft OneDrive</li><li>Minio</li><li>Nextcloud</li><li>Google Photos</li><li>Google Drive</li><li>Hetzner Storage Box</li><li>Dropbox</li><li>SFTP</li><li>FTP</li><li>WebDav</li></ul><p>Rclone provides commands equivalents to</p><ul><li>rsync</li><li>cp</li><li>mv</li><li>mount</li><li>ls</li><li>ncdu</li><li>tree</li><li>rm</li><li>cat</li></ul><p>Notable features include:</p><ul><li>Transferring files from one cloud provider to another without using the local disk</li><li>Virtual backends can wrap local and cloud file systems to apply encryption, compression, chunking, hashing and joining</li><li>Mounts any local, in the cloud or virtual filesystem locally</li><li>The in-build server serves any filesystem over SFTP, HTTP, WebDAV, FTP and DLNA.</li></ul><h4>Usecases</h4><p>What can rclone do for you? Some examples:</p><ul><li>Backup (and encrypt) files to cloud storage</li><li>Restore (and decrypt) files from cloud storage</li><li>Mirror cloud data to other cloud services or locally</li><li>Migrate data to the cloud, or between cloud storage vendors</li><li>Mount encrypted, cached or heterogeneous cloud storage</li><li>Union file systems together to present multiple local and/or cloud file systems as one</li><li>Analise and account for data held on cloud storage using inbuilt versions of lsf, ljson, size, ncdu</li></ul><h4>Operations</h4><p>These are the basic operations for working with files:</p><ul><li>Copy new or changed files to cloud storage</li><li>Sync (one way) to make a directory identical</li><li>Move files to cloud storage deleting the local after verification</li><li>Check hashes and for missing/extra files</li><li>Mount your cloud storage as a network disk</li><li>Serve local or remote files over HTTP/WebDav/FTP/SFTP/DLNA</li><li>Experimental Web based GUI</li><li>Analyze your data</li></ul><p>See <a href="https://rclone.org/commands/">https://rclone.org/commands/</a> for a list of commands.</p><h3>Setting up a first remote — Google Photos</h3><p>The rclone CLI walks you through the setup of remotes. Start with:</p><pre>rclone config</pre><p>Follow the steps of adding a new remote. If needed, have a look at the help for google photos backend at: <a href="https://rclone.org/googlephotos/">https://rclone.org/googlephotos/</a></p><h4>Listing files</h4><p>Rclone has some nice ls helpers:</p><ul><li>ls to list size and path of objects only</li><li>lsl to list modification time, size and path of objects only</li><li>lsd to list directories only -lsf to list objects and directories in easy to parse format</li></ul><h4>lsd - List Directories</h4><p>Let’s use lsd to show all albums:</p><pre>lsd photos-sjoerd:albums</pre><p>List the root of my google photos account</p><pre>rclone lsd photos-sjoerd:                             │<br>          -1 2023-10-20 13:20:29        -1 album                                                          │<br>          -1 2023-10-20 13:20:29        -1 feature                                                        │<br>          -1 2023-10-20 13:20:29        -1 media                                                          │<br>          -1 2023-10-20 13:20:29        -1 shared-album                                                   │<br>          -1 2023-10-20 13:20:29        -1 upload</pre><h4>Navigate media</h4><p>The directories under media show different ways of categorizing the media:</p><pre>rclone lsd photos-sjoerd:media<br>          -1 2023-10-20 13:27:55        -1 all<br>          -1 2023-10-20 13:27:55        -1 by-day<br>          -1 2023-10-20 13:27:55        -1 by-month<br>          -1 2023-10-20 13:27:55        -1 by-year</pre><p>Organize media by year:</p><pre>rclone lsd photos-sjoerd:media/by-year<br>          -1 2023-10-20 13:23:38        -1 2000<br>          -1 2023-10-20 13:23:38        -1 2001<br>          -1 2023-10-20 13:23:38        -1 2002<br>          -1 2023-10-20 13:23:38        -1 2003<br>          -1 2023-10-20 13:23:38        -1 2004<br>          -1 2023-10-20 13:23:38        -1 2005<br>          -1 2023-10-20 13:23:38        -1 2006<br>          -1 2023-10-20 13:23:38        -1 2007<br>          -1 2023-10-20 13:23:38        -1 2008<br>          -1 2023-10-20 13:23:38        -1 2009<br>          -1 2023-10-20 13:23:38        -1 2010<br>          -1 2023-10-20 13:23:38        -1 2011<br>          -1 2023-10-20 13:23:38        -1 2012<br>          -1 2023-10-20 13:23:38        -1 2013<br>          -1 2023-10-20 13:23:38        -1 2014<br>          -1 2023-10-20 13:23:38        -1 2015<br>          -1 2023-10-20 13:23:38        -1 2016<br>          -1 2023-10-20 13:23:38        -1 2017<br>          -1 2023-10-20 13:23:38        -1 2018<br>          -1 2023-10-20 13:23:38        -1 2019<br>          -1 2023-10-20 13:23:38        -1 2020<br>          -1 2023-10-20 13:23:38        -1 2021<br>          -1 2023-10-20 13:23:38        -1 2022<br>          -1 2023-10-20 13:23:38        -1 2023</pre><h4>Create a directory</h4><p>To create a new album, create a new directory under albums</p><pre>rclone mkdir &quot;photos-sjoerd:albums/trip to the lake&quot;</pre><h4>Copying content</h4><p>This is a simple copy:</p><pre>rclone copy photos-sjoerd:media/by-day by-day/</pre><p>-P adds a progress bar:</p><pre>rclone copy photos-sjoerd:media/by-day by-day/ -P</pre><p>Here we add a limit to the number of transactions per time unit:</p><pre>rclone copy photos-sjoerd:media/by-day by-day/ -P  --tpslimit 5</pre><p>Rclone provides great filtering options, like filter by age:</p><pre>rclone copy photos-sjoerd:media/by-day by-day/ -P  --max-age 2w</pre><h3>Learn more</h3><p>My other articles take you further:</p><ul><li>Diving Into Rclone’s Goolge Photo Backend</li><li><a href="https://medium.com/@desjoerdhaan/backup-your-google-photos-8c797a155ae3">Backup your google photos</a></li></ul><p>Feel free to follow me or connect to me on <a href="https://www.linkedin.com/in/sjoerddehaan/"><strong>LinkedIn</strong></a>. I love it when you leave a small message.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a08b906f6e12" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building datasets with Bash]]></title>
            <link>https://medium.com/analytics-vidhya/building-datasets-with-bash-bb48b10aa9b7?source=rss-67d3f3438a1e------2</link>
            <guid isPermaLink="false">https://medium.com/p/bb48b10aa9b7</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[shell]]></category>
            <category><![CDATA[bash]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[dataset]]></category>
            <dc:creator><![CDATA[Sjoerd de haan]]></dc:creator>
            <pubDate>Tue, 05 Dec 2023 02:22:48 GMT</pubDate>
            <atom:updated>2023-12-12T02:40:50.916Z</atom:updated>
            <content:encoded><![CDATA[<h4>How to build and structure your dataset with Snakmake</h4><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*yUW519WnhKJ9WD62uPPYVQ.png" /><figcaption>Image by author</figcaption></figure><h3>Organize the creation process</h3><p>Did you ever think about creating a dataset? I am sure you have some ideas on what to build, but have you also thought about how to structure such a project?</p><p>While generating data does not have to be hard, it can be a challenge to keep your workflow organized.</p><p>Ideally, you design a creation process distinct steps. And those steps should be repeatable.</p><p>In this article I show how to use Bash and Snakemake to build a dataset.</p><h3>Why build a dataset?</h3><p>Data creation is more popular than ever, and for good reasons.</p><p>While training models has be come easy in the list ten years, data quality and availability remains an issue. Synthetic, scraped or simulated data can be a solution.</p><p>My personal motive for building datasets, is that Building a dataset helps me to connect to the system at hand in a different way. Generating data requires a different level of understanding and a different way of thinking.</p><h3>Why use Bash and Snakemake?</h3><p>The example dataset that we will produce in this article could have been produced with a script in R or Python. I deliberately picked Bash and Snakemake. Why?</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*w1p1J3TnvHEcVXSM997K4w.png" /><figcaption>Figure by author</figcaption></figure><p>I chose Bash because the command line is a great environment for working with data. Endowed with a large set of small (gnu) tools, the shell offers unparalleled versatility. The dataset in this article will be created with no more than 10 lines of bash code.</p><p>Snakemake adds to versatility of the command line by gluing together data science workflows across languages (R, Python, Bash, Julia, Rust-script) and across environments (conda, docker). It can combine any numbers of scripts and environments and execute them locally or remote.</p><h4>Gluing tasks together</h4><p>Suppose you want to scrape some data in Python, send it through a deep learning model in a docker container and make beautiful ggplot2 plots in R? You can use make, a bash script or a Python script to glue the steps together but none of these provide a smooth ride.</p><p>Bash is hard to read and maintain. Python and R would need many lines of code to determine what part of the workflow to (re-)run.</p><p>Make overcomes this by sorting out which files need to be build first. However, make is not intuitive to write and it has no support for containers or conda environments.</p><p>Snakemake glues together all the steps with little effort. That’s why it is worth to use Snakmake for your projects.</p><h3>Thinking about your own dataset</h3><p>The latest wave of AI startups uses generative AI to generate data that could not be generated before.</p><p>There are many other methods though to create data. Here is a list to get you thinking about creating your own dataset:</p><ol><li>Web scraping</li><li>Document scraping (OCR and such)</li><li>Accessing API’s</li><li>Sensors (there are some good smartphone sensor apps)</li><li>Electronics and Robotics (I did some IMU / GPS sensor fusion on a micro controller)</li><li>Simulation (Physics, Chemistry, Biology, Statistics, Reinforcement learning)</li><li>Processing / enriching existing datasets (Augmentations, joining datasets)</li><li>System logging (server logs, networking, security)</li></ol><p>In this article I build a simple system logging dataset.</p><h3>Mirror ranking</h3><p>The dataset that I am going to build for this article is based on the mirror ranking tool reflector.</p><p>As part of the Arch Linux ecosystem, reflector measures download speed for different servers across the world. It then ranks the severs accordingly.</p><p>In my article <a href="https://medium.com/@desjoerdhaan/measuring-app-network-usage-with-a-script-b4c80e897e0b">Measuring mirror throughput with bash</a> I described a tiny script that</p><ol><li>Rates mirrors according to download speed</li><li>Records network usage at the same time</li></ol><p>This is the script:</p><pre>trap &#39;kill $(jobs -p)&#39; EXIT<br>nethogs -d 2 -bt | grep python &gt; rates.txt &amp;<br>reflector  --score 5 &gt; mirrors.txt</pre><h4>Ranking</h4><p>The script produces rankings like these:</p><pre># mirrors.txt<br>################################################################################<br>################# Arch Linux mirrorlist generated by Reflector #################<br>################################################################################<br><br># With:       reflector --score 5 --sort rate<br># When:       2023-11-24 08:17:19 UTC<br># From:       https://archlinux.org/mirrors/status/json/<br># Retrieved:  2023-11-24 08:16:59 UTC<br># Last Check: 2023-11-24 08:07:33 UTC<br><br>Server = https://mirror.osbeck.com/archlinux/$repo/os/$arch<br>Server = http://mirror.ubrco.de/archlinux/$repo/os/$arch<br>Server = http://arch.jensgutermuth.de/$repo/os/$arch<br>Server = http://mirrors.qontinuum.space/archlinux/$repo/os/$arch<br>Server = <a href="http://mirror.moson.org/arch/$repo/os/$arch">http://mirror.moson.org/arch/$repo/os/$arch</a></pre><h4>Rates</h4><p>The script produces rates like these:</p><pre># rates.txt<br>/usr/bin/python/703838/1000 13.59   1808.46<br>/usr/bin/python/703838/1000 14.5596 1717.18<br>/usr/bin/python/703838/1000 14.6182 1694.34<br>/usr/bin/python/703838/1000 13.2963 1683.07</pre><p>Columns: KB/s (up), KB/s (down).</p><h3>From a single datapoint to multiple datapoints</h3><p>The dataset that I am creating differentiates between</p><ol><li>Countries: Japan, Australia, Indonesia</li><li>Run: 0–9</li></ol><p>In the next sections we build up the rules to produce the following directory structure:</p><pre>ranking-australia-[0...9].txt<br>ranking-china-[0...9].txt<br>ranking-india-[0...9].txt<br>ranking-indonesia-[0...9].txt<br>ranking-japan-[0...9].txt<br>rate-australia-[0...9].csv<br>rate-china-[0...9].csv<br>rate-india-[0...9].csv<br>rate-indonesia-[0...9].csv<br>rate-japan-[0...9].csv</pre><h3>Building the workflow</h3><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*eh17ytG5r52DMJ5QzD-cJA.png" /><figcaption>Figure by author</figcaption></figure><p>Snakemake is a like GNU make, but with data science and bio informatics in mind.</p><p>It works by defining rules in a text file called Snakefile. In the next sections we will build the Snakefile file step by step.</p><h4>1. Constants</h4><p>Snakemake accepts Python statements, so we start off defining two constant that we can refer to later on:</p><pre>N_RUNS = 10<br>COUNTRIES = [&quot;japan&quot;, &quot;china&quot;, &quot;australia&quot;, &quot;indonesia&quot;, &quot;india&quot;]</pre><h4>Intermezzo: On rules</h4><p>Every file that we want to generate needs to be covered by a rule.</p><p>This is a minimal example:</p><pre>#Snakefile<br>make_copy:<br>  input:<br>    &quot;original.txt&quot;<br>  output:<br>    &quot;data.txt&quot;<br>  shell:<br>    &quot;copy {input} {output}&quot;</pre><p>The rule declares how to produce the file copy.txt.</p><p>We can trigger this rule from the command line with</p><pre>snakemake -c1 make_data</pre><p>The flag -c1 tells snakemake to use just one core.</p><p>In general, a rule will be triggered when</p><ol><li>One of the output files is not present</li><li>One of the input files has changed</li><li>The code for generation has changed</li><li>A (conda) environment has changed</li><li>Some other dependency has change; e.g. a parameter</li><li>Explicit trigger by other rule</li><li>Manual trigger from command line</li></ol><h4>2. A rule to define target files</h4><p>Back to our dataset, we add the following rule that tells what files should be created. It doesn’t tell how to create it:</p><pre>rule create_data:<br>  input:<br>     expand(&quot;results/data/example-dataset/{type}-{country}-{n}.txt&quot;, type=[&quot;ranking&quot;, &quot;rate&quot;], n=range(N_RUNS), country=COUNTRIES),</pre><p>Running</p><pre>snakemake -c1 create_data</pre><p>will trigger this rule. Snakemake will look for other rules to generate the target files.</p><p>Note the expand function here. It is a helper function that comes in handy in many places.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*65Y7uzkuQ5My45Z2WDOJvA.png" /><figcaption>Figure by author</figcaption></figure><h4>3. A wildcard rule</h4><p>Now we add a rule telling how to create the above target files:</p><pre>rule rank_country:<br>  output:<br>     &quot;results/data/example-dataset/ranking-{country}-{n, \d+}.txt&quot;,<br>     &quot;results/data/example-dataset/rate-{country}-{n, \d+}.txt&quot;,<br>  shell:<br>      &quot;&quot;&quot;<br>      #!/bin/bash<br>      trap &#39;kill $(jobs -p)&#39; EXIT<br>      nethogs -d 1 -bt |grep python &gt;  {output[1]} &amp;<br>      reflector --country {wildcards.country} --score 20 --sort rate &gt; {output[0]}<br>      &quot;&quot;&quot;</pre><p>When this rule is triggered, it spawns a bash script that creates the files.</p><h4>4. Further processing</h4><p>We can process the rate files further, turning them into csv format:</p><pre>rule rate_to_csv:<br>  input:<br>     &quot;results/data/example-dataset/rate-{country}-{n, \d+}.txt&quot;<br>  output:<br>     &quot;results/data/example-dataset/rate-{country}-{n, \d+}.csv&quot;<br>  shell:<br>    &quot;&quot;&quot;<br>    awk -F &quot;\\t&quot; -v OFS=&quot;,&quot; &#39;BEGIN {{print \&quot;up,down\&quot;}} {{print $2, $3}}&#39; {input} &gt; {output}<br>    &quot;&quot;&quot;<br><br>rule rate_csv:<br>  input:<br>     expand(&quot;results/data/example-dataset/{type}-{country}-{n}.csv&quot;, type=[&quot;rate&quot;], n=range(N_RUNS), country=COUNTRIES),</pre><p>The awk script prints a header for table and removes the first column of output from nethogs. Then it prints column 2 (up) and 3 (down) with a comma in between.</p><h4>5. Rule for debugging</h4><p>For debugging I used below shell command. I have put it into a rule for completeness.</p><pre>rule show_rate_lengths:<br>  shell:<br>    &quot;wc -l results/data/example-dataset/rate*.csv | sort -n&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*65Y7uzkuQ5My45Z2WDOJvA.png" /><figcaption>Figure by author</figcaption></figure><h3>6. Building the dataset</h3><p>The dataset can be build with a simple command:</p><pre>snakemake -c1 rate_to_csv</pre><p>Snakemake now builds graph (DAG) of dependencies.</p><p>It looks for missing targets, for input files that have changed and for other dependencies that have changed. Then it decides which rules need to be executed.</p><p>After the the dataset is build, we are ready to work with it.</p><p>Here are the recorded download rates for India for 3 runs:</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*B1BOLNLINO8isBGb4INgEg.png" /><figcaption>Figure by author</figcaption></figure><p>And here you see averages and variability over 10 runs per country:</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*VYqcbkf6eC1Ta0AmWqpsMw.png" /><figcaption>Figure by author</figcaption></figure><h3>Conclusion</h3><p>On the command line, data can often be inspected and manipulated with just a couple of one-liners.</p><p>If we glue those scripts together with a general scripting language, then we end up re-computing every step of the workflow for each change that we make.</p><p>We could use gnu make to manage workflows, but then we still have to write boiler code to manage conda environments and containers.</p><p>Snakemake handles all of these aspects of data workflows and many more; like parallelism and distributed computing.</p><p>Snakemake works with an intuitive language that is a mixture of Python and Yaml. It is natural to read and easy to learn.</p><p>Perfect for building datasets!</p><h3>Learn more</h3><p><a href="https://medium.com/@desjoerdhaan/measuring-app-network-usage-with-a-script-b4c80e897e0b">Measuring mirror throughput with bash</a></p><p><a href="https://snakemake.readthedocs.io/">Snakemake documentation</a></p><p>I am going to write two more articles on this topic:</p><ol><li>A challenge on ranking statistics. Will be based on a similar dataset</li><li>A tutorial on Snakefile rules</li></ol><p>Follow me to get notified for the next episode.</p><p>Feel free to connect to me on <a href="https://www.linkedin.com/in/sjoerddehaan/"><strong>LinkedIn</strong></a>. I love it when you include a small message.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bb48b10aa9b7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/building-datasets-with-bash-bb48b10aa9b7">Building datasets with Bash</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Measuring app network usage with a script]]></title>
            <link>https://medium.com/@desjoerdhaan/measuring-app-network-usage-with-a-script-b4c80e897e0b?source=rss-67d3f3438a1e------2</link>
            <guid isPermaLink="false">https://medium.com/p/b4c80e897e0b</guid>
            <category><![CDATA[arch]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[shell]]></category>
            <category><![CDATA[bash]]></category>
            <category><![CDATA[scripting]]></category>
            <dc:creator><![CDATA[Sjoerd de haan]]></dc:creator>
            <pubDate>Fri, 24 Nov 2023 08:42:38 GMT</pubDate>
            <atom:updated>2023-12-05T00:58:12.069Z</atom:updated>
            <content:encoded><![CDATA[<h3>Measuring mirror throughput with bash</h3><p>Measuring throughput&#39;s of mirror ranking script would make a nice dataset, I figured.</p><p>That lead me to Nethogs a tool like top, that shows total bandwidth per process:</p><figure><img alt="Image from https://www.techgrube.de/wp-content/uploads/2015/06/nethogs_1.png" src="https://cdn-images-1.medium.com/proxy/1*AsQkMW-9oRqmm8v-mKFsBA.png" /></figure><p>Wow! This shows upload and download per process and device.</p><p>And a nice interface that we are used to from top.</p><h4>Towards a script</h4><p>For generating a dataset, I need more though:</p><ol><li>A dump, and not a user interface</li><li>The dump must start as soon as the mirror ranking script starts</li><li>The dump must finish when when the mirror ranking script finishes</li><li>The dump must be filtered on process</li></ol><h4>Dumping nethogs</h4><p>nethogs has a dump option &#39;-t&#39; that produces an endless stream of updates. It updates every -d seconds.</p><p>The dump looks like this:</p><pre>&gt; nethogs -tb -d 2<br>Adding local address: 192.168.67.145<br>Adding local address: 240b:c020:471:405e:5e80:b6ff:fe68:2770<br>Adding local address: fe80::5e80:b6ff:fe68:2770<br>Ethernet link detected<br><br>Refreshing:<br>unknown TCP/0/0 0       0<br><br>Refreshing:<br>unknown TCP/0/0 0       0<br><br>Refreshing:<br>unknown TCP/0/0 0       0<br><br>Refreshing:<br>/usr/lib/firefox/firefox/2853/1000      0.0347656       0.0347656<br>unknown TCP/0/0 0       0</pre><p>sed can easily filter out the process I want to monitoring (process name is python)</p><pre>nethogs -d 2 -bt | grep python</pre><h4>Let’s create a shell script</h4><p>nethogs can be moved to the background with &amp; so that the download script can start.</p><p>I use trap to set a callback on the EXIT signal. Once the script sends the EXIT signal, trap launches the following payload:</p><pre>kill $(jobs -p)</pre><p>jobs - p lists all child processes and kill ends them.</p><p>Let’s put it all together:</p><pre>trap &#39;kill $(jobs -p)&#39; EXIT<br>nethogs -d 2 -bt | grep python &gt; rates.txt &amp;<br>reflector  --score 5 &gt; mirrors.txt</pre><p>And this is resulting table of throughput:</p><pre>cat rates.txt<br><br>/usr/bin/python/703838/1000	13.59	1808.46<br>/usr/bin/python/703838/1000	14.5596	1717.18<br>/usr/bin/python/703838/1000	14.6182	1694.34<br>/usr/bin/python/703838/1000	13.2963	1683.07</pre><h4>What about mirror ranking?</h4><p>Reflector, measures throughput of Arch Linux mirrors and ranks them.</p><p>Here we see it’s output:</p><pre>cat mirrors.txt</pre><pre>################################################################################<br>################# Arch Linux mirrorlist generated by Reflector #################<br>################################################################################<br><br># With:       reflector --score 5 --sort rate<br># When:       2023-11-24 08:17:19 UTC<br># From:       https://archlinux.org/mirrors/status/json/<br># Retrieved:  2023-11-24 08:16:59 UTC<br># Last Check: 2023-11-24 08:07:33 UTC<br><br>Server = https://mirror.osbeck.com/archlinux/$repo/os/$arch<br>Server = http://mirror.ubrco.de/archlinux/$repo/os/$arch<br>Server = http://arch.jensgutermuth.de/$repo/os/$arch<br>Server = http://mirrors.qontinuum.space/archlinux/$repo/os/$arch<br>Server = <a href="http://mirror.moson.org/arch/$repo/os/$arch">http://mirror.moson.org/arch/$repo/os/$arch</a></pre><p>There is a lot more to say about reflector and the dataset that I generated.</p><p>I will update you in a next article.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b4c80e897e0b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why I use Fish Shell]]></title>
            <link>https://medium.com/@desjoerdhaan/why-i-use-fish-shell-e5272e0770bf?source=rss-67d3f3438a1e------2</link>
            <guid isPermaLink="false">https://medium.com/p/e5272e0770bf</guid>
            <category><![CDATA[bash]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[shell]]></category>
            <dc:creator><![CDATA[Sjoerd de haan]]></dc:creator>
            <pubDate>Fri, 17 Nov 2023 06:49:10 GMT</pubDate>
            <atom:updated>2024-03-11T07:06:51.924Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H0JfpqeYxcVqnRvl5T_isw.png" /></figure><h4>Develop transferable shell skills quickly with fish</h4><p>tldr: With Bash I often did not start automating because the time investment of learning is not worth the effort. With fish you have one environment that is configured and pretty complete out of the box. It allows you to automate way more than you could possibly do with Bash or ZSH in the same amount of time.</p><h3>What I love about fish</h3><p>I have been using the <a href="https://fishshell.com/">Fish shell</a> for a couple of years. Let me take you through some of the features that make me love this shell.</p><p>Here are three reasons why I do not want to change to another shell:</p><ol><li>Fish provides good defaults out of the box. Unlike ZSH and other shells, it takes no time to set up and configure fish. After installation you have a functional shell that including features like vi and emacs key-binds, private mode, auto completion, highlighting and theming.</li><li>The scripting language is more sane than bash. It provides proper scoping, better argument parsing and better string manipulations.</li><li>Further it has great documentation, error message, examples, tab completion, and other features that add to its discoverability.</li></ol><blockquote>Every configuration option in a program is a place where the program is too stupid to figure out for itself what the user really wants, and should be considered a failure of both the program and the programmer who implemented it.</blockquote><p>Quoting the design documentation. Read it <a href="https://fishshell.com/docs/current/design.html">here</a>. It’s an interesting read.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*6MYBN93azDlTejTxCbatww.png" /></figure><h3>Extendability</h3><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*6r2nPw62N9toqrT3qJnoVQ.png" /></figure><p>The fish language makes extensive use of callables. Even for assigning variables, fish uses a callable. Callables can be build-ins, functions or shell executables. They are treated mostly equal.</p><p>This makes the language highly configurable..</p><p>Here is an example of the ‘set’ builtin that assigns variables:</p><pre>&gt; set x 5<br>&gt; echo $x<br>5</pre><p>Fish provides a couple of callables that are build-in’s like type and set:</p><pre>&gt; type type<br>type is a builtin<br>&gt; type set<br>set is a builtin</pre><p>The majority of callables that fish provides are functions. This includes aliases, prompt, and coloring functions.<br> For example, this is a prompt function:</p><pre>function fish_prompt<br>    # A simple prompt. Displays the current directory<br>    # (which fish stores in the $PWD variable)<br>    # and then a user symbol - a &#39;►&#39; for a normal user and a &#39;#&#39; for root.<br>    set -l user_char &#39;►&#39;<br>    if fish_is_root_user<br>        set user_char &#39;#&#39;<br>    end<br><br>    echo (set_color yellow)$PWD (set_color purple)$user_char<br>end<br>``&#39;<br>The prompt can be configured by re-defining the prompt function. <br><br><br>The executable `ls&#39; is an alias function:<br>```fish<br>&gt; type ls<br>ls is a function with definition<br># Defined in /usr/share/fish/functions/ls.fish @ line 20<br>function ls --description &#39;List contents of directory&#39;<br>    # Make ls use colors and show indicators if we are on a system that supports that feature and writing to stdout.<br>....</pre><h3>Functions</h3><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*KMYav3IMdk_d7ilpTFxnSw.png" /></figure><p>Fish makes it easy to modify functions. The following command let you modify the function la:</p><pre>&gt; funced la</pre><p>This opens $EDITOR with the content of the la functions</p><pre>#<br># These are very common and useful<br>#<br>function la --wraps ls --description &quot;List contents of directory, including hidden files in directory using long format&quot;<br>    ls -lAh $argv<br>end</pre><p>As you can see, la is an alias for ls.</p><p>After modifying a function, it is redefined for the current session. You can save it to the user’s autoload directory with one simple command:</p><pre>funcsave la</pre><p>To view all functions, use functions</p><pre>&gt; functions<br>N_, abbr, alias, bg, cd, cdh, contains_seq, diff, dirh, dirs, disown, down-or-search, edit_command_buffer, export, fg, fish_add_path, fish_breakpoint_prompt, fish_clipboard_copy, fish_clipboard_paste, fish_command_not_found, fish_commandline_append,<br>fish_commandline_prepend, fish_config, fish_default_key_bindings, fish_default_mode_prompt, fish_delta, fish_git_prompt, fish_greeting, fish_hg_prompt, fish_hybrid_key_bindings, fish_is_root_user, fish_job_summary, fish_mode_prompt, fish_opt, fish_print_git_action,<br>fish_print_hg_root, fish_prompt, fish_right_prompt, fish_sigtrap_handler, fish_status_to_signal, fish_svn_prompt, fish_title, fish_update_completions, fish_vcs_prompt, fish_vi_cursor, fish_vi_cursor_handle, fish_vi_cursor_handle_preexec, fish_vi_key_bindings, fisher,<br>funced, funcsave, fzf_configure_bindings, fzf_key_bindings, grep, help, history, isatty, kill, la, ll, ls, man, micromamba, nextd, open, popd, prevd, prompt_hostname, prompt_login, prompt_pwd, psub, pushd, realpath, return_last_status, seq, setenv, suspend, trap, umask,<br>up-or-search, vared, wait</pre><p>functions can also be used to inspect the source of a function:</p><pre>&gt; functions fg<br># Defined in /usr/share/fish/config.fish @ line 229<br>function fg<br>    builtin fg (__fish_expand_pid_args $argv)[-1]<br>end</pre><h4>Variables are lists</h4><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*7beoRPooIzvEAtEXMLq37Q.png" /></figure><p>Fish has good native support for lists. It has to because all variables in fish are lists.</p><p>Concatenation for example:</p><pre>&gt; set characters a b c d<br>&gt; set characters $characters e f<br>&gt; echo $characters<br>a b c d e f</pre><p>It also has convenient functions like count</p><pre>&gt; count $EDITOR<br>1<br>&gt; count $PATH<br>6<br>```fish<br><br>And it implements indexing like this:<br>```fish<br>&gt; echo $PATH[1]<br>/usr/local/sbin<br>&gt; echo $EDITOR[1]<br>vim<br>```fish<br><br>And slicing:<br>```fish<br>&gt; echo $characters [1..1]<br>a<br>&gt; echo $characters [1..2]<br>a b<br>&gt; echo $characters [-1..2]<br>a b<br>/usr/bin/core_perl</pre><h3>Command substitutions</h3><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*ElVgoopInDCfTb2GGgCvCQ.png" /></figure><p>Unlike most shells, there is not need to back-tick command substitutions:</p><pre>&gt; echo &quot;last file eddited: &quot; (ls -1t | head -n 1)<br>last file eddited:  public</pre><p>There is no $ character needed, unless the command substitution takes is surrounded by double quotes:</p><pre>&gt; echo &quot;last file eddited:  $(ls -1t | head -n 1)&quot;<br>last file eddited:  public</pre><pre>&gt; touch &quot;week-$(date +%W).txt&quot;<br>week-46.txt</pre><h3>Theming</h3><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*Jz0r9WE8tbmJVKJlmkdUeA.png" /></figure><p>Fish provides functions that let you preview and set themes with ease.</p><pre># List all themes<br>fish_config theme list <br># Show a single theme <br>fish_config theme show Tomorrow <br># Show all themes<br>fish_config theme show <br># Choose a theeme<br>fish_config theme choose Tomorrow</pre><p>This is the default prompt on my machine:</p><figure><img alt="Default prompt" src="https://cdn-images-1.medium.com/proxy/1*a9b9OReRosE9OWzJlSk9vA.png" /><figcaption>Default prompt</figcaption></figure><p>Choosing a fish prompt is easy too</p><pre># List all prompts<br>fish_config prompt list <br># Show a single prompt example<br>fish_config prompt show informative <br># Choose a theeme<br>fish_config prompt choose informative</pre><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*R4O8t1BW8nc3Nzdd5xV45w.png" /></figure><p>Fish even provides a web based configuration tool with</p><pre>fish_config</pre><h3>Getting help</h3><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*M3wqNPQ0VnoVOwznjtagaQ.png" /></figure><p>By default fish opens up a browser to show help pages</p><p>These are some useful help pages:</p><pre>&gt; help tutorial<br>&gt; help interactive # more about <br>&gt; help expand-brace<br>&gt; help language</pre><p>And some specific sections:<br> <a href="https://fishshell.com/docs/current/interactive.html#shared-bindings">Shared key bindings</a><br> <a href="https://fishshell.com/docs/current/interactive.html#command-mode">Vi key bindings command mode</a><br> <a href="https://fishshell.com/docs/current/interactive.html#insert-mode">Vi key bindings insert mode</a><br> <a href="https://fishshell.com/docs/current/interactive.html#visual-mode">Vi key bindings visual mode</a><br> <a href="https://fishshell.com/docs/current/interactive.html#emacs-mode-commands">Emacs key bindings</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e5272e0770bf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Japan and the habit of doing]]></title>
            <link>https://medium.com/@desjoerdhaan/japan-and-the-habit-of-doing-a891ed05b695?source=rss-67d3f3438a1e------2</link>
            <guid isPermaLink="false">https://medium.com/p/a891ed05b695</guid>
            <category><![CDATA[education]]></category>
            <category><![CDATA[japan]]></category>
            <category><![CDATA[morning-routines]]></category>
            <category><![CDATA[retirement]]></category>
            <category><![CDATA[habits]]></category>
            <dc:creator><![CDATA[Sjoerd de haan]]></dc:creator>
            <pubDate>Thu, 16 Nov 2023 05:30:32 GMT</pubDate>
            <atom:updated>2023-11-18T00:31:10.774Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LF4GLWmkiXI_x1Lew-Fhkg.jpeg" /></figure><p>For the past 14 weeks I have been living in Japan.</p><p>Every day I the Japanese amazed me with their inclination towards action or “doing”.</p><blockquote>From kindergarten till retirement, and after; doing is a way of live in Japan.</blockquote><p>Let me tell you how I get reminded of the Japanese their preference for action every day.</p><h3>Getting up a 5 o’clock</h3><p>From the morning onward, I see a bias towards action.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*N2ku9NhGib8kLdOXVyuI0Q.jpeg" /></figure><p>When I get up at 5 o’clock in the morning, the streets are far from empty. People walk, run, and kneel down in their gardens to start the day gardening. Others are make their way to their cars to drive to work.</p><p>While I stretch out my yoga mat in a small public park, I hear families waking up and cooking meal for breakfast. Children cry over the vegetables they need to eat. About an hour later they will join me in the park for their exercise drill.</p><h3>Work</h3><p>At 6:30 most of my neighbors have left for work. They will not be back before 17:00. Most arrive back around 19:00.</p><p>At work Japanese act professionally. There is little room for surprise or improvisation. Everything is packed up with routine.</p><h3>Relics of labor</h3><p>When I walk out of the door I am greeted by relics of labour every single time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*GcYy9IcQl0sqzNve5VZZvA.jpeg" /></figure><p>One of examples is electricity poles. A myriad of cables is craft-full connected to splitters, insulators, and junctions that reach into other, smaller and larger, poles. Eventually the cables and boxes lead into to houses, which they enter via their facades.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*prA_GGp7apx89tchNuI9qg.jpeg" /></figure><p>Whenever I see this marvel, I am reminded of the army of engineers that must be working day and night to keep this system up and running. They are skillful engineers; that leaves no doubt. While cycling, I see them working in groups of two or three on cherry-pickers. Their belts and suits are stuffed with equipment.<br> Three other man guide traffic around the cherry-pickers on the ground.</p><p>On the day that my family moved into our rental house, an engineer of the energy company came to connect gas and electricity. He spent a couple of hours changing and connecting parts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*MfNDLzc8mskxHWVQjvDaPg.jpeg" /></figure><p>Why does all this remind me of craft and doing?</p><p>In the Netherlands the electricity companies plan large maintenance projects for the whole street maybe once every 25 years. Their engineers are nowhere to be seen. They made the plans and the drawings. The energy companies send contractors that open the streets, replace the cables and disappear. When we move into a new house, no one turns up to connect the gas or the electricity.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*LIhTghAGTG5e701XQ3WVVg.jpeg" /></figure><h3>Kindergarten</h3><p>The first years in kindergarten(3–5 years old) revolve about sports, music, arts and teamwork.</p><p>From a young age the children learn to participate in a group. They go on trips walking in the fields. They practice for weeks for an upcoming sport event. They practice standing in line and to take their positions on the sing of their teacher.</p><p>About every month there is another event to prepare for. Over the course of weeks, the teachers practice with the children relentlessly to get ready for the event. The children’s skills and confidence is growing. As the date for the event nears, the group knows what to do and what to expect.</p><p>In the Netherlands, there is more emphasis on verbal skills, on one-to-one interactions, and on expressing as an individual. Every child is encouraged to talk, for example in front of the group about their weekend. The older children help the younger children to tie there shoes. Children learn to work together in pairs and communicate their needs and discuss the process. There is a bit of sports, maybe twice a week. There is a bit of music, perhaps once per week.</p><h3>Retirement</h3><p>Japan has an aging population. I guess half of my neighbors is enjoying retirement.<br> It is not common to have hobbies or free time in Japan. Many retirees continue to work after retirement. The once that are lucky to have a house with land may start a second career as a small farmer.</p><p>Where pensioners in the Netherlands tend to sleep longer than the working population, in Japan pensioners sleep less. I know three pensioners and they wake up sleepless at between 4 and 5 in the morning. Usually they start the day doing something. Cooking, walking, gardening.</p><h3>What I learned about “doing” in Japan</h3><p>In Japan, “doing” is not always a means to an end. Often, the Japanese value the process as much as the outcome.</p><p>That can be inspiring. Take the sports day of my son. At his daycare they are preparing a full month for the sports day. They practice every day. For a four year olds, that provides a wonderful opportunity to learn, to be part of a group and to gain confidence. There is relatively little value attached to on individual achievement. It is all about the process, and I think that is wonderful.</p><p>In some cases the process has become a burden that does not serve a purpose. Take recycling. Every household spends about two hours per week cleaning their cartons and plastics and tying their paper in a specific shape. If it is not done exactly in the prescribed way, our garbage is not accepted. As a result many people avoid recycling. It makes me frown. What is the point of a beautiful wrapped stacked of recycling paper if the garbage man throws it straight into the shredded immediately?</p><p>I learned that doing has strong merits. Just don’t overdo it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a891ed05b695" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>