Posts Tagged ‘Web’

Cheatsheet: moving data from one server to another

Wednesday, January 20th, 2010

This article is about moving a running web-environment along with it’s MySQL database from one server to another via SSH.

Compress files

Let’s compress the directory we’re going to move using gzip:

tar cfvz backup.tar.gz /path/

Dump MySQL database content

mysqldump -uUser -p -hlocalhost database_name > dump.sql

You can also dump several databases with mysqldump by addind the --databases or --all-databases parameter.

Moving files

Now we use SCP to move files to our new machine. The following example copies from the old machine:

scp user@host:/path/backup.tar.gz .

The other way round, copying the file to the new machine from the old one would look like this:

scp backup.tar.gz user@host:/path/backup.tar.gz

Do the same with your database dump.

Uncompress files

Simply type:

tar xfvz backup.tar.gz

Now we should have the same directory structure we had on our old machine.

Import MySQL database

mysql -uUser --default-character-set=utf8 -hlocalhost -p database_name < dump.sql

If you have international content and an utf-8 environment running don’t forget to pass the charset-parameter!

HTML to PDF Library for PHP 5

Wednesday, July 8th, 2009

DomPDF HTML to PDF As I had to build a simple html to pdf converting for a client using php, I found a beautiful library called DOMPDF written by Benj Carson.

It seemed to be very lightweight and uncomplicated, which turned out to be true. In a standard case it really is as simple as

$pdf->load_html($html);

I am going to talk about the basic usage and problems I had to solve, specially with umlauts / non latin characters.
(more…)

Blobfisch und Nacktmull

Thursday, October 23rd, 2008


Man glaubt es kaum, was für sinnfreie Debatten es im Netz gibt. Erstaunlich daran, dass die abstoßendsten davon wohlmöglich produktiv für den Biologie unterricht zu nutzen sind.
Mein Favorit der Debatten um Blobfisch vs. Nacktmull jedenfalls ist der Blobfisch :)

Blobfisch
BlobfischBlobfisch

Nacktmull
NacktmullHeterocephalus glaber