Run programs on system startup on Linux Ubuntu/Mint

The programs that are run on system startup are managed in a special application on Linux. Open Startup Applications from the distribution's main menu to find a list of programs already being run everytime you log in - you have the option to enable or disable existing entries, edit or delete them and to create new ones - click on Add to do so.
A new window with three text fields will open:

Name: Enter the name of the entry that will be shown in the previous menu.
Command: Enter the terminal command that launches the program you want to start - to see if you got the correct one, test it in a terminal (e.g. firefox, nautilus). If you want to start a program with root privileges, append the gksu string before the program's name (e.g. gksu nautilus).
Comment: Enter the comment that will be shown below the name in the previous menu.

Click on Add afterwards and close the startup applications window. Reboot your machine to test the configuration.

Restore GRUB bootloader after Windows installation on multi-boot system

Windows operating systems have the habit of installing their own bootloader on every installation - this wouldn't be a problem, if they would recognize all present operating systems. But unfortunately, they only recognize other Windows systems.

Apart from installing EasyBCD and other tools on your Windows partition to set things right, you can also just reinstall the lost GRUB boot manager with the help of a live CD (I used Ubuntu 11.10 for that). Insert the CD and boot from it. Open a terminal. If you have no idea what the name of your partitions is, use

fdisk -l

to get an overview. My output looks like this:

christian-main christian # fdisk -l
Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000587d5
Device Boot Start End Blocks Id System
/dev/sda1 63 629147647 314573792+ 83 Linux
/dev/sda2 * 629147648 775948287 73400320 7 HPFS/NTFS/exFAT
/dev/sda3 775948288 968380415 96216064 7 HPFS/NTFS/exFAT
/dev/sda4 968382196 976768064 4192934+ 5 Extended
/dev/sda5 968382198 976768064 4192933+ 82 Linux swap / Solaris
christian-main christian #

My first partition, /dev/sda1, has Linux installed and is the partition I want to have GRUB on - what I need is its identifier, sda1. Replace every following instance of that identifier with the one of your partition's identifier. Become root by typing

sudo -i

Afterwards mount your partition and install grub (replace sda1):

mount /dev/sda1 /mnt
grub-install --root-directory=/mnt/ /dev/sda

If there is no grub.cfg in /boot/grub, create one using

mount --bind /proc /mnt/proc
mount --bind /dev /mnt/dev
mount --bind /sys /mnt/sys
chroot /mnt update-grub
umount /mnt/sys
umount /mnt/dev
umount /mnt/proc

Afterwards you can restart your system, remove the Live CD and boot into GRUB.

Change grub default boot option on Linux Ubuntu/Mint

Grub's default boot option is stored within a config file found on the partition where your Master Boot Record is located (if you had it installed previously, there may also be grub.cfg files on other partitions, but these won't effect boot sequence). Its direct path is /boot/grub/grub.cfg and it has to be opened as root, so enter following into a terminal:

sudo gedit /boot/grub/grub.cfg

The important parts of the file is the line saying set default="0" and the blocks beginning with menuentry:

menuentry 'Linux Mint 12 64-bit, 3.0.0-12-generic (/dev/sda5)' --class linuxmint --class gnu-linux --class gnu --class os {
set gfxpayload=$linux_gfx_mode
insmod gzio
insmod part_msdos
insmod ext2
set root='(hd0,msdos5)'
search --no-floppy --fs-uuid --set=root 7df91f6c-5351-4336-a3c5-eac1cf58efca
linux /boot/vmlinuz-3.0.0-12-generic root=UUID=7df91f6c-5351-4336-a3c5-eac1cf58efca ro quiet splash vt.handoff=7
initrd /boot/initrd.img-3.0.0-12-generic

These blocks are the entries that are displayed in the boot menu - they are indexed from 0 to n-1, n being the number of entries. To set the default entry, take its index and enter it into the set default="0" line, replacing 0 with the desired index. Afterwards save the file.

Defragment Boot Files on Windows 7

Apart from the usual file defragmentation on Windows 7, there is another undocumented function that rearranges boot files to grant faster access on them, resulting in shorter boot times. The usual boot options can be viewed by entering defrag -? into a command line window (this can be done in any command line window; to actually start the defragmentation however you need an elevated command prompt - therefore search for cmd in the menu, right-click it and choose Run as Administrator).
The one we need to use, the /b switch, is not listed there. This undoubtedly has its reasons and you should back-up files before you run it. Do not run it if you fear loss of data.

defrag /b C:

I hereby assume that C: is the drive you have your boot-files on. I ran the command on a Windows 7 Enterprise 64-bit machine and it worked flawlessly.
If upon entering the defrag command you get the errorcode 0x89000017, stating that some registry entries are missing, run the following in an elevated command prompt, wait up to 20 minutes and try again afterwards:

Rundll32.exe advapi32.dll,ProcessIdleTasks

This will initiate some services to start that usually only run when the system is idle, one of them being a service of Superfetch that needs to be run before the defrag /b command.

Save Time On Windows Start-up

To boot your Windows machine faster, it is possible to disable the graphical user interface used during system start-up (the Windows logo loading screen). To accomplish that, hit Windows key + R on your desktop to call a Run prompt and enter msconfig. On the appearing window, go to the Boot tab and activate the No GUI boot checkbox. Hit Apply and/or OK and reboot the machine afterwards for the changes to take effect.

Make Windows XP Boot a Lot Faster

There is a simple registry option in the Windows XP Registry that, if not altered, adds a delay time to the the XP boot process. However you can easily set this delay time to zero if you know where to look for it: Open the Windows Registry by entering regedit into a Run... prompt. The registry is parted in two frames, the one on the left containing a large list of keys and sub-keys, the one on the right displaying the keys' values. In the list of keys, browse the following:


Left-click the ContentIndex-key to see its values, look for StartupDelay and double-click to modify it.

The default value is the hexadecimal number 75300, which is the decimal number 480000. Leave the hexadecimal button active and just change the value to 0 (you can also pick another value; to see which hexadecimal value you have to take for a decimal number, just switch to decimal, enter the value and switch back again).
After making this change, close the registry and reboot Windows to see how fast it has become.

Set a custom boot message on Windows 7

On Windows 7 there is an option that displays a text message to the user of the computer on system start-up. This message is configurable in the Local Security Policy which you can access over the start menu's program search bar. Once in there, expand Local Policies on the left frame of the window and select Security Options. There, find the two entries named message title for users attempting to log on and message text for users attempting to log on.

As the names say, the value of the title message is later displayed as the title, same goes for the text. The text can hold an infinite amount of lines and approximately 94 characters in one line. Close the window after you have specified your desired entries.

Both of these settings are also available in the Windows Registry. To find them, open the registry by typing regedit into the Run... prompt and browse the HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\Current Version\Policies\System key. There, the legalnoticecaption and the legalnoticetext values are stored. These are the registry storages for the values you entered in the Local Security Policy window.