UNIX/Linux permissions and groups – getent

I keep forgetting this command, so I writing it here so I know where to find it. Getent will list information about users and groups on a UNIX/Linux system, including NIS and LDAP users, which is crucial networks with multiple nodes. For example to list information about a user named robert_felty, you can do:

$ getent passwd robert_felty
robert_felty:$1$iPJ.svD/$ce77I/wxh129FLt2Z7UOm.:5440:112:Robert Felty:/home/robert_felty:/bin/bash
Posted in linux | Comments Off on UNIX/Linux permissions and groups – getent

Cherry rhubarb pie

Slice of cherry rhubarb pie

Slice of cherry rhubarb pie

We joined a CSA this year, taking over Greg and Mekayla’s fruit share. This week we got 3 lbs of pie cherries and a huge bundle of rhubarb. That sounded like pie to me.
Cherry rhubarb pie

Cherry rhubarb pie

I have never made cherry rhubarb pie before, only strawberry rhubarb, but I found some recipes, and decided to give it a go, using mostly this recipe, with my mom’s crust recipe. I haven’t made pie in about 10 years, and I know that making the crust is tricky. I knew it wasn’t going well while I rolled it out. I kept adding more and more water. The fourth ball I rolled was finally about right. I need to get back in practice. In spite of the pie not being super well constructed, it still tasted very good.
Cherry rhubarb pies

Cherry rhubarb pies

Posted in wordpress | Comments Off on Cherry rhubarb pie

Image stabilization in Canon EFS 17-85mm lens

Canon EFS 17-85mm with image stabilization off

Canon EFS 17-85mm with image stabilization off

Canon EFS 17-85mm with image stabilization on

Canon EFS 17-85mm with image stabilization on




I recently bought a new lens for my Canon Rebel XT. I debated for about 6 months between a new body, and one of three lenses, the 17-85mm f4/5.6 EFS, the 28-135 f 3.5/5.6 EF, and the 17-55 f2.8 USM. I ultimately decided that I’d rather have a new lens than a new body. My body is 5 years old now, but the only major thing I feel like I am missing is video. I also learned that some of my accessories for my current body would not work with a new Rebel, in particular the battery grip, which is probably my most expensive accessory, at about $150.

I have several lenses – the kit lens for my Rebel, which is an 18-55mm EFS, a 50mm f 1.8 single focal length, and a 28mm f1.8 single focal length. I really like the 28mm, but my wife frequently wants some zoom capability. My 28mm lens has USM focusing though, which is very nice, and I like being able to get good indoor shots without flash. Speaking of focusing, I had noticed recently that my 18-55mm seemed to be having trouble auto-focusing, which is what led to me consider a new lens. I decided that I definitely wanted a USM lens. I had almost decided on the 28-135 lens, which was the cheapest, but ultimately decided that I wanted to be able to go a bit wider than 28mm for my all purpose lens.

So far I am very happy, especially with the image stabilization. It is far better than I had expected. Normally I don’t take pictures slower than 1/30 of a second, but I was able to capture a pretty decent shot at 1/4 of a second. I took two versions of the picture, one with and one without image stabilization. There is a dramatic difference.

Posted in photography | Comments Off on Image stabilization in Canon EFS 17-85mm lens

Random featured images in wordpress

I’ve had random header images on the Fedibblety Family blog for quite some time. I originally implemented this by looking for images in a particular directory. However, I had to manually add pictures to this directory, which was a bit cumbersome. I started thinking, why not just select randomly from all the featured images I have for my posts? So I hacked up a quick function to do that. Here it is:

function get_random_header_images() {
  global $wpdb;
  $featured_image_query = "select id from wp_postmeta join wp_posts on wp_postmeta.meta_value=wp_posts.id where meta_key='_thumbnail_id' order by rand() limit 10";
  $img1 = '';
  $img2  = '';
  $featured_images = $wpdb->get_results($featured_image_query);
  foreach ($featured_images as $img) {
    $img_src = wp_get_attachment_image_src( $img->id, 'medium');
    $ratio = $img_src[1] / $img_src[2];
    if ($ratio > 1.3 and $ratio < 1.6) {
      // make sure that the image isn't too big, and that it has been scaled by WordPress
      if ($img_src[1] > 250 or preg_match("/[0-9]+x[0-9]+/", $img_src[0]) == 0)
        continue;
      if ($img1=='') {
        $img1=$img_src[0];
      } elseif ($img2=='') {
        $img2=$img_src[0];
        break;
      }
    }
  }
  return (array($img1,$img2));
}
Posted in php, sql, wordpress | Comments Off on Random featured images in wordpress

Postie 1.4.2 released

post to your blog via e-mail Yesterday I released Postie version 1.4.2, the WordPress plugin which gives you advanced features to post to your blog via e-mail. I haven’t done much work on Postie in the last several months, so I finally just decided to call the development version stable, since lots of people have been using it.


Improvements over 1.4.1 include:

  • Fixed mailto link bug (thanks to Jason McNeil)
  • Fixed bug with attachments with non-ascii characters in filename (thanks to
    mtakada)
  • checking for socket errors when checking mail (thanks elysian)
  • fixed issue with multiple files not being inserted correctly
  • Added support for ISO 8859-15 (thanks paolog)
  • fixed sql injection problem (thanks Jose P. Espinal for pointing it out)
  • Fixed namespace clashing for get_config function

Please report any bugs in the postie forum

Posted in wordpress | Tagged , | 6 Comments