mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-03-21 02:10:11 +08:00
20150211-2 选题
This commit is contained in:
parent
ba830d522c
commit
58f75899dc
@ -0,0 +1,229 @@
|
||||
Best Known Linux Archive / Compress Tools
|
||||
================================================================================
|
||||
Sending and receiving large files and pictures over the internet is a headache many times. Compression and decompression tools are meant to address this problem. Lets take a quick overview of a few open source tools that are available to make our jobs simpler.
|
||||
|
||||
Tar
|
||||
gzip, gunzip
|
||||
bzip2, bunzip2
|
||||
7-Zip
|
||||
|
||||
### Tar ###
|
||||
|
||||
Tar is derived from 'Tape archiver' as this was initially used for archiving and storing files on magnetic tapes. It is a GNU software. It can compress a set of files (archives), extract them and manipulate those which already exist. It is useful for storing, backing up and transporting files. Tar can preserve file and directory structure while creating the archives. Files archived using tar have '.tar' extensions.
|
||||
|
||||
Basic Usage
|
||||
|
||||
#### a) Creating an archive (c / --create) ####
|
||||
|
||||
tar --create --verbose --file=archive.tar file1 file2 file3
|
||||
|
||||
OR
|
||||
|
||||
tar cvf archive.tar file1 file2 file3
|
||||
|
||||

|
||||
|
||||
creating an archive
|
||||
|
||||
#### b) Listing an archive ( t / --list) ####
|
||||
|
||||
tar --list archive.tar
|
||||
|
||||

|
||||
|
||||
Listing the contents
|
||||
|
||||
#### c) Extracting an archive (x / --extract) ####
|
||||
|
||||
tar xvf archive.tar
|
||||
|
||||
tar xvf archive.tar --wildcards '*.c' - extracts files with only *.c extension from the archive.
|
||||
|
||||

|
||||
|
||||
Extracting files
|
||||
|
||||

|
||||
|
||||
Extract only the required files
|
||||
|
||||
#### d) Updating an archive ( u / --update) ####
|
||||
|
||||
tar uvf archive.tar newfile.c - updates the archive by adding newfile.c if its version is newer than the existing one.
|
||||
|
||||

|
||||
|
||||
Updating an archive
|
||||
|
||||
#### e) Delete from an archive (--delete) ####
|
||||
|
||||
tar--delete -f archive.tar file1.c - deletes 'file1.c' from the tar ball 'archive.tar'
|
||||
|
||||

|
||||
|
||||
Deleting files
|
||||
|
||||
Refer to [tar home page][1] for its detailed usage
|
||||
|
||||
### Gzip / Gunzip ###
|
||||
|
||||
Gzip stands for GNU zip. It is a compression utility that is commonly available in Linux operating system. Compressed files have an extension of '*.gz'
|
||||
|
||||
**Basic Usage**
|
||||
|
||||
#### a) Compressing files ####
|
||||
|
||||
gzip file(s)
|
||||
|
||||
Each file gets compressed individually
|
||||
|
||||

|
||||
|
||||
Compress files
|
||||
|
||||
This generally deletes the original files after compression. We can keep the original file by using the -c option.
|
||||
|
||||
gzip -c file > file.gz
|
||||
|
||||

|
||||
|
||||
Keep original files after compressing
|
||||
|
||||
We can also compress a group of files into a single file
|
||||
|
||||
cat file1 file2 file3 | gzip > archieve.gz
|
||||
|
||||

|
||||
|
||||
Compressing a group of files
|
||||
|
||||
#### b) Checking compression ratio ####
|
||||
|
||||
Compression ratio of the compressed file(s) can be verified using the '-l' option.
|
||||
|
||||
gzip -l archieve.gz
|
||||
|
||||

|
||||
|
||||
Checking compression ratio
|
||||
|
||||
#### c) Unzipping files ####
|
||||
|
||||
Gunzip is used for unzipping files. Here also, original files are deleted after decompression. Use the -c option to retain original files.
|
||||
|
||||
gunzip -c archieve.gz
|
||||
|
||||

|
||||
|
||||
Unzipping files
|
||||
|
||||
Using '-d' option with gzip command has the same effect of gunzip on compressed files.
|
||||
|
||||
More details can be obtained from [gzip home page][2]
|
||||
|
||||
### Bzip2 / Bunzip2 ###
|
||||
|
||||
[Bzip2][3] is also a compression tool like gzip but can compress files to smaller sizes than that is possible with other traditional tools. But the drawback is that it is slower than gzip.
|
||||
|
||||
**Basic Usage**
|
||||
|
||||
#### a) File Compression ####
|
||||
|
||||
Generally, no options are used for compression and the files to be compressed are passed as arguments. Each file gets compressed individually and compressed files will have the extension 'bz2'.
|
||||
|
||||
bzip2 file1 file2 file3
|
||||
|
||||

