Jason's Blog

A stochastic thought repository

Dear Jason

| Comments

An open letter to the gentleman (or woman?) behind these emails.


Dear Jason,

Greetings fellow J-Dog! There truly aren’t enough Jasons in the world, so it’s always a pleasure to meet another.

I apologize for not getting back to you sooner. I’ve been working to remove a family of ferrets from my email server. They caused quite a mess. I had to replace my RAMs and reinstall my internet from floppy! One thing’s for sure, I won’t be using frozen beef packages as extra heat sinks on my overclocked email server until I can rig up a more secure enclosure.

Anyway, I’m now able to look at and see all the emails you’ve been sending. Given the number of this short period, and the subject lines, I expect it’s quite urgent. Unfortunately, given my earlier ferret related difficulties, the contents of each email weren’t retrievable, and all I have is a couple of the headers. The envelope sealer also is malfunctioning, so I’m needing to post this on my blog rather than reply through email.

You seem to be a domain name aficionado, and have several different email addresses. Please let me know which of the following you would prefer me to use. For both our convenience, I have included the entire list of emails you’ve sent me thus far.

  • Date: Sun, 11 Aug 2013 16:35:54 +0200
    From: Shawn jasondoa@abuXXXX.ru
    Subject: Waiting for you

  • Date: Sun, 11 Aug 2013 20:23:32 +0200
    From: Rita jason@12thXXXX.org
    Subject: Where are you?

  • Date: Mon, 12 Aug 2013 09:06:13 -0200
    From: Elsa jason@alamoseXXXX.com
    Subject: Want to meet with you

  • Date: Mon, 12 Aug 2013 12:28:30 -0500
    From: Francine jason@absiliXXXX.com
    Subject: Im very sexy

  • Date: Wed, 14 Aug 2013 11:55:15 +0200
    From: DrOZ Online Shop jason@americlaXXXX.com
    Subject: New Product to Lose up to 15 lbs.

  • Date: Wed, 14 Aug 2013 10:49:11 -0500
    From: DrOZ Online Shop jason@21edu-renaissXXXX.jp
    Subject: New Product to Lose up to 15 lbs.

  • Date: Thu, 15 Aug 2013 11:19:46 +0200
    From: “Dr.OZ” jason@absolute-naXXXX.ro
    Subject: This brand new slimming product is a real sensation

  • Date: Thu, 15 Aug 2013 17:38:28 +0300
    From: “Dr.OZ” jason@acrilicospaXXXX.com.br
    Subject: This brand new slimming product is a real sensation

  • Date: Fri, 16 Aug 2013 18:15:00 +0800
    From: “Dr. Oz Official Newsletter” jason@art-aXXXX.com
    Subject: Get Slim! Fast and Safe!

  • Date: Fri, 16 Aug 2013 15:19:57 -0300
    From: “Dr. Oz Official Newsletter” jason@2creXXXX.com
    Subject: Get Slim! Fast and Safe!

  • Date: Sat, 17 Aug 2013 10:08:29 +0200
    From: “Dr. Oz Official Newsletter” jason@apartamentoseltXXXX.com
    Subject: Get Slim! Fast and Safe!

  • Date: Sat, 17 Aug 2013 10:57:50 +0100
    From: DoctorOZ Newsletter jason@alternative-deXXXX.co.uk
    Subject: How to Get Skinny

  • Date: Sat, 17 Aug 2013 16:28:37 -0500
    From: DoctorOZ Newsletter jason@aiglegrXXXX.net
    Subject: How to Get Skinny

  • Date: Sun, 18 Aug 2013 03:14:12 -0400
    From: DoctorOZ Newsletter jason@akadXXXX.hu
    Subject: How to Get Skinny

  • Date: Sun, 18 Aug 2013 12:17:48 -0700
    From: DoctorOZ Newsletter jason@ad-XXXX.com
    Subject: How to Get Skinny

  • Date: Mon, 19 Aug 2013 12:19:47 +0300
    From: OZ Daily News jason@aquXXXX.com
    Subject: The Secret to the Body You Want

  • Date: Mon, 19 Aug 2013 11:43:07 -0500
    From: OZ Daily News jason@agencXXXX.com.br
    Subject: The Secret to the Body You Want

I can only surmise from the above train of emails that you work from this OZ marketing company, and after trying this brave new slimming product yourself, that you are now “very sexy” and are trying to tell the whole world about it so that everyone can benefit.

