Redbeard Creations Redbeard's home on the web

Inktober 2016 Schedule (planned)

Posted on in art

Part of my inktober2016 series. See the initial Inktober 2016 post for details.

I had intended to have this up by the end of September. Missed that a bit, but here it is now!

This schedule is based on the combiniation of the Inktasy Challenge and the prompts for Inktober. Each list provides one "topic" per day of October. In addition, the Inktasy challenge provides for rolling two six-siced dice, one to determine the elemental influence of the character and one for an optional feature to work in.

Read the rest »

Inktober 2016

Posted on in art

I've been a fan of Inktober since I first heard about it a few years ago as well as NaNoWriMo and other similar challenges). Last year an artist I work with did some phenomenal drawings for Inktober. I can't hold a candle to Jason's work (or most of the other artists that participate). However, I doodle and I enjoy drawing. And my wife showed me the Inktasy Challenge a night or two ago. So I'm going to try to do this, following the Inktasy challenge, but, hopefully, working in the official Inktober prompts.

Read the rest »

Benchmarking the PHP Classname Resolution Keyword

Posted on in programming

Recently I had need to determine roughly what happened (and how quickly) when you use the ::class class name resolution keyword in PHP. If you don't know, this special use of the class keyword was added to PHP 5.5 to provide an easy means of determining the name of a class. It is frequently recommended for use in dependency injection containers. So, how does it perform? This post attempts to address that. But first, some background.

Quite some time ago, I added a dependency injection container to the legacy project I maintain. Specifically, I set up Aura.Di, although that's not really relavent to what I'm talking about today. What is relevant is how I was specifying classes to the container.

Read the rest »

LVM adds storage just in time

Posted on in sysadmin

I've been using LVM (Logical Volume Manager) on Linux ever since I first heard about it several years ago. I use it fairly mundanely and just use it to be able to resize the multiple partitions I carve out of a single drive on the fly. But that capability has helped at times. Earlier tonight, for instance.

I was restoring from SQL dumps a database that has a fairly big (6G) table with an even bigger index (about 15G). This is a slow process on my home machine (it's been running for nearly five hours now). Somewhere along the way I got a desktop notification saying that the MySQL partition had less than 1G free. I checked and, yep, only 931K. And going down slowly (the index was being rebuilt). What to do?

Well, I intentionally don't use all of my drive when I set up machines. It lets me increase space where I need it, while keeping each type of data relatively separate (MySQL, music, stock images). So, I knew I could increase the size with LVM. Here's how:

$ pydf # A pretty version of df
Filesystem           Size  Used Avail Use%                 Mounted on
. . .
/dev/ixchel/mysql     29G   27G  931M 91.8 [############.] /var/lib/mysql
. . .

$ sudo lvextend -L +20G /dev/ixchel/mysql  # Expand the requisite partition by 20G.

$ sudo resize2fs /dev/ixchel/mysql # Make the FS understand.

$ pydf
Filesystem           Size  Used Avail Use%                 Mounted on
. . .
/dev/ixchel/mysql     49G   32G   14G 66.1 [#########....] /var/lib/mysql
. . .

And done. In just a few (<5) minutes.

Now, most places that talk about lvextend and resize2fs warn that you could lose stuff. But I've been doing live resizes for years and haven't run into any problems (yet). Backups are, of course, important. But doing this live resize saved me from having to re-run the restore.

Making remote connections to MySQL

Posted on in database, programming

I sometimes connect to live or staging databases from my development machine. I do this by tunneling the MySQL connection over SSH. It's useful for viewing or testing against real and current data. It's also useful for cleaning up botched data from time to time.

Since this is a frequent occurrence for me, I usually set up my .ssh/config file so the tunnel is easily made. It looks something like this:

Read the rest »