Search Shell History Using Arrow Keys

FreeBSD's root user can easily search its shell command history using the arrow keys. Add the same search capability in the Bash shell with this change.

By default, the FreeBSD root user can type part of a command and then search through history for previous commands beginning with those characters using the up/down arrow keys. If you're new to FreeBSD or csh, you might think the convenient shell history search is specific to root or csh/tcsh. Fortunately, it's not. You can get similar functionality in Bash by creating or editing ~/.inputrc to add the following lines:

# Allow history searching with the up/down arrows:
"\e[A": history-search-backward
"\e[B": history-search-forward

Chromebook for Power Users: Part 3

After installing Debian Linux in a chroot on my Chromebook, I slimmed LXDE down a bit before connecting to my FreeBSD desktop running xrdp.

This is the final post in a 3-part series on using a Chromebook as a power user. Part 1 gave a high-level overview of how I'm using my Chromebook and some basic Chrome OS configuration steps. Part 2 dug deeper to show advanced users how to use crouton to install Debian Linux in a chroot. This post finishes up by configuring LXDE and connecting to a remote FreeBSD desktop running xrdp.

Configuring LXDE on Debian

Chromebook for Power Users: Part 2

The RDP apps on Chrome OS left me wondering if my Chromebook would be useless. Then I found crouton and installed Debian Linux in a chroot to expand my options.

This is the 2nd post in a 3-part series on using a Chromebook as a power user. Part 1 gave a high-level overview of how I'm using my Chromebook and some basic Chrome OS configuration steps. This post digs deeper to show advanced users how to use crouton to install Debian Linux in a chroot. Part 3 finishes up by configuring LXDE and connecting to a remote FreeBSD desktop running xrdp.

As discussed in Chromebook for Power Users: Part 1, the primary use for my Chromebook is to act as a dumb terminal to remote my FreeBSD desktop. I run xrdp on the desktop, which allows me to securely connect to an X session using a standard RDP client. That's why I was disappointed to find that none of the popular RDP clients for Chrome OS were able to connect to xrdp. In an effort to settle for less, I enabled a VNC server and tried connecting. While VNC "worked," the experience was unacceptable due to keyboard issues related to uppercase/lowercase letters and the shift key. That was a deal breaker for me: if I couldn't remote my desktop with it, a Chromebook would be almost useless—just an oversized tablet weighed down by an attached keyboard. Luckily, crouton came to the rescue by enabling me to install Debian Linux in a chroot on the Chromebook.

Chromebook for Power Users: Part 1

As a 'power user' who wanted to replace my laptop with something inexpensive and low maintenance, I gave a Chromebook an honest try. Was it up to the challenge?

This is the first post in a 3-part series on using a Chromebook as a power user. It gives a high-level overview of how I'm using my Chromebook and some basic Chrome OS configuration steps. Part 2 digs deeper to show advanced users how to use crouton to install Debian Linux in a chroot. Part 3 finishes up by configuring LXDE and connecting to a remote FreeBSD desktop running xrdp.

We all wear many hats. In my role as Household Systems Administrator, I manage more devices than I'd like. The desktop, my work laptop, and the youngster's college laptop (devices with important data on them) are actively managed: they get security updates for the OS and apps within days of release plus regularly scheduled backups. We also have a Windows VM that's actively managed, but it can skip backups since it's on the desktop. In addition, I manage the server that hosts this site and provide "IT support" for all devices within our home. Sometimes it feels like a second job, which is why I look for ways to minimize the workload while still meeting everyone's needs. All the important data is on the desktop, it's set up the way I like, and it's already actively managed, so adding another laptop to the mix seems like something to be avoided. Yet I live in the real world where computer activities happen throughout the house and may require more than a tablet to perform.

Life is Short by Paul Graham

Paul Graham's recent essay, Life is Short, discusses making the most of our short lives by focusing on the things that really matter.

With our youngster almost ready to leave the nest, I try to remind friends (and myself) to be conscious of how brief their kids' childhoods will be. Paul Graham puts it into perspective in his essay, Life is Short:

Having kids showed me how to convert a continuous quantity, time, into discrete quantities. You only get 52 weekends with your 2 year old. If Christmas-as-magic lasts from say ages 3 to 10, you only get to watch your child experience it 8 times. And while it's impossible to say what is a lot or a little of a continuous quantity like time, 8 is not a lot of something. If you had a handful of 8 peanuts, or a shelf of 8 books to choose from, the quantity would definitely seem limited, no matter what your lifespan was.

