Our Drupal Site Backed Up to a Laptop

Putting MakeKC.org on a Laptop

I have been spending time lately learning more about Drupal. The more I learn, the more I’m impressed with the system so I decided to write this up and post it to my blog.

I’ve wanted to have a local copy of our MakeKC live website on my home machine for testing and backup but I was having trouble getting the database installed. The phpMySql program wouldn’t let the large database dmp file load. The solution was actually simple but requires a command line keyin in the form:

mysql -u username -p databasename < backupfilename.sql

or in my case:

mysql -u makekcAcct -p databaseForMakekc < myHostingAcct-databaseForMakekc-4-25-2011.dmp 

I copied all of the files from makekc.org’s drupal6 directory down to my local machine. I have Ubuntu with Apache, PHP, and MySql installed. I copied the directory to my computer at:  ~home/www/makekc.local/drupal6 (where ~home is the shortcut notation for my home directory).

I added the a static IP address to the /etc/hosts file

127.0.0.1    localhost
127.0.0.7    makekc.local

(I happen to be using other ip addresses and the next in line was 127.0.0.7 at the time).

A Revelation About Website Root Directories

I’m using the versions of Apache, PHP, and MySql offered by Ubuntu’s Synaptic Package Manager. This causes my web site files to be placed off the root directory at /var/www/myVirtualDomains. Up until now I thought each of my local web sites had to go into the /var/www/ directory for special web site purposes. I wondered if pointing to a different web root directory inside my home directory would work. So I added the following to my /etc/apache2/sites-enabled/000-default file:

<VirtualHost makekc.local:80>
   ServerAdmin webmaster@makekc.local
   DocumentRoot /home/someoneknows/www/makekc.local/drupal6
   ServerName makekc.local
   ServerAlias www.makekc.local
   ErrorLog /var/log/apache2/makekc.local-error_log
   CustomLog /var/log/apache2/makekc.local-access_log common
</VirtualHost> 

Turns out it that pointing to a web root directory in my login account works there too.

With the website files and the web server configuration in place I restarted the server. Then navigated to the web page using makekc.local. The same homepage from the live website was showing up on my makekc.local site too. But when I tried logging in or going to one of the links in the site they didn’t work.

Enabling Clean URLs

I finally realized that the links to other pages probably weren’t working because Clean URLs are enabled on the live site but my default apache installation didn’t allow my Drupal install to Enable Clean URLs.  I didn’t take the time to learn how to apply the proper configuration at the time for my laptop computer to allow mod_rewrite to work.

It took a while but I finally found the command “sudo a2enmod rewrite“, this sets up apache to allow rewrites to happen. Then I changed the /ect/apache2/sites-enabled/000-default file again to change AllowOveride  None to AllowOverride All as in:

   <Directory />
       Options FollowSymLinks
       AllowOverride All
   </Directory>

After restarting Apache again I finally have a working local copy on my computer with the same contents and functionality as our live site.

 About SomeoneKnows 
(c) 2011 Vince Thompson

Advertisements

KC Drupal User Group 2010.02.23

2010.02.23 – Notes from KC Drupal Users Group

Last night marked a restart of the Kansas City Drupal Users Group with about twenty people in attendance. We were treated to pizza and about two hours of Drupal topic discussions. iLLin did a great job of presenting his use of Views, Templates, and Tables. I came away from the meeting with a list of items to research further.

Afterward, I started Googling several topics and passing comments mentioned at the meeting. What follows are links to documents that look useful.

Features Module

Often, the project module descriptions provide pertinent information but lack some information about how a particular module becomes useful. A web site that looks promising for information about the use of Drupal Modules is the abbridged descriptions from Affinity Bridge’s Feature Module Abridged.

Other useful Features resources:

Drupal t() function

Drupal l() Function

Drush

Subversion

  • Leveraging Drupal – Getting your site done right. I got this book from Amazon last week.
  • Practical Subversion – Manage your code with ease using the Subversion version control system. I got this book at MicroCenter earlier this week.

SCP vs. FTP

Node Reference

About SomeoneKnows
(c) 2010 Vince Thompson

Mathematterfly Genesis

I like illustrations, particularly pen and ink with watercolor wash. Today for Thing-A-Day I wanted to create a faux plate one might find in a book illustrating various species.

Mathematterfly Genesis

Mathematterfly Genesis

The inspiration for this piece came from a book I bought a few months ago titled: “Computers and the Imagination, visual adventures beyond the edge“. This book focuses on some of the beauty in mathematical equations. This butterfly is a computer generated shape of a butterfly using the equation listed under DNA Sequence.

Buterfly equation

Butterfly equation

This piece meets a few objectives I set for today. Instead of using watercolor crayons with the pieces last week, I bought some tubes of watercolor paint. I wanted to experiment with mixing and blending colors. It is harder than it looks. I feel these came out too muddy looking. It is going to take much more practice to get to a point where I would like to be in this medium. Another goal was to use the LaTeX formatting I installed last night. I was able to format the equation used in this piece. I also wanted to create a program using the equation to create this image. I used the Processing language to generate the image.


/*------------------------->>>
Mathmaterflys - (c) 2010 Vince Thompson

Inspired by the book "Computers and the Imagination, visual adventures
 beyond the edge" by Clifford A. Pickover Chapter 3 Butterfly Curves
<<<-------------------------*/

int winX = 1024;
int winY = 768;
int halfWinX;
int halfWinY;

void setup()
{
 size(winX, winY);
 halfWinX = winX/2;
 halfWinY = winY/2;
 noLoop();
 background(255);
}

void draw()
{
 float pi_100 = 100 * PI;
 float prevXX = 0;
 float prevYY = 0;
 stroke(0);

 for(float theta=0; theta<pi_100; theta += 0.010)
 {
 float r = exp(cos(theta)) - 2*cos(4*theta) + pow(sin(theta/12),5);
 float x = r * cos(theta);
 float y = r * sin(theta);
 float xx = (x * 90) + halfWinX;
 float yy = (y * 90) + halfWinY;
 if(theta > 0)
 line(prevXX, prevYY, xx, yy);
 prevXX = xx;
 prevYY = yy;
 print("theta: " + theta + ", cos(theta): " + cos(theta) + ", exp(cos(theta)): " + exp(cos(theta)) + ", x: " + xx + ", y: " + yy + " ");
 }
}

The piece uses a combination of tools. Processing to program the image. KSnapshot was used to grab the Processing image. Gimp was used to crop and adjust the image. OpenOffice was used to create the document and placeholder for the image. This combination was printed onto watercolor paper and received a watercolor wash.

About SomeoneKnows
(c) 2010 Vince Thompson

Preserving Formatted Source Code in HTML

I’m switching some of my WordPress blog content over to other web sites and reorganizing them into logical book type formats. One nice thing about the WordPress blog is the plugin that helps to format my C source code for Arduino programs and Processing.

I’ve tried copying and pasting the Arduino code into an OpenOffice document but the source code’s color formatting gets lost. I haven’t found a way of using the Arduino and Processing environments to save the source code with the formatting intact.

I started looking into ways of capturing the displays and saving them in Rich Text Format (RTF) documents then possibly writing a program to create the proper HTML formatting. Luckily I didn’t have to go that far. I have three different Integrated Development Environments (IDE) loaded on my computer in addition to the Arduino and Processing language IDEs. Since switching to Ubuntu from Windows a couple of months ago I’m experimenting with several new programming tools at the same time.

I loaded up some sample source code into the Code::Blocks IDE. Formatting based on the source code language shows up in the display. I tried the Save As feature but didn’t see alternate document formats listed. Then I noticed the Export feature. Under the menu item File->Export setting there are four options including HTML, RDF, ODT, and PDF. My goal was to produce the souce code in an HTML document anyway so I chose that option and it worked nicely.

