Force logout Mac users

Yet another one of those write this down Jan, it will come up again posts. There’s almost certainly a better way to force log out absent users on a Mac but heck, this works for me.

To kill off all the processes of a user named joe who’s left logged in but used the user switcher, open up the Terminal app and run these commands.

sudo su -
ps aux | grep ^joe | awk '{ print $2; }' | xargs -I{} kill -9 {}

In my kitchen is the community iMac and I have set up accounts for my whole family. Sometimes people come over and forget to log out but used fast user switching to go to the login screen or a different user.

That’s not too bad, but some software combinations I’m running often take up lots of CPU needlessly. Yes, Firefox and Adobe Flash I mean you. The whole iMac becomes slow and unresponsive.

That makes for a sad Mac. More importantly at 5:30 AM it makes for a sad me. As long as you know Joe’s user id then this will zap all of his processes and log him out as a result.

If some of those processes are stubbornly cling to life then rinse and repeat.

Holga 120 CFN for Christmas

For Christmas, one of my brothers gave me a Holga 120 CFN. This is a camera that takes 120 film and is entirely made out of plastic. Even the lens element is plastic.

Considering my infatuation with older film cameras, this really was a great gift. I’m always looking at eBay for a new vintage camera and this one is in that spirit. It’s all plastic; I’d never have bought one myself. But trying out 120 film was fun and I enjoyed shooting with it.

The Holga and the whole Lomography shoot-from-the-hip idea always struck me as silly. Switching to film still means you should still compose your shot and think about framing your image. While some out of focus images can be insightful, Lomography seems to me to be based on light leaks and poor photography.

That’s not to say that you can’t get good shots from one of these cameras, and I do admire the gallery. It’s just some of the examples look like the photographer wasn’t really trying.

After shooting a couple of rolls I can say that my opinion has been changed. The Holga is just for fun and intentionally taking soft picture is part of that.

This model comes with a built-in flash with color filters. You rotate the dial and get red, yellow, blue, or plain white. For black and white I used the white flash, for color I liked the yellow filter.

With 120 film there are two mask inserts, one for 6×6 cm and another for 6×4.5 cm. The 6×6 gets you 12 shots and the 6×4.5 gets 16. My first two rolls were shot with the 6×6 and I haven’t developed the 6×4.5 rolls yet.

Once thing I really need to watch out for is double exposures. On my 35mm cameras, the film advance cocks the shutter and you can’t take more than one exposure. On the Holga, the shutter and film advance knob are not mechanically connected. You can expose the same shot multiple times and that ability is part of the appeal.

I ruined a few of my B&W T Max shots because I hadn’t realized that I had already exposed that film. That’ll teach me to pay more attention.

Overall it was fun but I don’t expect this to replace my Olympus Trip 35. When the weather gets warmer I’ll take some outdoor shots with my remaining roll.

Using WP-PageNavi with the Elemin theme

Update: Added a conditional to ensure that wp_pagenavi() runs once.

The Elemin theme has it’s own built-in page navigation after the posts. It’s attractive, but not quite as flexible as the WP-PageNavi plugin. With this plugin you can put a page counter, link to the start and end pages, etc. It’s a cool add-on and I’ve gotten comfortable using it on my WordPress blog.

Adding support for that plugin to Elemin can be done simply by creating an includes directory for the child theme, and copying the elemin/includes/pagination.php file into the child theme includes directory. You then modify the copy with the wp_pagenavi() code and due to the magic of get_template_part() the child theme will pick that up.

Modifying a copy of a parent theme file isn’t too bad and that file is very small. But that’s not a very interesting solution. What’s more fun is to add support via hooking into the loop.

I’ve made many modifications to my child theme and not once have I had to copy and/or modify one of the parent theme files. For me, that’s the whole point of this exercise: creating a child theme that only uses functions.php and CSS.

So far using that method for this child theme I’ve been able to do the following:

  1. Add a random header image
  2. Made some CSS changes including a page background
  3. Added a fix for Internet Explorer 8 issues
  4. Created a front page view that shows the full content and then the excerpts and without using a front-page.php template

I’m having a great time doing it too. WordPress is very extensible and I’m picking up more and more PHP knowledge as a result of playing with my WordPress blog.

Here’s how I added support for WP-PageNavi to the Elemin theme. Continue reading “Using WP-PageNavi with the Elemin theme”