Monday, November 13, 2006

Mount the LAN Disk as Local Disk to Use

Source: http://myy.helia.fi/~karte/linux_as_a_client_to_windows_smb_shares.html

1. make the mount point. For me,
mkdir /media/depart

2. Edit authentication file
vi ~/sambapass
Then add the following content
username = minwang
password = password
domain = WORKGROUP

3. Mount the device:
sudo mount -t smbfs -o credentials=~/sambapass,uid=minwang,gid=root,dmask=700,fmask=700 //smb/minwang /media/depart

If receive the following error message: "mount: wrong fs type, bad option, bad superblock ...", it means smbfs not installed. Run
sudo apt-get install smbfs

Install LAN Printer

I successfully installed the printer from the department network today. Just open System -> Administration -> Printing. Then Add New Printer, select Network Printer (Windows Printer SMB) because of departmental setting. Host is "smb", printer is "lw.411" for our floor. Select the right printer model and done (no need to install the driver). See, it's very easy.

Maybe I can also use the CUPS Printer (IPP) type, but I haven't tried.

Saturday, November 11, 2006

Install QQ and MSN

aMSN can be used as substitution of MSN. (automatrix can install it automatically.)


Sources: http://www.linuxsir.org/bbs/showthread.php?t=278410

For QQ, there are three choices:
  1. Gaim. Can only be used to chat.
  2. LumaQQ. Most same as the original one.
  3. Cyclone.
  4. Eva
Here we mainly talk about the installation of LumaQQ.
  1. Download the package from www.lumaqq.linuxsir.org
  2. sudo tar -xzvf lumaqq_2006M2-linux_gtk2_x86_no_jre.tar.gz -C /opt
  3. sudo chmod -R 755 /opt/LumaQQ/
  4. sudo gedit /usr/share/applications/LumaQQ.desktop
Add following content to it:
[Desktop Entry]

Name=LumaQQ

Comment=QQ Client

Exec=/opt/LumaQQ/lumaqq

Icon=/opt/LumaQQ/QQ.png

Terminal=false

Type=Application

Categories=Application;Network;

Now you can find it Applications -> Internat -> LumaQQ and launch it.

Make Them All Easy

Source: http://www.getautomatix.com/

Automatix is a graphical interface for automating the installation of the most commonly requested applications in Debian based linux operating systems.

Installing on (K,X)Ubuntu 6.06 i386,amd64 (Dapper)

Edit your sources.list:

sudo gedit /etc/apt/sources.list

from terminal. Add the following to your sources.list:

 deb http://www.getautomatix.com/apt dapper main

Now from terminal do the following:

wget http://www.getautomatix.com/apt/key.gpg.asc gpg --import key.gpg.asc
gpg --export --armor 521A9C7C | sudo apt-key add -

To finish off:

sudo apt-get update sudo apt-get install automatix2

After successful Installation, Automatix can be found in Applications --> System Tools on Ubuntu and Main Menu --> System.

Now just choose the software you want (maybe non-free) to install and make your life easier. See, it contains almost all common tools in Windows.

