Various Ubuntu howto settings

Source: Internet
Author: User

* How do I add sudo permissions to a user?

Sudo VI/etc/sudoers

Join:Yulk all = (all) All


*Introduction and use of the/etc/skel framework directory in Linux

In Linux, the/etc/skel directory is often not noticed. In fact, this directory is useful when creating users. flexible use of this directory can save a certain amount of configuration time.
SKEL is short for skeleton, which indicates the skeleton and framework. Therefore, the directory is used to initialize the user root directory when creating a new user. The system copies all files and directories under this directory to the root directory of the new user, and changes the user owner and user group to the same root directory. Therefore, you can preset the user configuration file to the/etc/skel directory, such as. bashrc,. Profile and. vimrc.


* Domestic software sources

/Etc/APT/sources. List

Http://cn.archive.ubuntu.com/


* Clear the pull volumes generated after installation/uninstallation.

Sudo apt-Get autoremove // automatically unmount unused content

Sudo apt-Get autoclean // automatic cleanup, but temporary files downloaded for installation are not deleted

Sudo apt-Get clean // clear the downloaded temporary file

Directory in/var/Cache/APT/Archives

If no download is completed, go to/var/Cache/APT/archives/partial.


* MySQL

Sudo apt-cache search libmysql

Sudo apt-Get install mysql-server mysql-client libmysqlclient-Dev

Configure MySQL

Note: In ubuntu, MySQL only allows local access by default. If you want access from other machines, you need to change the/etc/MySQL/My. CNF configuration file! Next we will step by step:

After the default MySQL installation, the root user does not have a password. Therefore, use the root user to enter:

$ Mysql-u Root

-U root is used here because I am a general user (firehare). If-u root is not added, MySQL will assume that it is a firehare logon. Note: I have not entered the root user mode here because it is unnecessary. In general, it is not necessary to enter the root user mode to operate the database in MySQL. This is only possible when the database is set.

After entering MySQL, the most important thing is to set the root user password in MySQL. Otherwise, the MySQL service is no longer secure.

Mysql> grant all privileges on *. * to root @ localhost identified by "123456 ";

Note: I use 123456 as the root user password, but this password is not safe. Please use a password with a mix of uppercase and lowercase letters and numbers, and at least 8 characters.

In this case, the root user password in MySQL is set up, and then the database you need is created with the root user. Here we take xoops as an example:

Mysql> Create Database xoops;

Mysql> grant all privileges on xoops. * To xoops_root @ localhost identified by "654321 ";

In this way, a xoops_roots user is created, which has all permissions on the database xoops. In the future, we will use xoops_root to manage the xoops database, instead of using the root user. This user's permissions will only be limited to the xoops database.

If you want to implement remote access or control, you have to do two things:

1:

Mysql> grant all privileges on xoops. * To xoops_root @ "%" identified by "654321 ";

Allows the xoops_root user to log on to MySQL from any machine.

Second:

$ Sudo gedit/etc/MySQL/My. CNF

Earlier versions

> Skip-networking => # Skip-networking

New Version

> Bind-address = 127.0.0.1 => bind-address = IP address of your machine

This allows other machines to access MySQL.


Vim Chinese garbled characters

Source. Http://www.vimer.cn

Remote login to the server using Vim to edit and view files on the terminal often encounter various Chinese garbled characters.
Make the following settings to basically solve the problem of VIM Chinese garbled characters

First, check the system's support for Chinese characters.
Locale-A | grep zh_cn

The output sample is as follows:
Zh_cn.gbk
Zh_cn.utf8

Vim can only correctly identify Chinese encoding files in the list. To identify Chinese files of Other encoding types, you need to upgrade the system.

VI ~ /. Profile
Add at the end of the file

Export lang = "zh_CN.UTF-8" or "en_US.UTF-8"
Export lc_all = "zh_CN.UTF-8" or "en_US.UTF-8"

VI ~ /. Vimrc
Add at the end of the file

Let & termencoding = & Encoding
Set fileencodings = UTF-8, GBK, UTF-16, big5 (here is the priority to do the UTF-8 mode judgment, of course, can also give priority to GBK, here in my previous articles have said)

Modify securecrt settings
Options-> appearance character encoding to UTF-8
You can also modify the global configuration of appearance.
Options-> Global Options-> default sessions-> edit default settings-> appearance

Re-login securecrt use Vim to open the UTF-8 or GBK Encoded chinese files will not be garbled

More about Linux Localization
Http://www.linuxsir.org/bbs/thread312372.html

 


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.