Install build-essential

#!/bin/bash
 
sudo apt-get -y install build-essential

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 <<EOF> /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

#!/bin/bash
 
# parameter
DB_HOST=db.2003.example.com
DB_NAME=cms1
DB_USER=dbo12345
DB_PASS=terceS
TARGET=~/export
 
# create target directory if not exists
[ !

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 XEN image without xen-create-image

#!/bin/bash
 
if [ $# -eq 0 ]; then
	echo "USAGE $0 XEN_NAME DISK_SIZE RAM_SIZE DIST_NAME"
	echo "Example: $0 srv1 4096 256 edgy"
	exit
fi
 
XEN_NAME=$1
DISK_SIZE=$2
RAM_SIZE=$3
DIST_NAME=$4
 
# prepare directories
if [ ! -d /home/xen ]; then
	mkdir /home/xen
fi
 
if [ ! -d /home/xen/domains ]; then
	mkdir /home/xen/domains
fi
 
if [ !

Useful PHP configuration parameter (php.ini)

# create automaticly a session
session.auto_start = ON
 
# disable global variables
register_globals = OFF
 
# increase upload limit
upload_max_filesize = 50M

Disable natsami kernel messages

--- linux-2.6.24.3.org/drivers/net/natsemi.c	2008-02-26 01:20:20.000000000 +0100
+++ linux-2.6.24.3/drivers/net/natsemi.c	2008-03-17 12:24:50.000000000 +0100
@@ -1818,7 +1818,7 @@
 		dspcfg = readw(ioaddr+DSPCFG);
 		writew(0, ioaddr+PGSEL);
 		if (np->dspcfg_workaround && dspcfg != np->dspcfg) {
-			if (!netif_queue_stopped(dev)) {
+			if (netif_queue_stopped(dev)) {
 				spin_unlock_irq(&np->lock);
 				if (netif_msg_drv(np))
 					printk(KERN_NOTICE "%s: possible phy reset: "

installAdobeReader.sh

#!/bin/bash
 
sudo su
 
wget http://www.medibuntu.org/sources.list.d/hardy.list -O /etc/apt/sources.list.d/medibuntu.list
apt-get update
apt-get -y --force-yes install medibuntu-keyring
apt-get update
apt-get -f --force-yes  install acroread

Reset root password on MySQL

# stop mysql
/etc/init.d/mysql stop
mysqld_safe --skip-grant-tables &
 
# login
mysql -u root
 
# in mysql
use mysql;
update user set password=PASSWORD("NEW_PASS") where User='root';
flush privileges;
quit
 
# start mysql
/etc/init.d/mysql start
 
# Links
http://www.cyberciti.biz/tips/recover-mysql-root-password.html
http://www.cyberciti.biz/faq/mysql-change-root-password/

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;
Syndicate content