Capabilities

  1. Acrobat Reader (Adobe Acrobat Reader and plugin for Firefox 1.5)
  2. AMSN 0.95 (MSN client with webcam support)
  3. Amule (Latest version of a P2P file sharing client)
  4. Archiving Tools (Additional archiving tools (rar, unrar, ace, and 7zip))
  5. AUD-DVD codecs (NON-FREE Audio and DVD codecs) (Installation of this option is illegal in the United States of America)
  6. Avidemux (Video Editing Tool)
  7. Azureus (Installs Azureus bittorrent client)
  8. Backup and Restore (A graphical backup and restore solution for Ubuntu (GNOME))
  9. Beagle (A Mono-based search program)
  10. Bittornado (Bittorent Client)
  11. Boot-up Manager (Easy configuration of startup and shutdown scripts and services)
  12. Checkgmail (A nifty gmail checker)
  13. Ctrl-Alt-Del (This configures Ctrl-Alt-Del to Open Gnome System Monitor (GNOME ONLY))
  14. DCPP (Linux DC++ client)
  15. Debian Menu (Shows all installed applications on your system)
  16. Democracy Player (Internet TV platform)
  17. DVD Ripper (DVD ripper)
  18. Extra Fonts (Additional fonts and msttcorefonts)
  19. Flashplayer (Adobe Flash Player for FF)
  20. Frostwire (P2P file sharing client (GPL clone of Limewire))
  21. Gdesklets (eyecandy for Gnome)
  22. Gaim 2.0 beta3 (The latest version of a popular IM client compatible with YIM/MSN/AIM/Jabber etc)
  23. GFTP (FTP client for GNOME with ssh capability)
  24. Gizmo Project (VoIP phone)
  25. Gnomebaker (The best GTK2 CD/DVD burning software)
  26. GnomePPP (Graphical dialup connection tool (GNOME ONLY))
  27. GnuCash (Money management software for GNOME)
  28. Google Earth (Satellite Earth imagery application from Google)
  29. Google Picasa (Photo editing application from Google)
  30. iLinux (iLife Alternative (Banshee, F-Spot, Kino))
  31. Liferea (A RSS reader for GNOME)
  32. Listen Media Manager (Latest version of a new media manager and player for GNOME)
  33. Media Players (Totem-xine, VLC and Beep Media Player (with docklet))
  34. MPlayer & FF plugin (MPlayer and Firefox 1.5 plugin)
  35. Multimedia Codecs (Commonly needed audio and video codecs)
  36. Multimedia Editing (Audio (Audacity) Video (Kino) and ID3 Tag (Easytag) editors)
  37. Nautilus Scripts (Open Nautilus, and any file with gedit with a right click, as root (GNOME ONLY))
  38. NDISWrapper (A driver wrapper that allows you to use Windows driver for network cards)
  39. Network Manager (A program and menu applet that allows you to easily change networks)
  40. NVIDIA Driver (Installs NVIDIA drivers on select NVIDIA cards)
  41. Opera Browser (Opera Web Browser)
  42. OpenOffice Clipart (clipart in OpenOffice)
  43. Programming Tools (Anjuta (C/C++ IDE), Bluefish (HTML editor), Screem (web development), NVU (HTML editor)
  44. RealPlayer (RealPlayer)
  45. Rhythmbox (Latest version of Rhythmbox)
  46. Ripper and Tuner (Streamripper (rips Internet radio streams) and Streamtuner (Internet radio client))
  47. Security Suite (ClamAV AntiVirus and Firestarter Firewall)
  48. Skype (A free (as in free beer) Voice Over IP software)
  49. Slab (Novell's "Slab" menu used in SLED 10)
  50. SUN JAVA 1.5 JRE (Sun's version 1.5 JRE & The Firefox plugin)
  51. SUN JAVA 1.5 JDK (Sun's version 1.5 JDK (Most users DONT need this))
  52. Swiftfox Browser (optimized Firefox browser for your specific CPU)
  53. Swiftfox Plugins (Java, Flash, Acrobat, Mplayer, MS fonts)
  54. Thunderbird 1.5 (Email client)
  55. Wine (Installs Wine)
  56. XChat (a popular IRC client)


Friday, November 10, 2006

Make an MAC Outlook

Source: http://www.taimila.com/

Let's start with some basic concepts. Gnome desktop has three different themes, which you can change (System -> Preferences -> Theme -> Details). These are Controls, Window Border and Icons. Even only by changing them, you can get a very nice desktop. There are many themes available and you can find most of them at Gnome-look. You can of course use any theme you like, but in this guide we are making OSX look-a-like and we must select the best ones for our purpose.

Download the following themes from Gnome-look. The first one includes the theme for window decorator and for controls. And the second one has a lot of OSX style icons.

After you have downloaded these packages go to "System -> Preferences -> Theme". System menu can be found at the left upper corner of your screen. Select "Install Theme..." and browse to the folder where you just downloaded packages above. After the installation of both of them, select T-ish from theme list and OSX icons from icon list (details of theme). It's a good start, but why stop here!

I have only few icons on my desktop and they are pretty big as you can see from the screenshots. I use Innex icons theme on desktop icons. I also recommend you to download OS-L iconset even though it's for KDE. It still contains many nice icons which you can use in menus or in your application launchers. (This part is optional, because we already have a set of icons)

Gnome panel customizing

Let's begin with the bottom panel. Our aim is to have a panel which contains only application launchers.

The first step is to remove all the other elements from the panel. In default ubuntu installation there are Recycle bin, Taskbar, desktop switcher and show desktop -button. These are added later to the top panel so don't worry. You can remove these elements by clicking right mouse-button on them and selecting "Remove from panel" from pop-up menu. Now you have empty gray panel. Next click right mouse-button on the empty panel and select "Properties". Change the Size of the panel to 50 and remove all the ticks form the selectionboxes (See screenshot). Then change to Background tab and select "Solid color". Change the Color to white, if it's not already, and move "Style" slider like in this screenshot. Now the panel is ready. Next we just add icons (application launchers) to it. You can simply drag and drop the icons from the desktop. Another way is to click right mouse-button on the panel and select "Add to panel...". Select "Custom application launcher" from the window and fill Name, Command and select some beatiful icon. You can also write a short comment about the program, if you will. (See screenshot)

The Top panel is little more trickier than bottom panel. But I choose not to change it except adding some panels back.

One stop solution

Of course, we can download complete themes directly and install them. Then we can modify in "Theme Details" as we like. Now I'm using MacOS-X Aqua Theme from http://www.gnome-look.org/content/show.php?content=13548

Later on, we can change the thems or icons manuall at
~/.themes
~/.icons

PS: the following site aims to provide a more mac-like dock which is still in progress but promising: http://www.gnome-dock.org/trac

How to change icons manually

We should first look at the theme definition files in the folder ~/.themes/. To change the icons, we then goto the corresponding folder (name is specified in theme definition) in ~/.icons.

Now replace the unwanted icons in it can achieve the aim. However, we can get substituting sources from the following locatiosn:
  1. /usr/share/icons/
  2. /usr/share/pixmaps
  3. Internet of course


Thursday, November 09, 2006

Adding More Chinese Fonts

  • Get the following fonts from somewhere (c:\windows\fonts)
simsun.ttc --- 宋体和新宋体
tahoma.ttf --- tahoma字体
tahomabd.ttf --- tahoma字体的粗体形式
verdana.ttf --- verdana字体
verdanab.ttf --- verdana字体的粗体形式
verdanai.ttf --- verdana字体的斜体形式
verdanaz.ttf --- verdana字体的粗体+斜体形式
simfang.ttf --- 仿宋体
simhei.ttf --- 黑体
simkai.ttf --- 楷体

and
sudo cp * /usr/share/fonts/zh_CN/
  • Update font cache
cd zh_CN
sudo mkfontscale
sudo mkfontdir
sudo fc-cache

  • Modify the config file, replace the content of it:
gedit /etc/fonts/language-selector.conf





serif



Bitstream Vera Serif
SimSun
DejaVu Serif
AR PL ShanHeiSun Uni
AR PL ZenKai Uni







sans-serif



Bitstream Vera Sans
Simsun
DejaVu Sans
AR PL ShanHeiSun Uni
AR PL ZenKai Uni








monospace



Bitstream Vera Sans Mono
Simsun
DejaVu Sans Mono
AR PL ShanHeiSun Uni
AR PL ZenKai Uni









SimSun
Song
Sun
Kai
Ming


100




180





true







SimSun
宋体
宋体-18030
Song
Sun
Kai
Ming
黑体
新宋体
新宋体-18030
楷体_GB2312
仿宋_GB2312
隶体
SimSun-18030
SimHei
NSimSun
NSimSun-18030
KaiTi_GB2312
FangSong_GB2312
LiSu




false





0





true





false





true





12




24




false





  • Restart X Windows
PS: can run "fontconfig" command to check and set fonts.

Upgrading to Higher Version of Ubuntu

Source: https://help.ubuntu.com/community/EdgyUpgrades

Upgrading using Update Manager

If you want to upgrade from 6.06 LTS to 6.10, run the following command (either via ALT-F2 or a terminal):

gksu "update-manager -c" 

The -c switch instructs Update Manager to look for upgrades. By default, the Ubuntu 6.06 LTS release will not offer that automatically because of its long support cycle and high stability.

If you have a working network connection, it should then inform you about a new release and offer to upgrade your system.

If you have the Edgy Alternate Install CD (not the Desktop CD), you can save bandwidth by using:

gksu "sh /cdrom/cdromupgrade"


Wednesday, November 08, 2006

File Sharing in LAN

How to change computer Domain/Workgroup

sudo cp /etc/samba/smb.conf /etc/samba/smb.conf_backup
gksudo gedit /etc/samba/smb.conf
  • Find this line
             ...
workgroup = MSHOME
...
  • Replace with the following line
             workgroup = new_domain_or_workgroup
  • Save the edited file
             sudo testparm
sudo /etc/init.d/samba restart

How to share folders the easy way

  • Right click on folder -> Share folder
  • Shared folder -> Share with: Select "SMB"
  • Share properties -> Name: Specify the share name

How to browse network computers

  • Places -> Network Servers

How to access network folders without mounting

Assumed that network connections have been configured properly
Network computer's IP: 192.168.0.1
Shared folder's name: linux
  • Press 'Alt+F2' (Run Application...) and enter:
smb://192.168.0.1/linux

How to mount/unmount network folders manually, and allow all users to read/write

Assumed that network connections have been configured properly
Network computer's IP: 192.168.0.1
Network computer's Username: myusername
Network computer's Password: mypassword
Shared folder's name: linux
Local mount folder: /media/sharename
  • To mount network folder
      sudo mkdir /media/sharename
sudo mount //192.168.0.1/linux /media/sharename/ -o username=myusername,password=mypassword,dmask=777,fmask=777
  • To unmount network folder
      sudo umount /media/sharename/

How to mount network folders on boot-up, and allow all users to read/write

sudo mkdir /media/sharename
gksudo gedit /root/.smbcredentials
  • Insert the following lines into the new file
      username=myusername
password=mypassword
  • Save the edited file
     sudo chmod 700 /root/.smbcredentials
sudo cp /etc/fstab /etc/fstab_backup
gksudo gedit /etc/fstab
  • Append the following line at the end of file
     //192.168.0.1/linux    /media/sharename smbfs  credentials=/root/.smbcredentials,dmask=777,fmask=777  0    0
  • Save the edited file

Install Sun JDK

1. Search for Sun JDK in package manager, and then install it.

2. Try running the command

sudo update-alternatives --config java

and choose a default java of your liking.

3. Set Sun's JVM as default Java version:

sudo update-java-alternatives -s java-1.5.0-sun

4. Edit /etc/jvm and move /usr/lib/jvm/java-1.5.0-sun to the top of JVMs offered:

sudo gedit /etc/jvm

5. Configure the Eclipse.
There is a bug right now were Eclipse ignores Ubuntu's java-common settings and uses its own (bug 45347). To work around the bug, you need to edit Eclipse's java_home file:

sudo -b gedit /etc/eclipse/java_home

and add

/usr/lib/jvm/java-1.5.0-sun

to the top of the file.

If this still not work, just add the new JRE at Eclipse Global Settings.

HowTo: Speed up ubuntu boot process

Source: http://doc.gwos.org/index.php/Speed_up_boot

The following tool gives you a way to easily configure the boot process and runlevel configuration, but it's not necessary if you want to do it manually by linking/unlinking the files... Its up to you.

sudo apt-get update
sudo apt-get install sysv-rc-conf


Now let's fire it up by

sudo sysv-rc-conf

and analyze each service one by one.

Throw a little bit of runlevel knowledge here before we start messing them up.... All the boot processes are executed in sequence as following:

  • runlevel S: the first runlevel in boot process. /etc/init.d/rcS script will be invoked to start and all the processes underneath /etc/rcS.d will be executed.
  • runlevel 1: The single user mode. All processes underneath /etc/rc1.d will be executed.
  • runlevels 2, 3, 4 and 5: In Debian systems the multi-user environment may or may not include GUI. The same processes under each of the corresponding directories will be run. **Note** This is different than RedHat, SuSE, and other RPM-based systems.
  • runlevel 0: computer shutdown.
  • runlevel 6: computer reboot.

Okay, back to sysv-rc-conf:

1. acpi-support - You'd better leave it on "X" at S runlevel.

2. acpid - The acpi daemon. These two are for power management, quite important for laptop and desktop computers, so leave them on.

3. alsa - If you use alsa sound subsystem, yes leave it on.

4. alsa-utils - On my system, this service supercedes the alsa, so I turn off the alsa and turn this on at S level. **Note**, I mean "turn off" is to remove all "X" at all runlevels. If you don't have it on your system, no problem. Just keep going.

5. anacron - A cron subsystem that executes any cron jobs not being executed when the time is on. Most likely you've probably turned your computer off when a certain cron job time is ready. For example, if updatedb is scheduled at 2am everyday, but at that moment your computer is off, then if the anacron service is on, it will try to catch up that updatedb cron... I turn it off cause it didn't turn my laptop off very often, but its totally up to you for this one.

6. apmd - This is the one that confused me a quite bit. I have acpid on already and what's the benefits of having apmd on too? If you computer is not that old which can't even support acpi, then you may try to turn this off. I did anyway.

7. atd - like cron, a job scheduler. I turned it off.

8. binfmt-support - Kernel supports other format of binary files. I left it on.

9. bluez-utiles - I turned it off. I don't have any bluetooth devices.

10. bootlogd - Leave it on.

11. cron - Leave it on.

12. cupsys - subsystem to manager your printer. I don't have so I turned it off, but if you do, just leave it on.

13. dbus - Message bus system. Very important, leave it on.

14. dns-clean - Mainly for cleaning up the dns info when using dial-up connection. I don't use dial up, so I turn it off.

15. evms - Enterprise Volumn Management system. I turned it off.

16. fetchmail - A mail receving daemon. I turned it off.

17. gdm - The gnome desktop manager. I turned it off anyway since I get use to boot to console first. This is up to you if you want to boot directly to GUI.

18. gdomap - Actually I have no idea why this one should on. I didn't see any other systems have this daemon, so I turned it off and I don't feel I lose anything. Any benefits to have it on a loptop or desktop?

19. gpm - Mouse support for console. If you feel you'd better have a mouse on console, go turn it on at runlevel 1 and 2. That's all you need.

20. halt - Don't change it.

21. hdparm - tuning harddisk script. I removed the 2, 3, 4, 5 runlevel but add it to S runlevel. I feel that opening DMA, 32bit I/O, etc eariler will benefit the rest of the processes. Also I changed the original script to a very simple one that I made myself. I feel useless to put all those redundant checks if I know what I am doing. The configuration file is /etc/hdparm.conf.

22. hibernate - If your system support hibernate, leave it on. Otherwise, its useless for you.

23. hotkey-setup - This daemon setup some hotkey mappings for Laptop. Manufacturers supported are: HP, Acer, ASUS, Sony, Dell, and IBM. If you have a laptop in those brands, you can leave it on, otherwise, this might not have any benefits for you.

24. hotplug and hotplug-net #activating hotplug subsystems takes time. I'd consider to turn them off. I did some changes in my /etc/network/interfaces file. Instead of mapping my wireless card during hotplug process, I set it up to auto. So I can turn them off. I've tested even I turned them off, ubuntu can still detect my usb driver, my digital camera, etc. So I think its pretty safe to turn them off. **Note** If you find your sound card doesn't work after turning hotplug service off, you can turn it back. Or edit /etc/modules file to add your sound card's driver module. Tested out the later one is faster.

25. hplip - HP printing and Image subsystem. I turned it off.

26. ifrename - network interface rename script. Sounds pretty neat but I turned it off. Mainly for managing multiple network interfaces names. Since I have a wireless card and an ethernet card, they all assigned eth0 and ath0 from kernel, so its not really useful for me.

27. ifupdown and ifupdown-clean - Leave it on. They are network interfaces activation scripts for the boot time.

28. inetd or inetd.real - take a look your /etc/inetd.conf file and comment out any services that you don't need. If there aren't any services there, then it's very safe to turn them off.

29. klogd - Leave it on.

30. linux-restricted-modules-common - You need to see if you really have any restricted modules loaded on your system. Since I need madwifi ath_pci module, so I left it on. The restricted modules can be found from /lib/linux-restricted-modules. If you find that you are not using any of the restricted modules, then its ok to turn it off.

31. lvm - I don't use it so I turned it off. Leave it on if you *DO* have lvm.

32. makedev - Leave it on.

33. mdadm - Raid management tool. I don't use it so I turned it off.

34. module-init-tools - Load extra modules from /etc/modules file. You can investigate your /etc/modules file and see if there is any modules that you don't need. Normally, this is turned on.

35. networking - bring up network interfaces and config dns info during boot time by scaning /etc/network/interfaces file. Leave it on.

36. ntpdate - Sync time with the ubuntu time server. I don't need it on boot time so I turned it off.

37. nvidia-kernel - I compiled the nvidia driver by myself, so its useless for me now. If you use the ubuntu nvidia driver from the restrict modules, just leave it on.

38. pcmcia - Active pcmcia device. I changed it to start on S runlevel instead of on each 2,3,4,5 cause I feel it's better to have hardware device ready at first. Also, useless if you are using desktop which doesn't have pcmcia card. So in that case, turn it off please.

39. portmap - daemon for managing services like nis, nfs, etc. If your laptop or desktop is a pure client, then turn it off.

40. powernowd - client to manage cpufreq. Mainly for laptops that support CPU speed stepping technology. Normally, you should leave it on if you are configuring a laptop, but for desktop, it might be useless.

41. ppp and ppp-dns - Useless to me. I don't have dial-up.

42. readahead - **Thanks mr_pouit!** It seems readahead is a kind of "preloader". It loads at startup some libs on memory, so that some programs will start faster. But it increases startup time for about 3-4 seconds. So, you can keep it... or not . **update** I tested and I just didn't feel difference loading programs. So I decided to turn it off. If you have a reason to keep it on, please do so.

43. reboot - Don't change it.

44. resolvconfresolvconf - Automatically configuring DNS info according to your network status. I left it on.

45. rmnologin - Remove nologin if it finds it. It wouldn't happen on my laptop, so I got rid of it.

46. rsync - rsync daemon. I don't use it on my laptop, so turned it off.

47. sendsigs - send signals during reboot or shutdown. Leave it as it is.

48. single - Active single user mode. Leave it as it is.

49. ssh - ssh daemon. I need this so I turned it on.

50. stop-bootlogd - stop bootlogd from 2,3,4,5 runlevel. Leave it as it is.

51. sudo - check sudo status. I don't see any good to run it every time on a laptop or desktop client, so I turned it off.

52. sysklogd - Leave it as it is.

53. udev and udev-mab - Userspace dev filesystem. Good stuff, I left them on.

54. umountfs - Leave it as it is.

55. urandom - Random number generator. Might not useful but I left it on.

56. usplash - Well, if you really want to see the nice boot up screen, leave it as it is. I just turned it off anyway. If you want to turn it off, you also need to edit /boot/grub/menu. lst file to comment out the splashimage line and get rid of the splash kernel boot option.

57. vbesave - video card BIOS configuration tool. It's able to save your video card status. I left it on.

58. xorg-common - setup X server ICE socket. I moved it from starting at runlevel S to runlevel 2,3,4,5. Since I don't need this if I boot to single user mode. This way it wouldn't occupy time during the initial booting.

III. Alter the /etc/inittab file

file.pngCode:

vi /etc/inittab


then comment out tty4,tty5, and tty6. Just leave tty1, tty2, and tty3. Three vts should be enough for a laptop or desktop user. Save the file.

IV. Ok, now, we can reboot our box and see how it goes. From what I've tested, before I got tons of services stopped, the whole process is about 85 secs to 90 secs to boot to console. (At that time, I also has samba and nfs services turned on which I shouldn't. Apparently, I turned them off too). After this change, the whole boot up process took about 50 secs. I have a P4M 1.8G CPU laptop. Some of the high-end desktops or laptops should take even less time.

    • UPDATE**: speed up/clean system reboot or shutdown process.

1. start sysv-rc-conf by issuing:

file.pngCode:

sudo sysv-rc-conf


2. ok, open your eyes and look very carefully for those SERVICES DO NOT HAVE "X" ON ALL RUNLEVELS (All runlevel means 1,2,3,4,5,6, and S), write them down one by one. Don't make mistakes here. Double check after you've done.

3. quit sysv-rc-conf.

4.

file.pngCode:

cd /etc/rc0.d


- This is for the system shutdown process.

5. ok, now,

file.pngCode:

ls K*


will list all links starting from UPPERCASE letter "K". Compare with your list, change each of the filename containing the service name in your list to start from a lowercase "k". For example, in your list, you have ppp service (which means ppp is turned off at all runlevels), then you can do like:

file.pngCode:

sudo mv K00ppp k00ppp


You just change the UPPERCASE K to lowercase k, keep the rest the same. Do this on all of the services in your list.

6.

file.pngCode:

cd ../rc6.d


- This is for the system reboot process.

7. ok, you should see similar things here too. So do the same thing here as you did on rc0.d.

8. Now, you reboot and shutdown process should be cleaned up and faster.

The explanation for what you did is pretty simple. The /etc/rc and /etc/rcS scripts run start on each link on each runlevel by scanning if it is starting with a UPPERCASE "S" and run stop on each by scanning if it is starting with a UPPERCASE "K". So for reboot and shutdown runlevels, the most thing we care is the "K" links cause for those services not running on all runlevels, it's just not needed to stop them. They are not running at all. If some day you want to turn some of the services back on, just change the lowercase "k" to UPPERCASE "K". That's all.

Anyway, it is not intended to work on servers, but I did try on one of my servers has 2.7G P4 and 1.5G mem. It brought the boot process down to 31 secs. I calc'ed it with my watch. Besides, this is with my ftp server and nfs server started on boot time.




Cleaning up all those unnecessary junk files

1) Tip #1 - Getting rid of Residual Config packages
Residual Config packages are usually dependency packages that are
left behind after you uninstall a package from your machine. To use this
feature, go to System > Administration > Synaptic Package Manager.
On the bottom left hand corner of the window, click the Status button.
In the list above the Sections, Status, Search, and Custom buttons, Click
on the "Residual config" text. To get rid of these pests, click on the
box to the left of the package name and select "Mark for Complete Removal".
After you have done that for all of the Residual Config packages, click
"Apply".
2) Tip #2 - Getting rid of partial packages
in the Terminal, key in the following command:
sudo apt-get autoclean
3) Tip #3 - Getting rid of "orphaned" packages
Download the "deborphan" package found in Synaptic Package Manager. Then:
sudo deborphan | xargs sudo apt-get -y remove --purge

