[MySQL] Dump only triggers and stored procedures

By default mysqldump backup triggers but not stored procedures. For that you must add the --routines option.

But how do you do to dump only triggers and stored procedures ?

Like this :

mysqldump --routines --no-create-info --no-data --no-create-db --skip-opt <database> > <dump>.sql

[MySQL] Dump with one INSERT statement for each data row

By default mysqldump make a dump with only one INSERT statement per table. This is efficient but annoying as hell when you need to debug a failed import.

In that case i recommend you to redump the problematic database with the option --extended-insert=FALSE to get a dump with one INSERT statement for each data row.

Sharing GNU sessions

GNU Screen have a very useful feature: sharing the same same session with multiple terminals.

Setting up a shared screen session

The following command sequence sets up a shared screen session named ‘shared’:

screen -d -m -S shared

Listing screen sessions

screen -ls
There is a screen on:
	8632.shared	(Detached)
1 Socket in /var/run/screen/S-pkb.

Attaching an existing session

screen -x shared

 

Doing the same… with different users

First the bad news : screen sharing with another account requires that the screen command be suid root. That a strong security risk so do it only if you are on a non-critical environment. When it’s done, simply start a new session as usual, then:

Enable multiuser support

Ctrl-A
:multiuser on

Add the user to join your session

Ctrl-A
:acladd foobar

Now the user foobar can join the session shared launched by the user user like this screen -x user/shared.

[eZPublish] HostMatchMapItems

When adding a new domain name to an eZPublish website, the site.ini file must be modify to assign the domain to an existing siteaccess.

Simply add a new entry into the HostMatchMapItems array:

vi settings/override/site.ini.append.php
HostMatchMapItems[]=<domain_one><siteaccess_fr>
HostMatchMapItems[]=<domain_two><siteaccess_en>