fogbound.net




Wed, 8 Aug 2018

Building Kannel 1.4.5 under CentOS 7.5

— SjG @ 1:05 pm

Well, it’s been a few years since I’ve had to build Kannel (see Compiling Kannel under CentOS 7.0), and a server migration required that I figure it out again.

You can find discussions on why Bison v.3.0 or later, standard with modern versions of Linux, prevents compilation from succeeding. Some discussions provide workarounds that I couldn’t make work.

Here’s how I downgraded Bison and built a working Kannel 1.4.5 binary on CentOS 7.5:


$ cd /usr/local/kannel
$ wget --no-check-certificate https://redmine.kannel.org/attachments/download/322/gateway-1.4.5.tar.gz
$ tar xzvf gateway-1.4.5.tar.gz
$ cd gateway-1.4.5
$ sudo yum downgrade bison
$ sudo ./configure --prefix=/usr/local/kannel --disable-wap --enable-start-stop-daemon
$ sudo make
$ sudo make install

In that downgrade step, Bison was rolled back to version 2.7-4.el7. If you’re doing this at some indeterminate time in the future, the downgrade may be to a 3.x version, in which case you’ll want to downgrade until you’re at a 2.7.x version (also, if you’re at some indeterminate time in the future, simply check your watch and it will be roughly determinate again).


Sun, 20 May 2018

Moving away from Aperture

— SjG @ 7:39 pm

I’ve finally moved away from Aperture.

I thought I’d share a few thoughts.

Back in the day, when I was still largely shooting film and occasionally scanning prints or negatives, I organzied things by directories. I’d have descriptive names like “hike_at_paseo_miramar”. Over time, this became unweildy, and I had the startlingly brilliant and utterly original idea of organizing by date as well, so I had a directory the looked like:

photos
-> 1997-08-02
-> 1997-08-04-pasadena
-> 1998
—> 1998-02-01-hike
—> 1998-02-07-beach
birthday_party
hike_at_paseo_miramar

You can see the problem. I found I could keep this going by using Adobe Bridge, but I needed a better system. For a while, I organized my pictures on a web server with a cobbled-together collection of perl programs. That was manageable for about two months. Eventually, I tracked down some novel software to organize photos: iView Media Pro. It used the now-familiar idiom of folders (which represented physically where they were on the disk), virtual albums for grouping, and keywords.

iView was great until it wasn’t. The company didn’t have the resources to support it to the degree it needed, and occasional bugs (like the one that wiped out keywords for a few thousand pictures) were frustrating. When the product was sold and the team migrated to Microsoft, I figured it was time to move on. I went with Apple’s $300 “Professional” product: Aperture.

I had to write some code to export my keywords and organization from iView into Aperture, but that left me with a system that worked. It served me well for ten years. For the last two of those years, a cloud hung over me. Apple end-of-lifed the product, and, while it continues to run, did not get any new features or bug-fixes. With each new version of Mac OS, there was the risk that I’d no longer be able to run it.

I did a trial of Capture One, and was impressed with the RAW processing and the workflow. Where it failed for me, though, was in the cataloging. At this point, I had about 55,000 photos in my catalog. Because I like to have them all “with me” at all times, I kept my library on my notebook. I realize this is a strange requirement for most people, but I like the ability to bring up a collection of pictures from a given trip or a given event when I get together with someone else who participated.

Capture One had a hard time keeping up with that many photos. I considered breaking the catalog into separate, smaller collections, but was still resistant to any little impediment to finding the picture I want at a given moment. Ironically, Phase One, the company who creates/sells Capture One has acquired iView Media Pro from Microsoft somewhere along the line. I contemplated moving back to it, but realized I’d need to get that, plus a RAW-processing package, etc, and decided against it.

The 10,000 ton elephant in the room, of course, is Adobe Lightroom. It dominates the photo processing/organizing space. I didn’t want to move to it because of the software subscription model. I don’t want to be beholden to Adobe for all eternity.

Still, after trials of several products, I have been forced to surrender. Lightroom is the only product I could find that worked as well as Aperture.

Lightroom will import Aperture libraries, but the non-destructive editing from Aperture does not come across. Some adjustments might, a lot of metadata will, but those painstaking edits do not. I invested in ApertureExporter, which helps the export process by building a copy of the catalog, and creating extra copies of edited images where it “bakes in” the changes. So you’re left with the original (in case you wish to re-edit), and a JPG or TIFF version with all your changes. I left to run all night, and the result was a nice clean export.

Importing into Lightroom was not difficult. It was interesting to see all the cores of the CPU go to nearly 100% utilization while LR generated previews. I opted for large previews (typical screen resolution). This allows me to have the versions to show off to people (as I mentioned above) while keeping the originals on an external drive that may or may not be attached at any given moment. LR has something called “smart” previews that you can even edit while offline. I didn’t think it made sense for me, but I may revisit this decision later.

I was graciously given a nice tutorial on the basics of using Lightroom by Tomas Fjetland, which helped get me up to speed.

Some observations. Some things in Lightroom are much easier than in Aperture. Lens correction is a single click, instead of requiring a separate plugin. Some things in Lightroom are harder. Having separate panels that you have to switch through for “Library” functions (cataloging and managing keywords) and “Developing” (adjustments and edits) seems unnecessary, especially as the switch doesn’t really result in more efficient use of screen real-estate. Tagging keywords requires a lot more clicking. An auto-completed keyword requires one hit of the return key to accept the auto-completion, and a second hit to apply it to the image.

I’m still pretty slow at the editing tools, and the paradigms are not identical. All that old muscle memory in my fingers is slow to retrain. Overall, I’m pleased with some of the results I’m getting, but it will still be a while before I’m as quick or adept at Lightroom. No doubt I’ll revisit this posting at some later date.