Backing Up and Restoring Your Boot Sector

When GRUB runs, the boot sector part of your hard disk contains information about which OS you can boot. This sector sometimes gets corrupted due to a system crash or power loss and your computer won't boot. Luckily, with a few carefully chosen commands, you can back up and restore this important sector.
Back it up using this command:

foo@bar:~$ sudo dd if=/dev/hda of=MBR-backup bs=512 count=1

The dd command copies the sector from the first disk (/dev/hda-change this to your disk) and saves it as MBR-backup in the current directory.

When referring to boot sectors you may see it prefixed as MBR-this is short for master boot record. To restore the sector, run this command:

foo@bar:~$ sudo dd if=MBR-backup of=/dev/hda bs=512 count=1

When you boot your computer in rescue mode, you can use these command to manage your boot sector.

I Have Reinstalled Windows, and Now Ubuntu Won't Start!

The first thing your computer does when you turn it on is read a special place on your hard disk called the master boot record (MBR). The information written there tells the computer what to do next. When you installed Ubuntu, it placed a boot menu on the MBR that lets you choose from which system to boot.

Unfortunately, when you reinstall Windows it will recreate the MBR, not taking into consideration that any other OS may exist and replacing it with an MBR that only boots Windows. This is no good, and you naturally want to be able to replace it with the menu that lets you choose which system to boot.

