Technical

Pardon my formatting

Submitted by drmeister on Sat, 11/13/2021 - 15:45
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 me@davidreagan.net.

MySQL Access Denied From Within Docker Containers

Submitted by david.reagan on Sun, 03/07/2021 - 11:40

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.

Docker Fails To Start When Using A FirewallD Zone That Has A Mis-Configured forward-port Line

Submitted by david.reagan on Sun, 12/27/2020 - 14:04

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:

/etc/firewalld/zones/public.xml

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

Will cause this output when you try to start Docker:

Fixing the Support Problem

Submitted by david.reagan on Thu, 04/19/2018 - 18:17

## 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.

Amazon Drive Unlimited plan is going away

Submitted by david.reagan on Thu, 06/08/2017 - 09:00

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...

Comcast's Internet Data Limit is terrible

Submitted by david.reagan on Fri, 03/10/2017 - 21:18

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].

Modifying Drupal 7 User Pictures in code

Submitted by david.reagan on Mon, 06/20/2016 - 17:21

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/file.inc to figure this out.

How to fix Observium when graphs show 'Draw Error'

Submitted by david.reagan on Tue, 06/07/2016 - 12:51

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.

Checking out the Drupal 8 RC

Submitted by david.reagan on Sun, 11/08/2015 - 14:46

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.

Digital Rights Management should be considered actively harmful

Submitted by david.reagan on Thu, 11/20/2014 - 17:48

Why?

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.

Net Neutrality

Submitted by david.reagan on Thu, 06/05/2014 - 21:00

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.

Updating LDAP Boolean Attributes with PHP

Submitted by david.reagan on Tue, 11/13/2012 - 13:47

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

Quick alpha version of filtering a table

Submitted by david.reagan on Mon, 11/05/2012 - 15:11

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: https://gist.github.com/4028731

Checking a LDAP Password in PHP

Submitted by david.reagan on Thu, 05/24/2012 - 17:46

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. 

How To Migrate Content from a Wordpress Blog to Drupal 7

Submitted by david.reagan on Mon, 01/16/2012 - 13:03

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.

Drupal Tip: Drupal slow on WAMP

Submitted by david.reagan on Tue, 09/21/2010 - 10:48

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: http://drupal.org/node/348202

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.

Thoughts about Google Maps API

Submitted by david.reagan on Thu, 09/09/2010 - 22:11

My current project at work is creating a map of campus using Google Maps API. So far the experience has been decent. It's taken me about two weeks to get most of it working. Could have been less, but there were a few things I had to do to work around the API's limitations. So, here are a few of the pro's and con's I've found.

Thanks Drupal Gardens!

Submitted by david.reagan on Thu, 06/03/2010 - 22:16

Hey! Yet again, DavidReagan.net get's a new look. Drupal Gardens is giving away free beta keys to their Drupal site building service. I signed up for one, and a few days later they were nice enough to send one to me. It's pretty impressive what they've created. They make the creation of a Drupal site practically painless. Go check out this video. I'm definitely looking forward to seeing what else they add as time goes by.