Another Little Project - FLAC TO MP3

A few days ago my phone ran out of space. 

Looking into it, well, part of the problem is that I rip my cd's to FLAC. Then sync those files over to my phone. 

So, rather than manually use an audio conversion program every time I want to convert my FLAC files to mp3, I decided to just script it using bash and ffmpeg.

The end result is FLAC TO MP3.

Now, all I need to do, is run a single command in my terminal and wait a bit.

 by david.reagan on
Waterdrop - A Drupal in Docker Quickstart

I experiment with Drupal a lot. Enough that I created a template project a while back to get me up and running quickly. The thing is, I included the composer.json file in the repo, and that quickly got out of date. So I'd end up doing a lot of resetting of things every time I needed a new instance of Drupal.

I finally got tired enough of that that I decided to do a better job.

Thus, I created Waterdrop

 by david.reagan on
Why isn't my Drupal 9 sub theme pulling in styles.css?

Just a quick note for my own records.

When you're having trouble getting your sub theme's styles.css file to show up, and you've read over the official docs until your eyes bleed, and you've double-checked that your .libraries.yml file and .info.yml files match what they're supposed to match, here's one more thing you can check:

Does the parent theme have any schema or settings to install? As in theme/config/schema/theme.schema.yml and theme/config/install/theme.settings.yml.

 by david.reagan on
Pardon my formatting
For reasons you can find in the issue queue, the Drupal Markdown module does not have a version released for Drupal 9. Since I want to upgrade, I have had to remove that module. The end result is that a lot of my posts are no longer well formatted. I'm having to manually edit them to make sure they are readable. If you spot one you really think I should get to sooner than I might otherwise, drop me a line at
 by drmeister on
MySQL Access Denied From Within Docker Containers

A few days ago I ran into some very odd behavior. Even though I was setting my usernames and passwords via Docker secrets (so the same file on the db container and the app container), MySQL was throwing Access Denied errors at me. Thankfully all the frustrating details of my troubleshooting have left me, but I thought I would share both the problem, and the solution.

The Setup

Be running multiple MySQL containers, and their associated application containers, on the same Docker network.

 by david.reagan on
Docker Fails To Start When Using A FirewallD Zone That Has A Mis-Configured forward-port Line

If you use FirewallD to manage your firewall rules, and you include a `forward-port` tag in your zone file that is missing the `to-port` or `to-addr` parameters, Docker will refuse to start.

For example:


<?xml version="1.0" encoding="utf-8"?>
<zone target="DROP">
    <description>public zone.</description>
    <service name="ssh" />
<forward-port port="51820" protocol="udp" />

Will cause this output when you try to start Docker:

 by david.reagan on
Fixing the Support Problem

## The Problem

Over the years, one of my biggest frustrations when working with Open Source projects, has been learning how to communicate (get help, suggest features, etc.) in each different community.

Every community has a different style of communication. Some simply use GitHub issues for everything. Others have multiple mailing lists, discussion forums, and IRC channels.

Quite often, I've posted a question and been told I posted it in the wrong location. Usually politely, but it always has a negative effect on my interactions with that community.

 by david.reagan on
Amazon Drive Unlimited plan is going away

Today I found out that Amazon's unlimited cloud drive storage plan for Prime members is going away. I found out via Hacker News, judging from the comments there, a lot of people were abusing the heck out of the plan. Unfortunately, Amazon has chosen to implement pricyer plans than they really should. I have a relatively small amount of data to back up, but it will still cost me about 3 times as much as it did before. Say goodbye to a budget...

 by david.reagan on
Comcast's Internet Data Limit is terrible

Today, for the first time, I received notice from Comcast that I was nearing my 1024GB data limit. 10 days after the month began. When they first notified me that they would be enforcing that limit, I wasn't too annoyed. 1024GB is a pretty decent amount of data. Certainly it's much better than the unenforced 250GB they had shown on my account before. Unfortunately, they did not make clear, one key piece of information. Upload data counts against the data limit[1].

 by david.reagan on
Modifying Drupal 7 User Pictures in code

