Saturday, August 1, 2020

Setting Up a Raspberry Pi 3 as a Home Network Monitor

I repurposed my Raspberry Pi 3 to monitor our home network. In the picture, it's the small black box underneath the white cable modem and to the right of the cable amplifier. I followed the steps outlined in the article "How to use Raspberry Pi to monitor network? (Nagios)" by Patrick Fromaget, at his website RaspberryTips. I ran into a couple of head-scratchers when I installed Pi OS Lite. Out of the box, the OS was configured for British keyboards, and it was a little tricky choosing the right options for my cheap wireless keyboard/trackpad. The other roadblock was that wi-fi was disabled. To enable it, I had to unblock it:

rfkill unblock wlan
shutdown -r now


I'd had some experience with Nagios, so I had no problems building and installing it from source, following Fromaget's instructions. I customized Nagios to monitor the temperature of the monitoring Pi. First, I added a /usr/local/nagios/libexec/check_cputemp executable. It's a shell script:

#!/bin/bash

cpu_lo_warn=-30
cpu_lo_crit=-40
cpu_up_warn=75
cpu_up_crit=85
cpu_temp=$(</sys/class/thermal/thermal_zone0/temp)
cpu_temp=$((cpu_temp/1000))

if [ -z $cpu_temp ]; then
  echo "UNKNOWN - Undefined CPU temperature"
  exit 3
fi
if [ $cpu_lo_crit -gt $cpu_temp ]; then
  echo "CRITICAL - CPU temperature $cpu_temp too cold"
  exit 2
fi
if [ $cpu_lo_warn -gt $cpu_temp ]; then
  echo "WARNING - Low CPU temperature $cpu_temp"
  exit 1
fi
if [ $cpu_temp -gt $cpu_up_crit ]; then
  echo "CRITICAL - CPU temperature $cpu_temp too hot"
  exit 2
fi
if [ $cpu_temp -gt $cpu_up_warn ]; then
  echo "WARNING - High CPU temperature $cpu_temp"
  exit 1
fi
echo "OK - CPU temperature $cpu_temp"
exit 0

Next, I added a check_local_cputemp command, by adding these lines to /usr/local/nagios/etc/objects/commands.cfg:

define command {

    command_name    check_local_cputemp
    command_line    $USER1$/check_cputemp
}


Then I added a CPU Temperature service to localhost, by adding these lines to /usr/local/nagios/etc/objects/localhost.cfg:

define service {

    use                     local-service
    host_name               localhost
    service_description     CPU Temperature
    check_command           check_local_cputemp
}


Then I restarted Nagios. Now, the services page has a CPU Temperature service for localhost.

I also wanted to monitor new equipment that might pop up on our home network, so I installed the  arpwatch and Postfix packages. I administered  a sendmail server for quite a few years, but that would be overkill for a network monitor. For information about installing and configuring Postfix to send outgoing mail, see Tutorial - Install Postfix to allow outgoing email on Raspberry Pi, at the Ste Wright website. Basically, I did a sudo apt-get install postfix and specified the Internet site and default hostname.

I installed arpwatch with sudo apt-get install arpwatch. Then I configured arpwatch to email me whenever anything new happened on the network, by creating the file /etc/arpwatch/wlan0.iface with the single line IFACE_ARGS="-m my@email.address" (where "my@email.address" is a valid email address to receive arpwatch messages). Then I issued the commands:

sudo systemctl enable arpwatch@wlan0
sudo systemctl start arpwatch@wlan0


For more information about configuring arpwatch, see How to monitor Ethernet Activity using Arpwatch tool, at LinuxHelp.

Once I had the Pi configured, I shut it down and mounted it, headless, on my crude network equipment board. It was easy, the classic Raspberry Pi case has two holes in the base for mounting. I plugged the power supply in, and it works!

Tuesday, June 23, 2020

Greeting My Experience