|
||||
|
||||
File Compression
|
||||
|
||||
Use '-k' option to keep the original files after compression / decompression.
|
||||
|
||||

|
||||
|
||||
Retaining original files after compression
|
||||
|
||||
'-d' option is used for forced decompression.
|
||||
|
||||

|
||||
|
||||
Delete files using -d option
|
||||
|
||||
#### b) Decompression ####
|
||||
|
||||
bunzip2 filename
|
||||
|
||||

|
||||
|
||||
Decompressing files
|
||||
|
||||
bunzip2 can decompress files with extensions bz2, bz, tbz2 and tbz. Files with tbz2 and tbz will end up with '.tar' extension after decompression.
|
||||
|
||||
bzip2 -dc performs the function of decompressing files to the stdout
|
||||
|
||||
### 7-zip ###
|
||||
|
||||
[7-zip][4] is another open source file archiver. It uses 7z format which is a new compression format and provides high-compression ratio. Hence, it is considered to be better than the previously mentioned compression tools. It is available under Linux as p7zip package. The package includes three binaries – 7z, 7za and 7zr. Refer to the [p7zip wiki][5] for differences between these binaries. In this article, we will be using 7zr to explain the usage. Archived files will have '.7z' extension.
|
||||
|
||||
**Basic usage**
|
||||
|
||||
#### a) Creating an archive ####
|
||||
|
||||
7zr a archive-name.7z file-name(s) / directory-name(s)
|
||||
|
||||

|
||||
|
||||
Creating an archive
|
||||
|
||||
#### b) Listing an archive ####
|
||||
|
||||
7zr l archive-name.7z
|
||||
|
||||

|
||||
|
||||
Listing an archive
|
||||
|
||||
#### c) Extracting an archive ####
|
||||
|
||||
7zr e archive-name.7z
|
||||
|
||||

|
||||
|
||||
Extracting an archive
|
||||
|
||||
#### d) Updating an archive ####
|
||||
|
||||
7zr u archive-name.7z new-file
|
||||
|
||||

|
||||
|
||||
Updating an archive
|
||||
|
||||
#### e) Deleting files from an archive ####
|
||||
|
||||
7zr d archive-name.7z file-to-be-deleted
|
||||
|
||||

|
||||
|
||||
Deleting files
|
||||
|
||||

