Creating a perfect Linux operating system: Practical Tips

Source: Internet
Author: User
Tags mozilla thunderbird
Article Title: creating a perfect Linux operating system: Practical tips. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

The flexibility of Linux is manifested in multiple aspects. One of the ways to achieve the same goal and to quickly solve the problem is one of the manifestations. This also produces many tips. Here we will introduce some common tips.

  1. Restart the GNOME Desktop instead of restarting the computer

After saving and disabling the file to be saved, press Ctrl-Alt-Backspace to restart GNOME. If the Ctrl-Alt-Backspace key combination is disabled, enter

Sudo/etc/init. d/MCM restart

  2. Enable the numeric Lock Num Lock on the keypad when GNOME is started.

After joining the universe software library, use the new one to install numlockx
X11 (universe)> numlockx
If this classification is not available, search for this package, as shown in Figure 1:


Back up the/etc/X11/TPD/Init/Default file:

Sudo cp/etc/X11/mcm/Init/Default/etc/X11/mcm/Init/Default_backup

Edit/etc/X11/TPD/Init/Default:

Sudo gedit/etc/X11/mcm/Init/Default

Find this line (it should be the last line ).

Exit 0

Add

If [-x/usr/bin/numlockx]; then
/Usr/bin/numlockx on
Fi

Save the file. 2:


The change will take effect the next time GNOME is started. If you want to try it out immediately, you can disable Num Lock and restart GNOME without restarting your computer.

  3. automatically run the program at GNOME startup

This is similar to the boot program in Windows. Choose system> preference> session, select the Startup Program page, and use the add, edit, and delete buttons to manage the programs to be started at logon. 3:


   4. Switch to Terminal Mode

You can switch to the first terminal by using the Ctrl-Alt-F1 combination key. To switch back to the desktop, you can press the Ctrl-Alt-F7 key combination. A total of six terminals are available. Each of them corresponds to a Ctrl-Alt-F1 to a Ctrl-Alt-F6.

  5. Press Ctrl-Alt-Backspace to restart X.
  
Back up the/etc/X11/xorg. conf file.

Sudo cp/etc/X11/xorg. conf/etc/X11/xorg. conf_backup

Edit/etc/X11/xorg. conf.

Sudo gedit/etc/X11/xorg. conf

Add

Section "ServerFlags"
Option "DontZap" "yes"
EndSection

Save the file. The change will take effect the next time GNOME is started. If you want the change to take effect immediately, you can manually restart GNOME. 4:


   6. Use the non-browsing mode of Nautilus

In the Nautilus file browser, choose Edit> preference. Click the behavior tab. If this option is not selected, it is always opened in the browser window. Disable and re-open Nautilus. 5:


   7. show hidden items in Nautilus

By default, Nautilus, our file browsing tool, does not show hidden projects. You can use the Ctrl-H shortcut to switch between display and hide folders.

To permanently display hidden files, choose Edit> preference. Click view page. Select "show hidden and backup files ". 6:


  8. Browse files in Nautilus with root User Permissions

By default, our users have low permissions in Nautilus and it is inconvenient to manage files. Therefore, we can set the root user permission to browse files in Nautilus, create a new desktop configuration item in the/usr/share/applications directory:

Sudo gedit/usr/share/applications/Nautilus-root.desktop

Open blank Nautilus-root.desktop in Text Editor
Write in this file:

[Desktop Entry]
Name = File Manager (Super User)
Comment = Browse the filesystem with the file manager
Exec = gksudo "nautilus -- browser % U"
Icon = file-manager
Terminal = false
Type = Application
Categories = Application; System;

Save the file and close the file editor gedit. To start Nautilus as the Root user, choose Application> System Tools> File Manager (Root), as shown in Figure 7:


   9. view remote SSH, FTP, and SFTP servers in Nautilus

Use Ctrl + L to open the location bar of Nautilus and enter:

For SSH:

Ssh: // username@ssh.server.com

For FTP:

Ftp: // username@ftp.server.com

For SFTP:

Sftp: // username@sftp.server.com

Replace username with your username, and replace the @ with the server address. The system will ask you for a password if necessary. If you do not have a username (anonymous), you can omit the username and @ flag.

You can also enter a password, for example:

Ftp: // username: password@ftp.server.com

  10. display my computer, home directory, and recycle bin on GNOME Desktop

First, we have added the universe and multiverse software libraries. In the article "Creating a perfect linux system: hardware-related", we will provide a detailed tutorial to install the gtweakui program with the new version:

Gnome Desktop Environment (universe)> gtweakui

After the gTweakUI is installed, choose system> preference> gTweakUI-Nautilus. Check the Show computer icon, Show home icon, and Show recycle bin icon. This change takes effect immediately. 8:


Figure 8

   11. Change the default "open mode" of the file"

In Nautilus, right-click the file and choose Properties. The Properties dialog box is displayed. Click open mode. Some optional applications are listed here. You can select the default program you want to use. If the application you want to use is not in the list, you can use the Add button to add the application to the list. If you do not have a program, click "use custom command" to open an input column, enter the program name, or click "Browse" to find the program. 9:


Figure 9

   12. Change the default email client program to Thunderbird.

After installing Thunderbird, choose system> preference> preferred application, click the email reader page, select Custom in the Command box, enter mozilla-thunderbird % s, and close the page. 10:


0

   13. Add the option of opening a file as the root user in the right-click menu

Create an Open as root file

Gedit $ HOME/. gnome2/nautilus-scripts/Open \ as \ root

Add

For uri in $ NAUTILUS_SCRIPT_SELECTED_URIS; do
Gnome-sudo "gnome-open $ uri "&

Done

Save and continue input:

Chmod + x $ HOME/. gnome2/nautilus-scripts/Open \ as \ root

Right-click the file and choose Scripts> Open as root. You can add the "root User" option in the right-click menu to Open the file, as shown in 11:


1

  14. Do not use a buzzer for voice in Terminal Mode

The sound of the buzzer is too harsh, so turn it off: Open the terminal, select Application> System Tools> terminal, select Edit> edit the current configuration file in the toolbar, and select regular pages. Deselect the terminal bell check box. 12:


2

  15. Speed up Mozilla Firefox's Webpage Browsing

If you think firefox is not as fast as Windows in Linux, speed up Mozilla Firefox's Webpage Browsing. Choose Application> Internet> Firefox, enter about: config in the URL bar of the navigation bar, and find and change the following parameters in the filter:
*

Network. dns. disableIPv6-set the Value parameter to true.
*

Network. http. pipelining-sets the Value parameter to true.
*

Network. http. pipelining. maxrequests-sets the Value parameter to 8.
*

Network. http. proxy. pipelining-sets the Value parameter to true.
Restart Mozilla Firefox, as shown in Figure 13:


3

  16. Disable Mozilla Firefox from using a buzzer

Open the Application> Internet> Firefox. in Mozilla Firefox, enter about: config in the address bar.

The filter inputs accessibility. typeaheadfind. enablesound. The following figure shows accessibility. typeaheadfind. enablesound. Double-click it to select false, as shown in figure 14:


4

Restart Mozilla Firefox

  17. restore to the original Mozilla Firefox icon
  
If you like to use the Firefox icon of Mozilla Firefox, enter the following commands in the command line:
First, download the icon:

Wget-c/pic/18/a2006-1-11-436fox.png
Wget-c/pic/18/a2006-1-11-965ent.png

Change permissions:

Chmod 644 mozilla-firefox.png
Chmod 644 document.png
 
Replacement icon:

Sudo dpkg-divert -- rename/usr/share/pixmaps/mozilla-firefox.png
Sudo dpkg-divert -- rename/usr/share/pixmaps/mozilla-firefox.xpm
Sudo dpkg-divert -- rename/usr/lib/mozilla-firefox/icons/default. xpm
Sudo dpkg-divert -- rename/usr/lib/mozilla-firefox/icons/document.png
Sudo dpkg-divert -- rename/usr/lib/mozilla-firefox/chrome/icons/default. xpm
Sudo cp mozilla-firefox.png/usr/share/pixmaps/mozilla-firefox.png
Sudo cp mozilla-firefox.png/usr/share/pixmaps/mozilla-firefox.xpm
Sudo cp mozilla-firefox.png/usr/lib/mozilla-firefox/icons/default. xpm
Sudo cp document.png/usr/lib/mozilla-firefox/icons/document.png
Sudo cp mozilla-firefox.png/usr/lib/mozilla-firefox/chrome/icons/default. xpm

Press Ctrl-Alt-Backspace to restart GNOME. As shown in section 15:


5

   18. restore to the original Mozilla Thunderbird icon

If you like to use the falcon icon of Mozilla Thunderbird, enter the following commands in the command line:
First, download the icon:

Http://frankandjacq.com/ubuntuguide/mozilla-thunderbird.xpm wget-c

Change permissions:

Chmod 644 mozilla-thunderbird.xpm

Replacement icon:

Sudo dpkg-divert -- rename/usr/share/pixmaps/mozilla-thunderbird.xpm
Sudo dpkg-divert -- rename/usr/share/pixmaps/mozilla-thunderbird-menu.xpm
Sudo dpkg-divert -- rename/usr/share/pixmaps/mozilla-thunderbird-pm-menu.xpm
Sudo dpkg-divert -- rename/usr/lib/mozilla-thunderbird/chrome/icons/default/mozilla-thunderbird.xpm
Sudo dpkg-divert -- rename/usr/lib/mozilla-thunderbird/chrome/icons/default/messengerWindow16.xpm
Sudo dpkg-divert -- rename/usr/lib/mozilla-thunderbird/chrome/icons/default/messengerWindow. xpm
Sudo dpkg-divert -- rename/usr/lib/mozilla-thunderbird/chrome/icons/default. xpm
Sudo cp mozilla-thunderbird.xpm/usr/share/pixmaps/mozilla-thunderbird.xpm
Sudo cp mozilla-thunderbird.xpm/usr/share/pixmaps/mozilla-thunderbird-menu.xpm
Sudo cp mozilla-thunderbird.xpm/usr/share/pixmaps/mozilla-thunderbird-pm-menu.xpm
Sudo cp mozilla-thunderbird.xpm/usr/lib/mozilla-thunderbird/chrome/icons/default/mozilla-thunderbird.xpm
Sudo cp mozilla-thunderbird.xpm/usr/lib/mozilla-thunderbird/chrome/icons/default/messengerWindow16.xpm
Sudo cp mozilla-thunderbird.xpm/usr/lib/mozilla-thunderbird/chrome/icons/default/messengerWindow. xpm
Sudo cp mozilla-thunderbird.xpm/usr/lib/mozilla-thunderbird/chrome/icons/default. xpm