Why do people give up on meditation? "I can't make my thoughts go away." "It's boring." "Nothing happens." "I get fidgety." These are all variations on the same theme: "When I meditate, I don't have the kind of experience I think I should have." All these reasons not to meditate miss the point of meditation. I don't meditate to have a certain kind of experience; I meditate to be more fully present with whatever experience happens while I meditate.

When I meditate, I try to have an open curiosity about whatever comes up. I don't foster an analytical curiosity, a type of curiosity that tries to identify and understand. Instead, I try to develop more of an artistic appreciation of whatever is happening, a curiosity about what this experience actually is. I don't try to resist or push away anything that arises. Instead, I try to greet everything, to welcome anything that comes up. This doesn't mean I try to like everything I experience while I sit. It's a little like wandering through a museum, or listening to a concert, or watching a movie. I may not like everything I'm seeing or hearing or feeling, but I try to appreciate everything as it is.

So, for example, if I'm having thoughts, I just recognize that I'm thinking, and I let it go. I may have the thought, "I'm thinking--I shouldn't be thinking!" Okay, I realize I had that thought, and I let it go. If I feel I've failed because I'm having thoughts, I say to myself, fine, I'm feeling failure--and then I let it go. The same applies to boredom--okay, I'm bored. No big deal, let it go, on to the next moment. If my entire meditation consists of me releasing thoughts or recognizing I'm bored, then that's what that meditation experience was. The point is to accept the truth of each moment, as it is, without resistance.

Over time, this ability to appreciate each moment begins to affect daily life. As I become less likely to react dramatically, I become better able to pause and consider what has happened, and then, I hope, to act more wisely. I become less caught up in regrets about the past and worries about the future; I become more involved with what is happening here and now.

This is the essence of meditative practice. It's not another means of controlling what is happening, it's not one more expectation to meet, it's not one more challenge that leads to either success or failure. It is simply allowing yourself to greet the present moment, whatever it is. Everything else that you might want to get from a meditation practice flows from this.

Sunday, June 7, 2020

Whole Lotta Nothing



What do you need to meditate? Not much! All you really need is a little time. You can meditate almost anywhere, anytime your attention isn't being demanded. As long as you are conscious, you can meditate.

While you can meditate anywhere, it's best to have a dedicated quiet spot where you aren't going to be disturbed, especially if you're new to meditation. You should have a comfortable place to sit in a position that doesn't foster drowsiness. You can use a cushion, or a chair--you don't have to contort yourself into a pretzel. (If you want to practice walking meditation, you don't even need a place to sit!) Reclining or lying down can invite sleepiness, but if you have some kind of bodily limitation that makes it difficult to sit for long periods, then lying down is a good option.

You probably will want a timer. During meditation, your sense of time can be tricky, so especially when you're beginning a practice, it's good to time your meditation. But you can meditate without a timer--just meditate for as long as feels right. While you can spend a goodly amount on a dedicated meditation timer, it's certainly not necessary. A timer doesn't need to be anything fancy--free timer apps are available on smart phones, or you could use a kitchen timer. You can also use a clock or watch, and peek at the time when you think your meditation period is over.

Some people like to have a meditation altar. If you meditate within a religious or spiritual tradition, an altar might be a nice idea. An altar can reinforce the sense that the place you meditate is dedicated to your practice. But you don't have to have an altar to meditate. Likewise, objects like crystals, statues, pictures, incense, flags and banners might help make your meditation space feel like a special place devoted to practice. But you don't have to have any of those things to meditate, either.

You can pay an instructor and take meditation lessons. Investing a little of your money in your practice might be a good thing--it tells your subconscious that you're serious. It might make it more likely you'll maintain a practice over a long period of time. But it's not necessary. A teacher might grant you some kind of mantra (a phrase to repeat) or some kind of spiritual empowerment. Regardless of whether such things actually have any power, the sense of specialness might energize you. And being part of a student community, a community of practitioners, can only help your practice. But you can meditate without a teacher, without a special mantra, and even without a supportive community.

So if you're curious about meditation, if you have any interest at all, there is nothing stopping you from giving it a try. The only obstacles to meditation lie inside.

Wednesday, April 15, 2020

