Skip to main content

Drupal Form Uploads

Posted in

I spent way too long tonight trying to figure out how to upload a file to drupal, using the "file" field type in drupal. It's really easy, though, once you figure it out.

First, to instantiate the field:
<?php
function my_form() {

$form = array();
$form['#attributes'] = array('enctype' => 'multipart/form-data');

$form['upload'] = array(
'#type' => 'file',

Installing PHP on Debian without Apache

Posted in

When I recently went to install PHP on a server on which I did *not* want Apache, I learned that a simple, "apt-get install php5" will install Apache.

A quick look at the depends, though, and the following sequence worked.

Yes, I'm aware commands can be combined. I chose multiple steps.

sudo apt-get install php5-common
sudo apt-get install php5-cgi
sudo apt-get install php5

The php5-cgi package fulfills the depends that would otherwise be fulfilled by Apache.

-jbn

Custom Authentication for Drupal

Posted in

I recently had a need to write a custom authentication module for Drupal 6. I struggled to find a good example from which to work. As anyone researching the topic knows, Drupal 6 dropped the couple of hooks that were in Drupal 5 that made custom authentication a brainless activity.

Snow Pictures

The so-called "snowpocalypse" is here, and ... it's living up to many expectations. About 14-15" on the sidewalk at 7:30 this morning. The sidewalk was pretty heavily treated when this all started, so it was the last to accumulate snow. The middle of the yard is probably 2-3" higher, at least.

Picture: 

Freeswitch Installation

Posted in

I recently needed to install Freeswitch for a singular reason: to register to another server when a SIP client registered to it. (What I call "register on register"). As I went, I decided to document the process of installing and configuring.

Debian, locales, and puppet

Posted in

Having gotten sick and tired of receiving error messages like this:

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").

I decided to solve the problem once and for all. We use puppet to manage machines, so this should be - and is - straight forward.

/etc/puppet/modules/locales/files/locales.gen:

#
# /etc/locales.gen
#
# managed by puppet
#

The Quest for Wind Power

Posted in

When the state initially deregulated the electricity market, I had little use for it. It wasn't that I loved our monopoly provider, BGE, it was more that I really didn't believe I would benefit from deregulation. A year or two ago, I finally found a benefit: Pepco Energy Services offered to sell me 100% wind power at at premium over the price of regular power. (For what it's worth, BGE's supply is, I believe, coal and nuclear).

Generic Apache Redirect to Add www to Domain Name

Posted in

It's common to want to add "www" to a domain name, so that users typing in the "non-www" domain name, will get to the right site. It's important to implement this with a 301 redirect so that search engines recognize that there is only one true and real site.

The traditional way to do this is:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^euphline.com$
RewriteRule (.*) http://www.euphline.com/$1 [R=301,L]

Welcome to EuphLine

Posted in

Every few years since the dawn of time ... okay ... so perhaps since the late 90's, I've started euphline.com anew, from scratch. Each time, I've moved to a different content management scheme, and pretty much replaced all of the content. This time, it's on Drupal 6, running the Domain Access module, as part of a family of sites including ejTown and Elizabeth's Books.

He said, She said. Digital TV bill passes -- or fails?

Posted in
The Associated Press reports that the House bill, designed to delay the digital tv switchover failed to pass.  Reuters reports it passed.  I love it when that happens! AP: "The House has defeated a bill to postpone the upcoming transition from analog to digital television broadcasting by four months to June 12." Reuters: "The House of Representatives on Wednesday passed a bill to delay
Syndicate content