User login

Benjamin Melançon

Set login name to use for SSH per host

As a completely hypothetical example, suppose you boneheadly thought it would be nice to standardize your local login name to something different than on some existing servers.

You want standard scripts that assume current username to work— you wrote them to share, after all. So how to make this work?

Something like this in your ~/.ssh/config file (create and chmod 600 if it doesn't exist already) will work:

Host agaric-test
Hostname test.example.org
User bmelanco

Setting up a new GNU/Linux computer (Debian/Ubuntu flavor) for Drupal work, Agaric style

Create an SSH key

ssh-keygen

Send a copy of the public key to an agaric with access to the test server to add it there. Read more about setting up public keys and agent forwarding.

Get Drush

Follow composer instructions on https://github.com/drush-ops/drush (preferred over apt-get or PEAR.)

Overriding a string the second-simplest way in Drupal 7

Here's the situation: You don't need administrator-customizable strings like the String Overrides modules provide, but you'd like the changes in a more share-able (or consistently version controlled) place than settings.php, which details an easy $conf way of doing string overrides.

Well, here's how to do it with a variable set function that can go in a module's install or update hook:

move user search tab from search/user to admin/people/search

Agaric decided to make a contributed module to do this: http://drupal.org/project/usersearchtoadmin

See that project page. The below is mostly notes on wrong turns!

It would be nice if this just used a different permission other than a person's ability to access profiles:

Command line Git on Windows

A principal at Agaric regrettably uses Microsoft Windows as a primary operating system. In fact, though, everything works great for him using the open source integrated development environment Eclipse to develop, including using the eGit plugin-- except when something goes wrong, and my (limited) command line knowledge of Git is useless to help him.

Fortunately, it turns out to be pretty easy to have command-line Git on Windows with Eclipse, it just isn't well documented.

Define and Use a JQuery Plugin as a Helper Function for Drupal JavaScript

Here's the basics of defining and using a JQuery plugin within the context of Drupal.

This is definitely not the best and highest use of a plugin, and may in fact be a downright abomination-- this isn't a plugin that really works outside the context of the code it is written for, and certainly not outside Drupal. But it was a clean way to abstract out 42 lines of code, so here it is, for the enjoyment of all.

The first part here is simply how to call JQuery from Drupal, the second part is the plugin.

How to fetch a file at a URL and set it as the default image in an image field

There's two separate cool things here that you might want to do. One, simply know how to save a file from a URL (there's a secret Drupal function for that in system module) and two, how to give an image field a default image when creating it programmatically (that part is outsourced to the fieldhelp module).

Set a git commit message in bash but also go to Vim for further editing

A colleague insists that messages abide by the 72 character limit advisory, and i want to change my habit to get the files-changed and, just as important, files-left-out information that git commit will give in the Vim editor.

I'm still a bit addicted to the git commit -m "Message here" workflow of entering messages right in the command line, and it's more than just habit: it is very useful to be able to look at the git add -p record.

Using Views DataSource and Feeds to pull content from one site to another... with multiple images

Disclaimer: This is a should-be-deprecated approach, both Views DataSource and Feeds can be replaced with better options, such as Services or RestWS to Rules and Rules XPath Parser. But this approach basically works now.

On the source site.

Making Views Datasource Output multiple values for an image

drush dl image_url_formatter
drush -y en image_url_formatter

Configure the View to use it for the desired image field ("Image URL" instead of "Image").

/admin/structure/views/view/yourview_xml/edit

Syndicate content