|
||||
|
||||
Verifying file deletion
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://linoxide.com/tools/linux-compress-decompress-tools/
|
||||
|
||||
作者:[B N Poornima][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://linoxide.com/author/bnpoornima/
|
||||
[1]:http://www.gnu.org/software/tar/
|
||||
[2]:http://www.gzip.org/
|
||||
[3]:http://www.bzip.org/
|
||||
[4]:http://www.7-zip.org/
|
||||
[5]:https://wiki.archlinux.org/index.php/p7zip
|
@ -0,0 +1,78 @@
|
||||
Install Mumble in Ubuntu an Opensource VoIP Apps
|
||||
================================================================================
|
||||
Mumble is a free and open source voice over IP (VoIP) application, released under the new BSD license, primarily designed for use by gamers and it's similar to programs such as TeamSpeak and Ventrilo. It uses a server to witch people can connect with a client to talk to each other.
|
||||
|
||||
It offers the following great features:
|
||||
|
||||
- low latency, very important for gaming
|
||||
- offers in-game overlay so you can see who is talking and positional audio to hear the players from where they are located
|
||||
- has encrypted communications so you can stay private and secure
|
||||
- it also offers a few nice configuration interface that are easy to use
|
||||
- very stable and good on resource usage for your server
|
||||
|
||||
### Install Mumble ###
|
||||
|
||||
[Mumble][1] has become very popular and is now present in the software repositories of the major Linux distributions and this makes it easy to install and setup. In Ubuntu you can use the command line to install it with apt-get by running the following command:
|
||||
|
||||
$ sudo apt-get install mumble-server
|
||||
|
||||

|
||||
|
||||
This will install the server (also called Murmur) on your server.
|
||||
|
||||
### Configuring Mumble ###
|
||||
|
||||
To setup Mumble you will need to run the following command:
|
||||
|
||||
$ sudo dpkg-reconfigure mumble-server
|
||||
|
||||
The following questions will pop-up:
|
||||
|
||||

|
||||
|
||||
Pick Yes to have mumble start when your server boots, next it will ask if you wish to run it in a high-priority mode that will ensure lower latency, it's a good idea to have it run it like that for the best performance:
|
||||
|
||||

|
||||
|
||||
It will then require you to introduce a password for the administrator user of the new mumble server, you will need to remember this password for when you will log-in.
|
||||
|
||||

|
||||
|
||||
### Installing Mumble Client ###
|
||||
|
||||
The client can be installed on most major platforms like Windows, Mac OS X and Linux. We will cover the installation and configuration on Ubuntu Linux, to install it you can use the Software Center or run the following command:
|
||||
|
||||
$ sudo apt-get install mumble
|
||||
|
||||
When you first run Mumble it will present you with a wizard to help you configure your audio input and output to make the best of the client. It will first ask you what sound device and microphone to use:
|
||||
|
||||

|
||||
|
||||
Then it will help you calibrate the devices:
|
||||
|
||||

|
||||
|
||||
And since mumble encrypts all the communication it will ask you to also create a certificate:
|
||||
|
||||

|
||||
|
||||
After you finish with the wizard you can add your first server and connect to it the dialog will look like this:
|
||||
|
||||

|
||||
|
||||
First enter a label, this can be anything you wish to remember the server by, next add the address and port of the server, and finally use "SuperUser" as user and the password you used when you configured the mumble server.
|
||||
|
||||
You can now connect to the server and enjoy all of the features while you play online or talk to your friends or partners.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://linoxide.com/ubuntu-how-to/install-mumble-ubuntu/
|
||||
|
||||
作者:[Adrian Dinu][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://linoxide.com/author/adriand/
|
||||
[1]:http://wiki.mumble.info/wiki/Main_Page
|
@ -0,0 +1,169 @@
|
||||
Simple Steps Migration From MySQL To MariaDB On Linux
|
||||
================================================================================
|
||||
Hi all, this tutorial is all gonna be about how to migrate from MySQL to MariaDB on Linux Server or PC. So, you may ask why should we really migrate from MySQL to MariaDB for our database management. Here, below are the reasons why you should really need to migrate your database management system from MySQL to MariaDB.
|
||||
|
||||
### Why should I use MariaDB instead of MySQL? ###
|
||||
|
||||
MariaDB is an enhanced drop-in replacement and community-developed fork of the MySQL database system. It was developed by MariaDB foundation, and is being led by original developers of MySQL. Working with MariaDB is entirely same as MySQL. After Oracle bought MySQL, it is not free and open source anymore, but **MariaDB is still free and open source**. Top Websites like Google, Wikipedia, Linkedin, Mozilla and many more migrated to MariaDB. Its features are
|
||||
|
||||
- Backwards compatible with MySQL
|
||||
- Forever open source
|
||||
- Maintained by MySQL's creator
|
||||
- More cutting edge features
|
||||
- More storage engines
|
||||
- Large websites have switched
|
||||
|
||||
Now, lets migrate to MariaDB.
|
||||
|
||||
**For the testing purpose**, let us create a sample database called **linoxidedb** .
|
||||
|
||||
Log in to MySQL as root user using the following command:
|
||||
|
||||
$ mysql -u root -p
|
||||
|
||||
Enter the mysql root user password. You’ll be redirected to the **mysql prompt**.
|
||||
|
||||
**Create test databases:**
|
||||
|
||||
Enter the following commands from mysql prompt to create test databases.
|
||||
|
||||
mysql> create database linoxidedb;
|
||||
|
||||
To view the list of available databases, enter the following command:
|
||||
|
||||
mysql> show databases;
|
||||
|
||||

|
||||
|
||||
As see above, we have totally 5 databases including the newly created database linoxidedb .
|
||||
|
||||
mysql> quit
|
||||
|
||||
Now, we'll migrate the created databases from MySQL to MariaDB.
|
||||
|
||||
Note: This tutorial is not necessary for CentOS, fedora based distribution of Linux because MariaDB is automatically installed instead of MySQL which requires no need to backup the existing databases, you just need to update mysql which will give you mariadb.
|
||||
|
||||
### 1. Backup existing databases ###
|
||||
|
||||
Our first important step is to create a backup of existing databases. To do that, we'll enter the following command from the **Terminal (not from MySQL prompt)**.
|
||||
|
||||
$ mysqldump --all-databases --user=root --password --master-data > backupdatabase.sql
|
||||
|
||||
Oops! We encountered an error. No worries, it can be fixed.
|
||||
|
||||
$ mysqldump: Error: Binlogging on server not active
|
||||
|
||||

|
||||
mysqldump error
|
||||
|
||||
To fix this error, we have to do a small modification in **my.cnf** file.
|
||||
|
||||
Edit my.cnf file:
|
||||
|
||||
$ sudo nano /etc/mysql/my.cnf
|
||||
|
||||
Under [mysqld] section, add the following parameter.
|
||||
|
||||
**log-bin=mysql-bin**
|
||||
|
||||

|
||||
|
||||
Now, after done save and exit the file. Then, we'll need to restart mysql server. To do that please execute the below commands.
|
||||
|
||||
$ sudo /etc/init.d/mysql restart
|
||||
|
||||
Now, re-run the mysqldump command to backup all databases.
|
||||
|
||||
$ mysqldump --all-databases --user=root --password --master-data > backupdatabase.sql
|
||||
|
||||

|
||||
dumping databases
|
||||
|
||||
The above command will backup all databases, and stores them in **backupdatabase.sql** in the current directory.
|
||||
|
||||
### 2. Uninstalling MySQL ###
|
||||
|
||||
First of all, we'll want to **backup the my.cnf file to a safe location**.
|
||||
|
||||
**Note**: The my.cnf file will not be deleted when uninstalling MySQL packages. We do it for the precaution. During MariaDB installation, the installer will ask us to keep the existing my.cnf(old backup) file or to use the package containers version (i.e new one).
|
||||
|
||||
To backup the my.cnf file, please enter the following commands in a shell or terminal.
|
||||
|
||||
$ sudo cp /etc/mysql/my.cnf my.cnf.bak
|
||||
|
||||
To stop mysql service, enter the following command from your Terminal.
|
||||
|
||||
$ sudo /etc/init.d/mysql stop
|
||||
|
||||
Then, remove mysql packages.
|
||||
|
||||
$ sudo apt-get remove mysql-server mysql-client
|
||||
|
||||

|
||||
|
||||
### 3. Installing MariaDB ###
|
||||
|
||||
Here are the commands to run to install MariaDB on your Ubuntu system:
|
||||
|
||||
$ sudo apt-get install software-properties-common
|
||||
$ sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db
|
||||
# sudo add-apt-repository 'deb http://mirror.mephi.ru/mariadb/repo/5.5/ubuntu trusty main'
|
||||
|
||||

|
||||
|
||||
Once the key is imported and the repository added you can install MariaDB with:
|
||||
|
||||
$ sudo apt-get update
|
||||
$ sudo apt-get install mariadb-server
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
We should remember that during MariaDB installation, the installer will ask you either to use the existing my.cnf(old backup) file, or use the package containers version (i.e new one). You can either use the old my.cnf file or the package containers version. If you want to use the new my.cnf version, you can restore the contents of older my.cnf (We already have copied this file to safe location before) later ie my.cnf.bak . So, I will go for default which is N, we'll press N then. For other versions, please refer the [MariaDB official repositories page][2].
|
||||
|
||||
### 4. Restoring Config File ###
|
||||
|
||||
To restore my.cnf from my.cnf.bak, enter the following command in Terminal. We have the old as my.cnf.bak file in our current directory, so we can simply copy the file using the following command:
|
||||
|
||||
$ sudo cp my.cnf.bak /etc/mysql/my.cnf
|
||||
|
||||
### 5. Importing Databases ###
|
||||
|
||||
Finally, lets import the old databases that we created before. To do that, we'll need to run the following command.
|
||||
|
||||
$ mysql -u root -p < backupdatabase.sql
|
||||
|
||||
That’s it. We have successfully imported the old databases.
|
||||
|
||||
Let us check if the databases are really imported. To do that, we'll wanna log in to mysql prompt using command:
|
||||
|
||||
$ mysql -u root -p
|
||||
|
||||

|
||||
|
||||
Now, to check whether the databases are migrated to MariaDB please run "**show databases**;" command inside the MarianDB prompt without quotes("") as
|
||||
|
||||
mariaDB> show databases;
|
||||
|
||||

|
||||
|
||||
As you see in the above result all old databases including our very linoxidedb has been successfully migrated.
|
||||
|
||||
### Conclusion ###
|
||||
|
||||
Finally, we have successfully migrated our databases from MySQL to MariaDB Database Management System. MariaDB is far more better than MySQL. Though MySQL is still faster than MariaDB in performance but MariaDB is far more better because of its additional features and license. MariaDB is a Free and Open Source Software (FOSS) and will be FOSS forever but MySQL has many additional plugins, etc non-free and there is no proper public roadmap and won't be FOSS in future. If you have any questions, comments, feedback to us, please don't hesitate to write on the comment box below. Thank You ! And Enjoy MariaDB.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://linoxide.com/linux-how-to/migrate-mysql-mariadb-linux/
|
||||
|
||||
作者:[Arun Pyasi][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://linoxide.com/author/arunp/
|
||||
[1]:https://mariadb.org/
|
||||
[2]:https://downloads.mariadb.org/mariadb/repositories/#mirror=mephi
|
Loading…
Reference in New Issue
Block a user