Keep a process running in linux with NOHUP

These days I have been doing some work on my Raspberry PI 3B+ with a Raspberry PI OS image, and have come across some situations in which I would like to continue having a command run even when I close the terminal window in which I started it. To do so I just need to use the NOHUP command at the start of the command line to do just that. However maybe there are just a few more things to write about on top of that when it comes to starting and killing processes in a Linux operating system environment.

When starting a command as an independent process there is not just using the nohup command and then that is it. There is also the question of what to do with any output that might be produced while the process is running? So often There might be a need to redirect that output of the process to a file, or pipe it to another command maybe. Also once a process is started there is also how to go about keeping and eye on it, and if need be stop it. So it looks like I will be touching base on at least a few other related topics in the process of covering how to go about keeping a command running in the background in Linux.

Read More

Swap File Size and Raspberry PI OS

This month I have set up a new image on an sd card for my raspberry PI 3B+ and aim to start to transition into seeing if I can use a raspberry PI to get work done over my old windows 10 computer that is causing me a great deal a grief. So the new image I am working with is a clean Raspberry PI OS desktop image without the recommended software, so far I think going with this kind of image is best when it comes to just getting going with raspberry PI OS, but there are always at least a few things that I like to adjust. One thing that I see that I would like to adjust is the swap file size, as I would say the default size of it is to small.

I was able to find a decent post on swap file size in rasbian that still seems to work okay for me if I just want to increase the size a little. However I thought I would write my own post on this anyway just for the sake of having my own content on this topic.

Read More

Kill Box Canvas Example

While wasting some time scrolling threw you tube I can across a video on how to make a kill box in a game called RimWorld. I have found the video, other videos like it, and the game itself interesting even though I have nit played it myself just yet. This has inspired me to start a canvas canvas example of my own where I will be playing around with many of the things that where talked about in the video, because I think making just a simple striped down game based around this might prove to be a little fun.

Read More

js array copy methods both new and old

So now and then, when working with arrays, a javaScript developer might find themselves in a situation in which they will want to copy and array. If you are new to javaScript you might have just simply assigned an array from one variable to another variable and assumed that that would do the tick, as that is the case with numbers and strings after all. However that will of course not work with arrays, and objects in general actually, because just simply assigning an object to another variable will just create a new reference to the same array or object in memory. This is because arrays, and other types of objects, are copied by reference rather than value compared to primitive types.

So to copy an array one of several tricks for doing so will need to be used to do so that will result in a while new array being created that will contain the same values. However talking about values, if the values themselves are nested objects then they do might needed to be coped also if a full copy of the state of the array is desired. So in this post I will be taking a look at a few ways to copy an array in javaScript with both old and new ways of doing so when it comes to what there is to work with in late javaScript specs.

Read More

The lodash _.untion method and Sets

Time for another one of my usual lodash posts this time I will touch base on the lodash union method. Just like many lodash methods there are ways of doing the same thing that the lodash union method does with vanilla javaScriot, so I will be taking a look at sets in native javaScript also.

The lodash union method is a way to create an array of unique values from one or more arrays of values. So say you have a whole bunch of arrays, but you justs want a single array of values that are not repeated then the lodash unique method can be done to do so. There are ways of doing the same with native javaScript by itself also, which is one reason why I will also be touching based on sets also when it comes to not using lodash.

Read More