I am quite interested in your offer. You see, I haven’t been entirely open with you. These ferrets that I’m dealing with are quite large after a week of gorging themselves on the beef sitting inside my email server. I’ve managed to coax them out with some nicely marinated salmon fillets. Though I’ve saved some of my beef at least, they’ve now holed themselves up in my bedroom and keep biting me whenever I try to go in. I have an prescription orthopedic mattress, without which I can’t sleep. My exhaustion is causing me to black out occasionally, or it could possibly be the loss of blood from all of my bite wounds.

But how can you help me, you ask? It’s really quite fortuitous that you’ve contacted me at this time. I figure I can give your slimming product to the ferrets so I can get them back to a more controllable size. Only with your help can I reclaim my home.

Unfortunately, I am a bit low on cash right now. Would you accept payment in beef?

Yours truly,

Jason

Feed URL Is Changing

| Comments

I interrupt your usual reading to bring you this public service announcement.

According to Feedburner, there do appear to be at least a couple people who subscribe to his blog via RSS. For those of you who would like to continue to do so, please update your readers to fetch from http://jason.the-graham.com/atom.xml rather than the current Feedburner URL. While the Feedburner URL will continue to work in the immediate future, I expect that in a few months I will discontinue to use this service.

Thank you.

Farewell Google Reader

| Comments

Google has announced that they are closing Google Reader. This is quite sad for me: Reader is (in my opinion) the best feed reader available at the moment, and one of the only reasons my wife and I have a Google account in the first place.

I’m sure that Google realizes that their main service doesn’t require a log in to use … but without logging in, we produce less valuable metrics for them to sell ads.

I’m sure that Gmail is too profitable for them to consider it now, but if they ever get rid of it, there won’t be any reason for my wife and I, at least, to log in.

How to Use Systemd Timers

| Comments

I was setting up some scripts to run backups recently, and decided I would try to set them up to use systemd timers rather than the more familiar to me cron jobs.

As I went about trying to set them up, I had the hardest time, since it seems like the required information is spread around in various places. I wanted to record what I did so firstly, I can remember, but also so that others don’t have to go searching as far and wide as I did.

There are additional options associated with the each step I mention below, but this is the bare minimum to get started. Look at the man pages for systemd.service, systemd.timer, and systemd.target for all that you can do with them.

Running a Single Script

Let’s say you have a script /usr/local/bin/myscript that you want to run every hour.

Service File

First, create a service file, and put it wherever it goes on your Linux distribution (on Arch, it is either /etc/systemd/system/ or /usr/lib/systemd/system).

myscript.service
1
2
3
4
5
6
[Unit]
Description=MyScript

[Service]
Type=simple
ExecStart=/usr/local/bin/myscript

Note that it is important to set the Type variable to be “simple”, not “oneshot”. Using “oneshot” makes it so that the script will be run the first time, and then systemd thinks that you don’t want to run it again, and will turn off the timer we make next.

Timer File

Next, create a timer file, and put it also in the same directory as the service file above.

myscript.timer
1
2
3
4
5
6
7
8
9
10
11
12
[Unit]
Description=Runs myscript every hour

[Timer]
# Time to wait after booting before we run first time
OnBootSec=10min
# Time between running each consecutive time
OnUnitActiveSec=1h
Unit=myscript.service

[Install]
WantedBy=multi-user.target

Enable / Start

Rather than starting / enabling the service file, you use the timer.

1
2
3
4
# Start timer, as root
systemctl start myscript.timer
# Enable timer to start at boot
systemctl enable myscript.timer

Running Multiple Scripts on the Same Timer

Now let’s say there a bunch of scripts you want to run all at the same time. In this case, you will want make a couple changes on the above formula.

Service Files

Create the service files to run your scripts as I showed previously, but include the following section at the end of each service file.

1
2
[Install]
WantedBy=mytimer.target

If there is any ordering dependency in your service files, be sure you specify it with the After=something.service and/or Before=whatever.service parameters within the Description section.

Alternatively (and perhaps more simply), create a wrapper script that runs the appropriate commands in the correct order, and use the wrapper in your service file.

Timer File

You only need a single timer file. Create mytimer.timer, as I outlined above.

Target File

You can create the target that all these scripts depend upon.

mytimer.target
1
2
3
4
[Unit]
Description=Mytimer
# Lots more stuff could go here, but it's situational.
# Look at systemd.unit man page.

Enable / Start

You need to enable each of the service files, as well as the timer.

1
2
3
4
5
systemctl enable script1.service
systemctl enable script2.service
...
systemctl enable mytimer.timer
systemctl start mytimer.service

Good luck.