« July 2010 | Main | September 2010 »

August 25, 2010

Website to generate color palettes from images

This is one of those useful sites you could find one day via google and then never see again. You can upload an image and it will create a suggested color palette to complement your image.

Posted by kkwaiser at 01:33 PM | Comments (0)

Color Blind simulator

A few weeks ago, I spent a lot of time trying to find a way to simulate what our trail maps would look like to someone with color-impairments. This site allows you to upload a small image and generates a new image that mimics what your image looks like to someone who is color-impaired (blind).

Note, I am not color-blind so cannot test it but I'm going to assume someone behind the tool has done so. Great stuff.

Posted by kkwaiser at 01:29 PM | Comments (0)

Upgrade/Update Drupal Core

This post was originally for Drupal 6.15-6.16. I'm generalizing it for all core updates. Hopefully, I will convert to Drush soon which will make this post obsolete.

A catalog of steps. Mostly drawing from:

$ gedit drupal-6.19/UPGRADE.txt

1. Backup up the database using phpMyAdmin and this tutorial.

- This downloads a sql.gz file to your local drive. I use filezilla to sftp it to a backup directory on the webserver (~/blah/drupal)

2. Backup the sites folder and .htaccess

Confession - I once "backed" up my development Sites/ folder only to find that it was faulty. Probably a command line error but I discovered it AFTER deleting the original Sites/ folder!! I would strongly advise you to unpack the file created below to ensure that the backup was successful before completing step 6.

$ ssh uniqname@itcs_sftp_login.umich.edu (get to ITS Linux console)

% cd sites/
% tar -czf live_sites_Aug25_2010.tar.gz *
% mv live_sites_Aug25_2010.tar.gz /blah/drupal/Aug2010/
% cp blah/.htaccess blah/drupal/Aug2010/

3. Take the site off-line at Administer > Site Configuration > Site Maintenance

4. Disable all contributed modules. Update this list when updating again. I'm fairly certain the core modules can be left on.

If you're wondering whether this step is necessary you can pine with these folks. Note, I didn't disable modules while updating my dev site and had no problems. I'm disabling them on the live site though. Paranoia.

*See below the fold for a list of enabled modules.

5. Use Filezilla to transfer new Drupal core package to webserver (e.g. drupal-6.19.tar.gz).

Put new drupal files into place

6. Destroy old Drupal directory, recreate it and populate it with new Drupal files:

% rm -rf blah/research/
% mkdir research
% tar -xzf drupal-6.19.tar.gz
% mv drupal-6.19/* blah/research/

7. Copy .htaccess back in

% cp -rf blah/.htaccess blah/research/

8. Place old sites folder into new install

% rm -rf Public/html/research/sites/
% mkdir Public/html/research/sites

% cp blah/live_sites_Aug25_2010.tar.gz blah/sites/
% cd blah/sites/
% tar -xzf live_sites_Aug25_2010.tar.gz

9. If you are also updating modules at this time, upload them to the web server (again, I use Filezilla and put them into a Private directory) and unpack them.

% cp -rf blah/newModules/*.tar.gz blah/sites/all/modules/
% tar -xzf phone-6.x-2.17.tar.gz
% rm -rf *.tar.gz

10. Run update.php

11. Enable modules (see list below the fold.)

12. Run update.php again

13. Several file permission errors crop up at this point (due to ITS server configuration rules), run this command to solve those:

% find blah/sites/default/files/ -type d -exec fs sa {} umweb:servers write \;

CTools was also complaining about permission settings for files/ctools and files/ctools/css. This command got rid of those errors (note that, due to ITS server settings, these permissions are not very important):

% chmod 777 default/files/ctools/
% chmod 777 default/files/ctools/css

14. Run update.php once more to confirm that the error log has nothing new. I'm pretty sure steps 10-14 can be done more efficiently.

15. Check out the site to make sure everything is working correctly.

16. Put site back online.

------------------------------------

*4a. List of enabled modules:(as of Aug 25, 2010):

Biblio

Autocomplete Widgets
CCK Fieldgroup Tabs
Content
Content Copy
Email
Fieldgroup
FileField
ImageField
Link
Location CCK
Node Reference
Node Referrer
Number
Option Widgets
Phone - CCK
Serial
Text

Chaos tools
Chaos Tools Custom Plugins
Page manager
Views content panes

Date
Date API
Date Popup
Date Timezone

Node import

ImageAPI
ImageAPI GD2
ImageCache
ImageCache UI

GMap
GMap Location
Location
Node Locations

Advanced help
Image resize filter
Insert
Lightbox2
Nice Menus
Node Export
Node Export Files
noderefcreate
Panels stylizer
Tabs

Mini panels
Panels

jQuery UI
Wysiwyg

Bonus: Views Export
Views
Views UI

Webform

OLD NOTES (DO NOT TRAVEL BELOW HERE):

2.

/.htaccess webBackup/
$ sudo cp -rf /blah/sites/ webBackup/
$ sudo cp -rf /blah

I also did a backup of the whole drupal directory due to paranoia:
$ tar czf alpha_backup.tar.gz /var/drupal/

9. Got this error:
The selected file /tmp/fileKxVVzn could not be uploaded, because the destination sites/default/files/js/gmap_markers.js is not properly configured.

Fixed following this comment.
$ sudo chmod a+w /sites/default/files/js/

10. I had to mess with the image folder permissions to get things going:

$ sudo chmod 777 files
$ sudo chmod 777 files/imagefield_thumbs/images/blogs/
$ sudo chmod 777 files/resize/images/blogs/

11. Put site back on-line!


Posted by kkwaiser at 11:23 AM | Comments (0)

Drupal and JQuery UI

The Date module now requires the JQuery module. Here are the steps to installing it.

1. Download and unpack the JQuery module into sites/all/modules
2. Enable the module at admin/build/modules. Save.
3. Notice error messages at top of page after saving:

* The jQuery UI plugin is missing. Download and extract it to your jquery_ui module directory. See README.txt for more info. (Currently using jQuery UI Not found).

- The warning contains a link to this (not-so-helpful) page. I changed the drop-down menu to "All downloads" and picked jquery.ui-1.6.zip which has over 94,000 downloads.

4. $ sudo mkdir /sites/all/modules/jquery_ui/jquery.ui/
5. Unzip jquery.ui-1.6.zip into jquery.ui/
6. Run update.php
7. Enable JQuery UI

8. Date PopUp should work correctly now.

Posted by kkwaiser at 09:11 AM | Comments (0)

August 24, 2010

Move production site to development environment

% tar -czf live_sites_backup_8_24_2010.tar.gz /blah/sites/
$ sudo tar -czf alpha_sites_backup_Aug10_delete.tar.gz /blah/sites/*


$ mysql -u root -p beta < /blah/umbs_live_backup_8_24_2010.sql

where beta is the database to be appended to (already existing tables are kept in tack.)

comment this line out of settings.php
#dl( 'gd.so' );

chmod a few files in sites/default/files


- Pretty sure you will also need to go into the database and manually disable the secure pages and perhaps another module.

Posted by kkwaiser at 04:04 PM | Comments (0)

August 23, 2010

Vista and viruses

Discovering a virus on my Vista OS has forced me to learn more about the vulnerabilities and poor design choices that microsoft has made. In particular, I had files showing up in these uber-hidden directories (note, you can only view these directories if you know the path a priori):

My virus scan found trojans here:
C:\Users\username\AppData\Local\Microsoft\Windows\Temporary Internet Files\Content.IE5
C:\Users\Information Manager\AppData\Local\Microsoft\Windows\Temporary Internet Files\Low

This forum was extremely useful, especially a post by M. Ucal Ulutürk which suggested copying the temporary folder to your desktop so that all of the hidden and uber-hidden files become visible. What's the point of hiding files if such a simple work around will reveal everything? Please tell me there is an explanation.

I also found 112mb of stuff here (which I deleted):
C:\Users\username\AppData\Local\Microsoft\Windows\Temporary Internet Files\Content.Word

Finally, this webpage had a few relevant pointers about the .dat file(s) in these directories.

Posted by kkwaiser at 01:23 PM | Comments (0)

August 15, 2010

Storing data in tables (not csv's)

Updated section on the Data module with pointers to relevant forum posts.

Spent the morning investigating the ways in which a datafile can be stored in drupal. As with images and other complex questions, there are many (attempts at) solutions:

Warrant further investigation:
Webform module - could work for data entry because one webform is a node and each form submission ends up as a row in a table. Views compatibility seems to exist. Would need a separate solution to cover datafiles that are already digital?

Data module helps you model, manage and query related sets of tables. See posts #1 and #6 in this thread. This post hits on D7 and has a few other tidbits as well.

Discussion about moving Data to D7.

While you're not obligated to install it, you need the Schema module for the GUI in Data to work.

Table Wizard module - somehow similar to Data module. Compatible with Views2

CCK TableField module allows you to attach tabular data to a node in Drupal 6 or any entity in Drupal 7. Data is stored in a single db field so I don't know how handy it is for large datasets. CSV import available but primitive. Views can display the table.

Node Table module provides functionality for creating, uploading, editing, and presenting HTML tables within nodes or as nodes. Similar to table manager.

Dead in the water:
Dataset module is for grouping nodes together in sets. Nice name, not relevant

Table Manager module - the maintainer is trying to merge this module with Node Table.

Views Table Group Module is a Views style plugin to display Views results as cells in a table, grouping by row and column. - 1 dev commit thus far, although no bugs.

Cool but not relevant:
DataTables module appears to be for theming Views table views. Still in dev.

Posted by kkwaiser at 11:24 AM | Comments (0)

August 12, 2010

Receive Drupal Security Announcements

To sign up for security notices you need to have a drupal.org account. Then you go to My Account > Edit > My Newsletters > Security Announcements > Save. It seems I update modules/core about once per month.

Posted by kkwaiser at 09:20 AM | Comments (0)

August 11, 2010

Trail maps and the color blind

One of our projects this summer is to construct trail-guide-posts that will have an aerial photograph of the immediate property with trails overlain. The aerial photograph is green (forests) which raises the question of what color the trails should be so that they jump out AND are visible to the color blind. Red really jumps out (to me) but that would mean nearly 7% of the population wouldn't be able to read the maps. After googling to find out what colors are "universally" visible on a green background (one of those needle-in-a-haystack-moment), Renee (UMBS staff) pointed out that yellow is the way to go. I also found out another staff member is color blind so I have someone to test these maps out on before printing.

Posted by kkwaiser at 08:34 AM | Comments (0)