Tag Archives: tools

Using Image Magick to shrink your JPGs

Here is a small script to use Image Magick tools on the JPEG files from your camera, and create “smaller” versions in a new sub-folder called “smaller”.

It must be changed to match the JPG files produced by your camera. It looks for JPEG files with specific dimensions.

And of course this version only works on Unix-like systems that have the “bash” shell available.

#!/bin/bash
rm -f list.txt
mkdir smaller

echo List of JPG files
for a in P*.JPG; do (identify $a >>list.txt); done

echo convert 4032x2272 images
for a in $(grep -e "2272" list.txt | sed -re "s/^([^ ]+).*/\1/"); do (convert $a -comment "Copyright Robert Echlin. Larger version available." -resize 1920x1080 smaller/$a ); done

echo convert 4032x3024 images
for a in $(grep -e "3024" list.txt | sed -re "s/^([^ ]+).*/\1/"); do (convert $a -comment "Copyright Robert Echlin. Larger version available." -resize 1600x1200 smaller/$a ); done

echo checking ...
echo Local files
ls *JPG | wc -l

echo smaller files
ls smaller | wc -l

Review: DITA for Practitioners, Vol. 1

Author: Eliot Kimber, XML Press

I will start this review with my conclusion:
I recommend this book for the DITA developer, and also for the person designing your DITA Information Model. Some parts are useful for the writer who is using DITA, but there are other books for them. Continue reading

Your daily tools: Tortoise and ls

Gui is cute, and sometimes productive, but GNU command line saved my sanity today.

Tortoise is a good GUI for using Subversion on Windows. It nicely flags all the files with status symbols on their icons.

Usually.

Sometimes it gets confused when a change is made 2 or more folders deeper, below the one on display. I don’t know whose cache is causing this – Microsoft’s or Tortoise’s, but it’s a minor issue.

It’s been worse since I upgraded to Tortoise 1.7.5. I jumped from 1.6.x to 1.7.5 the other day while writing docs for some tech writers, including how to install Tortoise.

I have several checkouts (OK, working copies) from the same corporate repository, all checked out in C:\svn. (OK, creativity didn’t seem necessary in this case, OK?)

Today the checkout I am most interested in was mostly not displaying its status icons. Yesterday I wasn’t as worried about it. Usually the entire tree was unaccented. Sometimes a folder would light up until I changed something. Then I noticed that all the “.svn” folders were missing, except in the top folder of the tree. Weird. I checked settings on a couple of things to make sure hidden folders were visible. For a while I had a grain of doubt that maybe the .svn folders were really gone.

So I went to the command line. “dir” didn’t see any .svn folders at all. That was because they were “hidden” by a Microsoft flag on them. “dir /ah” showed them, but not any of the other files/folders. Two dir commands required. Painful.

I have GNU Win32 tools installed, which is a port of the regular GNU tools to Windows.

So the answer was “ls -Al”, or “ls -A” for that economical look.

Thanks to all the GNU developers and those who ported and packaged it for Windows. You help me stay sane on the MS platform.

The site to download for Windows is getgnuwin32.sourceforge.net.

Redmine, please copy Bugzilla

And other projects with multiple dependencies that depend on other things, please copy Bugzilla.

Redmine, like Bugzilla, has this library installation problem. I installed Redmine yesterday, and installed it and installed it and installed it.

I had just installed Xubuntu, so I didn’t even have ruby on the system, and then I couldn’t install the gems, until I found out the package name for “gem” is “rubygems”. That was my second guess, so I didn’t even have to go to Google.

You might think that a place like Redmine would have the list of dependencies in order, but no, the installer page lists “gem install rake” and “gem install rails” before they list “Rubygems 1.3.1 is required”. It’s something you only notice when you are new to installing apps for a specific language. (Note to self: set up an account on their bug site and tell them directly. 🙂 )

Yup, I just said I found the answer on their web page, one inch below the question, or maybe 3 cm.

Solution

After only 10 years, Bugzilla finally solved this problem in version 3.2, with a little help from Perl and CPAN. When you install Bugzilla, or update it, it checks if all the requirements are in place. That’s where it used to stop, with a list of work for you. Now it installs them for you. Yup, it asks first, because it wants to know if you want them in the “global” site library for Perl, or the “local” one for the Bugzilla user.

And then it goes off and gets them, and their dependencies, and their dependencies dependencies, and compiles things that need to be compiled and generally works hard while you work on something else, checking for any questions it might have.

Redmine, and many other apps, could learn from this.

Maybe Ruby can go one better, as a community, and create a generic dependency tool that takes your list of dependencies, and calls “gem” for you, installing the rubygem package, if necessary. You could call it an obvious name like “gemcase” if it’s available or come up with something creative.

This may seem obvious, but I will say it anyway: This gem installer thing can’t be a gem. More obvious stuff: The gem installer thing needs to know how to install rubygem on several OSes or platforms, including Microsoft platforms, by whatever name or means necessary on that platform. You should have it available in your top level folder when you untar your new toy, kinda like configure, although hopefully not so slow.

And no, you don’t want me to scratch this itch, or you might end up with a shell script. Although, maybe that’s just what you need here? 😉 Nah, you can assume Ruby is installed.

Short URLs – Reduce the risk

Short URLs are valuable in instant messaging or other text length limited places. They are also a valuable method for marketers to track which marketing tool produced the best results. I actually didn’t know that second bit until I checked out http://bit.ly/pro/.

The risks

First
Short URLs mask the real URL from the user. When a bot or a stolen account inserts a link into an email to a list, or a comment on a web page, or anywhere else, users may follow the link to a dangerous web page or an unexpected porn site.
Continue reading

Getting the real Vim on Debian/Ubuntu

Migrated. Originally posted: 2009-07-05

Did you notice that vi is pretty much feature-free on newer Debian systems? it doesn’t even have syntax coloring.

The default vi package installed on Debian Lenny, and Ubuntu is vim-tiny, which is really restricted and very appropriate for really, really small environments. Continue reading

Kate+fish

Migrated. Originally posted: 2009-04-04

I wanted to edit files on another computer, with an editor window on my own computer.

When I mentioned this to one of the guys at work, he suggested “fish”. Continue reading