Yearly Archives

5 Articles

Tech

Setting Up Multiple Project Areas with Taskwarrior

Posted by Steve Dondley on

Preface

Taskwarrior (TW) is an open source task management platform built for those who prefer to work on the command line. Like most command line tools with any sophistication, it has a learning curve that, at first, requires a fairly significant investment of time in order take advantage of its best features. But like any serious tool, once mastered, your time invested will pay off in spades with much increased efficiency and much less agony dealing with a GUI that slows you down and makes you want to scratch your eyeballs out.

The Problem

Out of the box, Taskwarrior dumps all of your projects into one list. Yes, there are ways you can filter these lists. But there are cases where you may want to have a separate project area dedicated to certain types of projects. For example, you may have one task list that you share with others and another that you’d prefer to keep private.

The Solution: Multiple .taskrc Files and .task Directories

As outlined in man taskd, TW provides a mechanism for overriding which .taskrc file is used. By default, TW uses ~/.taskrc. This is the file, like other “rc” files, that you can use to change the behavior of your application. So modifying the configuration settings in ~/.taskrc will change how TW behaves. Among other things, the .taskrc file controls which ~/.task directory is used to store data about your tasks and this is the key mechanism we use to switch between project areas. The other bit of magic needed to make this happen is setting a simple environment variable to tell TW which .taskrc file to load.

Below are the steps to take to modify this file and directory so you can segregate your tasks into different project areas. For the purposes of this tutorial, we will set up a “work” project area for tasks related to pleasing your bosses (or pissing them off, if you are so inclined), and a “personal” project area for holding your life together and hopefully making a more pleasurable one for yourself.

Step 1: Copy the .taskrc file

cd ~

cp .taskrc .taskrc_work

This is the .taskrc we will use for our work tasks. For simplicity’s sake, we will leave the default rc file name unchanged and use it for our personal tasks.

Step 2: Copy the .task directory

cp -r .task .task_work

Now we have a new home for storing our work tasks.

Step 3: Edit the ~/.taskrc_work file

Step 3a: Modify the data.location setting

Look for the data.location key and change its value to ~/.task_work

Here we tell our rc file to used the directory we created in step 2 for our tasks.

Step 3b: Change the color theme

Now uncomment out one the first color theme to make it easy to identify which project area you are working in and comment out the active color theme if you have one activated. If you don’t like this theme, change it later. Just uncomment out the first one for now.

That’s it. Leave everything else the same and save the file, unless you are using a taskserver. In which case, do Step 3c:

Step 3c: If you are using a taskserver, change taskd.credentials

If you are syncing your tasks with taskserver, you’ll want to create a user account in a different organization with a new key. Once you do that, replace the value of taskd.credentials with your new Org/User/Key credentials.

Step 4: Set the value of the $TASKRC environment variable

This is where the magic happens. Set the value of $TASKRC with the following bash command:

export TASKRC="$HOME/.taskrc_work"

Step 5: See if the new color theme is working

Issue the following command:

task list

You should now see all of your tasks in the new color scheme. If not, go back and check your work and try again. You’ll also see a message above your task list that warns you that you have overridden the default TASKRC file.

Step 6: Delete the tasks in the new .task_work directory

Go through and delete all your personal tasks from the list using the usual task commands leaving just the work ones behind. Alternatively, if you don’t want to keep any of the tasks and are starting fresh, remove all the *.data files from the .task_work directory:

rm -f ~/.task_work*.data

Step 7: Set up aliases to make it more convenient to switch between project areas

First, add an alias to switch to your work project area. Add this alias to the appropriate bash configuration file of your choosing:

alias wtasks="export TASKRC=$HOME/.taskrc_work"

And now add an alias to unset the TASKRC variable:

alias ptasks=‘unset TASKRC’

That’s it! Now you can quickly switch between project areas. If you’d like to set up more project areas, just follow the steps above for each project area.

If you’d like to also be able to manipulate tasks in one project area while in another, proceed to the next step.

Step 8: Set project area aliases for the task command (OPTIONAL)

Let’s say you are at work and think of something important that you need to take care of to get ready for vacation. Instead of switching to your personal tasks, adding the task, and then switching back, there is another feature TW provides so you can temporarily modify the settings in your .taskrc file for a single command.

This is done by adding an override to the task command. It’s simple and it looks like this:

task <override> <command>

So if you are at work and wish to see screw the man and view your personal tasks, you can do this:

task rc.data.location=~/.taskrc list

You don’t want to have to type all that in, however, so save your future self some aggravation and set up aliases for the task command for each work area:

alias taskw='task rc.data.location=~/.taskrc_work'

alias taskp='task rc.data.location=~/.taskrc'

Now you can quickly issue task commands to any work area. Great!

Tech

Setting up a “split DNS” configuration on a Synology NAS for hosting websites

Posted by Steve Dondley on

A Quick Primer on DNS

Here’s a very quick primer on the Domain Name System (DNS), a giant database distributed over millions of computers across the globe. It’s primary job is to “resolve,” or look up, the IP address for a given human-readable internet address. For example, the “google.com” address meant for humans resolves to the IP address of “172.217.6.206,” the number that computers use to “dial” google’s website up. This makes the internet much more convenient to use. Typing in long and not very memorable IP addresses is much more of a hassle than typing in an address made up of common letters and words.

