Extracing tar files (without and with gzip or bzip) on Linux

When importing data you will probably be extracting or unpacking a tarball File
To unpack or extract a tar file, type:

tar -xvf file.tar

To save disk space and bandwidth files are saved using compression program such as gzip or bzip2. To extract / unpack a .tar.gz (gzip) file, enter (note -z option):

tar -xzvf file.tar.gz

To extract / unpack a .tar.bz2 (bzip2) file, enter (note -j option):

tar -xjvf file.tar.bz2

to extract gzip file

tar xvzf file.tar.gz

Archiving your files for migration /with folder exclussion

If you need to archive your files and you want to exclude some folders, for example "files" folder or some subfolders of files. You can use gzip for it

tar --exclude=sites/default/files/* --exclude=cache/* -cf file.tar . && gzip file.tar

And you will have a nice zip archive without folders you maybe don't want to transfer.

VPS LAMP stackscript additional settings to make it work

If you have some stackscript, like you might have on VPS like Linode, where you have automaticly installed some linux distribution like Debian, and then Apacher, PHP and MySQL are also installed, this will not work out of the box, you will still need to add some extra stuff on your VPS so you could install some drupal sites.

1. You should enter following commands to set the hostname, replacing duck with the hostname of your choice:

echo "duck" > /etc/hostname
hostname -F /etc/hostname

Multilanguage(i18n) Taxonomy and URL aliases with pathauto

Well you want to use i18n taxonomy and have nice site, that is optimized for SEO and for viewers. Well you will have problems, here are some solutions depending on the which type of multilanguage option you choose for your taxonomy

Panels and translating Title

Panels seem all powerful, especially when used with Views. But then you come to simple problem and I can't be solved. You can't translate a title of a Panels. Seems very stupid but that is how it is.

Solutions.

1. http://drupal.stackexchange.com/questions/9007/how-to-translate-a-panel-...

2. There is a patch here http://drupal.org/node/1179034#comment-5349696 wating to get commited

3. My solution is no brainer, just clone the panel you have and give it a different title

Translating paths

I have got this panel, that has the same content for both English and Croatian. But I want to have custom path for each of them, so that address bar doesn't say something on Croatian when user interface is in English. So I as there is no path translation I made URL alias on English, then made new menu item, just for English and there I have new URL that goes to my Panel but shows right URL in address bar.

Simplenews SCS - Simplenews Content Selection

As i mention before in simplenews template you need to make table layout for it to work in all email readers, so if You are using this module, for selecting content of your newsletters, you might need this. I made and overide of template functions of SCS to make them how I wanted them to look so this is what I added to template.php

function fusion_core_scs_node_output($node) {
$output = '';
if (isset($node->field_naslovna[0]['filepath'])){

Simplenews template

This one is a drag to make. Very bad documentation and even less examples. Anyway what you need to do is go to module folder of simplenews and copy from subfolder "theme" files like simplenews-newsletter-body.tpl.php, simplenews-newsletter-footer.tpl.php to your default theme folder and edit them there. And what you need to do is make most of the html.

Files: 

Database repair with phpMyAdmin

Sometimes your drupal DB will have problems, and it will cause slow queries, especially when having many nodes. Log to you phpMyAdmin and select all tables in DB and click optimize or repair, this could fix many problems and make your site run smooth again. There is also module for this http://drupal.org/project/db_maintenance/ that should do the same thing and can be run on CRON.

Webform block redirect page

You hate it when webform block redirects to webform page and your visitor loses the page he/she was on when submiting form. Well you can sort this out. Make a form "No redirect (reload current page)" on webform/configure but you also need to go and edit block on block admin screen and add "Show all webform pages in block" that will make it work on the same page and not leave page when you submit.