It took me a while to figure out how to modify or add a user picture from inside a custom module. Google was not much help. So here's the answer I found, hope it helps someone.

First, you need an actual Drupal file object. Something you could reference a file id from. Like $newbieFile->fid.

I referenced modules/user/user.module and includes/ to figure this out.

 by david.reagan on
How to fix Observium when graphs show 'Draw Error'

I've been using Observium at work to collect and graph SNMP logs for a couple years now. A while back the graphs started showing "Draw Error" instead of the actual graph. I poked at it a bit, but never got it fixed. I wasn't too worried since I want to use the ELK Stack for most of what Observium does in the future. Today, though, a coworker came and asked about Observium. So I decided to poke at it some more.

 by david.reagan on
Checking out the Drupal 8 RC

For the past couple weekends I've spent a few hours seeing if I could build a new personal site using Drupal 8. D8 recently released it's first couple release candidates, and set an official launch date. (November 19, 2015)

So far I've only created the very basics of a site. Nothing worth making public. Of course, I've also spent very little time on the project. That said, here are my initial thoughts.

Installation is just as easy as D7. No changes that I noticed.

 by david.reagan on
Digital Rights Management should be considered actively harmful


As I'm writing this, Guardians of the Galaxy is pre-ordered on Amazon. When it comes out, I'll get the full movie on a physical Blu-Ray disc. When I stick that disc in my computer's Blu-Ray drive, open up my Blu-Ray player program, and hit play... I'm going to get nothing. The app is going to pop up a message saying that I need to pay more money to upgrade the app so it can get past the DRM on my movie.

That's right, a legitimate customer cannot watch the Blu-Ray he legitimately purchased.

 by david.reagan on
Net Neutrality

Net Neutrality has been something of a major topic in some of the areas of the internet I visit. Unfortunately, I have yet to see anyone truly address the actual cause of the issue.

So, first, what is the issue?

Big internet service providers, currently, can limit the traffic of various companies. So Comcast could force Netflix's traffic to be slow. The ISP's want to take advantage of this, and charge companies like Netflix lots of money to keep their traffic fast.

 by david.reagan on
Updating LDAP Boolean Attributes with PHP

Changing the value of an attribute in an LDAP directory via php generally uses the ldap_mod_replace function. Something like:

$newvals = array('attribute' => 'value);
ldap_mod_replace($ldap_connection, $dn, $newvals);

The problem I ran into was when the attribute was a boolean type. I kept getting:

 ldap_mod_replace(): Modify: Invalid syntax

 by david.reagan on
Quick alpha version of filtering a table

I've found it incredibly useful to be able to just start typing in an input box, and have a long table get pared down to only what I'm looking for. See Drupal's Module Filter for an example. Since I have an app I'm working on that will eventually need similar functionality, I wrote a quick proof of concept. It's rough, and I have no idea how well it will perform on large tables. But it might come in handy. Visit it on GitHub:

 by david.reagan on
Checking a LDAP Password in PHP

One of my current projects requires authenticating against an LDAP directory. I initially assumed that you would get the password from the directory, then compare it with the user supplied password. That's the wrong way.

The correct way is simpler. Just try to bind the user to the LDAP directory. If it works, you have the correct password, if it doesn't, the password or username is wrong. 

 by david.reagan on
How To Migrate Content from a Wordpress Blog to Drupal 7

As you can see, I have migrated my personal blog to this site. It's now here: Personal Blog. I tried a couple methods, I used Feeds and was able to easily import posts, but I couldn't figure out how to get the comments as well. After a bit of searching, I found the Wordpress Migrate module. And it worked quite well.

 by david.reagan on
Drupal Tip: Drupal slow on WAMP

So, I've been doing a lot of my Drupal development at work on Windows XP. For some reason Drupal was running extremly slow. After searching off and on for a few days, I finally stumbled across the right key words to find this:

Solution: increase realpath_cache_size in php.ini to something larger. I set it to 20M. I might make it bigger, we'll see. But at least Drupal is usable for now.

Oh, and I should note that when I am developing on Linux or on my server, Drupal is plenty fast. So this was a problem specific to my WAMP install.

 by david.reagan on