The DNS system is quite ingenious. Rather than one organization maintaining and updating a centralized database of all IP addresses and their associates names, it is the responsibility of the owners of each domain to create and update a “zone record” for the domains they have ownership of. For a few bucks a year, you can purchase your own domain and manage your own zone records which let the rest of the world know the IP addresses of the computers associated with your domain. Of course, you also need to pay someone to use an IP addresses provisioned to you and be sure that the computers attached to these IP addresses respond properly when the IP address is “dialed” by another computer, but that’s a topic for another day.

So when you type in an address to your browser, how does your computer know where to find these zone records? That’s the job of what are called “name servers.” If you’ve ever purchased a domain, you know that the registrar requires you to associate two more name servers with your new domain name. It’s the job of these name servers to tell other computers where to find your zone records. Once your computer knows where to find the zone records for a domain, it will then query that computer for the IP address of the human-readable address it’s looking for. Two name servers are usually required to provide redundancy. So if one of the name servers goes down temporarily, a least one other name server will be around to handle incoming requests.

Usually, registrars will give you free use of their name servers and provide a simple web-based interface for updating your own zone records. This makes things easy. But if you need more control over how DNS requests are handled for your domain, you’ll need to set up and run your own name servers so you can handle the requests yourself. To do that, you just have to provide the registrar with the names of the custom name servers that you wish to use.

The Problem

Hosting your own websites from your own home network, as I do, is one scenario where it’s probably a good idea to run your own name servers and manage your own zone records for you domain. In my case, after getting my website, https://steve.dondley.com, set up on my local network, I noticed that though I could reach my websites from outside my network, computers on my local network at home could could not pull up my website.

Not being familiar with this problem, I googled around and determined I had to set up what’s called a split DNS configuration. I won’t go into all the gory details here. I’m not enough of an expert on DNS to do that. But if you are interested as to what split DNS is and why it’s needed in this case, check out this excellent explanation.

The Solution

The solution I implemented, outlined below, is specific to the Synology NAS device I have set up on my home network. More specifically, I have model DS1511+ running DSM version 6.2.1-23824, Update 6 with the “DNS Server” package installed. I should also note that the solution below is specific to my situation where I have name server being hosted servers outside of my local network.

Finally, a word of caution: I am not familiar with DNS or Synology’s solution that it calls “Views” to say if the instructions below are optimal. Though the solution works for me, I may be overcomplicating things. You should consult with the official, built-in “DSM Help” documetnation (under “Packages -> “DNS Server” -> “Views”) or your friendly DNS expert to see if this solution can be improved upon:

  1. On the nameserver, create a zone record for subdomain.myowndomain.com if it doesn’t already exist
  2. Set up slave zone record for myowndomain.com on synology and fetch records from master zone record
  3. Set up a master zone record for myowndomain.com on synology using the interface under “Zone” in synology’s DNS server software
  4. Add a subdomain.myowndomain.com to the new master zone record. The IP address is the internal address of your synology device.
  5. Go down to the “Views” tab in synology’s DNS server software.
  6. Create a new view called “internal” (name is arbitrary)
  7. Set up the forwarders
  8. Under “select zone,” select the “slave” zone then save the view
  9. Create a second view called “external”
  10. set up forwarders
  11. Under “select zone”, select the “master” zone and save the view
  12. Make sure internal is listed first and then the external view. If change the order with the “up/down” buttons.


Labor

Stop & Shop Strike Continues

Posted by Steve Dondley on

Over 30,000 New England Stop & Shop grocery store workers continue their fight against Ahold Delhaize, the giant Dutch conglomerate which owns the chain. They have been on strike for about a week now.

Today, I took a trip to the strike line on Liberty St. in Springfield. As my photos attest, the strike has been very effective. The store is a ghost town.

However, Ahold is a multi-multi-muti-billion dollar business. They can afford to lose millions of dollars per week in their attempt to destroy the union. The workers on strike will be stretched far more thin than the company.

Thanks to the Stop & Shop workers for fighting the good fight for workers taking a stand. And thanks to everyone supporting these workers by refusing to shop at Stop & Shop.

Tech

Super Guide to the split-window tmux Subcommand (and Beyond)

Posted by Steve Dondley on

I spent the last few days writing a beginner’s guide for tmux users. It currently weighs in at about 22 printed pages.

tmux is a tool mostly used by developers to help them work across several documents at the same time. It’s very useful, but hard to master without sinking a lot of time into it.

Technical notes

I wrote it using vim, another power tool developers mostly used for editing software code but it’s an excellent editor for any text document. As an experiment, the document is hosted to the public with GitHub’s “Gist” service which allows you to easily integrate it with a git repository. This permits me to edit the file locally and when I’m finished making edits, I can push the the document out to the “gist” on GitHub. Since the document is tracked in a git repository, others can “fork” the document and make their own changes it without changing the original. It’s similar in concept to Google Docs. It’s unlikely, however, anyone would fork this document, but who knows?

My biggest interest in the the gist service is that each document has a javascript snippet for embedding the document on a web page. So as I continue to make changes to the document, the website will be updated as well. Seems like there is some potential for doing some interesting experiments; it could be very useful for live blogging. It seems, in general, GitHub integration with a WordPress site could open up interesting creative possibilities.

Anyway, here is the guide, live from GitHub: