A couple of days ago I noticed that my samba server running under Linux was listening on all interfaces, including the wireless interface for the public network that I share where I am, which is something I don’t want. Why? Because this server contains file shares for a large amount of my data. This is not stuff I want publicly accessible.
Actually, the shares can only be accessed if a remote user authenticates against samba, which would require their credentials having been added to the samba password database with the command smbpasswd, therefore even though the server was visible, it was not actually accessible. For security purposes however, it is better to simply not even have the server listening via the wireless interface, since I only need to access it locally through an Ethernet connection here.
Once I told samba to only listen to the Ethernet interface I noticed however that there was a large number of log files that it created since, for every host that tries to access the server, it creates a unique log file for that host in /var/log/samba. Having sat exposed on the public network here meant that every machine that automatically browsed the network for available shares had tried to communicate with my samba server (I don’t think any of the connections were malicious attempts to access my data). These log files for all these hosts did not get automatically cleaned up by logrotate. I was actually looking through these logs to check on some issues I was having, and it was annoying having all these old, pretty much irrelevant log files laying around since they only contained irrelevant info about failed connection attempts.
In order to get rid of all these useless log files laying around I broke out one of the most useful command-line utilities ever made: the venerable GNU find command which is part of the findutils suite of tools. find can usually do in one terse line what would normally take several commands patched together to do, if not more. It has the ability to recurse through a directory and look for patterns and then perform actions on whatever matches that pattern. This is one of those things in Information Technology which, no matter how advanced things seem to get, no matter how many great things get developed and fancy applications, it will always be useful to have because ultimately information gets stored in recursive directories which have attributes, the contents of which need to be processed in one way or another. It simply does not get more essential than this*.
To perform my task, I simply had to run:
find . -type f ! -mtime -2 -print0 | xargs -0 rm -f
To translate this command into the English language, I simply told it to find everything in the current directory and lower (find .) that is a file (-type f) (this was a safety precaution, because it could have been possible that there were also directories under this one which met the criteria, and I did not want these deleted, only files. As it turns out there were actually no directories.)
The next part is part of what is really cool about find, why I love it. You can craft these cool expressions to match exactly what you want. In this case, I wanted to match all files that had not been modified within the last three days. Anything that samba had not needed to log within the past three days was probably irrelevant to me. Here is the expression that did it: ! -mtime -2 Its so simple that its elegant! In Unix filesystems mtime means modification time, which is the most recent time that a file was changed in some way. Any time a log file is created or written to its mtime is naturally updated. For what its worth, there are also ctime which is creation time, and atime which is accessed time. mtime is usually the most important one for administrative purposes.
To explain this expression, the value after mtime is a number n which is a multiple of 24 hours. Therefore -mtime 0 means anything modified within the last 24 hours. -mtime 1 means anything modified between 24 and 48 hours ago, -mtime 2 anything modifed between 48 and 72 hours ago, and so on. Note that -mtime 2 does not mean anything within the last 72 hours, only within the 24 hour time period of n*24! The expression syntax is very strict about this! Since I wanted everything from now until 72 hours ago (n = 2), I put a – sign in front of n, therefore -2, which means everything from -2 and less. If I had put +2 instead that would have meant everything from 72 hours ago and later.
But wait a minute. Now I have -mtime -2 to indicate everything that has been modified within the previous 72 hours. But I actually want to delete everything that is NOT that. Easy, just put a ! in front of the expression: ! -mtime -2 Now I have matched everything that has not been modified within the past 72 hours.
To get an idea of how useful this is, imagine if you had to perform this same task with Windows Explorer, and the directory contained hundreds of files, some of which matched, some of which didn’t. Yes, you could manually go through and select all the candidates you want to delete, hopefully not making any mistakes, but it would be a tedious, arduous process at best. Now imagine you have to do this on 5 different machines! With the eminent find command we have reduced a potentially very arduous task that would be error prone and tedious to something very simple and fast.
The remainder of the command relates to the actual processing the files that match and deleting them: –print0 | xargs -0 rm -f The print0 | xargs -0 basically get the output of find – all the files that matched ! -mtime -2 and prepares them for the action we want to perform in them, in this case deletion, which is accomplished with rm -f at the end. Note that instead of deleting them with rm -f we could have performed any number of other actions, such as renaming them, moving them to a different location, etc.
Why print0 | xargs -0 is required is a little esoteric and not necessary for purposes of discussion now so I will let the reader find out more about this by consulting the excellent manual page for find (type man find) in a console window.
The GNU find command is so useful that I think it would be a good idea for every child to learn it in gradeschool because we are always going to have to process information and knowing how to do so efficiently is a skill that will always be valuable.
* This is also interesting from a philosophical viewpoint. The fact that the archival and access of data electronically involves the maintaining and management of certain attributes with respect to that data almost reminds me of certain a priori types of knowledge which exist – for example in mathematics the fact that the sum of the internal angles of a triangle always equals 180 degrees. There seem to be certain a priori aspects of information technology: no matter how certain problems are addressed or reduced, there always seems to be certain aspects associated with them which ultimately must be accounted for in order to facilitate the actual process of things like archival and access of data.
I have discovered this program called Atmosphere Deluxe that is so incredibly awesome I really want to tell everyone about it. While there may be ambient sound and relaxing sound effects CDs, this program takes the concept of ambiance to a completely new level. Unlike the CDs where you basically get whatever is on the CD, with this program you can basically create and shape any ambient sound environment you want.
For example, if you like listening to water (as I typically do), you don’t get just one river track that you can hear. No. What you get are Fountain, Stream, and River all of which you can enable, disable, or blend to whatever degree you want together to get what to you is the most perfect ambiance of running water.
But this is just the beginning of this little mind-blowing program. Would you like to add some Campfire to the mix? No problem. How about tempering Campfire with a little amount of randomized Crackling Fire? Sure. You can set the random factor of the background sounds.
Would you like some birds? We’ve got Barn Owls, Tawny Owls, Long-eared Owls, Doves, different types of Gulls, Loons, Finches, Starlings, Larks, etc. etc. How about rain? Well you can choose any combination of Hail on Tin Roof, Rain on Car Roof, Light Rain, Heavy Rain, Rain on Leaves, and Rain on Pavement. You get the idea. This program is amazing!
Now to add to all this the latest version also incorporates this new feature called Brainwaves which basically is a sound frequency and beat frequency which can be static or change dynamically over time to induce various types of brainwave patterns. There are many presets that can be selected depending upon the current mood you are in and the desired end-state mood. My favorite is called Sleep Induction from Relaxed which basically gradually lowers a pitch and beat frequency over a period of 15 minutes. I’ve tried it and I think it actually does help. The base pitch where it ends can then play continuously (or simply be set to stop) and I find it to be very relaxing to just keep it on all the time. You can also customize and tweak all of the settings to your heart’s content.
Given how awesome this program is, it doesn’t seem to have received the attention that it should. I consider this application to be among the upper-echelon of truly killer computer applications.
90% of the omega-3 fatty acid in the human brain is docosahexaenoic acid (DHA). It is essential (similar to all vitamins), because the human body cannot produce it itself. More and more research is being done which reveals how vital this compound is for humans. For example, it is known that during pregnancy a disproportionate amount of DHA will travel from the mother across the placenta to the developing baby, indicating its vital role in the development of the fetus.
It is now believed that the evolution of the early human brain, differentiating it from that of its primate relatives at a very fast pace, was due to abundance of seafood in the diet. I.e., early humans were not wandering around the savanna with spears killing rhinos. They were living by the water eating seafood. It is highly unusual for an organism to lack the capacity to manufacture a vital nutrient necessary for its survival on its own unless there exists an abundance of it in its diet.
Sciencedaily.com has an article about a new study published in Behavioral Neuroscience about the importance of DHA in human nervous system function, “New Study Links DHA Type of Omega-3 to Better Nervous-System Function“.
Today while reading about the current moderate El Niño condition that is occurring, which is part of the larger Pacific Decadal Oscillation, I came across the site of the NOAA Climate Prediction Center, which includes this map which is a three month precipitation forecast for December, January, and February 2009-2010. The green areas indicate regions where precipitation is expected to be higher than normal, the brown ones less.
Just read this article at the BBC discussing how a very high percentage of pedigree dogs suffer from serious issues due to genetic inbreeding and breeding selection based solely upon the owners’ interest in the animals’ superficial characteristics. Its truly gruesome.
While it is said that man’s best friend is the dog, it seems that the opposite is quite untrue for many of these poor animals.
I remember the first time that I stepped into the Arcade in downtown Cleveland when I was young. Going to downtown was such a thrilling experience for me at that young age – it was like there was this fascinating, exciting world of marvels awaiting me. I remember a certain grittiness to it combined with a grandeur – an old, dusty grandeur that was so magnificent it managed to shine through. I remember the illumination of the building through the wondrous glass ceiling, and the bustle and energy inside the building.
When I first saw the animation film Metropolis it evoked memories in me of the Arcade. In fact my whole impression of most of the steampunk genre animation I have seen was heavily influenced by not just the Arcade but much of the old part of downtown Cleveland and its dusty, gritty, majesty. The Arcade was where I saw my first hookah shop – an Indian store which had hookahs, bells, incense, and all sorts of exotic things which were new to me. I still remember the perfumy, exotic scent as though I had entered some other, mystical world.
I always wondered what happened to that majestic building, if it was still standing, and decided to do some searching. Yaay! Its still there. In recent photos it looks a lot cleaner (a lot!) than when I remember it. I hope that hookah shop is still there…
It turns out that this building is rare indeed and is on the U.S. National Register of Historic Places and listed as a U.S. National Historic Landmark.
This also brings back memories of the time when I was young and I used to go to see the Cleveland Orchestra in the grand Severance Hall nearly every week without fail. I used to be captivated watching the players of the orchestra as they performed the various great symphonic works. Their faces often showed a deep solemnity as though they were ministers in some sacred rite or, when the music was joyous, you could feel the exuberance coming through them.
The world to me at this time, growing up near Cleveland, was so mystical, serene, and vast. It was around this time that I also started practicing meditation, became a vegetarian, and started long-distance running. Balanced against my adventures through downtown were hours spent wandering through Metroparks or going on long, solitary runs along semi-rural roads near the outskirts of the metropolitan area where we lived.
Even though I know its not possible to go back in time, and even though I have the fondest memories of that time and will always cherish it deeply, I also embrace fully the present moment, filled with dissonances though it may seem. I believe that all that grandeur and glory that I felt at that time can still manifest within the hearts of those of us who are willing to let it happen. I believe that we can create a new world that is even more glorious and the music that will come from our hearts in unity and love will be more splendid than the grandest of symphonies.
There will always be beautiful architecture and wonderful music, yet the glorious forms and vibrations that emanate from our souls are eternal.
I am reminded of a saying an artist friend of mine from Germany a long time ago told me: “Lass dich von den kleinen, tanzenden Sternen befunkeln sein. Und wann sie dich begeistet haben, sei einer von ihnen.” Let yourself be amazed by the tiny, dancing stars. And when they have inspired you, become one of them.
Perhaps I will never write a beautiful symphony or architect some grand structure, yet I believe that I can still repay my deep gratitude for the inspiration that has been given me by manifesting brilliance and splendour within my soul.
Configuring a wireless network interface under Linux used to be something that was sufficiently unpleasant to drive new users away. In Linux there are often multiple ways to do something. Many times this is a good thing – when you are a Systems Administrator you want to have as many tools and possibilities at your disposal to do things.
Yet for some things, I argue that it is not an improvement. It can also be a sign of a lack of a comprehensive, elegant, well-planned solution.
As Linux becomes more and more developed, more utilities are developed to make it more user-friendly. However, I would also argue that progress in user-friendliness can be problematic when the new tools or utilities are developed and become integrated more deeply into systems which do not address the fundamental objectives in a comprehensive fashion, thereby adding unnecessary complexity.
One of the strong points of Linux has to me at least always been the fact that you could easily administer and configure the system from the command line. Contrary to what administrators without much experience might think, command-line administration of systems is in fact more straightforward and less complex than via graphical interfaces or complex systems which are often designed to make it “easier”.
When Network Manager first appeared it was very welcome as a means to make the configuration of network interfaces, especially wireless ones, easier. Yet behind the scenes of this tool lies an ugly mess.
The primary method for configuring wireless network interfaces relies upon a set of wireless tools created by a developer named Jean Tourrilhes. These include the command-line tool iwconfig
In order to use cnetworkmanager, you still have to kill any running instance of nm-applet. This seems ridiculous to me.
To actually use it, you run a command like:
cnetworkmanager --unprotected -C access_point
cnetworkmanager -C access_point --wpa-pass=password
Apparently this was a big deal to create. No one has figured out how to generate 3D Mandelbrot fractal images until now. These images are simply amazing!