Grab the CD you used to install Ubuntu on your computer. If you don't have it anymore, download a CD image from www.Ubuntu.com/download, and burn it on a blank CD. If you used the live CD to install, you will need to use the alternative installation CD with the traditional text mode installer.

Insert the CD in the drive, and restart your computer. It will boot on the CD instead of using the hard disk as usual. Now highlight the Rescue a Broken System line, and press Enter. Select your language and keyboard, and let the installer detect the network (for the computer name, you can leave the default Ubuntu) just like when you installed Ubuntu for the first time.

You will then be presented with a list of available partitions on your hard disks. Don't worry about the first line (/dev/discs/disc0/part1). Start looking at the other lines. You need to remember on which disk and on which partition Ubuntu is installed. Most of the time, you probably have just one disk. If you have Windows installed on it, it is probably located on the first partition of this disk, and Ubuntu should be on the second one. Therefore, you probably want to select /dev/discs/disc1/part2 (then press Enter), unless your situation is more complex.

On the last screen, select the first line Execute a shell in .... You can now enter commands. Start by mounting the disks on your system:

foo@bar:~# mount -a

Now type:

foo@bar:~# df

Look at the list printed on the screen. Search the last column for the single / character, and on the corresponding line look for the first column. It should say something such as /dev/hda2 (the last few characters may be different for you). Now type the following command, and replace /dev/hda with what you have just read, but without the last digit (/dev/hda instead of /dev/hda2 in the above example):

