Category Archives: organization

Labeling toy storage bins with photos and text using ImageMagick and org-babel

I wanted to make labels for A-‘s new toy storage: three low Trofast drawer frames all along the wall.

I liked how early childhood drop-in centres labeled their shelves with both pictures and text. That way, kids can find things before she can read, while still being exposed to print. I took pictures of the bin contents and renamed the files to the labels I wanted to put on them, such as 2x2 blocks.jpg. (We have a lot of Duplo.)

This time, I experimented with creating the labels entirely in Imagemagick instead of using LaTeX. First, I used a table in Org Mode to let me easily play with the dimensions and recalculate pixel sizes.

DPI   300
Columns 3  
Rows 5  
Paper width 14 4200
Paper height 8.5 2550
Minimum margins 0.5 150
Label width 4.3333333 1300
Label length 1.5 450

I passed the width and the height to the following code block by using header arguments. I liked using 400 pixels as the height instead of 450, so that’s what I used. My source image size was 4032×3024 pixels. If I resize them to a height of 400, that gives me a width of 533. Allowing 20 pixels for the text left and right borders gives me (- 1300 533 20 20) = 727 as the text width.

#+begin_src sh :dir ~/code/labels :var width=1300 :var textwidth=727 :var height=400 :var pointsize=72 :results silent
for x in source/*; do
  file=$(basename "$x")
  /usr/local/bin/convert \( \( "source/$file" -resize x${height} \) \
     \( -background white -fill black -font Alegreya-Regular -bordercolor White \
         -gravity West -border 20 -pointsize $pointsize -size ${textwidth}x caption:"${file%.*}" \) \
     +append \) \
     -extent ${width}x${height} \
     \( -fill none -stroke gray -draw "rectangle 0 0 $(echo $width - 1 | bc) $(echo $height - 1 | bc)" \) \
     "out/$file.png"
done
#+end_src

Sample resized label:

I moved the ones I wanted from the out directory to a ready directory and combined the ones I wanted to print into a PDF:

#+begin_src sh :dir ~/code/labels :results silent
montage ready/*.png -tile 3x5 -background none -geometry +0+0 print.png
convert print*.png -density 300 -quality 100 print.pdf
#+end_src

Then I printed the labels in colour on an 8.5×14″ sheet of paper (single-sided, landscape), cut them out, and taped them onto the bins with packing tape.

W- suggested taking macro shots that more clearly show the characteristics of things in the bins instead of just aiming down and taking pictures of the contents. Might be a good excuse to show A- basic product photography when we get back.

W- also recommended making the label text bigger. The first time I did it, I just picked a pointsize based on whatever fit the ones I wanted to print. I decided against letting Imagemagick maximize the font size because I didn’t want labels to have very different text sizes. After a little poking around, I figured out how to use caption: instead of label: to give me text that can neatly wrap within a given space, and that will probably let me use 90-point font instead of 72-point font. That will make the next iteration of labels even easier to read.

It’s nice having all these bins. A- is getting pretty good at heading straight for the bin she wants something from, and she even talks about them: “Horse is in animals bin.” I’m glad we labeled the most frequently used bins. I’ll tweak the labels when we get back from our trip. We’ll probably change some of the bin contents anyway.

Hooray for ImageMagick, and hooray for variables in org-babel blocks!

Using exiftool to put date, rating, and title in photo filenames

Now that we have a Synology backup server, I want to get better at keeping and organizing photos. I’ve got lots of pictures and videos of A- in Google Photos, but I don’t want to rely only on that. When Google eventually decommissions the service (no signs of this now, but you can never tell), I’d like to already have copies of my favourite photos and videos all prioritized and backed up instead of spending days wading through accumulated cruft.

I had previously added significant moments to a “Weekly highlights” album in the Google Photos app. I had also tried to select a number of those for “Level 2 highlights” and “Level 3 highlights” roughly approximating monthly and yearly filters. This was awkward, though, since Google Photos didn’t let me see which photos were already in an album or which timespans weren’t well represented. I wanted a five-star rating system so that I could gradually winnow images I liked, and I wanted tags for more flexibility.

The F-Stop Gallery app on Android seemed to be a quick way to sort through images, rate them, and tag them. I liked how it stored the metadata in the file instead of in a separate database. The bulk management tools were decent, although of course it would be even better to do things with fewer taps.

I downloaded ZIPs of my highlight albums and extracted them to a Samba share so that I could access them from my phone. I rated the level 3 highlights as 5 stars, level 2 as 3 stars, and weekly highlights as 2 stars, leaving the 4-star level for finer distinctions if I need to fiddle with things. Then I used cp -n (no clobber; don’t overwrite existing files) to copy the 5-star photos, then the 3-star photos, and lastly the 2-star photos. That way, even if a photo was in multiple albums, the file would have just the highest rating I assigned.

I can’t always rely on apps to index and search by the metadata in a file, so I like putting that information in the filename. A good filename might look like this:

2016-08-01-20-14-44 ### Relaxing on the deck #family.jpg

It starts with a date and time, since timelines make sense. I add one to the number of stars and convert that to # so that I can easily search for, say, ### to show me all entries that have at least two stars. This also creates a neat ASCII bar chart effect when looking at lists of filenames. I want to include the title if available, and any tags for easy searching as well.

Here’s the Bash script that takes an image file and renames it accordingly:

#!/bin/bash
exiftool -m \
  -"Filename<\${DateTimeOriginal;s/[ :]/-/g} \${Rating;s/([1-5])/'#' x (\$1 + 1)/e} \${Title} \${Subject;s/^/#/;s/, / #/g}.%e" \
  "[email protected]"

This probably has bugs, but it seems to be a decent start.

It was great to find out that I can pass Perl expressions to exiftool to modify the field value. I figured out that I could combine that with the /e flag for executable replacements so that I could generate a string of N+1 characters. While tinkering with the code, I accidentally used \1 instead of \$1 in my Org Mode block. That made a number such as 5 turn up as a scalar with a six-digit value, so I ended up with a really long line of #####... in my Org file. Emacs was definitely not happy. I ended up opening my Org file in vi so that I could delete the offending line. Anyway, I managed to recover from that and figure out what I needed to put in. Yay!

It would be pretty neat to have some kind of inotify thing watching my NAS inbox and processing files accordingly. In the meantime, I don’t mind running another script. We’ll see how this goes!

External brains – current state

Being the primary caregiver for a toddler means I’m distracted, often interrupted, and somewhat sleep-deprived, so using external brains (paper, phone, laptop) helps a lot. Here are a few things I rely on them to keep so that I can declutter my mind, worry less, and be more present:

  • Daily journal: This lets me tell W- stories about A-, appreciate A-‘s progress, and feel good about where the time went. I use Memento Database on my Android phone to add datestamped, categorized text notes to a Google Sheets spreadsheet.
  • Weekly/monthly review: This lets me appreciate progress over a longer period and plan for the next one. I edit the daily journal entries in Memento to set their importance (1: weekly highlight, 2: monthly), then filter, sort, group, and export the entries. I copy the text into Tasks Free (which synchronizes via Google Tasks) and then edit the text on my phone while A- nurses and sleeps. If I manage to have computer time, I might use Emacs to fill in more of my weekly or monthly review.
  • Tasks (next actions, inbox, waiting, thoughts, and assorted other lists): Tasks Free on my phone, since I can check it or add to it any time. I jot ideas/thoughts down here too, since I can write while nursing A- in bed. If I run out of battery, I charge my phone and move to W-‘s old phone, so I can keep writing. After I draft a thought that might be a good blog post, I copy it into the WordPress app and post it so that I can find it again later. (And so that other people might chime in with insights!) If I have time, I might copy a thought into Emacs, flesh it out further, and post it with org2blog.
  • Calendar: Google calendars – one for appointments, one for activity options. This way, I can hide all the optional stuff quickly.
  • Longer-term reminders, notes, work in progress: Org files. It’s so nice to be able to schedule tasks and have detailed notes on how to complete those tasks. I also really like being able to break things down with outlines and think out loud with code snippets. The weekly agenda review helps me catch reminders.
  • Photos and videos: I sync a Wi-Fi-enabled camera with my phone, then erase everything off the camera. Google Photos automatically uploads everything and shares them with W-. I post selected things to a Facebook closed group for kiddo updates.
  • Time and activity log: I track my time for curiosity. I made my own tracker (quantifiedawesone.com), and I made another button-based interface for easier tracking on my phone. That interface also lets me quickly log data to baby-connect.com, where I track A-‘s sleep, nursing, and potty use. I made my own visualizations, too.
  • Reference info: Org. Document scans in Dropbox or Owncloud, some GPG-encrypted.
  • Book notes: I’ve been reading mostly e-books from the library, so I take screenshots on my phone and they go through my photo workflow. I use Tasks Free to capture quick notes about paper books. I’d like to get back to sketchnotes when I have more focused time.
  • New words: I’m tracking this out of curiosity. She has said 350+ different words, and she’s not even 2 years old yet. :) Many of the words come from songs and books, so it helps to think of concrete experiences she can associate them with.
  • Scenarios, just-in-case notes: Org. Good for managing risks and worrying less.
  • Processes: Org. Good for step-by-step instructions when I’m sleep-deprived or doing something infrequently.
  • Finances: Ledger-cli. Text-based accounting, yay! I have some reports in ledger-mode and some in an Org file. I update this monthly or so.
  • Cooking: We manage our grocery list in OurGroceries because of the multiuser real-time sync. Recipes tend to be looked up on the Internet and then copied into a paper notebook or onto an index card when we like them. Meal plan is written on scrap paper and stuck to the front of the fridge.

I want to get better at structuring my observations of A-‘s progress, planning follow-up activities, and keeping the overall picture in mind. Since I’m roughly categorizing the daily journal entries in Memento / Google Sheets, I can probably create a table that will make it easy to see if there are neglected areas, and then extend that to plan ideas. Or, well, as much planning as one can do with a toddler, really – more like keeping an eye out for opportunities to build on A-‘s interests. So far it’s been okay, though. I’ve been learning about basic principles and skill components from textbooks on early childhood education, and that makes it a bit easier for me to improvise. I have a rough outline of areas to think about on a regular basis, and a few ideas to explore over the next few months.

I also want to get better at managing my book notes and other ideas I want to revisit at the appropriate time. I’m a little lacking on the review side, since most of my writing time is taken up by capturing observations and the occasional reflection. So far, this has also been okay. I just have to trust that whatever I’m writing down will still make sense to me in a few months or years, and the most important stuff will turn up on my radar at the appropriate time. Schedule-based reminders are easy, but things wait for all sorts of other factors. For example, there are lots of practical life skill exercises I picked up from the Montessori education books that will be a better fit when A-‘s fine motor skills improve.

I’d like to get back to drawing someday, although it may have to wait until I have more dedicated time. Whenever I start sketching out a thought, A- likes drawing on my paper or asking me to draw stuff for her. It’s all good, though, since it encourages us to scribble. It just means that I can’t take a picture and reuse the drawing – I have to type it up anyway, so I may as well explore the thought on my phone unless I want to think nonlinearly.

I’ll experiment with using timestamped notes in Memento to help me with offline logging when we go on our trip. I might also just spring for Internet access once we’re off the plane, since that’s useful for other things as well.

I’ve got a fair bit of clutter in my Org files, but I trust that the outlining tools will help me reorganize as needed. I tend to do just-in-time organizing: instead of starting with an outline and drilling down, I might capture a bunch of thoughts, refile them as the structure becomes clearer, and then work up and down from there.

I don’t spend nearly as much time on the computer as I might want to for optimal external-brain management, but the current system is surprisingly workable. Shifting more of my writing to my phone (including the weekly/monthly summaries) made a difference, since I don’t have to keep as much in my head or get constrained by computer time. I look forward to tweaking how things work as A- becomes more independent and as I learn more.

What do I want from my Org Mode files?

What do I want from the notes I keep in Org Mode, how’s that working out, and how can I improve?

Remind me of important tasks, especially recurring ones or ones in the far future
This works pretty well, especially with my weekly review. I mostly trust it, although it might be nice to use the timeline view to review tasks over the next few years just to make sure the important ones are there. And backups!
Keep detailed checklists, instructions, and notes, so that I don’t miss any steps or have to figure things out again when I’m sleep-deprived
I’ve found this useful when dealing with my business paperwork, and I look forward to documenting more routines.
Capture quick thoughts and tasks so that they don’t clutter up my mind
org-capture is good when I’m at my computer, and Google Tasks is a decent inbox when I’m away. Not very good at reviewing and refiling the items, though, but I can do that when I have more discretionary time.
Break bigger projects down into manageable tasks
I don’t have the brainspace right now to work on projects, so most of these have been shelved. I need to tweak my Org refile targets to make organizing things easier. I might be running into a limit with too many targets. Sometimes I can’t use org-refile to select a task that I already know exists.
Help me untangle my thoughts or keep a trail of breadcrumbs as I solve problems
Pretty good at this. Limited by computer time at the moment.
Pull together information and help me summarize
The code I wrote for my weekly and monthly reviews is working well. The code for Emacs News is decent, too, although I can save a little more time if I fix my function for opening all links in a region.
Draft blog posts
This is working well. It could be a little better if I sorted out image uploading and resizing, but my current workflow is fine.
Help me make the most of my limited computer time by prioritizing small tasks that move me forward
This is probably the weakest area. Right now, I tend to prioritize drawing, then checking my agenda for urgent/quick tasks, and maybe writing if I can squeeze it in. I mostly save writing for my phone, though, because I can write on my phone and I can’t do the other tasks then. Coding might help me improve efficiency, but that might have to wait until I have more focused time. It’s okay, I’ll get back to that someday. I think getting better at writing and posting will pay off well enough in the short term. If I give myself permission to post short, possibly incomplete thoughts (like I tell people to! :) ), I’ll get more stuff out there, and then I can build up from there.
Keep notes on people
Little memories, triggers for thoughtfulness, etc. I’m definitely the bottleneck here, not Org.
Help me review my decisions
It’s good to write down goals, options considered, criteria, trade-offs, reasons, predicted results, and so on. My bottleneck is probably taking the time to do so. People are good at rationalization, so I’m not trying to judge whether something was a good decision or a bad decision, but it’s interesting to see what decisions and evaluations reveal about my preferences and values.
Remind me about tools, how to use them, why, and so on
This is partly why I have a literate configuration – so the outline can remind me about stuff I’ve already coded. It’s also handy to keep track of commands and scripts that help me with various tasks. I just need to remember to copy and paste stuff as I do things.

Overall, I’m okay with input and output. Processing is my bottleneck at the moment. If I either fix that org-refile issue I’ve been running into, or come up with an alternative flexible search that will help me find outline entries when I don’t quite remember the headline, that should make processing a bit easier. A bit of outline gardening would help, too – archiving things that are no longer relevant, refiling notes and improving their headlines/text for searchability, maybe prioritizing tasks based on costs and benefits… I’m not entirely sure I’d be comfortable doing that on my phone, so it will have to wait for computer time.

In the meantime, I’m glad I have a place to accumulate (and eventually organize) all those notes!

Building a simple sketch navigator for myself

In 2015, I built the habit of drawing daily index-card-sized thoughts. Some days, I reached (or blew past!) my target of five index cards a day. Other days, I backfilled my daily journal entries based on fuzzy memories and my time logs. In February 2015, I started using a yyyy-mm-dd<letter> naming convention so that I could easily refer to individual cards. For a while, I tried to be fairly disciplined about organizing sketches into outlines and building up chunks into blog posts. That fell by the wayside when I found it difficult to concentrate, but I kept drawing anyway. I saved the images to my hard drive, started tagging them with keywords in the filenames, and uploaded my sketches to Flickr as a way to back up and share my files.

I’ve recently been exploring ways to take advantage of the Samsung tablet that W- bought some time ago. It works wonderfully as a second screen that I can use to review an old sketch while I draw another one. The FlickFolio app lets me do a random slideshow of the past 2000 images in my photostream or in an album. This turns out to be an excellent way to jog my memory and prompt me to revisit questions or decisions.

2016-01-22d What do I want from my idea pipeline -- index card #zettelkasten #ideas #thinking #questions #index-cards

2016-01-22d What do I want from my idea pipeline – index card #zettelkasten #ideas #thinking #questions #index-cards.png

Now those fragmented thoughts are starting to pay off. Many of my old index cards are on topics I haven’t thought about in a while. It’s fun to see what I’ve learned in the meantime, or to follow up on things I’ve forgotten. It’s like I’d been filling an idea pipeline or seeding an idea garden. I get this steady stream of questions, decisions, observations, memories, ideas, and notes, and I can build on those prompts instead of having to start from scratch.

2016-01-18g How do I want my sketches to help me think -- index card #drawing #sketches #zettelkasten #notes ref 2015-11-18a

2016-01-18g How do I want my sketches to help me think – index card #drawing #sketches #zettelkasten #notes ref 2015-11-18a.png

I want these index cards to help me shuffle ideas and possibly see serendipitous combinations. They’re small, so capturing thoughts on them doesn’t require as much effort as, say, writing a blog post. They’re a good way to smooth out and organize thoughts, and I can chunk up those thoughts into longer posts. The sketches are easy to review, too, so they work well as digital footprints. I re-read the year’s blog posts as part of my annual review and sometimes I reread my posts on a monthly basis as well, but it’s not as immediate or as wide-ranging as flipping through a random selection of images.

A random slideshow is a good start, but I’ve been meaning to make a sketch browser that’s a little more tuned to what I want.

2016-01-18d What do I want in a sketch browser -- index card #drawing #coding #plan

2016-01-18d What do I want in a sketch browser – index card #drawing #coding #plan.png

I wrote a simple NodeJS server that I can run on my laptop and access from the tablet (or other devices) while I’m on my home network. At first, I was trying to figure out an interface that would let me navigate by month/week/day, but then I realized that something simpler might be a more useful way to begin.

I started off by making it display random sketches:

Screenshot_2016-01-22_17-16-34

Then I extended it to let me browse by tag:

Screenshot_2016-01-22_17-19-33

And then to see a list of tags by frequency:

Screenshot_2016-01-22_17-17-12

Or by alphabetic order, since that might be handier if I’m trying to look for something specific on a mobile device

Screenshot_2016-01-22_17-17-23

I like distinguishing between daily/weekly/monthly/yearly reviews and non-journal sketches, too:

Screenshot_2016-01-22_17-16-43

Screenshot_2016-01-22_17-18-04

Screenshot_2016-01-22_17-17-34

It’s nice to be able to build custom little tools like that. =)

Here’s the script on Github, in case you’re curious or you want to build on the idea.

Making the most of paper notes

I’ve been drawing a lot more on paper lately, so I should update my Sketching Tools page. It is nice as a way to quickly get my thoughts down without the tiring brightness of the computer screen or the distractions of the Internet. Here’s what I’ve been learning about the differences between drawing on paper and drawing on my computer:

2013-10-28 Drawing on paper versus drawing on my computer

There’s always room to make things better, of course. How can we think on paper more effectively? The mindmap that I’ve been working on gives me a useful overview, letting me see when I’ve accumulated several sketches in a particular area so that I can put them into a blog post. I’ve also figured out how to include the sketches in my review process, thanks to this Flickr metadata downloader (Python). Speech recognition still hasn’t made its way into my toolkit, though…

2013-10-21 How can I think on paper more effectively

Now that I’ve got a decent archive of paper notes, the next challenge is making these easy to search and organize. I’ve put together some tips for making your paper notes more searchable here:

2013-11-11 Make your paper notes more searchable (low-tech and hi-tech tips)

… and getting them into your computer so that you can organize them along with the rest of your notes.

2013-11-14 Integrating paper and digital notes  

Lately I’ve been using Flickr for sharing and tagging images and Evernote for the occasional hand-written search. Let’s see how this works out…

I’m really curious about how other people manage their paper notes. I’ve been trying to find more details on how Isaac Asimov organized his notes – filing cabinets, apparently, but it would be great to get more detail! Do you have a large paper archive? How do you manage it? Do you know anyone who does this really well?