Wednesday, March 11, 2009

Standard Ubuntu Setup

----
-> After installing Ubuntu:

-> log in, change root password
sudo passwd root
----
-> as root:
apt-get install ssh
apt-get install unzip zip
apt-get install build-essential



apt-get install mysql-server-5.0
* Root password is blank. To change it use:
* /etc/init.d/mysql reset-password
----
-> setup static ip
sudo vi /etc/network/interfaces
iface eth0 inet static
address 192.168.0.102
netmask 255.255.255.0
network 192.168.0.1
broadcast 192.168.0.255
gateway 192.168.0.1
----
Set up the name servers
sudo nano /etc/resolv.conf , and add:

search yahoo.com
nameserver 216.162.128.6
nameserver 216.162.128.5
(your DNS servers are specific to your internet provider)

then,
sudo /etc/init.d/networking restart

To see if it worked,
ping google.com
and it should resolve google.com to its actual IP
----
-> as username, vi .bashrc to set up paths
export PATH=/opt/jdk1.6.0_04/bin:$PATH
export JAVA_HOME="/opt/jdk1.6.0_04"
export CLASSPATH=.:/opt/jdk1.6.0_04
----
-> grab jdk from another PC
scp username@192.168.0.202:/root/software/jdk-6u4-linux-i586.bin .
----
-> benchmark Sieve
wget http://rsb.info.nih.gov/nih-image/java/benchmarks/Sieve.java
----
How to set hard drives to go into standby mode after 10 minutes:

sudo hdparm -S 120 /dev/hda
----
How to save your hard drive from being hammered by Ubuntu power saver:

- based on http://www.breakitdownblog.com/ubuntu-power-saver-settings-could-damage-hard-drive/ :

1. Make a file named 99-hdd-spin-fix.sh The important thing is starting with 99.
2. Make sure the file contains the following 2 lines (fix it if you have PATA HDD):

#!/bin/sh
hdparm -B 255 /dev/sda

3. Copy this file to 3 locations:

/etc/acpi/suspend.d/
/etc/acpi/resume.d/
/etc/acpi/start.d/
----
The "perfect" Ubuntu setup:
http://www.howtoforge.com/perfect_setup_ubuntu_6.06
----
Install mail server:

apt-get install postfix
- run through the setup
----
Install KDE or GNOME: From: http://www.psychocats.net/ubuntu/kde

> sudo aptitude update && sudo aptitude install kubuntu-desktop

During the installation process, you should be asked whether you want to use KDM or GDM as your default display manager. The default can always be changed later by modifying the /etc/X11/default-display-manager file. For KDM, the file should read /usr/bin/kdm; for GDM, the file should read /usr/sbin/gdm . When KDE is done installing, log out. If you're using 6.06 or later, once you get to the login screen, click on Options and then Select Session. In older versions of Ubuntu (5.10 or earlier), you would have a separate Session button instead of drilling down to Session from Options. In the Sessions dialogue, select KDE and then Change Session.

Finally, before you log back in again, decide whether you want to change to KDE just for this session or if you want to make KDE your default desktop environment. Then, log back in, and you should be using KDE. To switch back to Gnome, just log out and select Gnome from the session menu.

If you later decide you don't want KDE any more, go back to the terminal and paste in
> sudo aptitude remove kubuntu-desktop
----
Install VPN:

sudo apt-get install vpnc
sudo apt-get install network-manager-vpnc
----
http://www.cyberciti.biz/tips/how-do-i-find-out-linux-cpu-utilization.html
cat /proc/cpuinfo
top -n 1 -b | head
Useful admin commands: http://www.reallylinux.com/docs/admin.shtml
----
How to install mysql:

1. download mysql, ex: mysql-5.0.51a-linux-i686.tar.gz

2. add groups
shell> groupadd mysql
shell> useradd -g mysql mysql

3. gzip and untar into /usr/local/mysql
shell> cd /usr/local
shell> gunzip < /PATH/TO/MYSQL-VERSION-OS.tar.gz | tar xvf - shell> ln -s FULL-PATH-TO-MYSQL-VERSION-OS mysql
shell> cd mysql
shell> chown -R mysql .
shell> chgrp -R mysql .
shell> scripts/mysql_install_db --user=mysql
shell> chown -R root .
shell> chown -R mysql data

4. How to start the daemon:
shell> /usr/local/mysql/bin/mysqld_safe --user=mysql &

----
How to use Xterm with Xming:

username@gamma:~$ xterm Xt error: Can't open display:
xterm: DISPLAY is not set
username@gamma:~$ export DISPLAY=gamma:0.0

In putty, under Connection, Ssh, X11, check the "Enable X11 forwarding" box, and in the X-display location field type localhost:0 Save this Putty entry, load it, open connection to server.

username@server:~$ xterm &
[1] 4513
----
Installing kde:
apt-get install kubuntu-desktop
(it's over 1200MB)
----
How to disable the kde logon screen from showing at start up:

echo "false" | sudo tee /etc/X11/default-display-manager

(simply placing the word false in the file, and then restarting, should disable the kdm logon screen)

- Another option would be to change the execute rights on the /etc/init.d/kdm startup script:
chmod a-x /etc/init.d/kdm
----
How to restart apache:
/etc/init.d/apache2 restart

Virtual hosts:
nano /etc/apache2/sites-available/default

Example of setting up a virtual host (do this for both digitalagora.com and www.digitalagora.com):

ServerName www.digitalagora.com
DocumentRoot /srv/websites/digitalagora.com
LogLevel notice
CustomLog /var/log/apache2/digitalagora.com-custom.log combined
ErrorLog /var/log/apache2/digitalagora.com-error.log

----

No comments:

Post a Comment