foo@bar:~# grub-install /dev/hda

Wait for the process to finish. It might take a few minutes. About a dozen lines should have appeared on the screen. Check whether you find the text 'installation finished'. If you do, everything went fine. You can now restart your computer by typing

foo@bar:~# exit

Eject the CD, and then select Reboot the System. Welcome back to Ubuntu!

I Forgot My System Password-What Can I Do?

Although passwords are indefinably essential and useful, they are also prone to being forgotten. With an increasing number of nasties out there on the Internet wanting to suck your password away, you need to think of more complex passwords, which are in turn harder to remember and easier to forget.

If you forget the system password, you need to jump through a few more hoops to reset your password. Reset your computer and when you see the word GRUB appear on the screen, press Escape to see the boot menu. Select the recovery mode option from the menu. When the computer boots it will present you with a root shell. At the prompt type:

foo@bar:~# passwd

Follow the prompts to set a new password. Finally, reboot the computer with the following command:

foo@bar:~# reboot


Tuesday, November 07, 2006

Setting my Ubuntu

I decided to move from windows to Linux world. After I installed the Ubuntu, there come several problems and I posted the answers as follows:
1. Acrobat Reader
acroread is conflict with SCIM. So modify the starting script:
/usr/lib/Adobe/Acrobat7.0/bin/acroread
by adding the following setting:
export GTK_IM_MODULE=xim

2. Setting SCIM
1) Open system to install the support package corresponding to
the language you want to input at:
System>Administration>Language Support
2) then log out (System>Quit>Log Out), and login again, now SCIM
can be used in some sessions
3) gedit ~/.scim/global
add or modify the line (not forgetting you need to add the full
name reported by `locale | grep LANG= after LANG=` ):
/SupportedUnicodeLocales = en_US.UTF-8,en_GB.UTF-8
4) Log out, then log in and you should be able to use SCIM input
in every application

3. Set Default Application
1) Right-click on a file of the type you wish to set a default
application to open it with
2) Select Properties
3) Select the Open With tab
4) Select the application you want associated with that file-type and OK