the itjerk

my adventures with technology

Category Archives: Drupal

ubuntu 16.04 xenial xerus

Last week the first point release for Ubuntu 16.04 LTS triggered the update on my 14.04 computer and I went for it. There are several questions that pop up and need an answer for the upgrade to continue, so it’s an attended upgrade. I didn’t pay too much attention to what was upgraded, removed, not supported, etc, I just figured I would figure out whatever I need to.

Drupal 6 did work because 16.04 ships with Php7, but it was easy enough to install Php5.6, with the help of this repository (the guy is an official packager for Debian) so now I again have a local copy of my website.

I also needed to upgrade Logitech Media Server to 7.9, which is a beta version, but once installed, my Slimserver – the thing that got me into linux so many years ago – started working again right away.

I have to admit, that with the LTS releases, there really isn’t much of a point to upgrading, because the base distribution is supported for five years. At that point, it’s time for a new computer and a clean install.

On the web: Xenial Xerus

recaptcha 2.0

unnamed
Got an email from Google about upgrading reCaptcha: “You’re receiving this email because you’re registered as a website administrator for a site that uses reCAPTCHA.” If you haven’t noticed, gone are the days with unreadable letters and house numbers, and in is a simple box asking to to check “I’m not a robot”. I upgraded my reCaptcha module on my drupal website and edited the settings.php file after installing it (depending on your version, you’ll get an error on your status page, also telling you how to correct). But it didn’t work! That’s because I needed to generate new public and private API keys for 2.0. So if you do ever get locked out by reCaptcha, you can always delete the module, login, fix what needs to be fixed and then reinstall.

On the web:
reCaptcha Developer’s Guide

linux box, clean install

Hardware all happy, it’s time to do a clean install of Ubuntu 14.04 LTS. The most important step before installing is to get a complete backup and a list of applications/settings etc. before tearing down the old computer! It’s also a good time to think about your new system, so consider what needs to be installed, and what needs to stay backed up, and what needs to be forgotten.

After installing from disk and running apt-get update/upgrade, there are a few usability tweaks I want to do right away:
1. Add packages nautilus-terminal, openssh-server, numlockx, update-motd, weather-util, landscape-common.
2. Setup ssh keys for my hosted server, and secure sshd!
3. Disable guest login in lightDM.
4. Import bookmarks and set panel applets (this could be a lot easier Canonical).
5. Fix writing to USB drives, then flash motherboard bios (F9 to F12)
sudo hdparm -r0 /dev/sdg

Then,
1. Configure router DHCP to give computer a fixed IP via MAC address.
2. Set privacy options in Unity. Include Imageviewer and Movie ;).
3. Install firewall (using gufw).
4. The fstab entries: Mount my new media hard drive. Side note here, always, always mount these things to /mnt/. The /media/ directory is not for anything in /etc/fstab. My backup directory (which is on a NAS drive), I have to enable cifs-utils, and set the cifs password.
5. Restore data from backup, sparingly.
6. Install applications, ditto.

Music stuff:
1. sudo apt-get install eyed facc lame flac vorbis-tools moc sox
2. I also installed Audex, Banshee, EasyTag, DeVeDe, Asunder, VLC, Audacious and Audacity.
3. Reinstall Logitech Media Server, located here.

Webserver:
1. Reinstall LAMP. You’ll be prompted to set MYSQL password, so be prepared with the one for your old databases!
sudo apt-get update.
sudo apt-get install tasksel
sudo tasksel install lamp-server

2. Create empty MYSQL databases, then restore backups. It’s as easy as:
mysql -u root -p
Create database databasename;
exit

then
mysql -u root -p databasename < path/to/backup.sql
3. Copy website backup to /var/www (or wherever), fix permissions. Then set initial directory in sites-available/default.conf and restart apache2.
4. For Drupal, I need to install php5-gd and add cron.php to crontab. For clean urls, I need to enable mod_rewrite (a2enmod rewrite) and configure .htaccess by adding this to sites-available/default.conf:

<Directory /var/www>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all
<Directory>

5. Restart apache2.

SSD:
Because I now have a speedy SSD drive (oh yes, it’s fast!), I read up on potential tweaks to improve performance and life of the drive. With 14.04, the trim command is executed weekly (/etc/cron.weekly/fstrim) by default. This is fine because my box is on 24/7, otherwise it should be moved to rc.local so it executes on boot. If you want to check if trim is enabled, try this script:
sudo hdparm -I /dev/sda | awk '/.*TRIM supported.*/{ if ($1 == "*") print "Yes, TRIM is enabled"; else print "No, TRIM is not enabled.";}'
1. Add noatime parameter to /etc/fstab for / to disable file read stamps.
2. Create a virtual file system with /etc fstab:
tmpfs /tmp tmpfs defaults,noatime,mode=1777 0
3. Then, move browser Firefox and Chromium caches to /tmp
4. Change swappiness? Actually I don’t use swap. RAM is cheap and faster!
5. Finally, I debated moving /home off the SSD, but couldn’t discern any benefit: I mean, every $$$ notebook ships with one, right? Easy to get sucked into all the tweaking… So I’ll opt for just paring down what’s in my home folder, and moving music, photos and videos to my /mnt/media drive. Heck I should buy another disk and create a RAID 1 for all that media…

Anyway, that’s got me up and running. Job complete.

drupal, simile and breaking free of external api’s

If you are using the Simile Widget for a timeline on your website, you'll know that there is an external api that needs to be accessed for the thing to work. It was hosted by MIT for many years, but seems to have gone "poof" very recently. It's still available, now located at simile-widgets.org, and it's easy enough to change $timeline_api in timeline.theme.inc, but another solution is to not use an external api at all.

First, disable the Timeline module in Drupal under Site Building. Then…

1. Download and install the Libraries module.
2. Download Xamanu's timeline libraries for the simile widget from Github. He's the current maintainer of the Drupal module.
3. Create a directory sites/all/libraries/simile_timeline
4. Copy the folders timeline_js and timeline_ajax to that directory. Permissions 755 for dirs, 644 for files work for me.
5. Change line 159 of timeline.module as follows (has to do with write permissions):

from:

if (file_check_directory($timeline_path)) {

to:

if (is_dir($timeline_path)) {

Go back and enable the Timeline module, then go to Site Configuration>Timeline and change the Location of Simile Timeline libraries to "Local Folder".

Timeline is back!

note to self

drupal

Okay, something new to learn, the Drupal content management system. I have some help from the good people at Ajenda.com and a great incentive in the discogs module written by karlheinz. Here's to the next incarnation of progressiverock.com!