After that I tried Eclipse. I didn’t find an export option and the Save As just used the standard dialog function to save the file with a different name. Eclipse is a great editor to work with and I hope to find a way to make this work.

The third IDE I’m getting to know is NetBeans. NetBeans didn’t offer an Export function but it does provide a File->Print to HTML feature that works nicely too. I found a plugin for NetBeans on the Processing web site. I am going to try the NetBeans Processing Template plugin to see how it works.

There seems to be some good articles about using Processing with Eclipse. I hope I can find an already developed function to create HTML from the formatted display. Also, I’m hoping the NetBeans plugin helps by including more formatting and keyword recognition to more closely match the Processing IDE display.

Anyway, I seem to have found an off the shelf way of adding line numbers to the source code display. The color coded formatting is being preserved and white space is not being smashed when converting into the HTML format.

About SomeoneKnows
(c) 2010 Vince Thompson

My First Attempt with Watercolor

For my February 9  Thing-A-Day, I decided to create a watercolor drawing.

One of the things on my list of ideas for Thing-A-Day projects was to do a pen and ink drawing with a watercolor wash. Actually, its been on my list for much longer. The watercolor paper I used was from a package I bought about five years ago with the same idea of trying to learn to create watercolor drawings. I finally opened that package today.

It’s almost like that package of paper has been a barrier keeping me from giving it a try. Mocking me on days when I notice it setting on the shelf. I need to work on that whole right brain, left brain thing to combine more of the creative side with the analytical side.

Pen and Ink with watercolor

Pen and Ink with watercolor

This project started with a photograph I took several years ago of the pickup. It is a 1946 Chevy half ton pickup. It is an old farm truck my grandfather had.

Photo of 1947 Chevy pickup.

Photo of 1947 Chevy pickup.

The Process

From photo to watercolor took place with the assistance of Gimp and Photoshop (I’m trying to find my way around in each). I used the programs to edit out the background, enlarge the image, use the edge detection filter, and flatten the range of colors to black and white. I printed out the manipulated image and used vellum tracing paper to ink over the lines.

Composite from Photo to Watercolor.

Composite from Photo to Watercolor.

After I had the pen and ink drawing, I placed a sheet of watercolor paper in the printer. From there I used my Staedtler watercolor crayons to add color. For the highlights I layered lighter colors like yellow and orange then touches of red. For shadows I used red, and two increasingly darker shades of brown.

Pen and Ink Tracing.

Pen and Ink Tracing.

One great thing about Thing-A-Day comes from inspiration to try new things. I’m excited about the way this turned out and I don’t think that package of paper will be as intimidating in the future.

I have access to several books about Photoshop with a lot of great information to help learn the mechanical techniques of operating the program. For me, one book stands out for inspiration more than the others, it’s “Creative Thinking in Photoshop“. It focuses on creating art from a collection of hand drawn media plus manipulation within Photoshop.

I have some web sites that I’m beginning to work on and hope to incorporate some hand drawn artwork into the themes they will use. This exercise has given me a good place to start.

About SomeoneKnows
(c) 2010 Vince Thompson

Silicone Mold for Tripod, Part 1.

The pattern for a tripod replacement part.

The pattern for a tripod replacement part.

This was posted as my thing-a-day project for February 8.

Yesterday I made a replacement part for a tripod I bought at a garage sale. The Sculpey clay part probably would work but I can make a stronger part if I cast it in a urethane plastic. I will be making a two part mold to cast the new piece. Today I’m creating the first part of my silicone mold.

Alumilite Casting Kit Materials

Alumilite Casting Kit Materials

I’m starting by cleaning up the surface of the pattern. It would be great if the top surface and bottom surface are parallel to each other. Since the tripod has an adjustment for tilt, I’m more concerned with keeping the top and bottom surface flat. I’m using sandpaper to prepare these surfaces.