Meditation and Compassion


A meditation practice can be brutal. Meditation is all about being present with whatever arises. And since I've never been a saint, a perfected being right from birth, some of what arises during meditation is not pleasant. Unhappy memories, feelings of embarrassment and shame, anxieties about the future, anger, frustration--all these boil up at one time or another, along with the more mundane distractions, the shopping lists, the todo lists.

But it's not just while I'm on the cushion. Meditation has given me a small space between provocative stimuli and my habitual reactions, a gap that gives me a chance to catch myself before I react destructively. But that space also can be a harsh spotlight that shines on the uglier sides of my personality, the parts of me that want to lash out in self-righteous anger or that want to numb out with mindless entertainment or a drink or two.

Meditation provides me with a mirror, both while meditating and while going about daily life. I don't know very many people who look in a mirror and like everything they see. By itself, a meditation practice can become a harsh, tyrannical court of self-condemnation. That's why practices to develop compassion are a necessary complement to meditation practice.

In my experience, compassion means shadow work. All the parts of me that I don't own, that I project outward onto others--that's shadow. Shadow contains all those unpleasant bits of self that cause embarrassment, shame, guilt, everything I don't like. Shadow also contains treasures, hidden talents, secret passions. There are many ways to work with shadow--Jungian depth psychology, dreamwork, shamanic practice, and many types of Buddhist practice, for a few. All center around reintroducing the self to the parts that have been pushed aside.

Shadow work is self-expanding, heart-opening, empathy-developing. It's the essence of compassion. It allows me to sit with myself as I am, to embrace whatever arises, on the cushion or off. Open-hearted mindfulness, compassionate presence--this is the center of my practice. And "practice" is definitely the right word; I haven't mastered this yet, and may not ever. But sometimes, in the gap between stimulus and reaction, when I can stand there and be compassionately present, wisdom can miraculously appear. And that's when the wonderful, mysterious, healing magic happens, the magic of responding with wisdom, rather than reacting mindlessly.

That's what it's all about.


Sunday, April 5, 2020

Meditation 101

I'm offering my services as a meditation mentor, so I thought I'd begin posting a few pieces about meditation. So for this inaugural meditation article, I'd like to begin with what I feel is the most essential item you need to begin a meditation practice--commitment.

You have many reasons to begin meditating. You might be seeking relief from pain, or a lower risk of heart disease, or mitigation of the effects of stress. Medical research has shown that meditation can have many benefits for your health and well-being. Or, you might be trying to improve your golf game--many top athletes and coaches practice meditation. Or you might want to achieve enlightenment, or develop the special powers mentioned in the Yoga Sutras. But your initial motivation can change or even disappear with time. Your medical condition might resolve, you may lose interest in golf, you might lose interest in your spiritual or esoteric path.

Difficult circumstances can challenge a meditation practice. It's easy to meditate when there's plenty of money, no danger of losing your apartment or home, no chance you'll miss a meal. When you have plenty of leisure time, it's not hard to spend a few minutes each day meditating. But circumstances change, you may lose your job, or you may get a new more demanding job, or you may start a family. Time may become more precious.

But there is one thing that will guide your meditation practice through the perils of shifting motivation or challenging times, and that is commitment. Commitment to a meditation practice--internal commitment, not commitment to someone else or some group--this is what will keep your practice alive.

How can a person have commitment? By realizing that a meditation practice is worthwhile in and of itself. This only happens via meditation--more meditation can develop more commitment. It cannot be put into words easily. It's an inner knowing that builds up slowly as you experience meditation over time.

An enduring, resilient meditation practice stems from meditation practice. Whatever gets you on the cushion or the chair seat at first, whatever put the idea of developing a meditation practice in your head--that will take you only so far, like the push a parent gives a child when they start learning how to ride a bike. You have to start pedaling yourself. That's when commitment will grow and your meditation practice will really start rolling.

Tuesday, April 30, 2019

Befriending My Demon


