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

Send mail from console

# install
sudo apt-get install -y mailx

# configure postfix
postconf -e 'smtp_generic_maps = hash:/etc/postfix/generic'
cat <> /etc/postfix/generic
root@ubuntu.example.local info@example.com
EOF
service postfix restart
postmap /etc/postfix/generic

# configure smtp
cat < ~/.mailrc
set from="YOU@YOUR_MAIL.COM"
set smtp="YOUR_SMTP_SERVER"
set smtp-auth-user="SMTP_USER"
set smtp-auth-password="SMTP_PASS"
EOF

# test
echo "This is a test message from ${USER}@${HOSTNAME} at $(date)" | mail -s "Test email" YOU@YOUR_MAIL.COM

# v2
sudo apt-get install nullmailer