Sat, 9 Dec 2017

Laser Menorah

— SjG @ 6:49 pm

You know, this title is misleading. The reality is a whole lot more boring. Maybe next year, I should take inspiration from the title.

This is more of a lazy Saturday afternoon project. I wanted to use some designs that I’ve been kicking around. So I took a sea of hexagons and a tree in Affinity Designer and mucked about for a bit until I had something where I more or less liked the look.

Next, I grabbed a slice of poplar (available in 8″ x 24″ x 0.25″ slabs at Home Deport, as “Hobby Poplar”) and drove over to CRASH Space. While it’s mega-take-apart-day, I scurried over to the laser cutter. I converted the design to PDF, loaded it up in Corel Draw, used the Epilog printer-driver, and sent it to the laser cutter. The poplar cuts very nicely.

Here’s a link to the PDF of the laser-cut portion, if you want to cut a copy yourself.2017-12-09-hexonorah-cut.pdf

I brought the pieces home, sanded lightly, drilled a few holes, and mounted the vertical piece onto the base, carefully mis-aligning it with the major axis of the elliptical base. Ah well.

I drilled holes where I would mount the candle holders themselves (after all, poplar is pretty, but not ideal as a holder for things on fire). For the actual sockets, I used some nice quarter-inch brass compression caps (also from Home Depot). I drilled a center hole, pushed through a brad, and then soldered it with a torch.

Next, let things cool, dried off the sockets, and put it all together.

The final result is not as attractive as I had imagined it. It’s a little … I dunno, squat? Perhaps the next iteration will have more dramatic tree-like branches emerging to hold the candles.

OK. Next year, forget the design. We’ll just go with lasers.


Sat, 7 Oct 2017

Simple file monitor

— SjG @ 11:59 am

Say you host a few web sites for various folks, and you give them write access to a directory on your server. Well, then, my friend, you’re as big a fool as I am.

Maybe you want to mitigate this foolhardiness by keeping an eye on what these folks upload. For example, when I see a user uploading SuperBulletinBoardThatIsTotallyNotASpamTool.php or SuperWordPressPasswordSharingPlugin.php, I can call them and explain why I’m deleting it. I can be a slightly-less-bastard operator from heck.

So here’s a quick bash script that I use. It’ll also help to alert you if somehow one of the WordPress sites gets compromised, and rogue php files get installed. It ignores commonly changing files or things we’re not interested in like images. It shouldn’t be considered an intrusion detection system, or a robust security auditing tool — this wouldn’t really help in the case of an actual hacker with any l33t skillz at all. It’s just a quick information source.


#/bin/bash

rm -f /tmp/fcl.txt

rm -f /tmp/fcld.txt

/usr/bin/find /var/www/ -type f -ctime -1 | /bin/egrep -v "\\.git|\\.svn|(*.jpg$)|(*.gif$)|(*.pdf$)|wp-content\\/cache|files\\/cache\\/zend_cache" > /tmp/fcl.txt

xargs -0 -n 1 ls -l < <(tr \\n \\0 /tmp/fcld.txt

[ -s /tmp/fcld.txt ] && /usr/bin/mail -aFrom:account@mydomain.com -s "MYDOMAIN.COM FILES UPDATED" you@youremail.com < /tmp/fcld.txt

Throw it into a crontab, and there you have it. You'll get an email with a list of files changed in the past day.


Wed, 27 Sep 2017

Seasonal Palettes

— SjG @ 7:43 pm

Over the years, I’ve written various JavaScript mandala-generators. I like giving variety to the color sets used, and in the past, I’ve hand-crafted collections of colors which I’ve given descriptive names like “Earthy,” “Angst,” and “Scorchio.”

For a new project, I wanted seasonal palettes. Being a northern-hemisphere dweller, I think of January as cool colors, May as yellows and greens, August as ambers and oranges, etc. Rather than hand assemble them, I thought this would be a good use for the Interwebs.

So I wrote a bash/php/ImageMagick script that would hit flickr.com with a seasonal search term to bring back the first twenty-five matching pictures. It then made a composite of the pictures, did a pixelation process, reduced the colors to a minimum set, and built a palette from them.

With excuses of fair use, here’s a visual of that process, using the example where the search terms were “Landscape July”:

1. Images are brought down, each scaled to fit in a 64 x 64 pixel square, and then they’re all combined into a single image.

2. The combined image is pixelated by scaling to 5% of the original size, then scaling back up to a larger size.

3. To get a little more punch and a little less muddy, the pixelated image has its histogram equalized

4. For good measure, the script then reduces the image to 32 colors.

Now, some of this may be redundant. For example, we could easily skip step 2, since we’re reducing colors in step 4. However, this way we sort of reduce the color space before we equalize the histogram. Maybe I should experiment with other paths here.

In any case, the results for my first search term “($month) Landscape” was not very good:

I tried some other search terms for good measure.

Here’s “($month) colors”:

Here’s “($month) thoughts”:

And finally, here’s “($month) skies”:

I have a few conclusions. First, it’s obvious that a hand-created set of palettes would be better. The pictures Flickr returned for each search term didn’t match my expectations very well. Perhaps I’d have done better with season names instead of month names. Lastly finding the best palette from an image is a problem that Google tells me many have worked on. I’m assuming others have probably done better than I.

But it’s a curious question — what are the “characteristic” colors from an image? My approach largely comes down to the number of pixels of a given general color. Are there lots of blues? My approach will have at least some blue. But if an accent color is “important,” whatever that means, my approach will probably lose it.

In any case, it’s probably back to mandalas and hand-crafted palettes for the next project.