Year in Review: 2015

I started 2015 on a great streak, but it didn't hold up all year. Here are the habits I need to pick up again and a few other targets for 2016.

It's that time of year again when most of us take a moment to reflect on what we've achieved in the last year and set some new (or old as the case may be) goals for the new year. I had a great 2014 as far as habit building, but 2015 lost traction and slipped a lot. It'll take a ton of effort to get my momentum back in 2016, but I know I have it in me since I've done it before.

Regular exercise isn't something I felt I needed as a young person, but I've been trying to develop the habit as I approach middle age. My goal for 2015 was to exercise at least a little every day just to maintain a habit of doing so, because it takes less willpower to exercise more if you're already doing it. I did very well for the first 7 1/2 months with only 1 day missed. Then I went out of town for a week, didn't exercise at all, and became Lazy Me again. I could count on one hand the number of times I exercised in the last 4 1/2 months of the year, and I can feel the impact it's had on my body. Maybe this is what "almost 40" should feel like, but I'm making it a priority to develop the exercise habit in 2016.

Command Line Plugin Added to Prism

After making several changes proposed by another contributor, my Command Line plugin is now part of the Prism project.

Back in February, I wrote about how to style shell commands using CSS. I wanted to submit that code to the Prism project, but I got distracted by other things. By the time I finally got around to submitting it, there were changes to the main project that affected the plugin code. I updated the plugin to incorporate their changes and submitted my first GitHub pull request at the end of November.

Another Prism contributor, zeitgeist87 (Andreas Rohner), was quick to provide useful feedback and offered some great suggestions for expanding the plugin's functionality. Andreas' suggestions resulted in a more flexible plugin that works for any type of command prompt as opposed to only shell/terminal sessions. Besides project-specific details I wasn't aware of, he also helped me with some general best practices for GitHub collaboration that I'm grateful for. People's willingness to help others is part of what's most impressive about the open source community.

Core Web Application for PHP Released

The Core Web Application Libraries provide a logger, database layer, and MVC framework for PHP. The code is available on GitHub along with 2 example projects.

When I built this site, I chose to start from scratch for several reasons. I could've thrown something together using any one of the open source content management systems, but I've been down that road before. Once you customize a popular CMS, it becomes an outright burden to keep up with security fixes and other updates. It's convenient to have so many features and plugins at your disposal, but having thousands of lines of unused/inapplicable code with frequent vulnerability fixes can leave you with an uneasy feeling about what's creeping into each release. Once you have multiple sites in that state, maintaining them starts to feel cumbersome or, worse, like a second job. Additionally, I wanted the freedom to use the code in any project I work on whether I retain ownership of the finished product or not.

That's why I created the Core Web Application Libraries and released the code under the Apache License Version 2.0. They're a lightweight and flexible base for building small to medium-sized websites using PHP. I didn't want to build yet another "kitchen sink" solution that tries to appeal to all developers everywhere. My aim is to keep it lightweight so developers can become intimate with the code while providing enough flexibility that they can extend it to do whatever they want. Security is a primary focus and keeping the code lean makes it easier for anyone to audit at any time. It can't address all possibilities, of course, but my intention is to provide a secure foundation "out of the box" so that any additional measures the developer takes are icing on the cake.

New Domain

This site has moved to a new domain, chriswells.io. Expect more frequent updates now that the move is complete.

It's been several months since I posted, so the site might have seemed dead already. We had a couple of hectic releases at work, which took time away from this site (and everything else). Also, I wasn't quite satisfied with the original domain name. It was a bit awkward to type and I knew I'd have to type it often. Since I wasn't sure if I would change domains or not, I didn't want to create too much content before deciding.

There's been a lot going on behind the scenes, though. I've done tons of refactoring and general code clean-up in what little time I had available. I also added several features to make site maintenance easier for myself. Finally, I built a fresh server to host the new domain and parked the old domain on top of it with redirects in place. Over the next couple of months, I intend to resume regular posting and release some source code. I'm looking forward to ramping up again.

Blank Results in MySQL Workbench on FreeBSD

An incompatibility with glib 2.42 causes MySQL Workbench to display a blank results grid. Here's how to patch the source code and recompile the port on FreeBSD.

There's one area where I simply don't like using the command line and that's SQL queries. When I'm working with a database, I appreciate having a decent GUI. That's why I was frustrated when I launched MySQL Workbench and found that the output was blank with no results being displayed for any query. The table editor also showed no data—no column names, indexes, nothing.

Blank select results

Empty results grid and blank output.