Press Ctrl-Alt-Backspace to restart GNOME. 16:


6

  19. Install/Delete the. deb package

If the downloaded installation file is a deb package, that is, the installation file for Ubuntu or Debian Linux (Ubuntu is based on Debain), you can use the following command to install the deb file:

Sudo dpkg-I package name. deb

Delete the. deb File

Sudo dpkg-r package name

  20. Convert the. rpm file to the. deb file.

You may need to install the Red Hat (Redhat Linux) installation package-rpm format, so you can easily convert it into a deb file for installation:

Sudo alien package_file.rpm

  21. Rename all files in the same folder at one time

Sometimes we need to rename all the files in the folder at a time, such as photos. Then we need mvb_1.6 to download it first:

Http://frankandjacq.com/ubuntuguide/mvb_1.6.tgz wget-c

Decompress the package to run:

Sudo tar zxvf mvb_1.6.tgz-C/usr/
Sudo chown-R root: root/usr/mvb_1.6/
Sudo ln-fs/usr/mvb_1.6/mvb/usr/bin/mvb

Enter a new mvb name on the terminal to rename all the files in the same folder at a time, as shown in figure 17:

  22. Set system environment variables

In many cases, we need to set the system environment variables, such as when using jdk. by editing the bash. bashrc file, we can achieve this goal:

Back up and edit:

Sudo cp/etc/bash. bashrc/etc/bash. bashrc_backup
Sudo gedit/etc/bash. bashrc

Add the corresponding environment variables at the end of the file. These variables are valid for the entire system. For example, if my jdk is on the desktop, add the following line:

JAVA_HOME =/home/aaron/Desktop/jdk1.5
Export JAVA_HOME
PATH = $ PATH: $ JAVA_HOME/bin
Export PATH

Save the file. Shown in October 18:


8

   23. output the man manual page to a file

It is too painful to see man in the command line. We can output it to a file like this:

Man command | col-B> file.txt

  24. Calculate the MD5 value of the file
  
Upload. md5 to facilitate Viewing:

Md5sum file.txt> file.txt. md5

  25. Check the MD5 value of the file.

Verify that the file.txt and file.txt. md5 files are in the same folder.
  
Enter

Md5sum-c file. iso. md5
  
You can.

26. Attach/detach a CD image file (ISO)

To mount a CD image file (ISO), you do not need to install a virtual optical drive similar to that in Windows. Enter the following command in the command line:

Create a directory/media/iso

Sudo mkdir/media/iso
Sudo modprobe loop
Sudo mount file. iso/media/iso/-t iso9660-o loop
  
We assume that file. iso is to be mounted.

To uninstall the CD image file (ISO), enter:

Sudo umount/media/iso/

  27. Change the reading time of the GRUB menu

If you think the GRUB menu is too fast or too slow to boot, we will adjust it as follows:

Sudo cp/boot/grub/menu. lst/boot/grub/menu. lst_backup
Sudo gedit/boot/grub/menu. lst

Menu. lst is equivalent to Windows boot. ini

Find

...
Timeout 3
...

Replace

Timeout the number of seconds you need

Save the file.

28. Change the default startup Item of GRUB

If you want to start Windows by default, change the following:

Sudo cp/boot/grub/menu. lst/boot/grub/menu. lst_backup
Sudo gedit/boot/grub/menu. lst

Find

...
Default 0
...

Replace

Default Windows Number

The number starts from 0. When you start the system, you will know the number of Windows. Save the file.

  29. Temporarily skip the startup of some services at startup

If a problem occurs when starting some services, causing too slow startup, Ctrl + C can temporarily skip the startup of some services.

  30. Permanently enable/disable a service

We can turn off unnecessary programs like in Windows, such as scheduled tasks and printing. Then we run the service settings: system> System Management> service. Ubuntu will ask for the password, enter your password, check/uncheck the service you want to run, and click OK. 19, as shown in the following figure:


9

31. Clear the/tmp/folder during shutdown.

Edit the sysklogd file:
Sudo cp/etc/init. d/sysklogd/etc/init. d/sysklogd_backup
Sudo gedit/etc/init. d/sysklogd

Find

...
Stop)
Log_begin_msg "Stopping system log daemon..." start-stop-daemon -- stop -- quiet -- oknodo -- exec $ binpath -- pidfile $ pidfile
Log_end_msg $ ?...

Add

Rm-fr/tmp/*/tmp /.?? *

Save the file.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.