Instal Drupal (CMS)

# create database
mysql -u root -p
create database drupal;
CREATE USER drupalo IDENTIFIED BY 'drupalp';
grant all on drupal.* to 'drupalo'@'%' identified by "drupalp";
commit;
quit;

# create installation file on your webserver
cat < /var/www/drupal-install.php
<?php
# dowload
system("/usr/local/bin/wget http://ftp.drupal.org/files/projects/drupal-6.19.tar.gz");

# extract
system("/usr/bin/tar xzf ./drupal-*.tar.gz");

# move drupal files to current dir
system("/bin/mv drupal-*/* .");
system("/bin/mv drupal-*/.* .");

# configure
system("/bin/cp ./sites/default/defa

MySQL: export and import

DB_HOST=localhost
DB_NAME=db1
DB_USER=root
DB_PASS=pass1234
TARGET=/tmp

# export DB
mysqldump --host=${DB_HOST} --password=${DB_PASS} --user=${DB_USER} ${DB_NAME} | bzip2 --best > ${TARGET}/$(hostname -f)_${DB_NAME}_$(date -I).sql.bz2

# import DB
bzcat /tmp/db_dump_${DB_NAME}.sql.bz2 | mysql --host=localhost --user=${DB_USER} --password=${DB_PASS} ${DB_NAME}
mysql --host=localhost --user=${DB_USER} --password=${DB_PASS} ${DB_NAME} < dump.sql

# import bzip2 compressed file
bzip2 -dc dump.sql.bz2 | mysql --user=${DB_USER} --password=${DB_PASS} ${DB_NAME}

Gnome

# get settings
gsettings list-recursively | grep -i gedit
gsettings list-recursively org.gnome.settings-daemon.plugins.power
dconf read /org/gnome/settings-daemon/plugins/media-keys/calculator

# unity
setsid unity
dconf dump /org/compiz/

# http://askubuntu.com/questions/67355/how-do-i-completely-turn-off-screensaver-and-power-management
# /usr/share/glib-2.0/schemas/org.gnome.desktop.wm.preferences.gschema.xml

dconf watch /
http://askubuntu.com/questions/359593/is-it-possible-to-monitor-dconf-for-changes

# reset pannel settings
gconftool-2 --recursive-unset /apps/panel
d

Create new MySQL DB

# BASH
echo "create database ${DB_NAME}" | mysql --user=${DB_USER} --password=${DB_PASS}

# SQL
mysql -u root -p
create database db_name;
create user db_user identified by 'user_pass';
grant all on db_name.* to 'db_user'@'%';
commit;
quit;

Tomcat configuration

<?php
$URL="https://raw.githubusercontent.com/panticz/installit/master/install.tomcat.sh";
echo "wget $URL -O - | bash -";
echo "

";
$c = curl_init();
curl_setopt($c, CURLOPT_URL, $URL);
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
echo htmlspecialchars(curl_exec($c));
curl_close($c);
echo "

";
?>

# start
export JAVA_HOME=/usr/lib/jvm/jdk1.6.0
export JAVA_OPTS="$JAVA_OPTS -Xmx256m"
/usr/local/apache-tomcat-5.5.20/bin/startup.sh

# deploy
/opt/SDK2/bin/asadmin deploy /tmp/Intranet.war

# change defau