University of Oregon

Drupal 6 – Pre-Popluate Menu Parents with jQuery

Here’s a fun one.
I wanted the menu parent to be pre-populated on node creation.

Use case:

  • When a content editor creates a new ‘Electronic Flyer’ it will be added to the per-determined menu: Primary Links >> Resources >> Electronic Flyers.

Here’s a screenshot demonstrating the pre-filled out menu parent: (more…)

Reset a password on a Parallels VM

I forgot the password to a RedHat 6 Parallels VM recently.

It’s a VM that we use to test changes to Aegir prior to working on the live hub.

Max Bronsema created and shared this VM a few years ago.
Unfortunately for me, I changed the original password at some point and now I’m locked out. But not to fret; the good news comes in the form of parallels control commands:

$ prlctl set ... --userpasswd ...

Here were my steps to reset the two user passwords (Note: names and ID’s have been changed to protect the some-such or another); Ref:

  • Open the Red Hat Enterprise Linux 6 (1) VM
  • Open Terminal
  • Reset the password for Admin and then AegirUser
    # prlctl = parallels control
    # list all running vm’s
    $ prlctl list –all | grep running
  • You may see something like this:
    {3e21f02b-9d52-4ebe-a079-675dc822d723} running - Red Hat Enterprise Linux 6 (1)
  • Use that machine ID to reset the passwords for your user accounts:
    $ prlctl set INSERT_MACHINE_ID –userpasswd Admin:tempPassWord
    authentication tokens updated successfully.
    $ prlctl set INSERT_MACHINE_ID –userpasswd AegirUser:tempPassWord
    authentication tokens updated successfully.
  • Then login as each user and reset their password

That’s a handy tool. Thanks Parallels!

Drupal hide/show a sidebar with jQuery

I’ve hid the right sidebar on the HR website today.
I used jQuery so that it degrades gracefully when users don’t have JS enabled.

The sidebar-right region is used for ancillary information; links, the audience for the node content, etc… So it was determined that we could hide it but make the information available if people wanted more. (more…)