I’ve been exercising a lot lately. As my issues with getting the meds I need have started to seem hopeless, I began using long walks to clear my mind. It helped. I lost 10 pounds and started being able to get about 60 solid minutes of work clocked per day, which is a huge step up from a few months of being able to handle about 30 minutes (elapsed) and not enough time to actually complete anything.
I started with hiking. First a mile at a time, then two, then extending beyond the point where at least one of my dogs could keep up1. The farther I walked, the more work I could do afterward. I have the good fortune of living within walking distance of an amazing trail system in the bluffs of Southeast Minnesota. I can walk out my door and be at a trailhead in 2 minutes. I’ve gotten to know about 8 miles of single track quite well, and have plenty more to explore.
Then I was talking to my friend Luc Beaudoin (creator of MySleepButton, one of the most effective sleep aids I’ve found), and he mentioned that the key is “vigorous” exercise. So I started incorporating short sprints into my hikes. Part of what I love about hiking is observing the forests and plains around me, and trail running absolutely requires keeping your eyes on the trail in front of you (or else ankle sprain), so I only ran for the “boring” sections of trails. A few minutes of sprinting combined with 30-60 minutes of walking was still enough to break me into a full sweat and maintain a high pulse rate, and it turned out he was right. Just walking isn’t enough to help with things like ADHD.
Then I started doing Yoga. I have a good friend who teaches a class at a local wellness center, so I decided to try it. It was good for me. I felt great afterward, and the class setting worked well for keeping me going. I decided to try out some other classes, and went to a Forrest Yoga class. It was an hour and fifteen minutes of soaking my yoga mat with sweat.
After the first Forrest class, I went to a friend’s poetry reading. I was sitting there when all of the sudden my brain started working. Thoughts, ideas, and plans all started flowing the way they used to. It lasted a couple of hours. I’ve been able to replicate it since then, but it takes about an hour of exercise to get two hours of work, so it’s not a perfect solution. I have, however, lost almost 20 pounds now and am feeling better physically than I have since I was 25 (which was 12 years ago).
Yoga wasn’t easy for me to get started with. I don’t like games I can’t win, and doing a flexibility-and-core-strength workout as a fat, out-of-shape guy was awkward. My instructors were very helpful and supportive, and my classmates were all—if not 100% encouraging—absolutely not judgmental. Having pretty girls around you is great encouragement to focus and try not to look like an idiot, and having better-looking guys around brings out some kind of primal competition in me that makes me push myself further than I would just working out on my own. It’s going well.
I’ve completed the ADHD testing that was asked of me by the psychologist I’ve parted ways with, and it confirms an ADHD Inattentive Type diagnosis (again). I don’t know yet if that will translate to me getting back on the meds I need, but it’s a good start, and these months of desperation have led to some lifestyle changes that I absolutely needed. It will all work out in the end. It always does…
Our German Shepherd can actually do 4+ miles fine with pep in his step, unless he gets SQUIRREL… and ends up running twice as far. Our middle-aged pit bull with synthetic knees, though, can only go about two miles before I have to carry her home.↩
Thanks to MailButler for sponsoring BrettTerpstra.com this week. See the end of the post for a 20% discount!
Have you ever wanted to schedule your email rather than send it right away? Or wished you knew if the recipient has actually opened your email?
If your answer is “yes,” then MailButler is the perfect solution.
This Apple Mail plugin allows you to schedule an email to be sent at a specific date and time. You can fulfill many tasks in advance by writing several emails at once and letting MailButler ensure their scheduled delivery.
Or another familiar situation: you sent an email several days ago, but still haven’t received a reply. What’s the best way to react in this case?
Email Tracking, MailButler’s newest feature, allows you to know if the recipient has actually opened your email. If you know that the first email has already been read, you can proceed with a follow-up. If it hasn’t, it’s better to wait a few days.
There are other cool features that MailButler adds to Apple Mail, such as the ability to convert emails to notes, upload attachments to the cloud regardless of size, and more. The developers are constantly adding new functionality to this list.
Updated:Dr. Drang pointed out that the original functions were mostly working but flawed. I’ve updated this whole post.
This is a simple bash function that will take each line of the input piped to it and truncate it at a given length (default 70 characters), optionally inserting an ellipsis or other string if the line is truncated.
Here’s the basic trick, using sed with an example line length of 60:
Here’s a more complete version of the function. It accepts a -l switch to truncate from the left instead of the right (default), and a -s STRING flag to allow the user to specify an ellipsis or other string to add to lines that have been truncated.
These functions can be added to any file that’s sourced during login, such as ~/.bash_profile. Then they can be used like:
Here’s a Bash function for searching all text files in the current directory for a pattern, then listing the files containing matches in ascending order by number of matches. It’s mostly a proof of concept, but a useful companion to a basic grep search.
The meat of the script happens in an array declaration. It first uses grep -lIi -E "$patt" * 2> /dev/null to list files containing the provided pattern (case insensitive), ignoring binary files. The error redirect at the end of the command will ignore the errors thrown by directories. The results of this are fed to another grep command: grep -Hi -c -E "$patt" which outputs the match count for each file. The results are saved to the array.
After including the function in a sourced file (e.g. ~/.bash_profile), running matches -h will show the available flags and switches:
$ matches -h
Find files in the current directory containing the most occurrences
of a pattern
-c Include occurrence counts in output
-r Reverse sort order (default ascending)
-m COUNT Minimum number of matches required
-h Display this help screen
# search for files containing at least 3 occurrences
# of the word "jekyll", display filenames with counts
$ matches -c -m 3 jekyll
Here’s the function for pasting into ~/.bash_profile (or other sourced file):
Thanks to HoudahSpot for sponsoring BrettTerpstra.com this week. Be sure to read to the end for a 30% discount!
HoudahSpot is a powerful file search tool for Mac. Think Spotlight on steroids. Use HoudahSpot to find documents, mail messages, photos, image files and more.
HoudahSpot helps you find files quickly using multiple criteria (such as name, text content, kind, author, recipient, date, image dimensions, etc.), and searches are easy to build with a few clicks. HoudahSpot shows your results in a convenient and easy-to-use interface that keeps all your important data within reach.
Combine search criteria to narrow down search results to the exact files you need
Search multiple locations at once, and exclude folders within selected locations
View search results as list or grid. Add columns
Create your perfect setup of search criteria, search locations, columns, sort order, and more. Set as default for future searches
Store frequently used criteria in snippets that you can drag into new searches
Use saved searches and templates for recurring searches
If you regularly search for files that match a variety of criteria, you really should have HoudahSpot. It takes all of the tedium out of search and lets you focus on finding what you need, when you need it.
HoudahGeo 5 is out, adding a bunch of powerful features to the OS X photo geotagging app. New features include Places (saved coordinates and location names), drag-and-drop geocoding, Google Earth/Maps/KML export, direct camera import, and map searching.
Udemy is offering a 30% discount on all of their courses for the duration of April. You can use the code TERPSTRA at checkout to apply the discount.
If you want to learn new skills and concepts on-demand, at your own pace and on an amazing array of devices, Udemy has both master and mini courses on everything from programming to photography. Take a look!
Thanks to PDFpen for sponsoring BrettTerpstra.com again this week!
PDFpen is the Swiss army knife for PDFs, and PDFpenPro is the knife with so many tools it can barely fit in your pocket. PDFpenPro has all the standard tools to add signatures, edit text and images, perform OCR on scanned documents, and export in Microsoft Word format. Only PDFpenPro can create an interactive PDF form, build a table of contents, set document permissions, and convert websites to multi-page PDFs.
PDFpenPro 7 adds easy editing of OCR text from scanned documents as well as export in Microsoft Excel, Microsoft PowerPoint, and PDF archive formats.