Flattening the surfaces.

Flattening the surfaces.

The silicone mold making materials are expensive and I don’t want to waste them by making this part of the mold any larger than necessary. I found a thin cardboard box that held soft drink cans to form the box. I’ve placed the pattern in the center then rolled out some more Sculpey clay. This time I’m not worried about curing the clay. I’m using the new clay to form a ring outside the pattern part. I intend for this ring to be used as a way of fitting the two part mold together with the proper orientation. I’m not being very careful at laying this out in a perfect square because I’m counting on the irregularities to orient the correct position when we create the second part of the mold later.

Positioning the pattern in the box.

Positioning the pattern in the box.

I intended to tape the sides of the box together but the tape had a hiding place of its own, a rubber band came to the rescue.  I folded the box sides up to be held in place by the rubber band instead. With my container built, its now time to start mixing the silicone mold compound.

Measuring the materials.

Measuring the materials.

With the mixture ready, its time to pour the goop over the pattern.

Beginning the pour.

Beginning the pour.

Filling the container so each side is covered by at least a quarter inch of material.

Finishing The Pour.

Finishing The Pour.

All that’s left now is the cleanup and waiting for the silicone to cure. The instructions suggest letting it cure for 24 hours. Until tomorrow – for the second part of my two part mold.

About SomeoneKnows
(c) 2010 Vince Thompson

Thing-A-Day Feb. 7

Making a Replacement Tripod Part

This was posted as my thing-a-day project for February 7.

In January our Make:KC group focused on mold making and casting parts. This is a project I wanted to create but was left over from last month.

Sometime last year I bought a nice tripod at a garage sale. The tripod was missing the piece that attaches a camera and the tripod together. For my Thing-A-Day project I wanted to make a pattern for a replacement part. My project today is making this pattern.

Garage sale tripod missing attachment part.

Garage sale tripod missing attachment part.

The missing part was designed to be wedged between an angled portion of the front bracket and a rotating latch which also has a specific angle to pinch the part into place. To make this part I’m going to use some Sculpey polymer modeling clay. This clay can be formed into the shape required then baked in an oven to retain its shape.

Kneading Sculpey Clay

After kneading the clay it’s time to begin rolling out the clay to the precise thickness of about four popsicle sticks.

Rolling clay to thickness needed.

Rolling clay to thickness needed.

Instead of filling the tripod solid with the clay, I need to leave a void so an attachment bolt has room plus enough width to tighten the bolt with my fingers. The wall widths seem to work if they are one popsicle stick wide.

Wall widths measuring one Ppopsicle stick wide.

Wall widths measuring one Ppopsicle stick wide.

The next step is to begin pushing the wall pieces into place. Squeezing them into place forming the angled latching pieces.. After placing the wall parts around the perimeter another wider piece is formed to cap off the top.

Forming the part and capping off the top.

Forming the part and capping off the top.

The trick is being able to pull the part back out without deforming the clay. Before placing the clay into the tripod I places a thin sheet of cardboard into the hole. The part pulled back out without much trouble.

Underside of pattern.

Underside of pattern.

After the clay is formed it’s time to bake the part. The oven was set at 275 degrees F. and left for about 20 minutes. After removing the part it is solid and can be handled without fear of deforming it.

Baking the polymer clay part.

Baking the polymer clay part.

The cured part is test fitted back in the tripod. It is a little tight fit but does pop into place.

Test fitting the pattern part.

Test fitting the pattern part.

The new Sculpey clay part could be drilled and fitted with a bolt to attach my camera. The cured clay part is durable and could work to save the day if I didn’t have any other options and needed the part to get the job done. I don’t want just a quick fix, I want a workable replacement part. By using this piece as a pattern I can create a molded part with more durable materials. Next project is to create a mold that can be used to cast a new part.

About SomeoneKnows
(c) 2010 Vince Thompson