Yuval Hager - Drupal development and consulting

  • About
  • Blog
  • Services
  • Contact

WTF - Server ignores connections from a specific machine

Submitted by yhager on Mon, 12/27/2010 - 01:38

Suddenly, out of nowhere, no configuration change, the server decides to ignore completely any TCP connection request from a specific laptop on the home network.

This server is both a web server and a mail server, so it means that using this laptop, one cannot read/send email nor access the websites on that server.

  • 3 comments
  • Read more
Tags:
  • network
  • tcp

Extracting embedded audio from a PDF

Submitted by yhager on Mon, 12/13/2010 - 19:30

I recently purchased a PDF with embedded sound files from Piano For All The PDF also contains videos, but they were provided as separate files.

For the life of me, I was unable to find an application that can play those media files from the PDF. I tried Adobe Reader, which just sends me to a web page with a “no plug-ins to your OS exist”. Then I tried Okular, my favourite PDF reader, and it too didn’t work.

  • 14 comments
  • Read more
  • 2 attachments
Tags:
  • audio
  • pdf

Looking to meet BC home schoolers

Submitted by yhager on Fri, 06/11/2010 - 02:00

We have moved to BC a few weeks ago, and everything we were told is
true. BC is a wonderful place, with wonderful people.

We are currently being hosted by a family in Fraser valley, with
their own unschooled kids, and our girls are very happy. It is clear
for us now that we want to keep them happy by staying near other free
kids during our travel (and forever after too ;-).

We have our own tent trailer, and we intend travel around BC with it
this summer.
We are looking for other home schooled families in the rural parts of

  • 2 comments
  • Read more
Tags:
  • canada
  • unschooling

Thoughts on Drupal 7's pluggable field storage

Submitted by yhager on Mon, 04/26/2010 - 09:19

Drupal7 introduces a lot of exciting and important innovations. As 1% of the biggest sites are now powered by Drupal, Drupal is at a stage it can take a lead at Internet technologies. Stuff like RDF needs a bootstrap from a major player in order to catch traction, and Drupal is taking a bold step here (and not for the first time). Other features, with less visibility to the non Drupal world, have quite a lot of significance as well.

The adoption of a generic data store allows support of the rather new noSQL movement.

  • 6 comments
  • Read more
Tags:
  • drupal
  • Drupal planet

Easy nginx with Drupal

Submitted by yhager on Mon, 02/01/2010 - 17:07

If you are impatient, the code is at nginx_drupal. If you want to know what it’s about - read on.

I recently needed to set up a consistent web server configuration for a Drupal web site. That site has 6 web servers and 3 images servers. The goal was to have a single nginx configuration file, with as little duplication as possible. The images servers are meant for the static content, and for imagecache only.

Although the servers are different (some are meant for generic web, some are meant just as images servers) I wanted to have a generic config, that will give maximum flexibility to the administrator. Such a config file can reside in a single location on the internal network, and be accessible from all servers through NFS.

  • 9 comments
  • Read more
Tags:
  • boost
  • drupal
  • nginx

Using option groups with acts_as_tree

Submitted by yhager on Fri, 12/18/2009 - 17:14

When you have a model that acts_as_tree, you might want to use that to generate a nice select element with option groups.

In your view, simply use:

<%= f.select (:category_id, option_groups_from_collection_for_select(
    Category.top,
    :children, :name, 
    :id, :name
    )) %>

and add a method to your model:

def self.top
  find(:all, :conditions => [ 'parent_id IS NULL' ])
end 

This generates HTML like this:

<select id="product_category_id" name="product[category_id]">
  <optgroup lab
  • 1 comment
  • Read more
Tags:
  • acts_as_tree
  • rails

Simple outgoing mail server on Archlinux

Submitted by yhager on Wed, 12/09/2009 - 18:08

It is very common to need an outgoing mail capabilities. If you are using a VPS for your web site, or just you want outgoing mails on your home machine to work natively. Automatic messages from cron, UPS management, or even your blog about new comments are too important to lose.

I am using ArchLinux, but this guide is probably good for other distributions as well. I could not find a simple and concise guide for setting this up - this post is aimed to fill that gap.

First let’s install Postfix (why postfix?

  • 4 comments
  • Read more
Tags:
  • linux
  • mail
  • postfix
Syndicate content
I love Smashing Magazine!
Fervens Drupal theme by Leow Kah Thong. Designed by Design Disease and brought to you by Smashing Magazine.