#!/bin/sh ###################################################################################### # faster-dapper.sh - Tweak default settings to speed up Ubuntu 6.06 Dapper Drake # # # # Usage: sudo ./faster-dapper.sh as a user with full sudo access # # # # Version 0.9 Created Jan 26, 2007 by Jeff Schroeder (jeffschroeder@computer.org) # # License: GNU GPL 2 ONLY. See http://www.fsf.org/licensing/licenses/info/GPLv2.html # # # # NOTE: If you don't understand this script, don't use it. I expect you to edit it # # # ###################################################################################### INSTALLED_DRIVE="/dev/hda" # Are we running on Dapper? if ( ! grep "Ubuntu 6.06" /etc/issue >/dev/null 2>&1); then echo "This script is only intended for Ubuntu 6.06 Dapper Drake" exit 1 fi logger " -===== Installation log started on $(date) for faster-dapper.sh =====- " #Logs installation information to /var/log/messages echo " -===== Installation started on $(date) for faster-dapper.sh =====- " # Update the system apt-get update && apt-get --yes upgrade # Enable the Completely Fair Queuing Linux process scheduler to handle high CPU usage situations better if (! grep "elevator=cfq" /boot/grub/menu.lst > /dev/null 2>&1); then logger " Kernel process scheduler changed to CFQ" sed -ie '/# defoptions/s/splash/splash elevator=cfq/' /boot/grub/menu.lst update-grub else echo "Kernel process scheduler is already CFQ" fi # Preload is an adaptive readahead daemon. Read /usr/share/doc/preload/proposal.txt.gz after installing preload for more info if [ ! -f /etc/preload.conf ]; then logger " Installed preload" apt-get --yes install preload else echo "Preload already installed" fi # Enable prelink which causes big applications like firefox and OO.o to load faster if (! grep "^PRELINKING=yes" /etc/default/prelink > /dev/null 2>&1); then logger " Installed prelink" apt-get --yes install prelink && sed -ie 's/unknown/yes/' /etc/default/prelink # Uncomment this if you don't keep your computer on all night and want to have prelink run on newly installed software # NOTE: This makes apt-get upgrade or apt-get dist-upgrade take a loooooong time. #echo 'DPkg::Post-Invoke {"echo Running prelink, please wait...;/etc/cron.daily/prelink";}' >> /etc/apt/apt.conf echo -n "Running prelink for the first time so this might take awhile..." /etc/cron.daily/prelink && echo "done" else echo "Prelinking already enabled" fi # Disable ipv6 to improve network responsiveness and speed dhcp lease negotiation at boot time if [ -d /etc/modprobe.d ]; then if ( ! grep "net-pf-10 off" /etc/modprobe.d/aliases > /dev/null 2>&1 ); then logger " Disabled ipv6" echo "alias net-pf-10 off" >> /etc/modprobe.d/aliases fi if ( ! grep "ipv6 off" /etc/modprobe.d/aliases > /dev/null 2>&1 ); then logger " Disabled ipv6 alias" echo "alias ipv6 off" >> /etc/modprobe.d/aliases fi fi # Speed up gnome a bit logger " Improved gnome speed" gconftool-2 --set --type boolean /desktop/gnome/interface/enable_animations false gconftool-2 --set --type boolean /apps/panel/global/enable_animations false gconftool-2 --set --type string /apps/nautilus/preferences/preview_sound never #gconftool-2 --set --type string /apps/nautilus/preferences/show_image_thumbnails never #gconftool-2 --set --type string /apps/nautilus/preferences/show_icon_text never # Performance tweak to speed up your hard drive logger " Enabled IDE hard disk tweaks" /sbin/hdparm -u1 -m16 -c1 -A1 -a64 -d1 -K1 $INSTALLED_DRIVE > /dev/null # Performance tweak to speed up ext3 partitions with lots of files for volume in $(mount 2> /dev/null| grep ext3 | awk '{print $1}'); do logger " Enabled dir_index ext3 option for $volume" tune2fs -O dir_index "$volume" done # Enable dash as /bin/sh to run shell scripts instead of bloated bash # See https://launchpad.net/distros/ubuntu/+spec/dash-as-bin-sh if ( ! dpkg -l dash >/dev/null 2>&1 ); then apt-get install dash && update-alternatives --install /bin/sh sh /bin/dash 1 else update-alternatives --install /bin/sh sh /bin/dash 1 fi # Disable unnecessary services. # Remove any of these if you use them: hplip: hp printers, bluez-utils: bluetooth, pppd-dns: dialup users. for service in hplip ppp festival bluez-utils mdadm apmd brltty lvm evms pppd-dns waitnfs.sh; do logger " Disabled service $service" /etc/init.d/$service stop update-rc.d -f $service remove done # Disable more unnecessary services if the computer is not a laptop # Comment out this section if you are using a laptop for service in laptop-mode pcmcia pcmciautils; do logger " Disabled service $service" /etc/init.d/$service remove update-rc.d -f $service remove done logger " -===== Installation log finished on $(date) for faster-dapper.sh =====- " echo " -===== Installation finished on $(date) for faster-dapper.sh =====- " echo " " echo "Your installation of Ubuntu 6.06 Dapper Drake should run faster now..." echo "Please reboot your computer for some changes to take affect."