diff options
Diffstat (limited to 'gemfeed/atom.xml.tmp')
| -rw-r--r-- | gemfeed/atom.xml.tmp | 764 |
1 files changed, 382 insertions, 382 deletions
diff --git a/gemfeed/atom.xml.tmp b/gemfeed/atom.xml.tmp index 1a04f5b7..7c5d5a68 100644 --- a/gemfeed/atom.xml.tmp +++ b/gemfeed/atom.xml.tmp @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <feed xmlns="http://www.w3.org/2005/Atom"> - <updated>2023-05-25T20:03:41+03:00</updated> + <updated>2023-05-28T00:01:07+03:00</updated> <title>foo.zone feed</title> <subtitle>To be in the .zone!</subtitle> <link href="gemini://foo.zone/gemfeed/atom.xml" rel="self" /> @@ -13,7 +13,7 @@ <updated>2023-05-06T17:23:16+03:00</updated> <author> <name>Paul Buetow</name> - <email>hi@paul.cyou</email> + <email>hi@foo.zone</email> </author> <summary>These are my personal takeaways after reading 'The Obstacle Is the Way' by Ryan Holiday. This is mainly for my own use, but you might find it helpful too.</summary> <content type="xhtml"> @@ -27,14 +27,14 @@ <br /> <pre> ,.......... .........., - ,..,' '.' ',.., - ,' ,' : ', ', - ,' ,' : ', ', - ,' ,' : ', ', - ,' ,'............., : ,.............', ', -,' '............ '.' ............' ', - '''''''''''''''''';''';'''''''''''''''''' - ''' + ,..,' '.' ',.., + ,' ,' : ', ', + ,' ,' : ', ', + ,' ,' : ', ', + ,' ,'............., : ,.............', ', +,' '............ '.' ............' ', + '''''''''''''''''';''';'''''''''''''''''' + ''' </pre> <br /> <span>"The obstacle is the way" is a powerful statement that encapsulates the wisdom of turning challenges into opportunities for growth and success. We will explore using obstacles as fuel, transforming weaknesses into strengths, and adopting a mindset that allows us to be creative and persistent in the face of adversity.</span><br /> @@ -43,9 +43,9 @@ <br /> <span>The obstacle in your path can become your path to success. Instead of being paralyzed by challenges, see them as opportunities to learn and grow. Remember, the things that hurt us often instruct us. </span><br /> <br /> -<span>We spend a lot of time trying to get things perfect and look at the rules, but what matters is that it works; it doesn't need to be after the book. Focus on results rather than on beautiful methods. In Jujitsu, it does matter that you bring your opponent down, but not how. There are many ways from point A to point B; it doesn't need to be a straight line. So many try to find the best solution but need to catch up on what is in Infront of them. Think progress and not perfection.</span><br /> +<span>We spend a lot of time trying to get things perfect and look at the rules, but what matters is that it works; it doesn't need to be after the book. Focus on results rather than on beautiful methods. In Jujitsu, it does matter that you bring your opponent down, but not how. There are many ways from point A to point B; it doesn't need to be a straight line. So many try to find the best solution but need to catch up on what is in Infront of them. Think progress and not perfection.</span><br /> <br /> -<span>Don't always try to use the front door; a backdoor could open. It's nonsense. Don't fight the judo master with judo. Non-action can be action, exposing the weaknesses of others.</span><br /> +<span>Don't always try to use the front door; a backdoor could open. It's nonsense. Don't fight the judo master with judo. Non-action can be action, exposing the weaknesses of others.</span><br /> <br /> <br /> <h2 style='display: inline'>Embrace rationality</h2><br /> @@ -54,13 +54,13 @@ <br /> <h2 style='display: inline'>Control your response</h2><br /> <br /> -<span>You can choose how you respond to obstacles. Focus on what you can control, and don't let yourself feel harmed by external circumstances. Remember, you decide how things affect you; nobody else does. Choose to feel good in response to any situation. Embrace the challenges and obstacles that come your way, as they are opportunities for growth and learning.</span><br /> +<span>You can choose how you respond to obstacles. Focus on what you can control, and don't let yourself feel harmed by external circumstances. Remember, you decide how things affect you; nobody else does. Choose to feel good in response to any situation. Embrace the challenges and obstacles that come your way, as they are opportunities for growth and learning.</span><br /> <br /> <h2 style='display: inline'>Practice emotional and physical resilience</h2><br /> <br /> <span>Martial artists know the importance of developing physical and emotional strength. Cultivate the art of not panicking; it will help you avoid making mistakes during high-pressure situations.</span><br /> <br /> -<span>Focus on what you can control. Don't choose to feel harmed, and then you won't be harmed. I decide things that affect me; nobody else does. E.g., in prison, your mind stays your own. Don't ignore fear but explain it away, have a different view.</span><br /> +<span>Focus on what you can control. Don't choose to feel harmed, and then you won't be harmed. I decide things that affect me; nobody else does. E.g., in prison, your mind stays your own. Don't ignore fear but explain it away, have a different view.</span><br /> <br /> <h2 style='display: inline'>Persistence and patience</h2><br /> <br /> @@ -72,11 +72,11 @@ <br /> <h2 style='display: inline'>Be adaptable</h2><br /> <br /> -<span>There are many ways to achieve your goals; sometimes, unconventional methods are necessary. Feel free to break the rules or go off the beaten path if it will lead to better results. Transform weaknesses into strengths. We have a choice of how to respond to things. It's not about being positive but to be creative. Aim high, but stuff will happen; E.g., surprises will always happen.</span><br /> +<span>There are many ways to achieve your goals; sometimes, unconventional methods are necessary. Feel free to break the rules or go off the beaten path if it will lead to better results. Transform weaknesses into strengths. We have a choice of how to respond to things. It's not about being positive but to be creative. Aim high, but stuff will happen; E.g., surprises will always happen.</span><br /> <br /> <h2 style='display: inline'>Embrace non-action</h2><br /> <br /> -<span>We constantly push to the next thing. Sometimes the best course of action is standing still or even going backwards. Obstacles might resolve by themselves. Or going sideways. Sometimes, the best action is to stand still, go sideways, or even go backwards. Obstacles may resolve themselves or present new opportunities if you're patient and observant. People always want your input before you have all the facts. They want you to play after their rules. The question is, do you let them? The English call it the cool head. Being in control of Stress; requires practice. Appear, the absence of fear (Greek). When all others do it one way, it does not mean it is the correct or best practice.</span><br /> +<span>We constantly push to the next thing. Sometimes the best course of action is standing still or even going backwards. Obstacles might resolve by themselves. Or going sideways. Sometimes, the best action is to stand still, go sideways, or even go backwards. Obstacles may resolve themselves or present new opportunities if you're patient and observant. People always want your input before you have all the facts. They want you to play after their rules. The question is, do you let them? The English call it the cool head. Being in control of Stress; requires practice. Appear, the absence of fear (Greek). When all others do it one way, it does not mean it is the correct or best practice.</span><br /> <br /> <h2 style='display: inline'>Leverage crisis</h2><br /> <br /> @@ -84,19 +84,19 @@ <br /> <span>The art of not panicking; otherwise, you will make mistakes. When overs are shocked, you know which way to take due to your thinking of the problem at Hand. A crisis gives you a chance to do things which never done before. Ordinary people shy from negative situations; great people use these for their benefit and are the most effective. The obstacle is not just turned upside down but used as a catapult.</span><br /> <br /> -<span>Be prepared for nothing to work. Problems are an opportunity to do your best, not to do miracles. Always manage your expectations. It will suck, but it will be ok. Be prepared to begin from the beginning. Be cheerful and eagerly work on the next obstacle. Each time you become better. Life is not a sprint but a marathon. After each obstacle lies another obstacle, there won't be anything without obstacles. Passing one means you are ready for the next.</span><br /> +<span>Be prepared for nothing to work. Problems are an opportunity to do your best, not to do miracles. Always manage your expectations. It will suck, but it will be ok. Be prepared to begin from the beginning. Be cheerful and eagerly work on the next obstacle. Each time you become better. Life is not a sprint but a marathon. After each obstacle lies another obstacle, there won't be anything without obstacles. Passing one means you are ready for the next.</span><br /> <br /> <h2 style='display: inline'>Build your inner citadel</h2><br /> <br /> <span>Develop your inner strength during good times so you can rely on it in bad times. Always prepare for adversity and face it with calmness and resilience. Be humble enough that things which happen will happen. Build your inner citadel. In good times strengthen it. In bad times rely on it.</span><br /> <br /> -<span>We should always prepare for things to get tough. Your house burns down: no worries, we eliminated much rubbish. Imagine what can go wrong before things go wrong. We are prepared for adversity; it's other people who aren't. Phil Jackson's hip problem example. To receive unexpected benefits, you must first accept the unexpected obstacles. Meditate on death. It's a universal obstacle. Use it as a reminder to do your best.</span><br /> +<span>We should always prepare for things to get tough. Your house burns down: no worries, we eliminated much rubbish. Imagine what can go wrong before things go wrong. We are prepared for adversity; it's other people who aren't. Phil Jackson's hip problem example. To receive unexpected benefits, you must first accept the unexpected obstacles. Meditate on death. It's a universal obstacle. Use it as a reminder to do your best.</span><br /> <br /> <h2 style='display: inline'>Love everything that happens</h2><br /> <br /> -<span>Turn an obstacle the other way around for your benefit. Use it at fuel. It's simple but challenging. Most are paralyzed instead. The obstacle in the path becomes the path. Obstacles are neither good nor bad. The things which hurt, instruct.</span><br /> +<span>Turn an obstacle the other way around for your benefit. Use it at fuel. It's simple but challenging. Most are paralyzed instead. The obstacle in the path becomes the path. Obstacles are neither good nor bad. The things which hurt, instruct.</span><br /> <br /> -<span>Should I hate people who hate me? That's their problem and not mine. Be always calm and relaxed during the fight. The story of the battle is the story of the smile. Cheerfulness in all situations, especially the bad ones. Love for everything that happens; if it happens, it was meant to happen. We can choose how we react to things, so why not choose to feel good? I love everything that happens. You must never lower yourself to the person you don't like.</span><br /> +<span>Should I hate people who hate me? That's their problem and not mine. Be always calm and relaxed during the fight. The story of the battle is the story of the smile. Cheerfulness in all situations, especially the bad ones. Love for everything that happens; if it happens, it was meant to happen. We can choose how we react to things, so why not choose to feel good? I love everything that happens. You must never lower yourself to the person you don't like.</span><br /> <br /> <h2 style='display: inline'>Conclusion</h2><br /> <br /> @@ -122,7 +122,7 @@ <updated>2023-04-30T13:10:26+03:00</updated> <author> <name>Paul Buetow</name> - <email>hi@paul.cyou</email> + <email>hi@foo.zone</email> </author> <summary>For fun, I am tracking the uptime of various personal machines (servers, laptops, workstations...). I have been doing this for over ten years now, so I have a lot of statistics collected.</summary> <content type="xhtml"> @@ -152,7 +152,7 @@ <br /> <span>For fun, I am tracking the uptime of various personal machines (servers, laptops, workstations...). I have been doing this for over ten years now, so I have a lot of statistics collected.</span><br /> <br /> -<span>As a result of this, I am introducing <span class='inlinecode'>guprecords.raku</span>, a handy Raku script that helps me combine uptime statistics from multiple servers into one comprehensive report. In this blog post, I'll explore what Guprecords is and some examples of its application. I will also add some notes on Raku.</span><br /> +<span>As a result of this, I am introducing <span class='inlinecode'>guprecords.raku</span>, a handy Raku script that helps me combine uptime statistics from multiple servers into one comprehensive report. In this blog post, I'll explore what Guprecords is and some examples of its application. I will also add some notes on Raku.</span><br /> <br /> <span>Guprecords, or global uptime records, is a Raku script designed to generate a consolidated uptime report from multiple hosts:</span><br /> <br /> @@ -177,7 +177,7 @@ <br /> <ul> <li>1. Generating uptime statistics using <span class='inlinecode'>uptimed</span>: First, I need to install and run <span class='inlinecode'>uptimed</span> on each host to generate uptime statistics. This tool is available for most common Linux and *BSD distributions and macOS via Homebrew.</li> -<li>2. Collecting uptime records to a central location: The next step involves collecting the raw uptime statistics files generated by <span class='inlinecode'>uptimed</span> on each host. It's a good idea to store all record files in a central git repository. The records file contains information about the total uptime since boot, boot time, and the operating system and kernel version. Guprecords itself does not do the collection part, but have a look at the <span class='inlinecode'>README.md</span> in the git repository for some guidance.</li> +<li>2. Collecting uptime records to a central location: The next step involves collecting the raw uptime statistics files generated by <span class='inlinecode'>uptimed</span> on each host. It's a good idea to store all record files in a central git repository. The records file contains information about the total uptime since boot, boot time, and the operating system and kernel version. Guprecords itself does not do the collection part, but have a look at the <span class='inlinecode'>README.md</span> in the git repository for some guidance.</li> <li>3. Generating global uptime stats: Finally, run the <span class='inlinecode'>guprecords.raku</span> script with the appropriate flags to create a global uptime report. For example, I can use the following command:</li> </ul><br /> <!-- Generator: GNU source-highlight 3.1.9 @@ -199,10 +199,10 @@ http://www.gnu.org/software/src-highlite --> </ul><br /> <h2 style='display: inline'>Example</h2><br /> <br /> -<span>You have already seen an example at the very top of this post, where the hosts were grouped by their total lifespans (uptime+downtime). Here's an example of what the global uptime report (grouped by total host uptimes) might look like:</span><br /> +<span>You have already seen an example at the very top of this post, where the hosts were grouped by their total lifespans (uptime+downtime). Here's an example of what the global uptime report (grouped by total host uptimes) might look like:</span><br /> <br /> <pre> -Top 20 Uptime's by Host +Top 20 Uptime's by Host +-----+-----------------+-----------------------------+ | Pos | Host | Uptime | @@ -236,7 +236,7 @@ Top 20 Uptime's by Host <br /> <a class='textlink' href='../uptime-stats.html'>My machine uptime stats</a><br /> <br /> -<span>Just recently, I decommissioned <span class='inlinecode'>vulcan</span> (the number one stop from above), which used to be my CentOS 7 (initially CentOS 6) VM hosting my personal NextCloud and Wallabag (which I modernised just recently with a brand new shiny Rocky Linux 9 VM). This was the last <span class='inlinecode'>uptimed</span> output before shutting it down (it always makes me feel sentimental decommissioning one of my machines <span class='inlinecode'>:'-(</span>):</span><br /> +<span>Just recently, I decommissioned <span class='inlinecode'>vulcan</span> (the number one stop from above), which used to be my CentOS 7 (initially CentOS 6) VM hosting my personal NextCloud and Wallabag (which I modernised just recently with a brand new shiny Rocky Linux 9 VM). This was the last <span class='inlinecode'>uptimed</span> output before shutting it down (it always makes me feel sentimental decommissioning one of my machines <span class='inlinecode'>:'-(</span>):</span><br /> <br /> <pre> # Uptime | System Boot up @@ -270,17 +270,17 @@ no1 in 455 days, 18:52:44 | at Sun Jul 21 07:37:51 2024 <br /> <h2 style='display: inline'>Conclusion</h2><br /> <br /> -<span>Guprecords is a small, yet powerful tool for analyzing uptime statistics. While developing Guprecords, I have come to truly appreciate and love Raku's expressiveness. The language is designed to be both powerful and flexible, allowing developers to express their intentions and logic more clearly and concisely.</span><br /> +<span>Guprecords is a small, yet powerful tool for analyzing uptime statistics. While developing Guprecords, I have come to truly appreciate and love Raku's expressiveness. The language is designed to be both powerful and flexible, allowing developers to express their intentions and logic more clearly and concisely.</span><br /> <br /> -<span>Raku's expressive syntax, support for multiple programming paradigms, and unique features, such as grammars and lazy evaluation, make it a joy to work with. </span><br /> +<span>Raku's expressive syntax, support for multiple programming paradigms, and unique features, such as grammars and lazy evaluation, make it a joy to work with. </span><br /> <br /> -<span>Working on Guprecords in Raku has been an enjoyable experience, and I've found that Raku's expressiveness has significantly contributed to the overall quality and effectiveness of the script. The language's ability to elegantly express complex logic and data manipulation tasks makes it an excellent choice for developing tools like these, where expressiveness and productiveness are of the utmost importance.</span><br /> +<span>Working on Guprecords in Raku has been an enjoyable experience, and I've found that Raku's expressiveness has significantly contributed to the overall quality and effectiveness of the script. The language's ability to elegantly express complex logic and data manipulation tasks makes it an excellent choice for developing tools like these, where expressiveness and productiveness are of the utmost importance.</span><br /> <br /> -<span>So far, I have only scratched the surface of what Raku can do. I hope to find more time to become a regular Rakoon (a Raku Programmer). I have many Ideas for other small tools like Guprecords, but the challenge is finding the time. I'd love to explore Raku Grammars and also I would love to explore writing concurrent code in Raku (I also love Go (Golang), btw!). Ideas for future Raku personal projects include:</span><br /> +<span>So far, I have only scratched the surface of what Raku can do. I hope to find more time to become a regular Rakoon (a Raku Programmer). I have many Ideas for other small tools like Guprecords, but the challenge is finding the time. I'd love to explore Raku Grammars and also I would love to explore writing concurrent code in Raku (I also love Go (Golang), btw!). Ideas for future Raku personal projects include:</span><br /> <br /> <ul> <li>A log file analyzer, for generating anonymized <span class='inlinecode'>foo.zone</span> visitor stats for both, the Web and Gemini.</li> -<li>A social media sharing scheduler a la <span class='inlinecode'>buffer.com</span>. I am using Buffer at the moment to share posts on Mastadon, Twitter, Telegram and LinkedIn, but it is proprietary and also it's not really reliable.</li> +<li>A social media sharing scheduler a la <span class='inlinecode'>buffer.com</span>. I am using Buffer at the moment to share posts on Mastadon, Twitter, Telegram and LinkedIn, but it is proprietary and also it's not really reliable.</li> <li>Rewrite the static photo album generator of <span class='inlinecode'>irregular.ninja</span> in Raku (from Bash).</li> </ul><br /> <span>Other related posts are:</span><br /> @@ -304,7 +304,7 @@ no1 in 455 days, 18:52:44 | at Sun Jul 21 07:37:51 2024 <updated>2023-04-09T22:31:42+03:00</updated> <author> <name>Paul Buetow</name> - <email>hi@paul.cyou</email> + <email>hi@foo.zone</email> </author> <summary>This is the first blog post about my Algorithms and Data Structures in Go series. I am not a Software Developer in my day job. In my current role, programming and scripting skills are desirable but not mandatory. I have been learning about Data Structures and Algorithms many years ago at University. I thought it would be fun to revisit/refresh my knowledge here and implement many of the algorithms in Go.</summary> <content type="xhtml"> @@ -316,7 +316,7 @@ no1 in 455 days, 18:52:44 | at Sun Jul 21 07:37:51 2024 <pre> ,_---~~~~~----._ _,,_,*^____ _____``*g*\"*, - / __/ /' ^. / \ ^@q f + / __/ /' ^. / \ ^@q f [ @f | @)) | | @)) l 0 _/ \`/ \~____ / __ \_____/ \ | _l__l_ I @@ -478,7 +478,7 @@ http://www.gnu.org/software/src-highlite --> <br /> <h2 style='display: inline'>Sleep sort</h2><br /> <br /> -<span>Let's implement our first algorithm, sleep sort. Sleep sort is a non-traditional and unconventional sorting algorithm based on the idea of waiting a certain amount of time corresponding to the value of each element in the input <span class='inlinecode'>ArrayList</span>. It's more of a fun, creative concept rather than an efficient or practical sorting technique. This is not a sorting algorithm you would use in any production code. As you can imagine, it is quite an inefficient sorting algorithm (it's only listed here as a warm-up exercise). This sorting method may also return false results depending on how the Goroutines are scheduled by the Go runtime. </span><br /> +<span>Let's implement our first algorithm, sleep sort. Sleep sort is a non-traditional and unconventional sorting algorithm based on the idea of waiting a certain amount of time corresponding to the value of each element in the input <span class='inlinecode'>ArrayList</span>. It's more of a fun, creative concept rather than an efficient or practical sorting technique. This is not a sorting algorithm you would use in any production code. As you can imagine, it is quite an inefficient sorting algorithm (it's only listed here as a warm-up exercise). This sorting method may also return false results depending on how the Goroutines are scheduled by the Go runtime. </span><br /> <br /> <br /> <!-- Generator: GNU source-highlight 3.1.9 @@ -521,7 +521,7 @@ http://www.gnu.org/software/src-highlite --> <font color="#FF0000">}</font> </pre> <br /> -<span>This Go code implements the sleep sort algorithm using generics and goroutines. The main function <span class='inlinecode'>Sleep[V ds.Integer](a ds.ArrayList[V]) ds.ArrayList[V]</span> takes a generic <span class='inlinecode'>ArrayList</span> as input and returns a sorted <span class='inlinecode'>ArrayList</span>. The code creates a separate goroutine for each element in the input array, sleeps for a duration proportional to the element's value, and then sends the element to a channel. Another goroutine waits for all the sleeping goroutines to finish and then closes the channel. The sorted result <span class='inlinecode'>ArrayList</span> is constructed by appending the elements received from the channel in the order they arrive. The <span class='inlinecode'>sync.WaitGroup</span> is used to synchronize goroutines and ensure that all of them have completed before closing the channel.</span><br /> +<span>This Go code implements the sleep sort algorithm using generics and goroutines. The main function <span class='inlinecode'>Sleep[V ds.Integer](a ds.ArrayList[V]) ds.ArrayList[V]</span> takes a generic <span class='inlinecode'>ArrayList</span> as input and returns a sorted <span class='inlinecode'>ArrayList</span>. The code creates a separate goroutine for each element in the input array, sleeps for a duration proportional to the element's value, and then sends the element to a channel. Another goroutine waits for all the sleeping goroutines to finish and then closes the channel. The sorted result <span class='inlinecode'>ArrayList</span> is constructed by appending the elements received from the channel in the order they arrive. The <span class='inlinecode'>sync.WaitGroup</span> is used to synchronize goroutines and ensure that all of them have completed before closing the channel.</span><br /> <br /> <h3 style='display: inline'>Testing</h3><br /> <br /> @@ -562,7 +562,7 @@ PASS ok codeberg<font color="#990000">.</font>org/snonux/algorithms/sort <font color="#993399">9</font><font color="#990000">.</font>002s </pre> <br /> -<span>I won't write any benchmark for sleep sort; that will be done for the algorithms to come in this series :-).</span><br /> +<span>I won't write any benchmark for sleep sort; that will be done for the algorithms to come in this series :-).</span><br /> <br /> <span>E-Mail your comments to hi@foo.zone :-)</span><br /> <br /> @@ -577,7 +577,7 @@ ok codeberg<font color="#990000">.</font>org/snonux/algorithms/sort <fo <updated>2023-04-01T20:00:17+03:00</updated> <author> <name>Paul Buetow</name> - <email>hi@paul.cyou</email> + <email>hi@foo.zone</email> </author> <summary>These are my personal takeaways after reading 'Never split the difference' by Chris Voss. Note that the book contains much more knowledge wisdom and that these notes only contain points I personally found worth writing down. This is mainly for my own use, but you might find it helpful too.</summary> <content type="xhtml"> @@ -590,14 +590,14 @@ ok codeberg<font color="#990000">.</font>org/snonux/algorithms/sort <fo <br /> <pre> ,.......... .........., - ,..,' '.' ',.., - ,' ,' : ', ', - ,' ,' : ', ', - ,' ,' : ', ', - ,' ,'............., : ,.............', ', -,' '............ '.' ............' ', - '''''''''''''''''';''';'''''''''''''''''' - ''' + ,..,' '.' ',.., + ,' ,' : ', ', + ,' ,' : ', ', + ,' ,' : ', ', + ,' ,'............., : ,.............', ', +,' '............ '.' ............' ', + '''''''''''''''''';''';'''''''''''''''''' + ''' </pre> <br /> <h2 style='display: inline'>Tactical listening, spreading empathy</h2><br /> @@ -607,7 +607,7 @@ ok codeberg<font color="#990000">.</font>org/snonux/algorithms/sort <fo <ul> <li>A mirror needs space and silence between the words. At least 4 seconds.</li> <li>A mirror might be awkward to be used at first, especially with a question coupled to it.</li> -<li>We fear what's different and are drawn to what is similar.</li> +<li>We fear what's different and are drawn to what is similar.</li> </ul><br /> <span>Mirror training is like Jedi training. Simple but effective. A mirror needs space. Be silent after "you want this?" </span><br /> <br /> @@ -621,33 +621,33 @@ ok codeberg<font color="#990000">.</font>org/snonux/algorithms/sort <fo <li>Detect and label the emotions of others for your powers. </li> <li>To be understood seems to solve all problems magically.</li> </ul><br /> -<span>Try: to put a label on someone's emotion and then be silent. Wait for the other to reveal himself. "You seem unhappy about this?"</span><br /> +<span>Try: to put a label on someone's emotion and then be silent. Wait for the other to reveal himself. "You seem unhappy about this?"</span><br /> <br /> <h3 style='display: inline'>More tips </h3><br /> <br /> <ul> -<li>Put on a poker face and don't show emotions.</li> -<li>Slow things down. Don't be a problem solver.</li> +<li>Put on a poker face and don't show emotions.</li> +<li>Slow things down. Don't be a problem solver.</li> <li>Smile while you are talking, even on the phone. Be easy and encouraging.</li> <li>Being right is not the key to successful negotiation; being mindful is.</li> <li>Be in the safe zone of empathy and acknowledge bad news.</li> </ul><br /> <h2 style='display: inline'>"No" starts the conversation</h2><br /> <br /> -<span>When the opponent starts with a "no", he feels in control and comfortable. That's why he has to start with "no".</span><br /> +<span>When the opponent starts with a "no", he feels in control and comfortable. That's why he has to start with "no".</span><br /> <br /> <ul> <li>"Yes" and "maybe" might be worthless, but "no" starts the conversation.</li> <li>If someone is saying "no" to you, he will be open to what you have to say next.</li> <li>"No" is not stopping the negotiation but will open up opportunities you were not thinking about before.</li> -<li>Start with "no". Great negotiators seek "no" because that's when the great discussions begin.</li> -<li>A "no" can be scary if you are not used to it. If your biggest fear is "no", then you can't negotiate.</li> +<li>Start with "no". Great negotiators seek "no" because that's when the great discussions begin.</li> +<li>A "no" can be scary if you are not used to it. If your biggest fear is "no", then you can't negotiate.</li> </ul><br /> -<span>Get a "That's right" when negotiating. Don't get a "you're right". You can summarise the opponent to get a "that's right".</span><br /> +<span>Get a "That's right" when negotiating. Don't get a "you're right". You can summarise the opponent to get a "that's right".</span><br /> <br /> <h2 style='display: inline'>Win-win</h2><br /> <br /> -<span>Win-win is a naive approach when encountering the win-lose counterpart, but always cooperate. Don't compromise, and don't split the difference. We don't compromise because it's right; we do it because it is easy. You must embrace the hard stuff; that's where the great deals are.</span><br /> +<span>Win-win is a naive approach when encountering the win-lose counterpart, but always cooperate. Don't compromise, and don't split the difference. We don't compromise because it's right; we do it because it is easy. You must embrace the hard stuff; that's where the great deals are.</span><br /> <br /> <h2 style='display: inline'>On Deadlines</h2><br /> <br /> @@ -673,15 +673,15 @@ ok codeberg<font color="#990000">.</font>org/snonux/algorithms/sort <fo <br /> <span>...then put an extreme anker.</span><br /> <br /> -<span>You always have to embrace thoughtful confrontation for good negotiation and life. Don't avoid honest, clear conflict. It will give you the best deals. Compromises are mostly bad deals for both sides. Most people don't negotiate a win-win but a win-lose. Know the best and worst outcomes and what is acceptable for you.</span><br /> +<span>You always have to embrace thoughtful confrontation for good negotiation and life. Don't avoid honest, clear conflict. It will give you the best deals. Compromises are mostly bad deals for both sides. Most people don't negotiate a win-win but a win-lose. Know the best and worst outcomes and what is acceptable for you.</span><br /> <br /> <h2 style='display: inline'>Calibrated question</h2><br /> <br /> <span>Calibrated questions. Give the opponent a sense of power. Ask open-how questions to get the opponent to solve your problem and move him in your direction. Calibrated questions are the best tools. Summarise everything, and then ask, "how I am supposed to do that?". Asking for help this way with a calibrated question is a powerful tool for joint problem solving</span><br /> <br /> -<span>Being calm and respectful is essential. Without control of your emotions, it won't work. The counterpart will have no idea how constrained they are with your question. Avoid questions which get a yes or short answers. Use "why?".</span><br /> +<span>Being calm and respectful is essential. Without control of your emotions, it won't work. The counterpart will have no idea how constrained they are with your question. Avoid questions which get a yes or short answers. Use "why?".</span><br /> <br /> -<span>Counterparts are more involved if these are their solutions. The counterpart must answer with "that's right", not "you are right". He has to own the problem. If not, then add more why questions.</span><br /> +<span>Counterparts are more involved if these are their solutions. The counterpart must answer with "that's right", not "you are right". He has to own the problem. If not, then add more why questions.</span><br /> <br /> <ul> <li>Tone and body language need to align with what people are saying.</li> @@ -693,7 +693,7 @@ ok codeberg<font color="#990000">.</font>org/snonux/algorithms/sort <fo <br /> <h2 style='display: inline'>The black swan </h2><br /> <br /> -<span>What we don't know can break our deal. Uncovering it can bring us unexpected success. You get what you ask for in this world, but you must learn to ask correctly. Reveal the black swan by asking questions.</span><br /> +<span>What we don't know can break our deal. Uncovering it can bring us unexpected success. You get what you ask for in this world, but you must learn to ask correctly. Reveal the black swan by asking questions.</span><br /> <br /> <h2 style='display: inline'>More</h2><br /> <br /> @@ -707,8 +707,8 @@ ok codeberg<font color="#990000">.</font>org/snonux/algorithms/sort <fo <li>Set an extreme anker. Make the counterpart the illusion of losing something.</li> <li>Hope-based deals. Hope is not a strategy.</li> <li>Tactical empathy, listening as a martial art. It is emotional intelligence on steroids.</li> -<li>Being right isn't the key to a successful negotiation, but having the correct mindset is.</li> -<li>Don't shop the groceries when you are hungry.</li> +<li>Being right isn't the key to a successful negotiation, but having the correct mindset is.</li> +<li>Don't shop the groceries when you are hungry.</li> </ul><br /> <span>Slow.... it.... down....</span><br /> <br /> @@ -731,12 +731,12 @@ ok codeberg<font color="#990000">.</font>org/snonux/algorithms/sort <fo <updated>2023-03-25T17:50:32+02:00</updated> <author> <name>Paul Buetow</name> - <email>hi@paul.cyou</email> + <email>hi@foo.zone</email> </author> <summary>I proudly announce that I've released Gemtexter version `2.0.0`. What is Gemtexter? It's my minimalist static site generator for Gemini Gemtext, HTML and Markdown written in GNU Bash.</summary> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline'>Gemtexter 2.0.0 - Let's Gemtext again²</h1><br /> + <h1 style='display: inline'>Gemtexter 2.0.0 - Let's Gemtext again²</h1><br /> <br /> <span class='quote'>Published at 2023-03-25T17:50:32+02:00</span><br /> <br /> @@ -753,13 +753,13 @@ ok codeberg<font color="#990000">.</font>org/snonux/algorithms/sort <fo mod. by Paul Buetow `"""""""""` </pre> <br /> -<span>I proudly announce that I've released Gemtexter version <span class='inlinecode'>2.0.0</span>. What is Gemtexter? It's my minimalist static site generator for Gemini Gemtext, HTML and Markdown written in GNU Bash.</span><br /> +<span>I proudly announce that I've released Gemtexter version <span class='inlinecode'>2.0.0</span>. What is Gemtexter? It's my minimalist static site generator for Gemini Gemtext, HTML and Markdown written in GNU Bash.</span><br /> <br /> <a class='textlink' href='https://codeberg.org/snonux/gemtexter'>https://codeberg.org/snonux/gemtexter</a><br /> <br /> <span>This is a new major release, so it contains a breaking change (see "Meta cache made obsolete").</span><br /> <br /> -<span>Let's list what's new!</span><br /> +<span>Let's list what's new!</span><br /> <br /> <h2 style='display: inline'>Minimal template engine</h2><br /> <br /> @@ -885,8 +885,8 @@ The remaining content of the Gemtext file<font color="#990000">...</font> <br /> <span>Other related posts are:</span><br /> <br /> -<a class='textlink' href='./2023-03-25-gemtexter-2.0.0-lets-gemtext-again-2.html'>2023-03-25 Gemtexter 2.0.0 - Let's Gemtext again² (You are currently reading this)</a><br /> -<a class='textlink' href='./2022-08-27-gemtexter-1.1.0-lets-gemtext-again.html'>2022-08-27 Gemtexter 1.1.0 - Let's Gemtext again</a><br /> +<a class='textlink' href='./2023-03-25-gemtexter-2.0.0-lets-gemtext-again-2.html'>2023-03-25 Gemtexter 2.0.0 - Let's Gemtext again² (You are currently reading this)</a><br /> +<a class='textlink' href='./2022-08-27-gemtexter-1.1.0-lets-gemtext-again.html'>2022-08-27 Gemtexter 1.1.0 - Let's Gemtext again</a><br /> <a class='textlink' href='./2021-06-05-gemtexter-one-bash-script-to-rule-it-all.html'>2021-06-05 Gemtexter - One Bash script to rule it all</a><br /> <a class='textlink' href='./2021-04-24-welcome-to-the-geminispace.html'>2021-04-24 Welcome to the Geminispace</a><br /> <br /> @@ -903,7 +903,7 @@ The remaining content of the Gemtext file<font color="#990000">...</font> <updated>2023-03-16T00:55:20+02:00</updated> <author> <name>Paul Buetow</name> - <email>hi@paul.cyou</email> + <email>hi@foo.zone</email> </author> <summary>These are my personal takeaways after reading 'The Pragmatic Programmer' by David Thomas and Andrew Hunt. Note that the book contains much more knowledge wisdom and that these notes only contain points I personally found worth writing down. This is mainly for my own use, but you might find it helpful too.</summary> <content type="xhtml"> @@ -916,14 +916,14 @@ The remaining content of the Gemtext file<font color="#990000">...</font> <br /> <pre> ,.......... .........., - ,..,' '.' ',.., - ,' ,' : ', ', - ,' ,' : ', ', - ,' ,' : ', ', - ,' ,'............., : ,.............', ', -,' '............ '.' ............' ', - '''''''''''''''''';''';'''''''''''''''''' - ''' + ,..,' '.' ',.., + ,' ,' : ', ', + ,' ,' : ', ', + ,' ,' : ', ', + ,' ,'............., : ,.............', ', +,' '............ '.' ............' ', + '''''''''''''''''';''';'''''''''''''''''' + ''' </pre> <br /> <span>Think about your work while doing it - every day on every project. Have a feeling of continuous improvement. </span><br /> @@ -943,7 +943,7 @@ The remaining content of the Gemtext file<font color="#990000">...</font> <li>Crashing is often the best thing you can do. </li> <li>Changes should be reversible.</li> </ul><br /> -<span>Erlang: Defensive programming is a waste of time. Let it crash. "This can never happen" - don't practise that kind of self-deception when programming. </span><br /> +<span>Erlang: Defensive programming is a waste of time. Let it crash. "This can never happen" - don't practise that kind of self-deception when programming. </span><br /> <br /> <span>Leave assertions in the code, even in production. Only leave out the assertions causing the performance issues.</span><br /> <br /> @@ -955,9 +955,9 @@ The remaining content of the Gemtext file<font color="#990000">...</font> <li>Refactor now and not later.</li> <li>Later, it will be even more painful.</li> </ul><br /> -<span>Don't think outside the box. Find the box. The box is more extensive than you think. Think about the hard problem at hand. Do you have to do it a certain way, or do you have to do it at all?</span><br /> +<span>Don't think outside the box. Find the box. The box is more extensive than you think. Think about the hard problem at hand. Do you have to do it a certain way, or do you have to do it at all?</span><br /> <br /> -<span>Do what works and not what's fashionable. E.g. does SCRUM make sense? The goal is to deliver deliverables and not to "become" agile.</span><br /> +<span>Do what works and not what's fashionable. E.g. does SCRUM make sense? The goal is to deliver deliverables and not to "become" agile.</span><br /> <br /> <h2 style='display: inline'>Continuous learning</h2><br /> <br /> @@ -972,7 +972,7 @@ The remaining content of the Gemtext file<font color="#990000">...</font> <br /> <h2 style='display: inline'>Stay connected</h2><br /> <br /> -<span>It's your life, and you own it. Bruce Lee once said: </span><br /> +<span>It's your life, and you own it. Bruce Lee once said: </span><br /> <br /> <span class='quote'>"I am not on the world to life after your expectations, neither are you to life after mine."</span><br /> <br /> @@ -981,13 +981,13 @@ The remaining content of the Gemtext file<font color="#990000">...</font> <li>Stay current.</li> <li>Dealing with computers is hard. Dealing with people is harder. </li> </ul><br /> -<span>It's your life. Share it, celebrate it, be proud and have fun.</span><br /> +<span>It's your life. Share it, celebrate it, be proud and have fun.</span><br /> <br /> <h2 style='display: inline'>The story of stone soup</h2><br /> <br /> <span>How to motivate others to contribute something (e.g. ideas to a startup):</span><br /> <br /> -<span class='quote'>A kindly, old stranger was walking through the land when he came upon a village. As he entered, the villagers moved towards their homes, locking doors and windows. The stranger smiled and asked, why are you all so frightened. I am a simple traveler, looking for a soft place to stay for the night and a warm place for a meal. "There's not a bite to eat in the whole province," he was told. "We are weak and our children are starving. Better keep moving on." "Oh, I have everything I need," he said. "In fact, I was thinking of making some stone soup to share with all of you." He pulled an iron cauldron from his cloak, filled it with water, and began to build a fire under it. Then, with great ceremony, he drew an ordinary-looking stone from a silken bag and dropped it into the water. By now, hearing the rumor of food, most of the villagers had come out of their homes or watched from their windows. As the stranger sniffed the "broth" and licked his lips in anticipation, hunger began to overcome their fear. "Ahh," the stranger said to himself rather loudly, "I do like a tasty stone soup. Of course, stone soup with cabbage -- that's hard to beat." Soon a villager approached hesitantly, holding a small cabbage he'd retrieved from its hiding place, and added it to the pot. "Wonderful!!" cried the stranger. "You know, I once had stone soup with cabbage and a bit of salt beef as well, and it was fit for a king." The village butcher managed to find some salt beef . . . And so it went, through potatoes, onions, carrots, mushrooms, and so on, until there was indeed a delicious meal for everyone in the village to share. The village elder offered the stranger a great deal of money for the magic stone, but he refused to sell it and traveled on the next day. As he left, the stranger came upon a group of village children standing near the road. He gave the silken bag containing the stone to the youngest child, whispering to a group, "It was not the stone, but the villagers that had performed the magic." </span><br /> +<span class='quote'>A kindly, old stranger was walking through the land when he came upon a village. As he entered, the villagers moved towards their homes, locking doors and windows. The stranger smiled and asked, why are you all so frightened. I am a simple traveler, looking for a soft place to stay for the night and a warm place for a meal. "There's not a bite to eat in the whole province," he was told. "We are weak and our children are starving. Better keep moving on." "Oh, I have everything I need," he said. "In fact, I was thinking of making some stone soup to share with all of you." He pulled an iron cauldron from his cloak, filled it with water, and began to build a fire under it. Then, with great ceremony, he drew an ordinary-looking stone from a silken bag and dropped it into the water. By now, hearing the rumor of food, most of the villagers had come out of their homes or watched from their windows. As the stranger sniffed the "broth" and licked his lips in anticipation, hunger began to overcome their fear. "Ahh," the stranger said to himself rather loudly, "I do like a tasty stone soup. Of course, stone soup with cabbage -- that's hard to beat." Soon a villager approached hesitantly, holding a small cabbage he'd retrieved from its hiding place, and added it to the pot. "Wonderful!!" cried the stranger. "You know, I once had stone soup with cabbage and a bit of salt beef as well, and it was fit for a king." The village butcher managed to find some salt beef . . . And so it went, through potatoes, onions, carrots, mushrooms, and so on, until there was indeed a delicious meal for everyone in the village to share. The village elder offered the stranger a great deal of money for the magic stone, but he refused to sell it and traveled on the next day. As he left, the stranger came upon a group of village children standing near the road. He gave the silken bag containing the stone to the youngest child, whispering to a group, "It was not the stone, but the villagers that had performed the magic." </span><br /> <br /> <span>By working together, everyone contributes what they can, achieving a greater good together.</span><br /> <br /> @@ -1011,7 +1011,7 @@ The remaining content of the Gemtext file<font color="#990000">...</font> <updated>2023-02-26T23:48:01+02:00</updated> <author> <name>Paul Buetow</name> - <email>hi@paul.cyou</email> + <email>hi@foo.zone</email> </author> <summary>Do you need help fully discharging from work in the evenings or for the weekend? Shutting down from work won't just improve your work-life balance; it will also significantly improve the quality of your personal life and work. After a restful weekend, you will be much more energized and productive the next working day. So it should not just be in your own, but also your employers' interest that you fully relax and shut down after work. </summary> <content type="xhtml"> @@ -1105,7 +1105,7 @@ The remaining content of the Gemtext file<font color="#990000">...</font> <updated>2023-01-23T15:31:52+02:00</updated> <author> <name>Paul Buetow</name> - <email>hi@paul.cyou</email> + <email>hi@foo.zone</email> </author> <summary>Art by Joan Stark</summary> <content type="xhtml"> @@ -1262,7 +1262,7 @@ Art by Joan Stark <updated>2022-12-24T23:18:40+02:00</updated> <author> <name>Paul Buetow</name> - <email>hi@paul.cyou</email> + <email>hi@foo.zone</email> </author> <summary>As a regular participant in the annual Pet Project competition at work, I always try to find a project where I can learn something new. In this post, I would like to share my takeaways after revisiting Java. You can read about my motivations in my 'Creative universe' post:</summary> <content type="xhtml"> @@ -1386,7 +1386,7 @@ Art by Joan Stark <updated>2022-11-24T11:17:15+02:00</updated> <author> <name>Paul Buetow</name> - <email>hi@paul.cyou</email> + <email>hi@foo.zone</email> </author> <summary>Art by \ \_! / __!</summary> <content type="xhtml"> @@ -1587,7 +1587,7 @@ nmap ,<b><font color="#0000FF">j</font></b> :<b><font color="#0000FF">call</font <updated>2022-10-30T11:03:19+02:00</updated> <author> <name>Paul Buetow</name> - <email>hi@paul.cyou</email> + <email>hi@foo.zone</email> </author> <summary>This will be a quick blog post, as I am busy with my personal life now. I have relocated to a different country and am still busy arranging things. So bear with me :-)</summary> <content type="xhtml"> @@ -1599,7 +1599,7 @@ nmap ,<b><font color="#0000FF">j</font></b> :<b><font color="#0000FF">call</font <pre> ,_---~~~~~----._ _,,_,*^____ _____``*g*\"*, -/ __/ /' ^. / \ ^@q f +/ __/ /' ^. / \ ^@q f @f | | | | 0 _/ \`/ \~__((@/ __ \__((@/ \ | _l__l_ I <--- The Go Gopher @@ -1610,27 +1610,27 @@ nmap ,<b><font color="#0000FF">j</font></b> :<b><font color="#0000FF">call</font | | | | A ; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~|~~~,--,-/ \---,-/|~~,~~~~~~~~~~~~~~~~~~~~~~~~~~~ - _|\,'. /| /| `/|-. - \`.' /| , `;. - ,'\ A A A A _ /| `.; + _|\,'. /| /| `/|-. + \`.' /| , `;. + ,'\ A A A A _ /| `.; ,/ _ A _ / _ /| ; /\ / \ , , A / / `/| /_| | _ \ , , ,/ \ // | |/ `.\ ,- , , ,/ ,/ \/ - / @| |@ / /' \ \ , > /| ,--. - |\_/ \_/ / | | , ,/ \ ./' __:.. - | __ __ | | | .--. , > > |-' / ` - ,/| / ' \ | | | \ , | / + / @| |@ / /' \ \ , > /| ,--. + |\_/ \_/ / | | , ,/ \ ./' __:.. + | __ __ | | | .--. , > > |-' / ` + ,/| / ' \ | | | \ , | / / |<--.__,->| | | . `. > > / ( - /_,' \\ ^ / \ / / `. >-- /^\ | - \\___/ \ / / \__' \ \ \/ \ | + /_,' \\ ^ / \ / / `. >-- /^\ | + \\___/ \ / / \__' \ \ \/ \ | `. |/ , , /`\ \ ) - \ ' |/ , V \ / `-\ - OpenBSD Puffy ---> `|/ ' V V \ \.' \_ - '`-. V V \./'\ + \ ' |/ , V \ / `-\ + OpenBSD Puffy ---> `|/ ' V V \ \.' \_ + '`-. V V \./'\ `|/-. \ / \ /,---`\ kat - / `._____V_____V' - ' ' + / `._____V_____V' + ' ' </pre> <br /> <span>This will be a quick blog post, as I am busy with my personal life now. I have relocated to a different country and am still busy arranging things. So bear with me :-)</span><br /> @@ -1641,7 +1641,7 @@ nmap ,<b><font color="#0000FF">j</font></b> :<b><font color="#0000FF">call</font <br /> <span>I am using Rexify for my OpenBSD automation. Check out the following article covering my Rex setup in a little bit more detail:</span><br /> <br /> -<a class='textlink' href='./2022-07-30-lets-encrypt-with-openbsd-and-rex.html'>Let's Encrypt with OpenBSD and Rex</a><br /> +<a class='textlink' href='./2022-07-30-lets-encrypt-with-openbsd-and-rex.html'>Let's Encrypt with OpenBSD and Rex</a><br /> <br /> <span>I will also mention some relevant <span class='inlinecode'>Rexfile</span> snippets in this post!</span><br /> <br /> @@ -1672,7 +1672,7 @@ $ file dtail dtail: ELF 64-bit LSB executable, x86-64, version 1 </pre> <br /> -<span>Now, there isn't any need anymore to keep <span class='inlinecode'>git</span>, <span class='inlinecode'>go</span> and <span class='inlinecode'>gmake</span>, so they can be deinstalled now:</span><br /> +<span>Now, there isn't any need anymore to keep <span class='inlinecode'>git</span>, <span class='inlinecode'>go</span> and <span class='inlinecode'>gmake</span>, so they can be deinstalled now:</span><br /> <br /> <pre> $ doas pkg_delete git go gmake @@ -1701,7 +1701,7 @@ $ doas usermod -d /var/run/dserver/ _dserver <span>The OpenBSD init script is created from scratch (not part of the official DTail project). Run the following to install the bespoke script:</span><br /> <br /> <pre> -$ cat <<'END' | doas tee /etc/rc.d/dserver +$ cat <<'END' | doas tee /etc/rc.d/dserver #!/bin/ksh daemon="/usr/local/bin/dserver" @@ -1724,19 +1724,19 @@ $ doas chmod 755 /etc/rc.d/dserver <br /> <h3 style='display: inline'>Rexification</h3><br /> <br /> -<span>This is the task for setting it up via Rex. Note the <span class='inlinecode'>. . . .</span>, that's a placeholder which we will fill up more and more during this blog post:</span><br /> +<span>This is the task for setting it up via Rex. Note the <span class='inlinecode'>. . . .</span>, that's a placeholder which we will fill up more and more during this blog post:</span><br /> <br /> <pre> -desc 'Setup DTail'; -task 'dtail', group => 'frontends', +desc 'Setup DTail'; +task 'dtail', group => 'frontends', sub { my $restart = FALSE; - file '/etc/rc.d/dserver': - content => template('./etc/rc.d/dserver.tpl'), - owner => 'root', - group => 'wheel', - mode => '755', + file '/etc/rc.d/dserver': + content => template('./etc/rc.d/dserver.tpl'), + owner => 'root', + group => 'wheel', + mode => '755', on_change => sub { $restart = TRUE }; . @@ -1744,8 +1744,8 @@ task 'dtail', group => 'frontends', . . - service 'dserver' => 'restart' if $restart; - service 'dserver', ensure => 'started'; + service 'dserver' => 'restart' if $restart; + service 'dserver', ensure => 'started'; }; </pre> <br /> @@ -1774,35 +1774,35 @@ $ curl https://raw.githubusercontent.com/mimecast/dtail/master/samples/dtail.jso <br /> <h3 style='display: inline'>Rexification</h3><br /> <br /> -<span>That's as simple as adding the following to the Rex task:</span><br /> +<span>That's as simple as adding the following to the Rex task:</span><br /> <br /> <pre> -file '/etc/dserver', - ensure => 'directory'; +file '/etc/dserver', + ensure => 'directory'; -file '/etc/dserver/dtail.json', - content => template('./etc/dserver/dtail.json.tpl'), - owner => 'root', - group => 'wheel', - mode => '755', +file '/etc/dserver/dtail.json', + content => template('./etc/dserver/dtail.json.tpl'), + owner => 'root', + group => 'wheel', + mode => '755', on_change => sub { $restart = TRUE }; </pre> <br /> <h2 style='display: inline'>Update the key cache for it</h2><br /> <br /> -<span>DTail relies on SSH for secure authentication and communication. However, the system user <span class='inlinecode'>_dserver</span> has no permission to read the SSH public keys from the user's home directories, so the DTail server also checks for available public keys in an alternative path <span class='inlinecode'>/var/run/dserver/cache</span>. </span><br /> +<span>DTail relies on SSH for secure authentication and communication. However, the system user <span class='inlinecode'>_dserver</span> has no permission to read the SSH public keys from the user's home directories, so the DTail server also checks for available public keys in an alternative path <span class='inlinecode'>/var/run/dserver/cache</span>. </span><br /> <br /> <span>The following script, populating the DTail server key cache, can be run periodically via <span class='inlinecode'>CRON</span>:</span><br /> <br /> <pre> -$ cat <<'END' | doas tee /usr/local/bin/dserver-update-key-cache.sh +$ cat <<'END' | doas tee /usr/local/bin/dserver-update-key-cache.sh #!/bin/ksh CACHEDIR=/var/run/dserver/cache DSERVER_USER=_dserver DSERVER_GROUP=_dserver -echo 'Updating SSH key cache' +echo 'Updating SSH key cache' ls /home/ | while read remoteuser; do keysfile=/home/$remoteuser/.ssh/authorized_keys @@ -1824,17 +1824,17 @@ while read cachefile; do keysfile=/home/$remoteuser/.ssh/authorized_keys if [ ! -f $keysfile ]; then - echo 'Deleting obsolete cache file $cachefile' + echo 'Deleting obsolete cache file $cachefile' rm $cachefile fi done -echo 'All set...' +echo 'All set...' END $ doas chmod 500 /usr/local/bin/dserver-update-key-cache.sh </pre> <br /> -<span>Note that the script above is a slight variation of the official DTail script. The official DTail one is a <span class='inlinecode'>bash</span> script, but on OpenBSD, there's <span class='inlinecode'>ksh</span>. I run it once daily by adding it to the <span class='inlinecode'>daily.local</span>:</span><br /> +<span>Note that the script above is a slight variation of the official DTail script. The official DTail one is a <span class='inlinecode'>bash</span> script, but on OpenBSD, there's <span class='inlinecode'>ksh</span>. I run it once daily by adding it to the <span class='inlinecode'>daily.local</span>:</span><br /> <br /> <pre> $ echo /usr/local/bin/dserver-update-key-cache.sh | doas tee -a /etc/daily.local @@ -1843,23 +1843,23 @@ $ echo /usr/local/bin/dserver-update-key-cache.sh | doas tee -a /etc/daily.local <br /> <h3 style='display: inline'>Rexification</h3><br /> <br /> -<span>That's done by adding ...</span><br /> +<span>That's done by adding ...</span><br /> <br /> <pre> -file '/usr/local/bin/dserver-update-key-cache.sh', - content => template('./scripts/dserver-update-key-cache.sh.tpl'), - owner => 'root', - group => 'wheel', - mode => '500'; +file '/usr/local/bin/dserver-update-key-cache.sh', + content => template('./scripts/dserver-update-key-cache.sh.tpl'), + owner => 'root', + group => 'wheel', + mode => '500'; -append_if_no_such_line '/etc/daily.local', '/usr/local/bin/dserver-update-key-cache.sh'; +append_if_no_such_line '/etc/daily.local', '/usr/local/bin/dserver-update-key-cache.sh'; </pre> <br /> <span>... to the Rex task!</span><br /> <br /> <h2 style='display: inline'>Start it</h2><br /> <br /> -<span>Now, it's time to enable and start the DTail server:</span><br /> +<span>Now, it's time to enable and start the DTail server:</span><br /> <br /> <pre> $ sudo rcctl enable dserver @@ -1883,7 +1883,7 @@ INFO|1022-090739|86050|stats.go:53|2|11|7|||MAPREDUCE:STATS|currentConnections=0 Ctr+C </pre> <br /> -<span>As we don't want to wait until tomorrow, let's populate the key cache manually:</span><br /> +<span>As we don't want to wait until tomorrow, let's populate the key cache manually:</span><br /> <br /> <pre> $ doas /usr/local/bin/dserver-update-key-cache.sh @@ -1907,7 +1907,7 @@ All set... ❯ ./dgrep -user rex -servers blowfish.buetow.org,fishfinger.buetow.org --regex local /etc/fstab CLIENT|earth|WARN|Encountered unknown host|{blowfish.buetow.org:2222 0xc0000a00f0 0xc0000a61e0 [blowfish.buetow.org]:2222 ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC9ZnF/LAk14SgqCzk38yENVTNfqibcluMTuKx1u53cKSp2xwHWzy0Ni5smFPpJDIQQljQEJl14ZdXvhhjp1kKHxJ79ubqRtIXBlC0PhlnP8Kd+mVLLHYpH9VO4rnaSfHE1kBjWkI7U6lLc6ks4flgAgGTS5Bb7pLAjwdWg794GWcnRh6kSUEQd3SftANqQLgCunDcP2Vc4KR9R78zBmEzXH/OPzl/ANgNA6wWO2OoKKy2VrjwVAab6FW15h3Lr6rYIw3KztpG+UMmEj5ReexIjXi/jUptdnUFWspvAmzIl6kwzzF8ExVyT9D75JRuHvmxXKKjyJRxqb8UnSh2JD4JN [23.88.35.144]:2222 ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC9ZnF/LAk14SgqCzk38yENVTNfqibcluMTuKx1u53cKSp2xwHWzy0Ni5smFPpJDIQQljQEJl14ZdXvhhjp1kKHxJ79ubqRtIXBlC0PhlnP8Kd+mVLLHYpH9VO4rnaSfHE1kBjWkI7U6lLc6ks4flgAgGTS5Bb7pLAjwdWg794GWcnRh6kSUEQd3SftANqQLgCunDcP2Vc4KR9R78zBmEzXH/OPzl/ANgNA6wWO2OoKKy2VrjwVAab6FW15h3Lr6rYIw3KztpG+UMmEj5ReexIjXi/jUptdnUFWspvAmzIl6kwzzF8ExVyT9D75JRuHvmxXKKjyJRxqb8UnSh2JD4JN 0xc0000a2180} CLIENT|earth|WARN|Encountered unknown host|{fishfinger.buetow.org:2222 0xc0000a0150 0xc000460110 [fishfinger.buetow.org]:2222 ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDNiikdL7+tWSN0rCaw1tOd9aQgeUFgb830V9ejkyJ5h93PKLCWZSMMCtiabc1aUeUZR//rZjcPHFLuLq/YC+Y3naYtGd6j8qVrcfG8jy3gCbs4tV9SZ9qd5E24mtYqYdGlee6JN6kEWhJxFkEwPfNlG+YAr3KC8lvEAE2JdWvaZavqsqMvHZtAX3b25WCBf2HGkyLZ+d9cnimRUOt+/+353BQFCEct/2mhMVlkr4I23CY6Tsufx0vtxx25nbFdZias6wmhxaE9p3LiWXygPWGU5iZ4RSQSImQz4zyOc9rnJeP1rwGk0OWDJhdKNXuf0kIPdzMfwxv2otgY32/DJj6L [46.23.94.99]:2222 ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDNiikdL7+tWSN0rCaw1tOd9aQgeUFgb830V9ejkyJ5h93PKLCWZSMMCtiabc1aUeUZR//rZjcPHFLuLq/YC+Y3naYtGd6j8qVrcfG8jy3gCbs4tV9SZ9qd5E24mtYqYdGlee6JN6kEWhJxFkEwPfNlG+YAr3KC8lvEAE2JdWvaZavqsqMvHZtAX3b25WCBf2HGkyLZ+d9cnimRUOt+/+353BQFCEct/2mhMVlkr4I23CY6Tsufx0vtxx25nbFdZias6wmhxaE9p3LiWXygPWGU5iZ4RSQSImQz4zyOc9rnJeP1rwGk0OWDJhdKNXuf0kIPdzMfwxv2otgY32/DJj6L 0xc0000a2240} -Encountered 2 unknown hosts: 'blowfish.buetow.org:2222,fishfinger.buetow.org:2222' +Encountered 2 unknown hosts: 'blowfish.buetow.org:2222,fishfinger.buetow.org:2222' Do you want to trust these hosts?? (y=yes,a=all,n=no,d=details): a CLIENT|earth|INFO|STATS:STATS|cgocalls=11|cpu=8|connected=2|servers=2|connected%=100|new=2|throttle=0|goroutines=19 CLIENT|earth|INFO|Added hosts to known hosts file|/home/paul/.ssh/known_hosts @@ -1915,7 +1915,7 @@ REMOTE|blowfish|100|7|fstab|31bfd9d9a6788844.h /usr/local ffs rw,wxallowed,nodev REMOTE|fishfinger|100|7|fstab|093f510ec5c0f512.h /usr/local ffs rw,wxallowed,nodev 1 2 </pre> <br /> -<span>Running it the second time, and given that you trusted the keys the first time, it won't prompt you for the host keys anymore:</span><br /> +<span>Running it the second time, and given that you trusted the keys the first time, it won't prompt you for the host keys anymore:</span><br /> <br /> <pre> ❯ ./dgrep -user rex -servers blowfish.buetow.org,fishfinger.buetow.org --regex local /etc/fstab @@ -1925,7 +1925,7 @@ REMOTE|fishfinger|100|7|fstab|093f510ec5c0f512.h /usr/local ffs rw,wxallowed,nod <br /> <h2 style='display: inline'>Conclusions</h2><br /> <br /> -<span>It's a bit of manual work, but it's ok on this small scale! I shall invest time in creating an official OpenBSD port, though. That would render most of the manual steps obsolete, as outlined in this post!</span><br /> +<span>It's a bit of manual work, but it's ok on this small scale! I shall invest time in creating an official OpenBSD port, though. That would render most of the manual steps obsolete, as outlined in this post!</span><br /> <br /> <span>Check out the following for more information:</span><br /> <br /> @@ -1952,7 +1952,7 @@ REMOTE|fishfinger|100|7|fstab|093f510ec5c0f512.h /usr/local ffs rw,wxallowed,nod <updated>2022-09-30T09:53:23+03:00</updated> <author> <name>Paul Buetow</name> - <email>hi@paul.cyou</email> + <email>hi@foo.zone</email> </author> <summary>Everyone has it once in a while: A bad night's sleep. Here I attempt to list valuable tips on how to deal with it.</summary> <content type="xhtml"> @@ -2066,12 +2066,12 @@ jgs (________\ \ <updated>2022-08-27T18:25:57+01:00</updated> <author> <name>Paul Buetow</name> - <email>hi@paul.cyou</email> + <email>hi@foo.zone</email> </author> <summary>I proudly announce that I've released Gemtexter version `1.1.0`. What is Gemtexter? It's my minimalist static site generator for Gemini Gemtext, HTML and Markdown written in GNU Bash.</summary> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline'>Gemtexter 1.1.0 - Let's Gemtext again</h1><br /> + <h1 style='display: inline'>Gemtexter 1.1.0 - Let's Gemtext again</h1><br /> <br /> <span class='quote'>Published at 2022-08-27T18:25:57+01:00</span><br /> <br /> @@ -2087,17 +2087,17 @@ jgs (________\ \ jgs `"""""""""` </pre> <br /> -<span>I proudly announce that I've released Gemtexter version <span class='inlinecode'>1.1.0</span>. What is Gemtexter? It's my minimalist static site generator for Gemini Gemtext, HTML and Markdown written in GNU Bash.</span><br /> +<span>I proudly announce that I've released Gemtexter version <span class='inlinecode'>1.1.0</span>. What is Gemtexter? It's my minimalist static site generator for Gemini Gemtext, HTML and Markdown written in GNU Bash.</span><br /> <br /> <a class='textlink' href='https://codeberg.org/snonux/gemtexter'>https://codeberg.org/snonux/gemtexter</a><br /> <br /> -<span>It has been around a year since I released the first version <span class='inlinecode'>1.0.0</span>. Although, there aren't any groundbreaking changes, there have been a couple of smaller commits and adjustments. I was quite surprised that I received a bunch of feedback and requests about Gemtexter so it means that I am not the only person in the universe actually using it.</span><br /> +<span>It has been around a year since I released the first version <span class='inlinecode'>1.0.0</span>. Although, there aren't any groundbreaking changes, there have been a couple of smaller commits and adjustments. I was quite surprised that I received a bunch of feedback and requests about Gemtexter so it means that I am not the only person in the universe actually using it.</span><br /> <br /> -<h2 style='display: inline'>What's new?</h2><br /> +<h2 style='display: inline'>What's new?</h2><br /> <br /> <h3 style='display: inline'>Automatic check for GNU version requirements</h3><br /> <br /> -<span>Gemtexter relies on the GNU versions of the tools <span class='inlinecode'>grep</span>, <span class='inlinecode'>sed</span> and <span class='inlinecode'>date</span> and it also requires the Bash shell in version 5 at least. That's now done in the <span class='inlinecode'>check_dependencies()</span> function:</span><br /> +<span>Gemtexter relies on the GNU versions of the tools <span class='inlinecode'>grep</span>, <span class='inlinecode'>sed</span> and <span class='inlinecode'>date</span> and it also requires the Bash shell in version 5 at least. That's now done in the <span class='inlinecode'>check_dependencies()</span> function:</span><br /> <br /> <!-- Generator: GNU source-highlight 3.1.9 by Lorenzo Bettini @@ -2122,11 +2122,11 @@ http://www.gnu.org/software/src-highlite --> } </pre> <br /> -<span>Especially macOS users didn't read the <span class='inlinecode'>README</span> carefully enough to install GNU Grep, GNU Sed and GNU Date before using Gemtexter.</span><br /> +<span>Especially macOS users didn't read the <span class='inlinecode'>README</span> carefully enough to install GNU Grep, GNU Sed and GNU Date before using Gemtexter.</span><br /> <br /> <h3 style='display: inline'>Backticks now produce <span class='inlinecode'>inline code blocks</span> in the HTML output</h3><br /> <br /> -<span>The Gemtext format doesn't support inline code blocks, but Gemtexter now produces <span class='inlinecode'>inline code blocks</span> (means, small code fragments can be placed in the middle of a paragraph) in the HTML output when the code block is enclosed with Backticks. There were no adjustments required for the Markdown output format, because Markdown supports it already out of the box.</span><br /> +<span>The Gemtext format doesn't support inline code blocks, but Gemtexter now produces <span class='inlinecode'>inline code blocks</span> (means, small code fragments can be placed in the middle of a paragraph) in the HTML output when the code block is enclosed with Backticks. There were no adjustments required for the Markdown output format, because Markdown supports it already out of the box.</span><br /> <br /> <h3 style='display: inline'>Cache for Atom feed generation</h3><br /> <br /> @@ -2145,7 +2145,7 @@ http://www.gnu.org/software/src-highlite --> <br /> <h3 style='display: inline'>Revamped <span class='inlinecode'>git</span> support</h3><br /> <br /> -<span>The Git support has been completely rewritten. It's now more reliable and faster too. Have a look at the <span class='inlinecode'>README</span> for more information.</span><br /> +<span>The Git support has been completely rewritten. It's now more reliable and faster too. Have a look at the <span class='inlinecode'>README</span> for more information.</span><br /> <br /> <h3 style='display: inline'>Addition of <span class='inlinecode'>htmlextras</span> and web font support</h3><br /> <br /> @@ -2153,7 +2153,7 @@ http://www.gnu.org/software/src-highlite --> <br /> <h3 style='display: inline'>Sub-section support</h3><br /> <br /> -<span>It's now possible to define sub-sections within a Gemtexter capsule. For the HTML output, each sub-section can use its own CSS and web font definitions. E.g.:</span><br /> +<span>It's now possible to define sub-sections within a Gemtexter capsule. For the HTML output, each sub-section can use its own CSS and web font definitions. E.g.:</span><br /> <br /> <a class='textlink' href='https://foo.zone'>The foo.zone main site</a><br /> <a class='textlink' href='https://foo.zone/notes'>The notes sub-section (with different fonts)</a><br /> @@ -2162,12 +2162,12 @@ http://www.gnu.org/software/src-highlite --> <br /> <span>Additionally, there were a couple of bug fixes, refactorings and overall improvements in the documentation made. </span><br /> <br /> -<span>Overall I think it's a pretty solid <span class='inlinecode'>1.1.0</span> release without anything groundbreaking (therefore no major version jump). But I am happy about it.</span><br /> +<span>Overall I think it's a pretty solid <span class='inlinecode'>1.1.0</span> release without anything groundbreaking (therefore no major version jump). But I am happy about it.</span><br /> <br /> <span>Other related posts are:</span><br /> <br /> -<a class='textlink' href='./2023-03-25-gemtexter-2.0.0-lets-gemtext-again-2.html'>2023-03-25 Gemtexter 2.0.0 - Let's Gemtext again²</a><br /> -<a class='textlink' href='./2022-08-27-gemtexter-1.1.0-lets-gemtext-again.html'>2022-08-27 Gemtexter 1.1.0 - Let's Gemtext again (You are currently reading this)</a><br /> +<a class='textlink' href='./2023-03-25-gemtexter-2.0.0-lets-gemtext-again-2.html'>2023-03-25 Gemtexter 2.0.0 - Let's Gemtext again²</a><br /> +<a class='textlink' href='./2022-08-27-gemtexter-1.1.0-lets-gemtext-again.html'>2022-08-27 Gemtexter 1.1.0 - Let's Gemtext again (You are currently reading this)</a><br /> <a class='textlink' href='./2021-06-05-gemtexter-one-bash-script-to-rule-it-all.html'>2021-06-05 Gemtexter - One Bash script to rule it all</a><br /> <a class='textlink' href='./2021-04-24-welcome-to-the-geminispace.html'>2021-04-24 Welcome to the Geminispace</a><br /> <br /> @@ -2184,7 +2184,7 @@ http://www.gnu.org/software/src-highlite --> <updated>2022-07-30T12:14:31+01:00</updated> <author> <name>Paul Buetow</name> - <email>hi@paul.cyou</email> + <email>hi@foo.zone</email> </author> <summary>I was amazed at how easy it is to automatically generate and update Let's Encrypt certificates with OpenBSD.</summary> <content type="xhtml"> @@ -2862,7 +2862,7 @@ rex commons <updated>2022-06-15T08:47:44+01:00</updated> <author> <name>Paul Buetow</name> - <email>hi@paul.cyou</email> + <email>hi@foo.zone</email> </author> <summary>This blog post is a bit different from the others. It consists of multiple but smaller projects worth mentioning. I got inspired by Julia Evan's 'Tiny programs' blog post and the side projects of The Sephist, so I thought I would also write a blog posts listing a couple of small projects of mine:</summary> <content type="xhtml"> @@ -3206,7 +3206,7 @@ v = 008 [v = p*c*(s != c ? 2 : 1)] Total logical CPUs <updated>2022-05-27T07:50:12+01:00</updated> <author> <name>Paul Buetow</name> - <email>hi@paul.cyou</email> + <email>hi@foo.zone</email> </author> <summary>Perl (the Practical Extraction and Report Language) is a battle-tested, mature, multi-paradigm dynamic programming language. Note that it's not called PERL, neither P.E.R.L. nor Pearl. 'Perl' is the name of the language and `perl` the name of the interpreter or the interpreter command.</summary> <content type="xhtml"> @@ -3217,9 +3217,9 @@ v = 008 [v = p*c*(s != c ? 2 : 1)] Total logical CPUs <br /> <a href='./2022-05-27-perl-is-still-a-great-choice/regular_expressions.png'><img alt='Comic source: XKCD' title='Comic source: XKCD' src='./2022-05-27-perl-is-still-a-great-choice/regular_expressions.png' /></a><br /> <br /> -<span>Perl (the Practical Extraction and Report Language) is a battle-tested, mature, multi-paradigm dynamic programming language. Note that it's not called PERL, neither P.E.R.L. nor Pearl. "Perl" is the name of the language and <span class='inlinecode'>perl</span> the name of the interpreter or the interpreter command.</span><br /> +<span>Perl (the Practical Extraction and Report Language) is a battle-tested, mature, multi-paradigm dynamic programming language. Note that it's not called PERL, neither P.E.R.L. nor Pearl. "Perl" is the name of the language and <span class='inlinecode'>perl</span> the name of the interpreter or the interpreter command.</span><br /> <br /> -<span>Unfortunately (it makes me sad), Perl's popularity has been declining over the last years as Google trends shows:</span><br /> +<span>Unfortunately (it makes me sad), Perl's popularity has been declining over the last years as Google trends shows:</span><br /> <br /> <a href='./2022-05-27-perl-is-still-a-great-choice/googletrendsperl.jpg'><img src='./2022-05-27-perl-is-still-a-great-choice/googletrendsperl.jpg' /></a><br /> <br /> @@ -3227,15 +3227,15 @@ v = 008 [v = p*c*(s != c ? 2 : 1)] Total logical CPUs <br /> <ul> <li>Perl is a write-only language. Nobody can read Perl code.</li> -<li>Perl? Isn't it abandoned? It's still at version 5!</li> +<li>Perl? Isn't it abandoned? It's still at version 5!</li> <li>Why use Perl as there are better alternatives?</li> <li>Why all the sigils? It looks like an exploding ASCII factory!!</li> </ul><br /> <h2 style='display: inline'>Write-only language</h2><br /> <br /> -<span>Is Perl really a write-only language? You have to understand that Perl 5 was released in 1994 (28 years ago as of this writing) and when we refer to Perl we usually mean Perl 5. That's many years, and there are many old scripts not following the modern Perl best practices (as they didn't exist yet). So yes, legacy scripts may be difficult to read. Japanese may be difficult to read too if you don't know Japanese, though.</span><br /> +<span>Is Perl really a write-only language? You have to understand that Perl 5 was released in 1994 (28 years ago as of this writing) and when we refer to Perl we usually mean Perl 5. That's many years, and there are many old scripts not following the modern Perl best practices (as they didn't exist yet). So yes, legacy scripts may be difficult to read. Japanese may be difficult to read too if you don't know Japanese, though.</span><br /> <br /> -<span>To come back to the question: Is Perl a write-only language? I don't think so. Like in any other language, you have to apply best practices in order to keep your code maintainable. Some other programming languages enforce best practices, but that makes these languages less expressive. Perl follows the principles "there is more than one way to do it" (aka TIMTOWDI) and "making easy things easy and hard things possible".</span><br /> +<span>To come back to the question: Is Perl a write-only language? I don't think so. Like in any other language, you have to apply best practices in order to keep your code maintainable. Some other programming languages enforce best practices, but that makes these languages less expressive. Perl follows the principles "there is more than one way to do it" (aka TIMTOWDI) and "making easy things easy and hard things possible".</span><br /> <br /> <span>Perl gives the programmer more flexibility in how to do things, and this results in a stronger learning curve than for lesser expressive languages like for example Go or Python. But, like in everything in life, common sense has to be applied. You should not take TIMTOWDI to the extreme in a production piece of code. In my personal opinion, it is also more satisfying to program in an expressive language.</span><br /> <br /> @@ -3244,7 +3244,7 @@ v = 008 [v = p*c*(s != c ? 2 : 1)] Total logical CPUs <a class='textlink' href='http://modernperlbooks.com'>Modern Perl</a><br /> <a class='textlink' href='https://hop.perl.plover.com'>Higher Order Perl</a><br /> <br /> -<span>Due to Perl's expressiveness you will find a lot of obscure code in the interweb in form of obfuscation, fancy email signatures (JAPHs), art, polyglots and even poetry in Perl syntax. But that's not what you will find in production code. That's only people having fun with the language which is different to "getting things done". The expressiveness is a bonus. It makes the Perl programmers love Perl.</span><br /> +<span>Due to Perl's expressiveness you will find a lot of obscure code in the interweb in form of obfuscation, fancy email signatures (JAPHs), art, polyglots and even poetry in Perl syntax. But that's not what you will find in production code. That's only people having fun with the language which is different to "getting things done". The expressiveness is a bonus. It makes the Perl programmers love Perl.</span><br /> <br /> <a class='textlink' href='https://en.wikipedia.org/wiki/Just_another_Perl_hacker'>JAPH</a><br /> <a class='textlink' href='http://www.cpan.org/misc/japh'>http://www.cpan.org/misc/japh</a><br /> @@ -3255,7 +3255,7 @@ v = 008 [v = p*c*(s != c ? 2 : 1)] Total logical CPUs <a class='textlink' href='./2008-06-26-perl-poetry.html'>My very own Perl Poetry</a><br /> <a class='textlink' href='./2014-03-24-the-fibonacci.pl.c-polyglot.html'>A Perl-Raku-C polyglot generating the Fibonacci sequence</a><br /> <br /> -<span>This all doesn't mean that you can't "get things done" with Perl. Quite the opposite is the case. Perl is a very pragmatic programming language and is suitable very well for rapid prototyping and any kind of small to medium-sized scripts and programs. You can write large enterprise scale application in Perl too, but that wasn't the original intend of why Perl was invented (more on that later).</span><br /> +<span>This all doesn't mean that you can't "get things done" with Perl. Quite the opposite is the case. Perl is a very pragmatic programming language and is suitable very well for rapid prototyping and any kind of small to medium-sized scripts and programs. You can write large enterprise scale application in Perl too, but that wasn't the original intend of why Perl was invented (more on that later).</span><br /> <br /> <h2 style='display: inline'>Is Perl abandoned?</h2><br /> <br /> @@ -3267,25 +3267,25 @@ v = 008 [v = p*c*(s != c ? 2 : 1)] Total logical CPUs <br /> <a class='textlink' href='https://perlschool.com/books/perl-new-features/'>Perl New Features by Joshua McAdams and brian d foy</a><br /> <br /> -<span>Actually, Perl is a family of two high-level, general-purpose, interpreted, dynamic programming languages. "Perl" refers to Perl 5, but from 2000 to 2019 it also referred to its redesigned "sister language", Perl 6, before the latter's name was officially changed to Raku in October 2019 as the differences between Perl 5 and Perl 6 were too groundbreaking. Raku would be a different topic (mostly out of scope of this blog article) but I at least wanted it to mention here. In my opinion, Raku is the "most powerful" programming language out there (I recently started learning it and intend to use it for some of my future personal programming projects):</span><br /> +<span>Actually, Perl is a family of two high-level, general-purpose, interpreted, dynamic programming languages. "Perl" refers to Perl 5, but from 2000 to 2019 it also referred to its redesigned "sister language", Perl 6, before the latter's name was officially changed to Raku in October 2019 as the differences between Perl 5 and Perl 6 were too groundbreaking. Raku would be a different topic (mostly out of scope of this blog article) but I at least wanted it to mention here. In my opinion, Raku is the "most powerful" programming language out there (I recently started learning it and intend to use it for some of my future personal programming projects):</span><br /> <br /> <a class='textlink' href='https://raku.org'>The Raku Programming Language</a><br /> <br /> <span>So it means that Perl and Raku now exist in parallel. They influence each other, but are different programming languages now. So why not just all use Raku instead of Perl? There are still a couple of reasons of why to choose Perl over Raku:</span><br /> <br /> <ul> -<li>Many programmers already know Perl and many scripts are already written in Perl. It's possible to call Perl code from Raku (either inline or as a library) and it is also possible to auto-convert Perl code into Raku code, but that's either a workaround or involves some kind of additional work.</li> +<li>Many programmers already know Perl and many scripts are already written in Perl. It's possible to call Perl code from Raku (either inline or as a library) and it is also possible to auto-convert Perl code into Raku code, but that's either a workaround or involves some kind of additional work.</li> <li>Perl 5 comes with a great backwards compatibility. Perl scripts from 5.000 will generally still work on a recent version of Perl. New features usually have to be enabled via a so-called "use pragmas". For example, in order to enable sub signatures, <span class='inlinecode'>use signatures;</span> has to be specified.</li> -<li>Perl is pre-installed almost everywhere. Fancy running a quick one-off script? In almost all cases, there's no need to install Perl first - it's already there on almost any Linux or *BSD or Unix or other Unix like operating system!</li> -<li>Perl has been ported to "zillions" of platforms. One day I found myself on a VMS box. Perl doesn't come installed by default on VMS, but the admin installed Perl there already. The whole operating system was very strange to me, but I was able to write "shell scripts" in Perl and became productive pretty quickly on VMS without knowing almost anything about VMS :-).</li> +<li>Perl is pre-installed almost everywhere. Fancy running a quick one-off script? In almost all cases, there's no need to install Perl first - it's already there on almost any Linux or *BSD or Unix or other Unix like operating system!</li> +<li>Perl has been ported to "zillions" of platforms. One day I found myself on a VMS box. Perl doesn't come installed by default on VMS, but the admin installed Perl there already. The whole operating system was very strange to me, but I was able to write "shell scripts" in Perl and became productive pretty quickly on VMS without knowing almost anything about VMS :-).</li> <li>Perl is reliable. It has been proven itself "millions" of times, over and over again. Large enterprises, such as booking.com, heavily rely on Perl. Did you know that the package manager of the OpenBSD operating system is programmed in Perl, too?</li> -<li>Perl is a great language to program in (given that you follow the modern best practices). Don't get confused when Perl is doing some things differently than other programming languages.</li> +<li>Perl is a great language to program in (given that you follow the modern best practices). Don't get confused when Perl is doing some things differently than other programming languages.</li> </ul><br /> <a class='textlink' href='https://perldoc.perl.org/feature'>Perl feature pragmas</a><br /> <a class='textlink' href='https://www.OpenBSD.org'>The OpenBSD Operating System</a><br /> <a class='textlink' href='https://news.ycombinator.com/item?id=23360338'>Why does OpenBSD still include Perl in its base installation?</a><br /> <br /> -<span>The renaming of Perl 6 to Raku has now opened the door for a future Perl 7. As far as I understand, Perl 7 will be Perl 5 but with modern features enabled by default (e.g. pragmas <span class='inlinecode'>use strict;</span>, <span class='inlinecode'>use warnings;</span>, <span class='inlinecode'>use signatures;</span> and so on. Also, the hope is that a Perl 7 with modern standards will attract more beginners. There aren't many Perl jobs out there nowadays. That's mostly due to Perl's bad (bad for no real reasons) reputation.</span><br /> +<span>The renaming of Perl 6 to Raku has now opened the door for a future Perl 7. As far as I understand, Perl 7 will be Perl 5 but with modern features enabled by default (e.g. pragmas <span class='inlinecode'>use strict;</span>, <span class='inlinecode'>use warnings;</span>, <span class='inlinecode'>use signatures;</span> and so on. Also, the hope is that a Perl 7 with modern standards will attract more beginners. There aren't many Perl jobs out there nowadays. That's mostly due to Perl's bad (bad for no real reasons) reputation.</span><br /> <br /> <span class='quote'>Update 2022-12-10: A reader pointed out, that <span class='inlinecode'>use v5.36;</span> already turns strict, warnings and signatures pragmas automatically on! </span><br /> <br /> @@ -3294,22 +3294,22 @@ v = 008 [v = p*c*(s != c ? 2 : 1)] Total logical CPUs <br /> <span class='quote'>Update 2022-12-10: A reader pointed out, that Perl 7 needs to provide a big improvement to earn and keep the attention for a major version bump.</span><br /> <br /> -<span class='quote'>Update 2023-01-28: Meanwhile, I was also reading brian d foy's Perl New Feature book. It nicely presents all new features added to Perl since <span class='inlinecode'>v5.10</span>.</span><br /> +<span class='quote'>Update 2023-01-28: Meanwhile, I was also reading brian d foy's Perl New Feature book. It nicely presents all new features added to Perl since <span class='inlinecode'>v5.10</span>.</span><br /> <br /> <a class='textlink' href='https://www.leanpub.com/perl_new_features'>Perl New Features</a><br /> <br /> <h2 style='display: inline'>Why use Perl as there are better alternatives?</h2><br /> <br /> -<span>Here, common sense must be applied. I don't believe there is anything like "the perfect" programming language. Everyone has got his preferred (or a set of preferred) programming language to chose from. All programming languages come with their own set of strengths and weaknesses. These are the strengths making Perl shine, and you (technically) don't need to bother to look for "better" alternatives:</span><br /> +<span>Here, common sense must be applied. I don't believe there is anything like "the perfect" programming language. Everyone has got his preferred (or a set of preferred) programming language to chose from. All programming languages come with their own set of strengths and weaknesses. These are the strengths making Perl shine, and you (technically) don't need to bother to look for "better" alternatives:</span><br /> <br /> <ul> -<li>Perl is better than Shell/AWK/SED scripts. There's a point where shell scripts become fairly complex. The next step-up is to switch to Perl. There are many different versions of shells and AWK and SED interpreters. Do you always know which versions (<span class='inlinecode'>mawk</span>, <span class='inlinecode'>nawk</span>, <span class='inlinecode'>gawk</span>, <span class='inlinecode'>sed</span>, <span class='inlinecode'>gsed</span>, <span class='inlinecode'>grep</span>, <span class='inlinecode'>ggrep</span>...) are currently installed? These commands aren't fully compatible to each other. However, there is only one Perl 5. Simply: Perl is faster, more powerful, more expressive than any shell script can ever be, and it is also extendible through CPAN. Perl can directly talk to databases, which shell scripts can't.</li> -<li>Perl code tends to be compact so that it's much better suitable for "shell scripting" and quick "one-liners" than other languages. In my own experience: Ruby and Python code tends to blow up quickly. It doesn't mean that Ruby and Python are not suitable for this task, but I think Perl does much better.</li> +<li>Perl is better than Shell/AWK/SED scripts. There's a point where shell scripts become fairly complex. The next step-up is to switch to Perl. There are many different versions of shells and AWK and SED interpreters. Do you always know which versions (<span class='inlinecode'>mawk</span>, <span class='inlinecode'>nawk</span>, <span class='inlinecode'>gawk</span>, <span class='inlinecode'>sed</span>, <span class='inlinecode'>gsed</span>, <span class='inlinecode'>grep</span>, <span class='inlinecode'>ggrep</span>...) are currently installed? These commands aren't fully compatible to each other. However, there is only one Perl 5. Simply: Perl is faster, more powerful, more expressive than any shell script can ever be, and it is also extendible through CPAN. Perl can directly talk to databases, which shell scripts can't.</li> +<li>Perl code tends to be compact so that it's much better suitable for "shell scripting" and quick "one-liners" than other languages. In my own experience: Ruby and Python code tends to blow up quickly. It doesn't mean that Ruby and Python are not suitable for this task, but I think Perl does much better.</li> <li>Perl 5 has proven itself for decades and is a very stable/robust language. It is a battle-tested and mature as something can ever become.</li> -<li>Perl is the reference standard for regular expressions. Even so much that there is a PCRE library (Perl Compatible Regular Expressions) used by many other languages now. Perl fully integrates regular expression syntax into the language, which doesn't feel like an odd add-on like in most other languages.</li> +<li>Perl is the reference standard for regular expressions. Even so much that there is a PCRE library (Perl Compatible Regular Expressions) used by many other languages now. Perl fully integrates regular expression syntax into the language, which doesn't feel like an odd add-on like in most other languages.</li> <li>Perl 5 is the master of text processing (well, maybe after Raku now. But you might not have the latest Raku available everywhere). The chief objective of developing the language was for text processing, and this is where Perl (Practical extraction and report language) really shines.</li> <li>Perl is a "deep" language. That means Perl got a lot of features and syntactic sugar and magic. Depending on the perspective, this could be interpreted as a downside too. But IMHO mastery of a "deep" language brings big rewards. The code can be very compact, and it is fun to code in it.</li> -<li>Perl is the only language I know which can do "taint checking". Running a script in taint mode makes Perl sanitize all external input and that's a great security feature. Ruby used to have this feature too, but it got removed (as I understand there were some problems with the implementation not completely safe and it was easier just to remove it from the language than to fix it).</li> +<li>Perl is the only language I know which can do "taint checking". Running a script in taint mode makes Perl sanitize all external input and that's a great security feature. Ruby used to have this feature too, but it got removed (as I understand there were some problems with the implementation not completely safe and it was easier just to remove it from the language than to fix it).</li> </ul><br /> <span>About the first point, using Perl for better "shell" scripts was actually the original intend of why Perl was invented in the first place.</span><br /> <br /> @@ -3320,10 +3320,10 @@ v = 008 [v = p*c*(s != c ? 2 : 1)] Total logical CPUs <span>Here are some reasons why not to chose Perl and look for "better" alternatives:</span><br /> <br /> <ul> -<li>If performance is your main objectives, then Perl might not be the language to use. Perl is a dynamic interpreted language, and it will generally never be as fast as statically typed languages compiled to native binaries (e.g. C/C++/Rust/Haskell) or statically typed languages run in a VM with JIT (e.g. Java) or gradually typed languages run in a VM (e.g. Raku) or languages like Golang (statically typed, compiled to a binary but still with a runtime in the binary). Perl might be still faster than the other language listed here in certain circumstances (e.g. faster startup time than Java or faster regular expressions engine), but usually it's not. It's not a problem of Perl, it's a problem of all dynamic scripting languages including Python, Ruby, ....</li> -<li>Don't use Perl (just yet) if you want to code object-oriented. Perl supports OOP, but it feels clunky and odd to use (blessed references to any data types are objects) and doesn't support real encapsulation out of the box. There are many (many) extensions available on CPAN to make OOP better, but that's totally fragmented. The most popular extension, Moose, comes with a huge dependency tree. But wait for Perl 7. It will maybe come with a new object system (an object system inspired by Raku).</li> -<li>It's possible to write large programs in Perl (make difficult things possible), but it might not be the best choice here. This also leads back to the clunky object system Perl has. You could write your projects in a procedural or functional style (Perl perfectly fits here), but OOP seems to be the gold standard for large projects nowadays. Functional programming requires a different mindset, and pure procedural programming lacks abstractions.</li> -<li>Apply common sense. What is the skill set your team has? What's already widely used and supported at work? Which languages comes with the best modules for the things you want to work on? Maybe Python is the answer (better machine learning modules). Maybe Perl is the better choice (better Bioinformatic modules). Perhaps Ruby is already the de-facto standard at work and everyone knows at least a little Ruby (as it happened to be at my workplace) and Ruby is "good enough" for all the tasks already. But that's not a hindrance to throw in a Perl one-liner once in a while :P.</li> +<li>If performance is your main objectives, then Perl might not be the language to use. Perl is a dynamic interpreted language, and it will generally never be as fast as statically typed languages compiled to native binaries (e.g. C/C++/Rust/Haskell) or statically typed languages run in a VM with JIT (e.g. Java) or gradually typed languages run in a VM (e.g. Raku) or languages like Golang (statically typed, compiled to a binary but still with a runtime in the binary). Perl might be still faster than the other language listed here in certain circumstances (e.g. faster startup time than Java or faster regular expressions engine), but usually it's not. It's not a problem of Perl, it's a problem of all dynamic scripting languages including Python, Ruby, ....</li> +<li>Don't use Perl (just yet) if you want to code object-oriented. Perl supports OOP, but it feels clunky and odd to use (blessed references to any data types are objects) and doesn't support real encapsulation out of the box. There are many (many) extensions available on CPAN to make OOP better, but that's totally fragmented. The most popular extension, Moose, comes with a huge dependency tree. But wait for Perl 7. It will maybe come with a new object system (an object system inspired by Raku).</li> +<li>It's possible to write large programs in Perl (make difficult things possible), but it might not be the best choice here. This also leads back to the clunky object system Perl has. You could write your projects in a procedural or functional style (Perl perfectly fits here), but OOP seems to be the gold standard for large projects nowadays. Functional programming requires a different mindset, and pure procedural programming lacks abstractions.</li> +<li>Apply common sense. What is the skill set your team has? What's already widely used and supported at work? Which languages comes with the best modules for the things you want to work on? Maybe Python is the answer (better machine learning modules). Maybe Perl is the better choice (better Bioinformatic modules). Perhaps Ruby is already the de-facto standard at work and everyone knows at least a little Ruby (as it happened to be at my workplace) and Ruby is "good enough" for all the tasks already. But that's not a hindrance to throw in a Perl one-liner once in a while :P.</li> </ul><br /> <a class='textlink' href='https://github.com/Ovid/Cor'>Cor - Bringing modern OOP to the Perl Core</a><br /> <br /> @@ -3331,7 +3331,7 @@ v = 008 [v = p*c*(s != c ? 2 : 1)] Total logical CPUs <br /> <span>The sigils <span class='inlinecode'>$ @ % &</span> (where Perl is famously known for) serve a purpose. They seem confusing at first, but they actually make the code better readable. <span class='inlinecode'>$scalar</span> is a scalar variable (holding a single value), <span class='inlinecode'>@array</span> is an array (holding a list of values), <span class='inlinecode'>%hash</span> holds a list of key-value pairs and <span class='inlinecode'>&sub</span> is for subroutines. A given variable <span class='inlinecode'>$ref</span> can also hold reference to something. <span class='inlinecode'>@$arrayref</span> dereferences a reference to an array, <span class='inlinecode'>%$hashref</span> to a hash, <span class='inlinecode'>$$scalarref</span> to a scalar, <span class='inlinecode'>&$subref</span> dereferences a referene to a subroutine, etc. That can be encapsulated as deep as you want. (This paragraph only scratched the surface here of what Perl can do, and there is a lot of syntactic sugar not mentioned here).</span><br /> <br /> -<span>In most other programming languages, you won't know instantly what's the "basic type" of a given variable without looking at the variable declaration or the variable name (If named intelligently, e.g. a variable name containing a list of cats is <span class='inlinecode'>cat_list</span>). Even Ruby makes some use of sigils (<span class='inlinecode'>@</span>, <span class='inlinecode'>@@</span> and <span class='inlinecode'>$</span>), but that's for a different purpose than in Perl (in Ruby it is about object scope, class scope and global scope). Raku uses all the sigils Perl uses plus an additional bunch of twigils, e.g. <span class='inlinecode'>$.foo</span> for a scalar object variable with public accessors, <span class='inlinecode'>$!foo</span> for a private scalar object variable, <span class='inlinecode'>@.foo</span>, <span class='inlinecode'>@!foo</span>, <span class='inlinecode'>%.foo</span>, <span class='inlinecode'>%!foo</span> and so on. Sigils (and twigils) are very convenient once you get used to them. Don't let them scare you off - they are there to help you!</span><br /> +<span>In most other programming languages, you won't know instantly what's the "basic type" of a given variable without looking at the variable declaration or the variable name (If named intelligently, e.g. a variable name containing a list of cats is <span class='inlinecode'>cat_list</span>). Even Ruby makes some use of sigils (<span class='inlinecode'>@</span>, <span class='inlinecode'>@@</span> and <span class='inlinecode'>$</span>), but that's for a different purpose than in Perl (in Ruby it is about object scope, class scope and global scope). Raku uses all the sigils Perl uses plus an additional bunch of twigils, e.g. <span class='inlinecode'>$.foo</span> for a scalar object variable with public accessors, <span class='inlinecode'>$!foo</span> for a private scalar object variable, <span class='inlinecode'>@.foo</span>, <span class='inlinecode'>@!foo</span>, <span class='inlinecode'>%.foo</span>, <span class='inlinecode'>%!foo</span> and so on. Sigils (and twigils) are very convenient once you get used to them. Don't let them scare you off - they are there to help you!</span><br /> <br /> <a class='textlink' href='https://www.perl.com/article/on-sigils/'>https://www.perl.com/article/on-sigils/</a><br /> <br /> @@ -3348,7 +3348,7 @@ v = 008 [v = p*c*(s != c ? 2 : 1)] Total logical CPUs <br /> <a class='textlink' href='https://www.perl.org'>https://www.perl.org</a><br /> <br /> -<span class='quote'>Update 2022-12-17: The following is another related post. I don't agree to the statement made there, that Python code tends to be shorter than Perl code, though!</span><br /> +<span class='quote'>Update 2022-12-17: The following is another related post. I don't agree to the statement made there, that Python code tends to be shorter than Perl code, though!</span><br /> <br /> <a class='textlink' href='https://stackoverflow.blog/2022/07/06/why-perl-is-still-relevant-in-2022/'>Why Perl is still relevant in 2022</a><br /> <br /> @@ -3372,7 +3372,7 @@ v = 008 [v = p*c*(s != c ? 2 : 1)] Total logical CPUs <updated>2022-04-10T10:09:11+01:00</updated> <author> <name>Paul Buetow</name> - <email>hi@paul.cyou</email> + <email>hi@foo.zone</email> </author> <summary>I have been participating in an annual work-internal project contest (we call it Pet Project contest) since I moved to London and switched jobs to my current employer. I am very happy to say that I won a 'silver' prize last week here 🎆. Over the last couple of years I have been a finalist in this contest six times and won some kind of prize five times. Some of my projects were also released as open source software. One had a magazine article published, and for another one I wrote an article on my employer's engineering blog. If you have followed all my posts on this blog (the one you are currently reading), then you have probably figured out what these projects were:</summary> <content type="xhtml"> @@ -3531,7 +3531,7 @@ learn () { <updated>2022-03-06T18:11:39+00:00</updated> <author> <name>Paul Buetow</name> - <email>hi@paul.cyou</email> + <email>hi@foo.zone</email> </author> <summary>I have recently released DTail 4.0.0 and this blog post goes through all the new goodies. If you want to jump directly to DTail, do it here (there are nice animated gifs which demonstrates the usage pretty well):</summary> <content type="xhtml"> @@ -3543,7 +3543,7 @@ learn () { <pre> ,_---~~~~~----._ _,,_,*^____ _____``*g*\"*, - ____ _____ _ _ / __/ /' ^. / \ ^@q f + ____ _____ _ _ / __/ /' ^. / \ ^@q f | _ \_ _|_ _(_) | @f | @)) | | @)) l 0 _/ | | | || |/ _` | | | \`/ \~____ / __ \_____/ \ | |_| || | (_| | | | | _l__l_ I @@ -3558,15 +3558,15 @@ learn () { <br /> <a class='textlink' href='https://dtail.dev'>https://dtail.dev</a><br /> <br /> -<h2 style='display: inline'>So, what's new in 4.0.0?</h2><br /> +<h2 style='display: inline'>So, what's new in 4.0.0?</h2><br /> <br /> <h3 style='display: inline'>Rewritten logging</h3><br /> <br /> <span>For DTail 4, logging has been completely rewritten. The new package name is "internal/io/dlog". I rewrote the logging because DTail is a special case here: There are logs processed by DTail, there are logs produced by the DTail server itself, there are logs produced by a DTail client itself, there are logs only logged by a DTail client, there are logs only logged by the DTail server, and there are logs logged by both, server and client. There are also different logging levels and outputs involved.</span><br /> <br /> -<span>As you can imagine, it becomes fairly complex. There is no ready Go off-shelf logging library which suits my needs and the logging code in DTail 3 was just one big source code file with global variables and it wasn't sustainable to maintain anymore. So why not rewrite it for profit and fun? </span><br /> +<span>As you can imagine, it becomes fairly complex. There is no ready Go off-shelf logging library which suits my needs and the logging code in DTail 3 was just one big source code file with global variables and it wasn't sustainable to maintain anymore. So why not rewrite it for profit and fun? </span><br /> <br /> -<span>There's a are new log level structure now (The log level now can be specified with the "-logLevel" command line flag):</span><br /> +<span>There's a are new log level structure now (The log level now can be specified with the "-logLevel" command line flag):</span><br /> <br /> <pre> // Available log levels. @@ -3589,7 +3589,7 @@ const ( <br /> <h3 style='display: inline'>Configurable terminal color codes</h3><br /> <br /> -<span>A complaint I received from the users of DTail 3 were the terminal colors used for the output. Under some circumstances (terminal configuration) it made the output difficult to read so that users defaulted to "--noColor" (disabling colored output completely). I toke it by heart and also rewrote the color handling. It's now possible to configure the foreground and background colors and an attribute (e.g. dim, bold, ...).</span><br /> +<span>A complaint I received from the users of DTail 3 were the terminal colors used for the output. Under some circumstances (terminal configuration) it made the output difficult to read so that users defaulted to "--noColor" (disabling colored output completely). I toke it by heart and also rewrote the color handling. It's now possible to configure the foreground and background colors and an attribute (e.g. dim, bold, ...).</span><br /> <br /> <span>The example "dtail.json" configuration file represents the default (now, more reasonable default) color codes used, and it is free to the user to customize them:</span><br /> <br /> @@ -3695,9 +3695,9 @@ const ( <li>Client: Color configuration for all lines produced by a DTail client by itself (e.g. status information).</li> <li>Server: Color configuration for all lines produced by the DTail server by itself and sent to the client (e.g. server warnings or errors)</li> <li>MaprTable: Color configuration for the map-reduce table output.</li> -<li>Common: Common color configuration used in various places (e.g. when it's not clear what's the current context of a line).</li> +<li>Common: Common color configuration used in various places (e.g. when it's not clear what's the current context of a line).</li> </ul><br /> -<span>When you do so, make sure that you check your "dtail.json" against the JSON schema file. This is to ensure that you don't configure an invalid color accidentally (requires "jsonschema" to be installed on your computer). Furthermore, the schema file is also a good reference for all possible colors available:</span><br /> +<span>When you do so, make sure that you check your "dtail.json" against the JSON schema file. This is to ensure that you don't configure an invalid color accidentally (requires "jsonschema" to be installed on your computer). Furthermore, the schema file is also a good reference for all possible colors available:</span><br /> <br /> <pre> jsonschema -i dtail.json schemas/dtail.schema.json @@ -3705,7 +3705,7 @@ jsonschema -i dtail.json schemas/dtail.schema.json <br /> <h3 style='display: inline'>Serverless mode</h3><br /> <br /> -<span>All DTail commands can now operate on log files (and other text files) directly without any DTail server running. So there isn't a need anymore to install a DTail server when you are on the target server already anyway, like the following example shows:</span><br /> +<span>All DTail commands can now operate on log files (and other text files) directly without any DTail server running. So there isn't a need anymore to install a DTail server when you are on the target server already anyway, like the following example shows:</span><br /> <br /> <pre> % dtail --files /var/log/foo.log @@ -3714,7 +3714,7 @@ jsonschema -i dtail.json schemas/dtail.schema.json <span>or</span><br /> <br /> <pre> -% dmap --files /var/log/foo.log --query 'from TABLE select .... outfile result.csv' +% dmap --files /var/log/foo.log --query 'from TABLE select .... outfile result.csv' </pre> <br /> <span>The way it works in Go code is that a connection to a server is managed through an interface and in serverless mode DTail calls through that interface to the server code directly without any TCP/IP and SSH connection made in the background. This means, that the binaries are a bit larger (also ship with the code which normally would be executed by the server) but the increase of binary size is not much.</span><br /> @@ -3731,7 +3731,7 @@ jsonschema -i dtail.json schemas/dtail.schema.json <br /> <h3 style='display: inline'>Spartan (aka plain) mode</h3><br /> <br /> -<span>There's a plain mode, which makes DTail only print out the "plain" text of the files operated on (without any DTail specific enriched output). E.g.:</span><br /> +<span>There's a plain mode, which makes DTail only print out the "plain" text of the files operated on (without any DTail specific enriched output). E.g.:</span><br /> <br /> <pre> % dcat --plain /etc/passwd > /etc/test @@ -3745,14 +3745,14 @@ jsonschema -i dtail.json schemas/dtail.schema.json <span>In serverless mode, you might want to process your data in a pipeline. You can do that now too through an input pipe:</span><br /> <br /> <pre> -% dgrep --plain --regex 'somethingspecial' /var/log/foo.log | - dmap --query 'from TABLE select .... outfile result.csv' +% dgrep --plain --regex 'somethingspecial' /var/log/foo.log | + dmap --query 'from TABLE select .... outfile result.csv' </pre> <br /> <span>Or, use any other "standard" tool:</span><br /> <br /> <pre> -% awk '.....' < /some/file | dtail .... +% awk '.....' < /some/file | dtail .... </pre> <br /> <h3 style='display: inline'>New command dtailhealth</h3><br /> @@ -3782,7 +3782,7 @@ exec /usr/local/bin/dtailhealth --server localhost:2222 <br /> <h3 style='display: inline'>Integration testing suite</h3><br /> <br /> -<span>DTail comes already with some unit tests, but what's new is a full integration testing suite which covers all common use cases of all the commands (dtail, dcat, dgrep, dmap) with a server backend and also in serverless mode.</span><br /> +<span>DTail comes already with some unit tests, but what's new is a full integration testing suite which covers all common use cases of all the commands (dtail, dcat, dgrep, dmap) with a server backend and also in serverless mode.</span><br /> <br /> <span>How are the tests implemented? All integration tests are simply unit tests in the "./integrationtests" folder. They must be explicitly activated with:</span><br /> <br /> @@ -3807,7 +3807,7 @@ exec /usr/local/bin/dtailhealth --server localhost:2222 <br /> <ul> <li>Reduce the complexity of a couple of functions (splitting code up into several smaller functions)</li> -<li>Avoid repeating code (this version of DTail doesn't use Go generics yet, though).</li> +<li>Avoid repeating code (this version of DTail doesn't use Go generics yet, though).</li> </ul><br /> <span>Other than that, a lot of other code has been refactored as I saw fit.</span><br /> <br /> @@ -3815,18 +3815,18 @@ exec /usr/local/bin/dtailhealth --server localhost:2222 <br /> <span>DTail makes excessive use of string builder and byte buffer objects. For performance reasons, those are now re-used from memory pools.</span><br /> <br /> -<h2 style='display: inline'>What's next</h2><br /> +<h2 style='display: inline'>What's next</h2><br /> <br /> -<span>DTail 5 won't be released any time soon I guess, but some 4.x.y releases will follow this year fore sure. I can think of:</span><br /> +<span>DTail 5 won't be released any time soon I guess, but some 4.x.y releases will follow this year fore sure. I can think of:</span><br /> <br /> <ul> -<li>New (but backwards compatible) features which don't require a new major version bump (some features have been requested at work internally).</li> +<li>New (but backwards compatible) features which don't require a new major version bump (some features have been requested at work internally).</li> <li>Even more improved documentation.</li> <li>Dependency updates.</li> </ul><br /> <span>I use usually DTail at work, but I have recently installed it on my personal OpenBSD machines too. I might write a small tutorial here (and I might also add the rc scripts as examples to one of the next DTail releases).</span><br /> <br /> -<span>I am a bit busy at the moment with two other pet projects of mine (one internal work-project, and one personal one, the latter you will read about in the next couple of months). If you have ideas (or even a patch), then please don't hesitate to contact me (either via E-Mail or a request at GitHub).</span><br /> +<span>I am a bit busy at the moment with two other pet projects of mine (one internal work-project, and one personal one, the latter you will read about in the next couple of months). If you have ideas (or even a patch), then please don't hesitate to contact me (either via E-Mail or a request at GitHub).</span><br /> <br /> <span>Other related posts are:</span><br /> <br /> @@ -3851,7 +3851,7 @@ exec /usr/local/bin/dtailhealth --server localhost:2222 <updated>2022-02-04T09:58:22+00:00</updated> <author> <name>Paul Buetow</name> - <email>hi@paul.cyou</email> + <email>hi@foo.zone</email> </author> <summary>This is a list of Operating Systems I currently use. This list is in no particular order and also will be updated over time. The very first operating system I used was MS-DOS (mainly for games) and the very first Unix like operating system I used was SuSE Linux 5.3. My first smartphone OS was Symbian on a clunky Sony Ericsson device.</summary> <content type="xhtml"> @@ -4098,7 +4098,7 @@ GNU/kFreeBSD rhea.buetow.org 8.0-RELEASE-p5 FreeBSD 8.0-RELEASE-p5 #2: Sat Nov 2 <updated>2022-01-23T16:42:04+00:00</updated> <author> <name>Paul Buetow</name> - <email>hi@paul.cyou</email> + <email>hi@foo.zone</email> </author> <summary>I don't count this as a real blog post, but more of an announcement (I aim to write one real post once monthly). From now on, 'foo.zone' is the new address of this site. All other addresses will still forward to it and eventually (based on the traffic still going through) will be deactivated.</summary> <content type="xhtml"> @@ -4163,7 +4163,7 @@ GNU/kFreeBSD rhea.buetow.org 8.0-RELEASE-p5 FreeBSD 8.0-RELEASE-p5 #2: Sat Nov 2 <updated>2022-01-01T23:36:15+00:00</updated> <author> <name>Paul Buetow</name> - <email>hi@paul.cyou</email> + <email>hi@foo.zone</email> </author> <summary>This is the second blog post about my Bash Golf series. This series is random Bash tips, tricks and weirdnesses I came across. It's a collection of smaller articles I wrote in an older (in German language) blog, which I translated and refreshed with some new content.</summary> <content type="xhtml"> @@ -4173,24 +4173,24 @@ GNU/kFreeBSD rhea.buetow.org 8.0-RELEASE-p5 FreeBSD 8.0-RELEASE-p5 #2: Sat Nov 2 <span class='quote'>Published at 2022-01-01T23:36:15+00:00; Updated at 2022-01-05</span><br /> <br /> <pre> - '\ '\ . . |>18>> - \ \ . ' . | - O>> O>> . 'o | + '\ '\ . . |>18>> + \ \ . ' . | + O>> O>> . 'o | \ .\. .. . | /\ . /\ . . | - / / . / / .' . | + / / . / / .' . | jgs^^^^^^^`^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Art by Joan Stark, mod. by Paul Buetow </pre> <br /> -<span>This is the second blog post about my Bash Golf series. This series is random Bash tips, tricks and weirdnesses I came across. It's a collection of smaller articles I wrote in an older (in German language) blog, which I translated and refreshed with some new content.</span><br /> +<span>This is the second blog post about my Bash Golf series. This series is random Bash tips, tricks and weirdnesses I came across. It's a collection of smaller articles I wrote in an older (in German language) blog, which I translated and refreshed with some new content.</span><br /> <br /> <a class='textlink' href='./2022-01-01-bash-golf-part-2.html'>2022-01-01 Bash Golf Part 2 (You are currently reading this)</a><br /> <a class='textlink' href='./2021-11-29-bash-golf-part-1.html'>2021-11-29 Bash Golf Part 1</a><br /> <br /> <h2 style='display: inline'>Redirection</h2><br /> <br /> -<span>Let's have a closer look at Bash redirection. As you might already know that there are 3 standard file descriptors:</span><br /> +<span>Let's have a closer look at Bash redirection. As you might already know that there are 3 standard file descriptors:</span><br /> <br /> <ul> <li>0 aka stdin (standard input)</li> @@ -4223,7 +4223,7 @@ Foo <li>Redirect stderr to stdin: "echo foo 2>&1"</li> <li>Redirect stdin to stderr: "echo foo >&2"</li> </ul><br /> -<span>It is, however, not possible to redirect multiple times within the same command. E.g. the following won't work. You would expect stdin to be redirected to stderr and then stderr to be redirected to /dev/null. But as the example shows, Foo is still printed out:</span><br /> +<span>It is, however, not possible to redirect multiple times within the same command. E.g. the following won't work. You would expect stdin to be redirected to stderr and then stderr to be redirected to /dev/null. But as the example shows, Foo is still printed out:</span><br /> <br /> <pre> ❯ echo Foo 1>&2 2>/dev/null @@ -4253,7 +4253,7 @@ Foo ❯ </pre> <br /> -<span>A handy way to list all open file descriptors is to use the "lsof" command (that's not a Bash built-in), whereas $$ is the process id (pid) of the current shell process:</span><br /> +<span>A handy way to list all open file descriptors is to use the "lsof" command (that's not a Bash built-in), whereas $$ is the process id (pid) of the current shell process:</span><br /> <br /> <pre> ❯ lsof -a -p $$ -d0,1,2 @@ -4263,7 +4263,7 @@ bash 62676 paul 1u CHR 136,9 0t0 12 /dev/pts/9 bash 62676 paul 2u CHR 136,9 0t0 12 /dev/pts/9 </pre> <br /> -<span>Let's create our own descriptor "3" for redirection to a file named "foo":</span><br /> +<span>Let's create our own descriptor "3" for redirection to a file named "foo":</span><br /> <br /> <pre> ❯ touch foo @@ -4309,7 +4309,7 @@ echo Second line: $LINE2 exec 0<&6 6<&- </pre> <br /> -<span>Let's execute it:</span><br /> +<span>Let's execute it:</span><br /> <br /> <pre> ❯ chmod 750 ./grandmaster.sh @@ -4320,7 +4320,7 @@ Second line: for Great Good <br /> <h2 style='display: inline'>HERE</h2><br /> <br /> -<span>I have mentioned HERE-documents and HERE-strings already in this post. Let's do some more examples. The following "cat" receives a multi line string from stdin. In this case, the input multi line string is a HERE-document. As you can see, it also interpolates variables (in this case the output of "date" running in a subshell).</span><br /> +<span>I have mentioned HERE-documents and HERE-strings already in this post. Let's do some more examples. The following "cat" receives a multi line string from stdin. In this case, the input multi line string is a HERE-document. As you can see, it also interpolates variables (in this case the output of "date" running in a subshell).</span><br /> <br /> <pre> ❯ cat <<END @@ -4328,10 +4328,10 @@ Second line: for Great Good > It’s $(date) > END Hello World -It's Fri 26 Nov 08:46:52 GMT 2021 +It's Fri 26 Nov 08:46:52 GMT 2021 </pre> <br /> -<span>You can also write it the following way, but that's less readable (it's good for an obfuscation contest):</span><br /> +<span>You can also write it the following way, but that's less readable (it's good for an obfuscation contest):</span><br /> <br /> <pre> ❯ <<END cat @@ -4339,7 +4339,7 @@ It's Fri 26 Nov 08:46:52 GMT 2021 > It’s $(date) > END Hello Universe -It's Fri 26 Nov 08:47:32 GMT 2021 +It's Fri 26 Nov 08:47:32 GMT 2021 </pre> <br /> <span>Besides of an HERE-document, there is also a so-called HERE-string. Besides of...</span><br /> @@ -4347,7 +4347,7 @@ It's Fri 26 Nov 08:47:32 GMT 2021 <pre> ❯ declare VAR=foo ❯ if echo "$VAR" | grep -q foo; then -> echo '$VAR ontains foo' +> echo '$VAR ontains foo' > fi $VAR ontains foo </pre> @@ -4356,7 +4356,7 @@ $VAR ontains foo <br /> <pre> ❯ if grep -q foo <<< "$VAR"; then -> echo '$VAR contains foo' +> echo '$VAR contains foo' > fi $VAR contains foo </pre> @@ -4364,7 +4364,7 @@ $VAR contains foo <span>Or even shorter, you can do:</span><br /> <br /> <pre> -❯ grep -q foo <<< "$VAR" && echo '$VAR contains foo' +❯ grep -q foo <<< "$VAR" && echo '$VAR contains foo' $VAR contains foo </pre> <br /> @@ -4381,10 +4381,10 @@ yay ❯ read a <<< ja ❯ echo $a ja -❯ read b <<< 'NEIN!!!' +❯ read b <<< 'NEIN!!!' ❯ echo $b NEIN!!! -❯ dumdidumstring='Learn you a Golang for Great Good' +❯ dumdidumstring='Learn you a Golang for Great Good' ❯ read -a words <<< "$dumdidumstring" ❯ echo ${words[0]} Learn @@ -4395,7 +4395,7 @@ Golang <span>The following is good for an obfuscation contest too:</span><br /> <br /> <pre> -❯ echo 'I like Perl too' > perllove.txt +❯ echo 'I like Perl too' > perllove.txt ❯ cat - perllove.txt <<< "$dumdidumstring" Learn you a Golang for Great Good I like Perl too @@ -4403,7 +4403,7 @@ I like Perl too <br /> <h2 style='display: inline'>RANDOM</h2><br /> <br /> -<span>Random is a special built-in variable containing a different pseudo random number each time it's used.</span><br /> +<span>Random is a special built-in variable containing a different pseudo random number each time it's used.</span><br /> <br /> <pre> ❯ echo $RANDOM @@ -4414,9 +4414,9 @@ I like Perl too 9104 </pre> <br /> -<span>That's very useful if you want to randomly delay the execution of your scripts when you run it on many servers concurrently, just to spread the server load (which might be caused by the script run) better.</span><br /> +<span>That's very useful if you want to randomly delay the execution of your scripts when you run it on many servers concurrently, just to spread the server load (which might be caused by the script run) better.</span><br /> <br /> -<span>Let's say you want to introduce a random delay of 1 minute. You can accomplish it with:</span><br /> +<span>Let's say you want to introduce a random delay of 1 minute. You can accomplish it with:</span><br /> <br /> <pre> ❯ cat ./calc_answer_to_ultimate_question_in_life.sh @@ -4428,7 +4428,7 @@ random_delay () { local -i sleep_for=$((RANDOM % MAX_DELAY)) echo "Delaying script execution for $sleep_for seconds..." sleep $sleep_for - echo 'Continuing script execution...' + echo 'Continuing script execution...' } main () { @@ -4448,7 +4448,7 @@ Continuing script execution... <br /> <h2 style='display: inline'>set -x and set -e and pipefile</h2><br /> <br /> -<span>In my opinion, -x and -e and pipefile are the most useful Bash options. Let's have a look at them one after another.</span><br /> +<span>In my opinion, -x and -e and pipefile are the most useful Bash options. Let's have a look at them one after another.</span><br /> <br /> <h3 style='display: inline'>-x</h3><br /> <br /> @@ -4462,7 +4462,7 @@ Continuing script execution... ++ square 11 ++ local -i num=11 ++ echo 121 -+ echo 'Square of 11 is 121' ++ echo 'Square of 11 is 121' Square of 11 is 121 </pre> <br /> @@ -4472,7 +4472,7 @@ Square of 11 is 121 ❯ bash -x ./half_broken_script_to_be_debugged.sh </pre> <br /> -<span>Let's do that on one of the example scripts we covered earlier:</span><br /> +<span>Let's do that on one of the example scripts we covered earlier:</span><br /> <br /> <pre> ❯ bash -x ./grandmaster.sh @@ -4496,7 +4496,7 @@ Second line: for Great Good <br /> <span>This is a very important option you want to use when you are paranoid. This means, you should always "set -e" in your scripts when you need to make absolutely sure that your script runs successfully (with that I mean that no command should exit with an unexpected status code).</span><br /> <br /> -<span>Ok, let's dig deeper:</span><br /> +<span>Ok, let's dig deeper:</span><br /> <br /> <pre> ❯ help set | grep -- -e @@ -4506,7 +4506,7 @@ Second line: for Great Good <span>As you can see in the following example, the Bash terminates after the execution of "grep" as "foo" is not matching "bar". Therefore, grep exits with 1 (unsuccessfully) and the shell aborts. And therefore, "bar" will not be printed out anymore:</span><br /> <br /> <pre> -❯ bash -c 'set -e; echo hello; grep -q bar <<< foo; echo bar' +❯ bash -c 'set -e; echo hello; grep -q bar <<< foo; echo bar' hello ❯ echo $? 1 @@ -4515,47 +4515,47 @@ hello <span>Whereas the outcome changes when the regex matches:</span><br /> <br /> <pre> -❯ bash -c 'set -e; echo hello; grep -q bar <<< barman; echo bar' +❯ bash -c 'set -e; echo hello; grep -q bar <<< barman; echo bar' hello bar ❯ echo $? 0 </pre> <br /> -<span>So does it mean that grep will always make the shell terminate whenever its exit code isn't 0? This will render "set -e" quite unusable. Frankly, there are other commands where an exit status other than 0 should not terminate the whole script abruptly. Usually, what you want is to branch your code based on the outcome (exit code) of a command:</span><br /> +<span>So does it mean that grep will always make the shell terminate whenever its exit code isn't 0? This will render "set -e" quite unusable. Frankly, there are other commands where an exit status other than 0 should not terminate the whole script abruptly. Usually, what you want is to branch your code based on the outcome (exit code) of a command:</span><br /> <br /> <pre> -❯ bash -c 'set -e +❯ bash -c 'set -e > grep -q bar <<< foo > if [ $? -eq 0 ]; then > echo "matching" > else > echo "not matching" -> fi' +> fi' ❯ echo $? 1 </pre> <br /> -<span>...but the example above won't reach any of the branches and won't print out anything, as the script terminates right after grep.</span><br /> +<span>...but the example above won't reach any of the branches and won't print out anything, as the script terminates right after grep.</span><br /> <br /> <span>The proper solution is to use grep as an expression in a conditional (e.g. in an if-else statement):</span><br /> <br /> <pre> -❯ bash -c 'set -e +❯ bash -c 'set -e > if grep -q bar <<< foo; then > echo "matching" > else > echo "not matching" -> fi' +> fi' not matching ❯ echo $? 0 -❯ bash -c 'set -e +❯ bash -c 'set -e > if grep -q bar <<< barman; then > echo "matching" > else > echo "not matching" -> fi' +> fi' matching ❯ echo $? 0 @@ -4573,7 +4573,7 @@ foo () { local arg="$1"; shift if [ -z "$arg" ]; then - arg='You!' + arg='You!' fi echo "Hello $arg" } @@ -4586,7 +4586,7 @@ bar () { set -e if [ -z "$arg" ]; then - arg='You!' + arg='You!' fi echo "Hello $arg" } @@ -4605,7 +4605,7 @@ Hello Universe Hello You! </pre> <br /> -<span>Why does calling "foo" with no arguments make the script terminate? Because as no argument was given, the "shift" won't have anything to do as the argument list $@ is empty, and therefore "shift" fails with a non-zero status.</span><br /> +<span>Why does calling "foo" with no arguments make the script terminate? Because as no argument was given, the "shift" won't have anything to do as the argument list $@ is empty, and therefore "shift" fails with a non-zero status.</span><br /> <br /> <span>Why would you want to use "shift" after function-local variable assignments? Have a look at my personal Bash coding style guide for an explanation :-):</span><br /> <br /> @@ -4625,19 +4625,19 @@ Hello You! <span>The following greps for paul in passwd and converts all lowercase letters to uppercase letters. The exit code of the pipe is 0, as the last command of the pipe (converting from lowercase to uppercase) succeeded:</span><br /> <br /> <pre> -❯ grep paul /etc/passwd | tr '[a-z]' '[A-Z]' +❯ grep paul /etc/passwd | tr '[a-z]' '[A-Z]' PAUL:X:1000:1000:PAUL BUETOW:/HOME/PAUL:/BIN/BASH ❯ echo $? 0 </pre> <br /> -<span>Let's look at another example, where "TheRock" doesn't exist in the passwd file. However, the pipes exit status is still 0 (success). This is so because the last command ("tr" in this case) still succeeded. It is just that it didn't get any input on stdin to process:</span><br /> +<span>Let's look at another example, where "TheRock" doesn't exist in the passwd file. However, the pipes exit status is still 0 (success). This is so because the last command ("tr" in this case) still succeeded. It is just that it didn't get any input on stdin to process:</span><br /> <br /> <pre> ❯ grep TheRock /etc/passwd ❯ echo $? 1 -❯ grep TheRock /etc/passwd | tr '[a-z]' '[A-Z]' +❯ grep TheRock /etc/passwd | tr '[a-z]' '[A-Z]' ❯ echo $? 0 </pre> @@ -4646,7 +4646,7 @@ PAUL:X:1000:1000:PAUL BUETOW:/HOME/PAUL:/BIN/BASH <br /> <pre> ❯ set -o pipefail -❯ grep TheRock /etc/passwd | tr '[a-z]' '[A-Z]' +❯ grep TheRock /etc/passwd | tr '[a-z]' '[A-Z]' ❯ echo $? 1 </pre> @@ -4671,7 +4671,7 @@ PAUL:X:1000:1000:PAUL BUETOW:/HOME/PAUL:/BIN/BASH <updated>2021-12-26T12:02:02+00:00</updated> <author> <name>Paul Buetow</name> - <email>hi@paul.cyou</email> + <email>hi@foo.zone</email> </author> <summary>Log4shell (CVE-2021-44228) made it clear, once again, that working in information technology is not an easy job (especially when you are a DevOps person). I thought it would be interesting to summarize a few techniques to help you to relax.</summary> <content type="xhtml"> @@ -4815,7 +4815,7 @@ PAUL:X:1000:1000:PAUL BUETOW:/HOME/PAUL:/BIN/BASH <updated>2021-11-29T14:06:14+00:00</updated> <author> <name>Paul Buetow</name> - <email>hi@paul.cyou</email> + <email>hi@foo.zone</email> </author> <summary>This is the first blog post about my Bash Golf series. This series is about random Bash tips, tricks and weirdnesses I came across. It's a collection of smaller articles I wrote in an older (in German language) blog, which I translated and refreshed with some new content.</summary> <content type="xhtml"> @@ -4825,17 +4825,17 @@ PAUL:X:1000:1000:PAUL BUETOW:/HOME/PAUL:/BIN/BASH <span class='quote'>Published at 2021-11-29T14:06:14+00:00; Updated at 2022-01-05</span><br /> <br /> <pre> - '\ . . |>18>> - \ . ' . | - O>> . 'o | + '\ . . |>18>> + \ . ' . | + O>> . 'o | \ . | /\ . | - / / .' | + / / .' | jgs^^^^^^^`^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Art by Joan Stark </pre> <br /> -<span>This is the first blog post about my Bash Golf series. This series is about random Bash tips, tricks and weirdnesses I came across. It's a collection of smaller articles I wrote in an older (in German language) blog, which I translated and refreshed with some new content.</span><br /> +<span>This is the first blog post about my Bash Golf series. This series is about random Bash tips, tricks and weirdnesses I came across. It's a collection of smaller articles I wrote in an older (in German language) blog, which I translated and refreshed with some new content.</span><br /> <br /> <a class='textlink' href='./2022-01-01-bash-golf-part-2.html'>2022-01-01 Bash Golf Part 2</a><br /> <a class='textlink' href='./2021-11-29-bash-golf-part-1.html'>2021-11-29 Bash Golf Part 1 (You are currently reading this)</a><br /> @@ -4854,7 +4854,7 @@ jgs^^^^^^^`^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ <br /> <span>The Bash treats /dev/tcp/HOST/PORT in a special way so that it is actually establishing a TCP connection to HOST:PORT. The example above redirects the TCP output of the time-server to cat and cat is printing it on standard output (stdout).</span><br /> <br /> -<span>A more sophisticated example is firing up an HTTP request. Let's create a new read-write (rw) file descriptor (fd) 5, redirect the HTTP request string to it, and then read the response back:</span><br /> +<span>A more sophisticated example is firing up an HTTP request. Let's create a new read-write (rw) file descriptor (fd) 5, redirect the HTTP request string to it, and then read the response back:</span><br /> <br /> <pre> ❯ exec 5<>/dev/tcp/google.de/80 @@ -4872,7 +4872,7 @@ X-XSS-Protection: 0 X-Frame-Options: SAMEORIGIN </pre> <br /> -<span>You would assume that this also works with the ZSH, but it doesn't. This is one of the few things which don't work with the ZSH but in the Bash. There might be plugins you could use for ZSH to do something similar, though.</span><br /> +<span>You would assume that this also works with the ZSH, but it doesn't. This is one of the few things which don't work with the ZSH but in the Bash. There might be plugins you could use for ZSH to do something similar, though.</span><br /> <br /> <h2 style='display: inline'>Process substitution</h2><br /> <br /> @@ -4897,7 +4897,7 @@ Change: 2021-11-20 10:59:31.482411961 +0000 Birth: - </pre> <br /> -<span>This example doesn't make any sense practically speaking, but it clearly demonstrates how process substitution works. The standard output pipe of "uptime" is redirected to an anonymous file descriptor. That fd then is opened by the "cat" command as a regular file.</span><br /> +<span>This example doesn't make any sense practically speaking, but it clearly demonstrates how process substitution works. The standard output pipe of "uptime" is redirected to an anonymous file descriptor. That fd then is opened by the "cat" command as a regular file.</span><br /> <br /> <span>A useful use case is displaying the differences of two sorted files:</span><br /> <br /> @@ -4965,7 +4965,7 @@ foo bar baz 97 </pre> <br /> -<span>But wait, what is the difference between curly braces and normal braces? I assumed that the normal braces create a subprocess whereas the curly ones don't, but I was wrong:</span><br /> +<span>But wait, what is the difference between curly braces and normal braces? I assumed that the normal braces create a subprocess whereas the curly ones don't, but I was wrong:</span><br /> <br /> <pre> ❯ echo $$ @@ -4992,7 +4992,7 @@ foo bar baz <br /> <pre> (list) list is executed in a subshell environment (see COMMAND EXECUTION ENVIRONMENT - below). Variable assignments and builtin commands that affect the shell's + below). Variable assignments and builtin commands that affect the shell's environment do not remain in effect after the command completes. The return status is the exit status of list. @@ -5023,7 +5023,7 @@ $ Expands to the process ID of the shell. In a () subshell, it expands to <br /> <h2 style='display: inline'>Expansions</h2><br /> <br /> -<span>Let's start with simple examples:</span><br /> +<span>Let's start with simple examples:</span><br /> <br /> <pre> ❯ echo {0..5} @@ -5062,7 +5062,7 @@ a b c d e "These" "words" "are" "quoted" </pre> <br /> -<span>Let's also expand to the cross product of two given lists:</span><br /> +<span>Let's also expand to the cross product of two given lists:</span><br /> <br /> <pre> ❯ echo {one,two}\:{A,B,C} @@ -5091,16 +5091,16 @@ Hello world Hello world ONECHEESEBURGERPLEASE Hello world -❯ cat - <<< 'Hello world' +❯ cat - <<< 'Hello world' Hello world </pre> <br /> -<span>Let's walk through all three examples from the above snippet:</span><br /> +<span>Let's walk through all three examples from the above snippet:</span><br /> <br /> <ul> <li>The first example is obvious (the Bash builtin "echo" prints its arguments to stdout).</li> -<li>The second pipes "Hello world" via stdout to stdin of the "cat" command. As cat's argument is "-" it reads its data from stdin and not from a regular file named "-". So "-" has a special meaning for cat.</li> -<li>The third and fourth examples are interesting as we don't use a pipe as of "|" but a so-called HERE-document and a HERE-string. But the end results are the same.</li> +<li>The second pipes "Hello world" via stdout to stdin of the "cat" command. As cat's argument is "-" it reads its data from stdin and not from a regular file named "-". So "-" has a special meaning for cat.</li> +<li>The third and fourth examples are interesting as we don't use a pipe as of "|" but a so-called HERE-document and a HERE-string. But the end results are the same.</li> </ul><br /> <span>The "tar" command understands "-" too. The following example tars up some local directory and sends the data to stdout (this is what "-f -" commands it to do). stdout then is piped via an SSH session to a remote tar process (running on buetow.org) and reads the data from stdin and extracts all the data coming from stdin (as we told tar with "-f -") on the remote machine:</span><br /> <br /> @@ -5141,7 +5141,7 @@ declare -r PASS=${PASS:?Missing the secret password for $USER} echo $USER:$PASS </pre> <br /> -<span>So what we are doing here is to pass the arguments via environment variables to the script. The script will abort with an error when there's an undefined argument.</span><br /> +<span>So what we are doing here is to pass the arguments via environment variables to the script. The script will abort with an error when there's an undefined argument.</span><br /> <br /> <pre> ❯ chmod +x foo.sh @@ -5161,7 +5161,7 @@ paul:secret ❯ VARIABLE1=value1 VARIABLE2=value2 ./script.sh </pre> <br /> -<span>That's just another way to pass environment variables to a script. You can write it as well as like this:</span><br /> +<span>That's just another way to pass environment variables to a script. You can write it as well as like this:</span><br /> <br /> <pre> ❯ export VARIABLE1=value1 @@ -5173,7 +5173,7 @@ paul:secret <br /> <h2 style='display: inline'>: aka the null command</h2><br /> <br /> -<span>First, let's use the "help" Bash built-in to see what it says about the null command:</span><br /> +<span>First, let's use the "help" Bash built-in to see what it says about the null command:</span><br /> <br /> <pre> ❯ help : @@ -5186,7 +5186,7 @@ paul:secret Always succeeds. </pre> <br /> -<span>PS: IMHO, people should use the Bash help more often. It is a very useful Bash reference. Too many fallbacks to a Google search and then land on Stack Overflow. Sadly, there's no help built-in for the ZSH shell though (so even when I am using the ZSH I make use of the Bash help as most of the built-ins are compatible). </span><br /> +<span>PS: IMHO, people should use the Bash help more often. It is a very useful Bash reference. Too many fallbacks to a Google search and then land on Stack Overflow. Sadly, there's no help built-in for the ZSH shell though (so even when I am using the ZSH I make use of the Bash help as most of the built-ins are compatible). </span><br /> <br /> <span>OK, back to the null command. What happens when you try to run it? As you can see, absolutely nothing. And its exit status is 0 (success):</span><br /> <br /> @@ -5211,7 +5211,7 @@ Sun 21 Nov 12:08:33 GMT 2021 <br /> <pre> ❯ foo () { } --bash: syntax error near unexpected token `}' +-bash: syntax error near unexpected token `}' ❯ foo () { :; } ❯ foo ❯ @@ -5228,8 +5228,8 @@ Sun 21 Nov 12:08:33 GMT 2021 <pre> ❯ : I am a comment and have no other effect ❯ : I am a comment and result in a syntax error () --bash: syntax error near unexpected token `(' -❯ : "I am a comment and don't result in a syntax error ()" +-bash: syntax error near unexpected token `(' +❯ : "I am a comment and don't result in a syntax error ()" ❯ </pre> <br /> @@ -5246,7 +5246,7 @@ bash: 1: command not found... 4 </pre> <br /> -<span>For these kinds of expressions it's always better to use "let" though. And you should also use $((...expression...)) instead of the old (deprecated) way $[ ...expression... ] like this example demonstrates:</span><br /> +<span>For these kinds of expressions it's always better to use "let" though. And you should also use $((...expression...)) instead of the old (deprecated) way $[ ...expression... ] like this example demonstrates:</span><br /> <br /> <pre> ❯ declare j=0 @@ -5260,26 +5260,26 @@ bash: 1: command not found... <br /> <h2 style='display: inline'>(No) floating point support</h2><br /> <br /> -<span>I have to give a plus-point to the ZSH here. As the ZSH supports floating point calculation, whereas the Bash doesn't:</span><br /> +<span>I have to give a plus-point to the ZSH here. As the ZSH supports floating point calculation, whereas the Bash doesn't:</span><br /> <br /> <pre> -❯ bash -c 'echo $(( 1/10 ))' +❯ bash -c 'echo $(( 1/10 ))' 0 -❯ zsh -c 'echo $(( 1/10 ))' +❯ zsh -c 'echo $(( 1/10 ))' 0 -❯ bash -c 'echo $(( 1/10.0 ))' +❯ bash -c 'echo $(( 1/10.0 ))' bash: line 1: 1/10.0 : syntax error: invalid arithmetic operator (error token is ".0 ") -❯ zsh -c 'echo $(( 1/10.0 ))' +❯ zsh -c 'echo $(( 1/10.0 ))' 0.10000000000000001 ❯ </pre> <br /> -<span>It would be nice to have native floating point support for the Bash too, but you don't want to use the shell for complicated calculations anyway. So it's fine that Bash doesn't have that, I guess. </span><br /> +<span>It would be nice to have native floating point support for the Bash too, but you don't want to use the shell for complicated calculations anyway. So it's fine that Bash doesn't have that, I guess. </span><br /> <br /> <span>In the Bash you will have to fall back to an external command like "bc" (the arbitrary precision calculator language):</span><br /> <br /> <pre> -❯ bc <<< 'scale=2; 1/10' +❯ bc <<< 'scale=2; 1/10' .10 </pre> <br /> @@ -5305,7 +5305,7 @@ bash: line 1: 1/10.0 : syntax error: invalid arithmetic operator (error token is <updated>2021-10-22T10:02:46+03:00</updated> <author> <name>Paul Buetow</name> - <email>hi@paul.cyou</email> + <email>hi@foo.zone</email> </author> <summary>I have seen many different setups and infrastructures during my carreer. My roles always included front-line ad-hoc fire fighting production issues. This often involves identifying and fixing these under time pressure, without the comfort of 2-week-long SCRUM sprints and without an exhaustive QA process. I also wrote a lot of code (Bash, Ruby, Perl, Go, and a little Java), and I followed the typical software development process, but that did not always apply to critical production issues.</summary> <content type="xhtml"> @@ -5426,7 +5426,7 @@ bash: line 1: 1/10.0 : syntax error: invalid arithmetic operator (error token is <updated>2021-09-12T09:39:20+03:00</updated> <author> <name>Paul Buetow</name> - <email>hi@paul.cyou</email> + <email>hi@foo.zone</email> </author> <summary>A robust computer system must be kept simple and stupid (KISS). The fancier the system is, the more can break. Unfortunately, most systems tend to become complex and challenging to maintain in today's world. In the early days, so I was told, engineers understood every part of the system, but nowadays, we see more of the 'lasagna' stack. One layer or framework is built on top of another layer, and in the end, nobody has got a clue what's going on.</summary> <content type="xhtml"> @@ -5542,7 +5542,7 @@ bash: line 1: 1/10.0 : syntax error: invalid arithmetic operator (error token is <updated>2021-08-01T10:37:58+03:00</updated> <author> <name>Paul Buetow</name> - <email>hi@paul.cyou</email> + <email>hi@foo.zone</email> </author> <summary>I believe that it is essential to always have free and open-source alternatives to any kind of closed-source proprietary software available to choose from. But there are a couple of points you need to take into consideration. </summary> <content type="xhtml"> @@ -5677,7 +5677,7 @@ bash: line 1: 1/10.0 : syntax error: invalid arithmetic operator (error token is <updated>2021-07-04T10:51:23+01:00</updated> <author> <name>Paul Buetow</name> - <email>hi@paul.cyou</email> + <email>hi@foo.zone</email> </author> <summary>When I was a Linux System Administrator, I have been programming in Perl for years. I still maintain some personal Perl programming projects (e.g. Xerl, guprecords, Loadbars). After switching jobs a couple of years ago (becoming a Site Reliability Engineer), I found Ruby (and some Python) widely used there. As I wanted to do something new, I decided to give Ruby a go.</summary> <content type="xhtml"> @@ -5800,7 +5800,7 @@ Hello World <updated>2021-06-05T19:03:32+01:00</updated> <author> <name>Paul Buetow</name> - <email>hi@paul.cyou</email> + <email>hi@foo.zone</email> </author> <summary>You might have read my previous blog posts about entering the Geminispace, where I pointed out the benefits of having and maintaining an internet presence there. This whole site (the blog and all other pages) is composed in the Gemtext markup language.</summary> <content type="xhtml"> @@ -5812,42 +5812,42 @@ Hello World <pre> o .,<>., o |\/\/\/\/| - '========' + '========' (_ SSSSSSs - )a'`SSSSSs + )a'`SSSSSs /_ SSSSSS .=## SSSSS .#### SSSSs ###::::SSSSS .;:::""""SSS - .:;:' . . \\ - .::/ ' .'| + .:;:' . . \\ + .::/ ' .'| .::( . | :::) \ /\( / /) ( | - .' \ . ./ / - _-' |\ . | + .' \ . ./ / + _-' |\ . | _..--.. . /"---\ | ` | . | - -=====================,' _ \=(*#(7.#####() | `/_.. , ( - _.-''``';'-''-) ,. \ ' '+/// | .'/ \ ``-.) \ - ,' _.- (( `-' `._\ `` \_/_.' ) /`-._ ) | - ,'\ ,' _.'.`:-. \.-' / <_L )" | - _/ `._,' ,')`; `-'`' | L / / - / `. ,' ,|_/ / \ ( <_-' \ - \ / `./ ' / /,' \ /|` `. | - )\ /`._ ,'`._.-\ |) \' - / `.' )-'.-,' )__) |\ `| - : /`. `.._(--.`':`':/ \ ) \ \ - |::::\ ,'/::;-)) / ( )`. | - ||::::: . .::': :`-( |/ . | + -=====================,' _ \=(*#(7.#####() | `/_.. , ( + _.-''``';'-''-) ,. \ ' '+/// | .'/ \ ``-.) \ + ,' _.- (( `-' `._\ `` \_/_.' ) /`-._ ) | + ,'\ ,' _.'.`:-. \.-' / <_L )" | + _/ `._,' ,')`; `-'`' | L / / + / `. ,' ,|_/ / \ ( <_-' \ + \ / `./ ' / /,' \ /|` `. | + )\ /`._ ,'`._.-\ |) \' + / `.' )-'.-,' )__) |\ `| + : /`. `.._(--.`':`':/ \ ) \ \ + |::::\ ,'/::;-)) / ( )`. | + ||::::: . .::': :`-( |/ . | ||::::| . :| |==[]=: . - \ |||:::| : || : | | /\ ` | - ___ ___ '|;:::| | |' \=[]=| / \ \ -| /_ ||``|||::::: | ; | | | \_.'\_ `-. -: \_``[]--[]|::::'\_;' )-'..`._ .-'\``:: ` . \ - \___.>`''-.||:.__,' SSt |_______`> <_____:::. . . \ _/ - `+a:f:......jrei''' + ___ ___ '|;:::| | |' \=[]=| / \ \ +| /_ ||``|||::::: | ; | | | \_.'\_ `-. +: \_``[]--[]|::::'\_;' )-'..`._ .-'\``:: ` . \ + \___.>`''-.||:.__,' SSt |_______`> <_____:::. . . \ _/ + `+a:f:......jrei''' </pre> <br /> <span>You might have read my previous blog posts about entering the Geminispace, where I pointed out the benefits of having and maintaining an internet presence there. This whole site (the blog and all other pages) is composed in the Gemtext markup language.</span><br /> @@ -5877,7 +5877,7 @@ Hello World <li>A Gemfeed for my blog posts (a particular feed format commonly used in Geminispace. The Gemfeed can be used as an alternative to the Atom feed).</li> <li>An HTML Atom feed of my blog posts</li> </ul><br /> -<span>I could have done all of that with a more robust language than Bash (such as Perl, Ruby, Go...), but I didn't. The purpose of this exercise was to challenge what I can do with a "simple" Bash script and learn new things.</span><br /> +<span>I could have done all of that with a more robust language than Bash (such as Perl, Ruby, Go...), but I didn't. The purpose of this exercise was to challenge what I can do with a "simple" Bash script and learn new things.</span><br /> <br /> <h2 style='display: inline'>Taking it as far as I should, but no farther</h2><br /> <br /> @@ -5905,7 +5905,7 @@ http://www.gnu.org/software/src-highlite --> <font color="#993399">834</font> total </pre> <br /> -<span>This way, the script could grow far beyond 1000 lines of code and still be maintainable. With more features, execution speed may slowly become a problem, though. I already notice that Gemtexter doesn't produce results instantly but requires few seconds of runtime already. That's not a problem yet, though. </span><br /> +<span>This way, the script could grow far beyond 1000 lines of code and still be maintainable. With more features, execution speed may slowly become a problem, though. I already notice that Gemtexter doesn't produce results instantly but requires few seconds of runtime already. That's not a problem yet, though. </span><br /> <br /> <h3 style='display: inline'>Bash best practises and ShellCheck</h3><br /> <br /> @@ -5917,7 +5917,7 @@ http://www.gnu.org/software/src-highlite --> <br /> <span>ShellCheck, a shell script analysis tool written in Haskell, is run on Gemtexter ensuring that all code is acceptable. I am pretty impressed with what ShellCheck found. </span><br /> <br /> -<span>It, for example, detected "some_command | while read var; do ...; done" loops and hinted that these create a new subprocess for the while part. The result is that all variable modifications taking place in the while-subprocess won't reflect the primary Bash process. ShellSheck then recommended rewriting the loop so that no subprocess is spawned as "while read -r var; do ...; done < <(some_command)". ShellCheck also pointed out to add a "-r" to "read"; otherwise, there could be an issue with backspaces in the loop data.</span><br /> +<span>It, for example, detected "some_command | while read var; do ...; done" loops and hinted that these create a new subprocess for the while part. The result is that all variable modifications taking place in the while-subprocess won't reflect the primary Bash process. ShellSheck then recommended rewriting the loop so that no subprocess is spawned as "while read -r var; do ...; done < <(some_command)". ShellCheck also pointed out to add a "-r" to "read"; otherwise, there could be an issue with backspaces in the loop data.</span><br /> <br /> <span>Furthermore, ShellCheck recommended many more improvements. Declaration of unused variables and missing variable and string quotations were the most common ones. ShellSheck immensely helped to improve the robustness of the script.</span><br /> <br /> @@ -5959,7 +5959,7 @@ assert<font color="#990000">::</font>equals <font color="#FF0000">"$(generate::m <br /> <span>For now, I have to re-generate all HTML files whenever the CSS changes. That should not be an issue now, but I might move the CSS into a separate file one day.</span><br /> <br /> -<span>It's worth mentioning that all generated HTML files and Atom feeds pass the W3C validation tests.</span><br /> +<span>It's worth mentioning that all generated HTML files and Atom feeds pass the W3C validation tests.</span><br /> <span> </span><br /> <h2 style='display: inline'>Configurability</h2><br /> <br /> @@ -5977,14 +5977,14 @@ assert<font color="#990000">::</font>equals <font color="#FF0000">"$(generate::m </ul><br /> <h2 style='display: inline'>Conclusion</h2><br /> <br /> -<span>It was quite a lot of fun writing Gemtexter. It's a relatively small project, but given that I worked on that in my spare time once in a while, it kept me busy for several weeks. </span><br /> +<span>It was quite a lot of fun writing Gemtexter. It's a relatively small project, but given that I worked on that in my spare time once in a while, it kept me busy for several weeks. </span><br /> <br /> <span>I finally revamped my personal internet site and started to blog again. I wanted the result to be exactly how it is now: A slightly retro-inspired internet site built for fun with unconventional tools. </span><br /> <br /> <span>Other related posts are:</span><br /> <br /> -<a class='textlink' href='./2023-03-25-gemtexter-2.0.0-lets-gemtext-again-2.html'>2023-03-25 Gemtexter 2.0.0 - Let's Gemtext again²</a><br /> -<a class='textlink' href='./2022-08-27-gemtexter-1.1.0-lets-gemtext-again.html'>2022-08-27 Gemtexter 1.1.0 - Let's Gemtext again</a><br /> +<a class='textlink' href='./2023-03-25-gemtexter-2.0.0-lets-gemtext-again-2.html'>2023-03-25 Gemtexter 2.0.0 - Let's Gemtext again²</a><br /> +<a class='textlink' href='./2022-08-27-gemtexter-1.1.0-lets-gemtext-again.html'>2022-08-27 Gemtexter 1.1.0 - Let's Gemtext again</a><br /> <a class='textlink' href='./2022-01-01-bash-golf-part-2.html'>2022-01-01 Bash Golf Part 2</a><br /> <a class='textlink' href='./2021-11-29-bash-golf-part-1.html'>2021-11-29 Bash Golf Part 1</a><br /> <a class='textlink' href='./2021-06-05-gemtexter-one-bash-script-to-rule-it-all.html'>2021-06-05 Gemtexter - One Bash script to rule it all (You are currently reading this)</a><br /> @@ -6004,7 +6004,7 @@ assert<font color="#990000">::</font>equals <font color="#FF0000">"$(generate::m <updated>2021-05-16T14:51:57+01:00</updated> <author> <name>Paul Buetow</name> - <email>hi@paul.cyou</email> + <email>hi@foo.zone</email> </author> <summary>Lately, I have been polishing and writing a lot of Bash code. Not that I never wrote a lot of Bash, but now as I also looked through the Google Shell Style Guide, I thought it is time also to write my thoughts on that. I agree with that guide in most, but not in all points. </summary> <content type="xhtml"> @@ -6023,7 +6023,7 @@ assert<font color="#990000">::</font>equals <font color="#FF0000">"$(generate::m /======"---""---""---""---"=| =|| |____ []* ____ | ==|| // \\ // \\ |===|| hjw -"\__/"---------------"\__/"-+---+' +"\__/"---------------"\__/"-+---+' </pre> <br /> <span>Lately, I have been polishing and writing a lot of Bash code. Not that I never wrote a lot of Bash, but now as I also looked through the Google Shell Style Guide, I thought it is time also to write my thoughts on that. I agree with that guide in most, but not in all points. </span><br /> @@ -6042,7 +6042,7 @@ assert<font color="#990000">::</font>equals <font color="#FF0000">"$(generate::m #!/bin/bash </pre> <br /> -<span>... as the shebang line, but that does not work on all Unix and Unix-like operating systems (e.g., the *BSDs don't have Bash installed to /bin/bash). Better is:</span><br /> +<span>... as the shebang line, but that does not work on all Unix and Unix-like operating systems (e.g., the *BSDs don't have Bash installed to /bin/bash). Better is:</span><br /> <br /> <pre> #!/usr/bin/env bash @@ -6052,9 +6052,9 @@ assert<font color="#990000">::</font>equals <font color="#FF0000">"$(generate::m <br /> <span>I know there have been many tab- and soft-tab wars on this planet. Google recommends using two space soft-tabs for Bash scripts. </span><br /> <br /> -<span>I don't care if I use two or four space indentations. I agree, however, that we should not use tabs. I tend to use four-space soft-tabs as that's how I currently configured Vim for any programming language. What matters most, though, is consistency within the same script/project.</span><br /> +<span>I don't care if I use two or four space indentations. I agree, however, that we should not use tabs. I tend to use four-space soft-tabs as that's how I currently configured Vim for any programming language. What matters most, though, is consistency within the same script/project.</span><br /> <br /> -<span>Google also recommends limiting the line length to 80 characters. For some people, that seems to be an old habit from the '80s, where all computer terminals couldn't display longer lines. But I think that the 80 character mark is still a good practice, at least for shell scripts. For example, I am often writing code on a Microsoft Go Tablet PC (running Linux, of course), and it comes in convenient if the lines are not too long due to the relatively small display on the device.</span><br /> +<span>Google also recommends limiting the line length to 80 characters. For some people, that seems to be an old habit from the '80s, where all computer terminals couldn't display longer lines. But I think that the 80 character mark is still a good practice, at least for shell scripts. For example, I am often writing code on a Microsoft Go Tablet PC (running Linux, of course), and it comes in convenient if the lines are not too long due to the relatively small display on the device.</span><br /> <br /> <span>I hit the 80 character line length quicker with the four spaces than with two spaces, but that makes me refactor the Bash code more aggressively, which is a good thing. </span><br /> <br /> @@ -6095,7 +6095,7 @@ greet () { } </pre> <br /> -<span>In this particular example, I agree that you should quote them as you don't know the input (are there, for example, whitespace characters?). But if you are sure that you are only using simple bare words, then I think that the code looks much cleaner when you do this instead:</span><br /> +<span>In this particular example, I agree that you should quote them as you don't know the input (are there, for example, whitespace characters?). But if you are sure that you are only using simple bare words, then I think that the code looks much cleaner when you do this instead:</span><br /> <br /> <pre> say_hello_to_paul () { @@ -6113,7 +6113,7 @@ declare FOO=bar echo "foo${FOO}baz" </pre> <br /> -<span>A few more words on always quoting the variables: For the sake of consistency (and for making ShellCheck happy), I am not against quoting everything I encounter. I also think that the larger the Bash script becomes, the more critical it becomes always to quote variables. That's because it will be more likely that you might not remember that some of the functions don't work on values with spaces in them, for example. It's just that I won't quote everything in every small script I write. </span><br /> +<span>A few more words on always quoting the variables: For the sake of consistency (and for making ShellCheck happy), I am not against quoting everything I encounter. I also think that the larger the Bash script becomes, the more critical it becomes always to quote variables. That's because it will be more likely that you might not remember that some of the functions don't work on values with spaces in them, for example. It's just that I won't quote everything in every small script I write. </span><br /> <br /> <h3 style='display: inline'>Prefer built-in commands over external commands</h3><br /> <br /> @@ -6126,22 +6126,22 @@ substitution="${string/#foo/bar}" # Instead of this: addition="$(expr "${X}" + "${Y}")" -substitution="$(echo "${string}" | sed -e 's/^foo/bar/')" +substitution="$(echo "${string}" | sed -e 's/^foo/bar/')" </pre> <br /> -<span>I can't entirely agree here. The external commands (especially sed) are much more sophisticated and powerful than the built-in Bash versions. Sed can do much more than the Bash can ever do by itself when it comes to text manipulation (the name "sed" stands for streaming editor, after all).</span><br /> +<span>I can't entirely agree here. The external commands (especially sed) are much more sophisticated and powerful than the built-in Bash versions. Sed can do much more than the Bash can ever do by itself when it comes to text manipulation (the name "sed" stands for streaming editor, after all).</span><br /> <br /> <span>I prefer to do light text processing with the Bash built-ins and more complicated text processing with external programs such as sed, grep, awk, cut, and tr. However, there is also medium-light text processing where I would want to use external programs. That is so because I remember using them better than the Bash built-ins. The Bash can get relatively obscure here (even Perl will be more readable then - Side note: I love Perl).</span><br /> <br /> <span>Also, you would like to use an external command for floating-point calculation (e.g., bc) instead of using the Bash built-ins (worth noticing that ZSH supports built-in floating-points).</span><br /> <br /> -<span>I even didn't get started with what you can do with awk (especially GNU Awk), a fully-fledged programming language. Tiny Awk snippets tend to be used quite often in Shell scripts without honouring the real power of Awk. But if you did everything in Perl or Awk or another scripting language, then it wouldn't be a Bash script anymore, wouldn't it? ;-)</span><br /> +<span>I even didn't get started with what you can do with awk (especially GNU Awk), a fully-fledged programming language. Tiny Awk snippets tend to be used quite often in Shell scripts without honouring the real power of Awk. But if you did everything in Perl or Awk or another scripting language, then it wouldn't be a Bash script anymore, wouldn't it? ;-)</span><br /> <br /> <h2 style='display: inline'>My additions</h2><br /> <br /> -<h3 style='display: inline'>Use of 'yes' and 'no'</h3><br /> +<h3 style='display: inline'>Use of 'yes' and 'no'</h3><br /> <br /> -<span>Bash does not support a boolean type. I tend just to use the strings 'yes' and 'no' here. I used 0 for false and 1 for true for some time, but I think that the yes/no strings are easier to read. Yes, the Bash script would need to perform string comparisons on every check, but if performance is crucial to you, you wouldn't want to use a Bash script anyway, correct?</span><br /> +<span>Bash does not support a boolean type. I tend just to use the strings 'yes' and 'no' here. I used 0 for false and 1 for true for some time, but I think that the yes/no strings are easier to read. Yes, the Bash script would need to perform string comparisons on every check, but if performance is crucial to you, you wouldn't want to use a Bash script anyway, correct?</span><br /> <br /> <pre> declare -r SUGAR_FREE=yes @@ -6151,9 +6151,9 @@ buy_soda () { local -r sugar_free=$1 if [[ $sugar_free == yes ]]; then - echo 'Diet Dr. Pepper' + echo 'Diet Dr. Pepper' else - echo 'Pepsi Coke' + echo 'Pepsi Coke' fi } @@ -6174,7 +6174,7 @@ variable="$(eval some_function)" </pre> <br /> -<span>However, if I want to read variables from another file, I don't have to use eval here. I only have to source the file:</span><br /> +<span>However, if I want to read variables from another file, I don't have to use eval here. I only have to source the file:</span><br /> <br /> <pre> % cat vars.source.sh @@ -6182,7 +6182,7 @@ declare foo=bar declare bar=baz declare bay=foo -% bash -c 'source vars.source.sh; echo $foo $bar $baz' +% bash -c 'source vars.source.sh; echo $foo $bar $baz' bar baz foo </pre> <br /> @@ -6196,11 +6196,11 @@ declare date="$(date)" declare user=$USER END -% bash -c 'source <(./vars.sh); echo "Hello $user, it is $date"' +% bash -c 'source <(./vars.sh); echo "Hello $user, it is $date"' Hello paul, it is Sat 15 May 19:21:12 BST 2021 </pre> <br /> -<span>The downside is that ShellCheck won't be able to follow the dynamic sourcing anymore.</span><br /> +<span>The downside is that ShellCheck won't be able to follow the dynamic sourcing anymore.</span><br /> <br /> <h3 style='display: inline'>Prefer pipes over arrays for list processing</h3><br /> <br /> @@ -6208,12 +6208,12 @@ Hello paul, it is Sat 15 May 19:21:12 BST 2021 <br /> <pre> filter_lines () { - echo 'Start filtering lines in a fancy way!' >&2 + echo 'Start filtering lines in a fancy way!' >&2 grep ... | sed .... } process_lines () { - echo 'Start processing line by line!' >&2 + echo 'Start processing line by line!' >&2 while read -r line; do ... do something and produce a result... echo "$result" @@ -6222,12 +6222,12 @@ process_lines () { # Do some post-processing of the data postprocess_lines () { - echo 'Start removing duplicates!' >&2 + echo 'Start removing duplicates!' >&2 sort -u } genreate_report () { - echo 'My boss wants to have a report!' >&2 + echo 'My boss wants to have a report!' >&2 tee outfile.txt wc -l outfile.txt } @@ -6246,9 +6246,9 @@ main <br /> <h3 style='display: inline'>Assign-then-shift</h3><br /> <br /> -<span>I often refactor existing Bash code. That leads me to add and removing function arguments quite often. It's pretty repetitive work changing the $1, $2.... function argument numbers every time you change the order or add/remove possible arguments.</span><br /> +<span>I often refactor existing Bash code. That leads me to add and removing function arguments quite often. It's pretty repetitive work changing the $1, $2.... function argument numbers every time you change the order or add/remove possible arguments.</span><br /> <br /> -<span>The solution is to use of the "assign-then-shift"-method, which goes like this: "local -r var1=$1; shift; local -r var2=$1; shift". The idea is that you only use "$1" to assign function arguments to named (better readable) local function variables. You will never have to bother about "$2" or above. That is very useful when you constantly refactor your code and remove or add function arguments. It's something that I picked up from a colleague (a pure Bash wizard) some time ago:</span><br /> +<span>The solution is to use of the "assign-then-shift"-method, which goes like this: "local -r var1=$1; shift; local -r var2=$1; shift". The idea is that you only use "$1" to assign function arguments to named (better readable) local function variables. You will never have to bother about "$2" or above. That is very useful when you constantly refactor your code and remove or add function arguments. It's something that I picked up from a colleague (a pure Bash wizard) some time ago:</span><br /> <br /> <pre> some_function () { @@ -6282,7 +6282,7 @@ some_function () { } </pre> <br /> -<span>As you can see, I didn't need to change any other assignments within the function. Of course, you would also need to change the function argument lists at every occasion where the function is invoked - you would do that within the same refactoring session.</span><br /> +<span>As you can see, I didn't need to change any other assignments within the function. Of course, you would also need to change the function argument lists at every occasion where the function is invoked - you would do that within the same refactoring session.</span><br /> <br /> <h3 style='display: inline'>Paranoid mode</h3><br /> <br /> @@ -6294,7 +6294,7 @@ grep -q foo <<< bar echo Jo </pre> <br /> -<span>Here 'Jo' will never be printed out as the grep didn't find any match. It's unrealistic for most scripts to run in paranoid mode purely, so there must be a way to add exceptions. Critical Bash scripts of mine tend to look like this:</span><br /> +<span>Here 'Jo' will never be printed out as the grep didn't find any match. It's unrealistic for most scripts to run in paranoid mode purely, so there must be a way to add exceptions. Critical Bash scripts of mine tend to look like this:</span><br /> <br /> <pre> #!/usr/bin/env bash @@ -6306,7 +6306,7 @@ some_function () { ... set +e - # Grep might fail, but that's OK now + # Grep might fail, but that's OK now grep .... local -i ec=$? set -e @@ -6321,7 +6321,7 @@ some_function () { <br /> <h2 style='display: inline'>Learned</h2><br /> <br /> -<span>There are also a couple of things I've learned from Google's guide.</span><br /> +<span>There are also a couple of things I've learned from Google's guide.</span><br /> <br /> <h3 style='display: inline'>Unintended lexicographical comparison.</h3><br /> <br /> @@ -6352,9 +6352,9 @@ fi <br /> <h3 style='display: inline'>PIPESTATUS</h3><br /> <br /> -<span>I have never used the PIPESTATUS variable before. I knew that it's there, but I never bothered to understand how it works until now thoroughly.</span><br /> +<span>I have never used the PIPESTATUS variable before. I knew that it's there, but I never bothered to understand how it works until now thoroughly.</span><br /> <br /> -<span>The PIPESTATUS variable in Bash allows checking of the return code from all parts of a pipe. If it's only necessary to check the success or failure of the whole pipe, then the following is acceptable:</span><br /> +<span>The PIPESTATUS variable in Bash allows checking of the return code from all parts of a pipe. If it's only necessary to check the success or failure of the whole pipe, then the following is acceptable:</span><br /> <br /> <pre> tar -cf - ./* | ( cd "${dir}" && tar -xf - ) @@ -6363,7 +6363,7 @@ if (( PIPESTATUS[0] != 0 || PIPESTATUS[1] != 0 )); then fi </pre> <br /> -<span>However, as PIPESTATUS will be overwritten as soon as you do any other command, if you need to act differently on errors based on where it happened in the pipe, you'll need to assign PIPESTATUS to another variable immediately after running the command (don't forget that [ is a command and will wipe out PIPESTATUS).</span><br /> +<span>However, as PIPESTATUS will be overwritten as soon as you do any other command, if you need to act differently on errors based on where it happened in the pipe, you'll need to assign PIPESTATUS to another variable immediately after running the command (don't forget that [ is a command and will wipe out PIPESTATUS).</span><br /> <br /> <pre> tar -cf - ./* | ( cd "${DIR}" && tar -xf - ) @@ -6411,7 +6411,7 @@ fi <updated>2021-04-24T19:28:41+01:00</updated> <author> <name>Paul Buetow</name> - <email>hi@paul.cyou</email> + <email>hi@foo.zone</email> </author> <summary>ASCII Art by Andy Hood!</summary> <content type="xhtml"> @@ -6422,7 +6422,7 @@ fi <br /> <span>ASCII Art by Andy Hood!</span><br /> <br /> -<span>Have you reached this article already via Gemini? It requires a Gemini client; web browsers such as Firefox, Chrome, Safari, etc., don't support the Gemini protocol. The Gemini address of this site (or the address of this capsule as people say in Geminispace) is:</span><br /> +<span>Have you reached this article already via Gemini? It requires a Gemini client; web browsers such as Firefox, Chrome, Safari, etc., don't support the Gemini protocol. The Gemini address of this site (or the address of this capsule as people say in Geminispace) is:</span><br /> <br /> <a class='textlink' href='gemini://foo.zone'>gemini://foo.zone</a><br /> <br /> @@ -6436,14 +6436,14 @@ fi | | | | | | - ' ` + ' ` |Gemini| | | |______| - '-`'-` . - / . \'\ . .' - ''( .'\.' ' .;' -'.;.;' ;'.;' ..;;' AsH + '-`'-` . + / . \'\ . .' + ''( .'\.' ' .;' +'.;.;' ;'.;' ..;;' AsH </pre> <br /> @@ -6455,7 +6455,7 @@ fi <br /> <h3 style='display: inline'>My still great Laptop running hot</h3><br /> <br /> -<span>Earlier this year (2021), I noticed that my almost seven-year-old but still great Laptop started to become hot and slowed down while surfing the web. Also, the Laptop's fan became quite noisy. This was all due to the additional bloat such as JavaScript, excessive use of CSS, tracking cookies+pixels, ads, and so on there was on the website. </span><br /> +<span>Earlier this year (2021), I noticed that my almost seven-year-old but still great Laptop started to become hot and slowed down while surfing the web. Also, the Laptop's fan became quite noisy. This was all due to the additional bloat such as JavaScript, excessive use of CSS, tracking cookies+pixels, ads, and so on there was on the website. </span><br /> <br /> <span>All I wanted was to read an interesting article, but after a big advertising pop-up banner appeared and made everything worse, I gave up and closed the browser tab.</span><br /> <br /> @@ -6463,16 +6463,16 @@ fi <br /> <span>Around the same time, I discovered a relatively new, more lightweight protocol named Gemini, which does not support all these CPU-intensive features like HTML, JavaScript, and CSS. Also, tracking and ads are unsupported by the Gemini protocol.</span><br /> <br /> -<span>The "downside" is that due to the limited capabilities of the Gemini protocol, all sites look very old and spartan. But that is not a downside; that is, in fact, a design choice people made. It is up to the client software how your capsule looks. For example, you could use a graphical client, such as Lagrange, with nice font renderings and colours to improve the appearance. Or you could use a very minimalistic command line black-and-white Gemini client. It's your (the user's) choice.</span><br /> +<span>The "downside" is that due to the limited capabilities of the Gemini protocol, all sites look very old and spartan. But that is not a downside; that is, in fact, a design choice people made. It is up to the client software how your capsule looks. For example, you could use a graphical client, such as Lagrange, with nice font renderings and colours to improve the appearance. Or you could use a very minimalistic command line black-and-white Gemini client. It's your (the user's) choice.</span><br /> <br /> <a href='./2021-04-24-welcome-to-the-geminispace/amfora-screenshot.png'><img alt='Screenshot Amfora Gemini terminal client surfing this site' title='Screenshot Amfora Gemini terminal client surfing this site' src='./2021-04-24-welcome-to-the-geminispace/amfora-screenshot.png' /></a><br /> <a href='./2021-04-24-welcome-to-the-geminispace/lagrange-screenshot.png'><img alt='Screenshot graphical Lagrange Gemini client surfing this site' title='Screenshot graphical Lagrange Gemini client surfing this site' src='./2021-04-24-welcome-to-the-geminispace/lagrange-screenshot.png' /></a><br /> <br /> -<span>Why is there a need for a new protocol? As the modern web is a superset of Gemini, can't we use simple HTML 1.0 instead? That's a good and valid question. It is not a technical problem but a human problem. We tend to abuse the features once they are available. You can ensure that things stay efficient and straightforward as long as you are using the Gemini protocol. On the other hand, you can't force every website on the modern web to only create plain and straightforward-looking HTML pages.</span><br /> +<span>Why is there a need for a new protocol? As the modern web is a superset of Gemini, can't we use simple HTML 1.0 instead? That's a good and valid question. It is not a technical problem but a human problem. We tend to abuse the features once they are available. You can ensure that things stay efficient and straightforward as long as you are using the Gemini protocol. On the other hand, you can't force every website on the modern web to only create plain and straightforward-looking HTML pages.</span><br /> <br /> <h2 style='display: inline'>My own Gemini capsule</h2><br /> <br /> -<span>As it is effortless to set up and maintain your own Gemini capsule (Gemini server + content composed via the Gemtext markup language), I decided to create my own. What I like about Gemini is that I can use my favourite text editor and get typing. I don't need to worry about the style and design of the presence, and I also don't have to test anything in ten different web browsers. I can only focus on the content! As a matter of fact, I am using the Vim editor + its spellchecker + auto word completion functionality to write this. </span><br /> +<span>As it is effortless to set up and maintain your own Gemini capsule (Gemini server + content composed via the Gemtext markup language), I decided to create my own. What I like about Gemini is that I can use my favourite text editor and get typing. I don't need to worry about the style and design of the presence, and I also don't have to test anything in ten different web browsers. I can only focus on the content! As a matter of fact, I am using the Vim editor + its spellchecker + auto word completion functionality to write this. </span><br /> <br /> <span>This site was generated with Gemtexter. You can read more about it here:</span><br /> <br /> @@ -6484,10 +6484,10 @@ fi <li>Supports an alternative to the modern bloated web</li> <li>Easy to operate and easy to write content</li> <li>No need to worry about various web browser compatibilities</li> -<li>It's the client's responsibility how the content is designed+presented</li> +<li>It's the client's responsibility how the content is designed+presented</li> <li>Lightweight (although not as lightweight as the Gopher protocol)</li> <li>Supports privacy (no cookies, no request header fingerprinting, TLS encryption)</li> -<li>Fun to play with (it's a bit geeky, yes, but a lot of fun!)</li> +<li>Fun to play with (it's a bit geeky, yes, but a lot of fun!)</li> </ul><br /> <h2 style='display: inline'>Dive into deep Gemini space</h2><br /> <br /> @@ -6498,8 +6498,8 @@ fi <br /> <span>Other related posts are:</span><br /> <br /> -<a class='textlink' href='./2023-03-25-gemtexter-2.0.0-lets-gemtext-again-2.html'>2023-03-25 Gemtexter 2.0.0 - Let's Gemtext again²</a><br /> -<a class='textlink' href='./2022-08-27-gemtexter-1.1.0-lets-gemtext-again.html'>2022-08-27 Gemtexter 1.1.0 - Let's Gemtext again</a><br /> +<a class='textlink' href='./2023-03-25-gemtexter-2.0.0-lets-gemtext-again-2.html'>2023-03-25 Gemtexter 2.0.0 - Let's Gemtext again²</a><br /> +<a class='textlink' href='./2022-08-27-gemtexter-1.1.0-lets-gemtext-again.html'>2022-08-27 Gemtexter 1.1.0 - Let's Gemtext again</a><br /> <a class='textlink' href='./2021-06-05-gemtexter-one-bash-script-to-rule-it-all.html'>2021-06-05 Gemtexter - One Bash script to rule it all</a><br /> <a class='textlink' href='./2021-04-24-welcome-to-the-geminispace.html'>2021-04-24 Welcome to the Geminispace (You are currently reading this)</a><br /> <br /> @@ -6516,7 +6516,7 @@ fi <updated>2021-04-22T19:28:41+01:00</updated> <author> <name>Paul Buetow</name> - <email>hi@paul.cyou</email> + <email>hi@foo.zone</email> </author> <summary>This article first appeared at the Mimecast Engineering Blog but I made it available here in my personal internet site too.</summary> <content type="xhtml"> @@ -6648,7 +6648,7 @@ dtail –servers serverlist.txt –files ‘/var/log/*.log’ –regex ‘(?i:er <updated>2018-06-01T14:50:29+01:00</updated> <author> <name>Paul Buetow</name> - <email>hi@paul.cyou</email> + <email>hi@foo.zone</email> </author> <summary>This text first was published in the german IT-Administrator computer Magazine. 3 years have passed since and I decided to publish it on my blog too. </summary> <content type="xhtml"> @@ -6854,7 +6854,7 @@ Total time: 1213.00s <updated>2016-11-20T22:10:57+00:00</updated> <author> <name>Paul Buetow</name> - <email>hi@paul.cyou</email> + <email>hi@foo.zone</email> </author> <summary>You can do a little of object-oriented programming in the C Programming Language. However, that is, in my humble opinion, limited. It's easier to use a different programming language than C for OOP. But still it's an interesting exercise to try using C for this.</summary> <content type="xhtml"> @@ -6987,7 +6987,7 @@ http://www.gnu.org/software/src-highlite --> <updated>2016-05-22T18:59:01+01:00</updated> <author> <name>Paul Buetow</name> - <email>hi@paul.cyou</email> + <email>hi@foo.zone</email> </author> <summary>Finally, I had time to deploy my authoritative DNS servers (master and slave) for my domains 'buetow.org' and 'buetow.zone'. My domain name provider is Schlund Technologies. They allow their customers to edit the DNS records (BIND files) manually. And they also allow you to set your authoritative DNS servers for your domains. From now, I am making use of that option.</summary> <content type="xhtml"> @@ -7242,7 +7242,7 @@ apply Service "dig6" { <updated>2016-04-16T22:43:42+01:00</updated> <author> <name>Paul Buetow</name> - <email>hi@paul.cyou</email> + <email>hi@foo.zone</email> </author> <summary>I enhanced the procedure a bit. From now on, I have two external 2TB USB hard drives. Both are set up precisely the same way. To decrease the probability that both drives will not fail simultaneously, they are of different brands. One drive is kept at a secret location. The other one is held at home, right next to my HP MicroServer.</summary> <content type="xhtml"> @@ -7288,7 +7288,7 @@ apply Service "dig6" { <updated>2016-04-09T18:29:47+01:00</updated> <author> <name>Paul Buetow</name> - <email>hi@paul.cyou</email> + <email>hi@foo.zone</email> </author> <summary>Over the last couple of years I wrote quite a few Puppet modules in order to manage my personal server infrastructure. One of them manages FreeBSD Jails and another one ZFS file systems. I thought I would give a brief overview in how it looks and feels.</summary> <content type="xhtml"> @@ -7695,7 +7695,7 @@ Notice: Finished catalog run in 206.09 seconds <updated>2016-04-03T22:43:42+01:00</updated> <author> <name>Paul Buetow</name> - <email>hi@paul.cyou</email> + <email>hi@foo.zone</email> </author> <summary>When it comes to data storage and potential data loss, I am a paranoid person. It is due to my job and a personal experience I encountered over ten years ago: A single drive failure and loss of all my data (pictures, music, etc.).</summary> <content type="xhtml"> @@ -7755,7 +7755,7 @@ Notice: Finished catalog run in 206.09 seconds <updated>2015-12-05T16:12:57+00:00</updated> <author> <name>Paul Buetow</name> - <email>hi@paul.cyou</email> + <email>hi@foo.zone</email> </author> <summary>You can use the following tutorial to install a full-blown Debian GNU/Linux Chroot on an LG G3 D855 CyanogenMod 13 (Android 6). First of all, you need to have root permissions on your phone, and you also need to have the developer mode activated. The following steps have been tested on Linux (Fedora 23).</summary> <content type="xhtml"> @@ -7968,7 +7968,7 @@ chmod <font color="#990000">+</font>x /data/local/userinit<font color="#990000"> <updated>2014-03-24T21:32:53+00:00</updated> <author> <name>Paul Buetow</name> - <email>hi@paul.cyou</email> + <email>hi@foo.zone</email> </author> <summary>In computing, a polyglot is a computer program or script written in a valid form of multiple programming languages, which performs the same operations or output independent of the programming language used to compile or interpret it.</summary> <content type="xhtml"> @@ -8135,7 +8135,7 @@ fib<font color="#990000">(</font><font color="#993399">10</font><font color="#99 <updated>2011-05-07T22:26:02+01:00</updated> <author> <name>Paul Buetow</name> - <email>hi@paul.cyou</email> + <email>hi@foo.zone</email> </author> <summary>PerlDaemon is a minimal daemon for Linux and other Unix like operating systems programmed in Perl. It is a minimal but pretty functional and fairly generic service framework. This means that it does not do anything useful other than providing a framework for starting, stopping, configuring and logging. To do something useful, a module (written in Perl) must be provided.</summary> <content type="xhtml"> @@ -8145,9 +8145,9 @@ fib<font color="#990000">(</font><font color="#993399">10</font><font color="#99 <span class='quote'>Published at 2011-05-07T22:26:02+01:00; Updated at 2021-05-07</span><br /> <br /> <pre> - a'! _,,_ a'! _,,_ a'! _,,_ + a'! _,,_ a'! _,,_ a'! _,,_ \\_/ \ \\_/ \ \\_/ \.-, - \, /-( /'-,\, /-( /'-, \, /-( / + \, /-( /'-,\, /-( /'-, \, /-( / //\ //\\ //\ //\\ //\ //\\jrei </pre> <br /> @@ -8221,7 +8221,7 @@ daemon<font color="#990000">.</font><font color="#009900">wd</font><font color=" <br /> <h2 style='display: inline'>Example </h2><br /> <br /> -<span>So let's start the daemon with a loop interval of 10 seconds:</span><br /> +<span>So let's start the daemon with a loop interval of 10 seconds:</span><br /> <br /> <!-- Generator: GNU source-highlight 3.1.9 by Lorenzo Bettini @@ -8296,7 +8296,7 @@ http://www.gnu.org/software/src-highlite --> <br /> <h3 style='display: inline'>Your own module</h3><br /> <br /> -<span>Want to give it some better use? It's just as easy as:</span><br /> +<span>Want to give it some better use? It's just as easy as:</span><br /> <br /> <!-- Generator: GNU source-highlight 3.1.9 by Lorenzo Bettini @@ -8309,7 +8309,7 @@ http://www.gnu.org/software/src-highlite --> <font color="#990000">.</font>/bin/perldaemon restart <font color="#990000">(</font>or shortcurt <font color="#990000">.</font>/control restart<font color="#990000">)</font> </pre> <br /> -<span>Now watch <span class='inlinecode'>./log/perldaemon.log</span> closely. It is a good practice to test your modules in 'foreground mode' (see above how to do that).</span><br /> +<span>Now watch <span class='inlinecode'>./log/perldaemon.log</span> closely. It is a good practice to test your modules in 'foreground mode' (see above how to do that).</span><br /> <br /> <span>BTW: You can install as many modules within the same instance as desired. But they are run in sequential order (in future, they can also run in parallel using several threads or processes).</span><br /> <br /> @@ -8338,7 +8338,7 @@ http://www.gnu.org/software/src-highlite --> <updated>2010-05-09T12:48:29+01:00</updated> <author> <name>Paul Buetow</name> - <email>hi@paul.cyou</email> + <email>hi@foo.zone</email> </author> <summary>Fype is an interpreted programming language created by me for learning and fun. The interpreter is written in C. It has been tested on FreeBSD and NetBSD and may also work on other Unix like operating systems such as Linux based ones. Besides learning and fun, there is no other use case of why Fype exists as many other programming languages are much faster and more powerful.</summary> <content type="xhtml"> @@ -8870,7 +8870,7 @@ BB <updated>2010-05-07T08:17:59+01:00</updated> <author> <name>Paul Buetow</name> - <email>hi@paul.cyou</email> + <email>hi@foo.zone</email> </author> <summary>In contrast to Haskell, Standard SML does not use lazy evaluation by default but an eager evaluation. </summary> <content type="xhtml"> |