Some time after my parents passed away, my family gathered at my parents' home, our childhood home, to divvy up their belongings. When we were finished with the more obvious items, we combed the house for anything else one of us might want. Searching a drawer in the basement, I came across the little guy in the picture. We were all surprised; no one remembered seeing him while we were growing up. Later, a little online searching would reveal that this bronze figure is a devil or satyr fireplace damper pull--it would dangle over the fire on a chain from the damper and glow red as it heated. But at the moment we saw him, no one had any idea what he was.

When I was little, the basement was a spooky place, especially in the dark--I couldn't run up the stairs fast enough. Sometimes I'd have nightmares about little demonic beings coming up from the basement. As I grew, my dream demons were replaced by an invisible, disembodied but menacing evil presence. When I married and started a family, I no longer felt personally endangered by the demonic presence, but I'd have nightmares in which it threatened my wife and children.

I had my first lucid dream when I was about 14, and from then on, I had spontaneous lucid dreams once or twice a month. I enjoyed becoming aware in my dreams. Lucid dreams were always vivid, feeling almost more real than waking life, and sometimes, I had amazing experiences. When I was in my 50s, one night I dreamed I was in an brightly lit white attic. Suddenly, I felt the invisible evil presence gather at the opposite end of the room. This time, the presence triggered lucidity. Realizing this was a dream and nothing bad could happen to me, I decided to accept whatever would happen.

As I stood there, the presence coalesced into the form of a teenage boy, someone I'd known, a pariah, not one of the cool kids. I remained present with my sense of dread, and I consciously relaxed. He walked across the room, stood in front of me, and reached out and hugged me. As he dissolved into me, the sense of evil dissipated, and I felt almost overwhelming compassion and acceptance.

As time passed, I could tell that the dream had changed my relationship with the demonic presence. I still would dream of it occasionally, but now, it felt lonely, eager to be accepted, as if it were a puppy. I wasn't afraid of it anymore, but instead, I felt affection for it. I sensed that it had been trying to protect me, probably from very intense subconscious material. In another dream, I went down to the basement again and felt the presence. But the dark, frightening basement of my boyhood had changed into a walk-out basement, with windows and a door to the outside, filled with light. The wall opposite the exterior was lined with filing cabinet drawers. I opened one, and I knew that all the material in every cabinet was now available to me.

So, years later, when I opened the drawer in my parents' basement and came across the damper devil, I felt an immediate sense of recognition. I asked if anyone else wanted him, and when no one spoke up, he was mine. Back home, I cleaned him up a bit and placed him on the bottom shelf of my meditation altar. I feel a deep, compassionate connection with him. He's a tangible reminder of the path we're all on, the journey to recover the parts of ourselves that we've lost.




Friday, September 29, 2017

Remarks on an Unremarkable Brain

I had an MRI last week, to diagnose a partial hearing loss, nothing horrible, especially at this stage of my life. My ENT gave me a copy of the report, and I'm drawn to this sentence: "The enhanced and unenhanced MR appearance of the brain is unremarkable."

I know that were Mom still alive, she would disagree. Mom was all about the brain, and she was sure that each of her sons had a remarkable cerebrum. She raised us to be smart. I don't know how many timed math and spelling tests she gave me after school, right in the door, before homework or play time or anything else. Mom even wrote and self-published a book about how to raise scholars, Hey, Grandmaa source of much embarrassment. I was a National Merit Scholarship semifinalist--I always tested well. But a scholar, no.

Mom would be chagrined to learn that the family ear trouble has touched me. Mom's side of the family had a history of ear problems, some of which have trickled down to my sibs and me. Mom had Meniere's disease, and besides nearly total hearing loss, she suffered from balance problems and vertigo. Tough Nordic farm girl that she was, she insisted on her independence, pulling her arm away from an offered hand and weaving her way over uneven sidewalks like a drunken sailor.

While I am relieved that the MRI report tells me that "Ventricles are appropriate size" and "The orbits, sella, and vascular structures appear within normal limits," I still come back to "appearance of the brain is unremarkable." Mom would take umbrage. Sorry, Mom.