20150816-2 选题

This commit is contained in:
DeadFire 2015-08-16 02:59:16 +08:00
parent 88435ed2b8
commit 71b69ec574
3 changed files with 405 additions and 0 deletions

View File

@ -0,0 +1,62 @@
Ubuntu NVIDIA Graphics Drivers PPA Is Ready For Action
================================================================================
![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/08/Screen-Shot-2015-08-12-at-14.19.42.png)
Get your frame-rate on
**Well, that didnt take long. **
Just days after [proposing][1] the creation of a new PPA to provide Ubuntu users with the latest NVIDIA graphics drivers the Ubuntu community has clubbed together to do, well, just that.
The plainly named **Graphics Drivers PPA** contains the latest release of NVIDIAs proprietary Linux grapics drivers, packaged up for Ubuntu users to upgrade to no binary runtime headaches needed!
The PPA is designed to offer gamers a way to run the latest games on the latest on Ubuntu as easily as possible.
#### Ready, But Not Ready ####
Jorge Castros idea to create a blessed PPA containing newer NVIDIA graphics drivers for those wot want em has been greeted with enthusiasm by Ubuntu users and games developers alike.
Even those involved in porting some of Steams biggest titles to Linux have chimed in to offer advice and suggestions.
Edwin Smith, head of production at Feral Interactive (Shadow of Mordor) welcomed the initiative to prove users with “easier way of updating drivers”.
### How To Use The New Nvidia Drivers PPA ###
Although the new Graphic Drivers PPA is live it is not strictly ready for the prime time. Its maintainers caution:
> “This PPA is currently in testing, you should be experienced with packaging before you dive in here. Give a few days to sort out the kinks.”
Jorge, who soft launched the PPA in a post to the Ubuntu desktop mailing list, also notes that gamers using existing PPAs, like xorg-edgers, for timely graphics driver updates wont notice any driver difference for now (as the drivers have simply been copied over from some of those PPAs to this new one).
“The real fun begins when new drivers are released,” he adds.
Right now, as of writing, the PPA contains a batch of recent Nvidia drivers for Ubuntu 12.04.1 through 15.10. Note all drivers are available for all releases.
> **It should go without saying: unless you know what youre doing, and how to undo it, do not follow the instructions that follow. **
To add the PPA run the following in a new Terminal window:
sudo add-apt-repository ppa:graphics-drivers/ppa
To upgrade to or install the latest Nvidia drivers:
sudo apt-get update && sudo apt-get install nvidia-355
Remember: if the PPA breaks your system you are allowed to keep both halves.
To roll back/undo changes made the PPA you should use the ppa-purge command.
Feel free to leave any advice/help/corrections/thoughts on the PPA (and as I dont have NVIDIA hardware to test the above out for myself, its all appreciated) in the comments below.
--------------------------------------------------------------------------------
via: http://www.omgubuntu.co.uk/2015/08/ubuntu-nvidia-graphics-drivers-ppa-is-ready-for-action
作者:[Joey-Elijah Sneddon][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:https://plus.google.com/117485690627814051450/?rel=author
[1]:http://www.omgubuntu.co.uk/2015/08/ubuntu-easy-install-latest-nvidia-linux-drivers

View File

@ -0,0 +1,157 @@
shellinabox A Web based AJAX Terminal Emulator
================================================================================
### About shellinabox ###
Greetings Unixmen readers!
We, usually, access any remote servers using well known communication tools like OpenSSH, and Putty etc. But, one important thing is we cant access the remote systems using those tools behind a Firewall or the firewalls that allow only HTTPS traffic. No worries! We, still, have some options to access your remote systems even if youre behind a firewall. And also, you dont need to install any communications tools like OpenSSH or Putty. All you need is only a modern JavaScript and CSS enabled browser. And you dont need to install any plugins or third party softwares either.
Meet **Shell In A Box**, pronounced as **shellinabox**, a free, open source, web based AJAX Terminal emulator developed by **Markus Gutschke**. It uses AJAX technology to provide the look and feel of a native shell via a web browser. The **shellinaboxd** daemon implements a webserver that listens on the specified port. The web server publishes one or more services that will be displayed in a VT100 emulator implemented as an AJAX web application. By default, the port is 4200. You can change the default port to any random port number of your choice. After installing shellinabox on all your remote servers that you want to access them from your local system, open up the web browser and navigate to: **http://IP-Address:4200/**. Enter your user name and password and start using your remote systems shell. Seems interesting, isnt it? Indeed!
**Disclaimer**:
Shellinabox is not a ssh client or any sort of security software. It is just a application that emulates a remote systems shell via a web browser. Also, It has nothing to do with SSH in anyway. Its not a bullet proof security way to remote your systems. It is just one of the easiest methods so far. You should not run it on any public network for any reason.
### Install shellinabox ###
#### In Debian/Ubuntu based systems: ####
shellinabox is available in the default repositories. So, you can install it using command:
$ sudo apt-get install shellinabox
#### In RHEL/CentOS systems: ####
First, install EPEL repository using command:
# yum install epel-release
Then, install shellinabox using command:
# yum install shellinabox
Done!
### Configure shellinabox ###
As I mentioned before, shellinabox listens on port **4200** by default. You can change this port to any random number of your choice to make it difficult to guess by anyone.
The shellinabox config file is located in **/etc/default/shellinabox** file by default in Debian/Ubuntu systems. In RHEL/CentOS/Fedora, the default location of config file is **/etc/sysconfig/shellinaboxd**.
If you want to change the default port,
In Debian/Ubuntu:
$ sudo vi /etc/default/shellinabox
In RHEL/CentOS/Fedora:
# vi /etc/sysconfig/shellinaboxd
Change your port to any random number. Since I am testing it on my local network, I use the default values.
# Shell in a box daemon configuration
# For details see shellinaboxd man page
# Basic options
USER=shellinabox
GROUP=shellinabox
CERTDIR=/var/lib/shellinabox
PORT=4200
OPTS="--disable-ssl-menu -s /:LOGIN"
# Additional examples with custom options:
# Fancy configuration with right-click menu choice for black-on-white:
# OPTS="--user-css Normal:+black-on-white.css,Reverse:-white-on-black.css --disable-ssl-menu -s /:LOGIN"
# Simple configuration for running it as an SSH console with SSL disabled:
# OPTS="-t -s /:SSH:host.example.com"
Restart shelinabox service.
**In Debian/Ubuntu:**
$ sudo systemctl restart shellinabox
Or
$ sudo service shellinabox restart
In RHEL/CentOS systems run the following command to start shellinaboxd service automatically on every reboot.
# systemctl enable shellinaboxd
Or
# chkconfig shellinaboxd on
Remember to open up port **4200** or any port that you assign if you are running a firewall.
For example, in RHEL/CentOS systems, you can allow the port as shown below.
# firewall-cmd --permanent --add-port=4200/tcp
----------
# firewall-cmd --reload
### Usage ###
Now, go to your client systems, open up the web browser and navigate to: **https://ip-address-of-remote-servers:4200**.
**Note**: Mention the correct port if you have changed it.
Youll get a warning message of certificate issue. Accept the certificate and go on.
![Privacy error - Google Chrome_001](http://www.unixmen.com/wp-content/uploads/2015/08/Privacy-error-Google-Chrome_001.jpg)
Enter your remote systems username and password. Now, youll be able to access the remote systems shell right from the browser itself.
![Shell In A Box - Google Chrome_003](http://www.unixmen.com/wp-content/uploads/2015/08/sk@server1-Shell-In-A-Box-Google-Chrome_003.jpg)
You can get some additional menu options which might be useful by right clicking on the empty space of your browser.
![Shell In A Box - Google Chrome_004](http://www.unixmen.com/wp-content/uploads/2015/08/sk@server1-Shell-In-A-Box-Google-Chrome_004.jpg)
From now on, you can do whatever you want to do in your remote server from the local systems web browser.
Once you done, type **exit** in the shell.
To connect again to the remote system, click the **Connect** button and then type the user name and password of your remote server.
![Shell In A Box - Google Chrome_005](http://www.unixmen.com/wp-content/uploads/2015/08/sk@server1-Shell-In-A-Box-Google-Chrome_005.jpg)
For more details about shellinabox, type the following command in your Terminal:
# man shellinabox
Or
# shellinaboxd -help
Also, refer the [shellinabox wiki page][1] for comprehensive usage details.
### Conclusion ###
Like I mentioned before, web-based SSH tools are very useful if youre running servers behind a Firewall. There are many web-based ssh tools, but Shellinabox is pretty simple and useful tool to emulate a remote systems shell from anywhere in your network. Since, it is browser based, you can access your remote server from any device as long as you have a JavaScript and CSS enabled browser.
Thats all for now. Have a good day!
#### Reference link: ####
- [shellinabox website][2]
--------------------------------------------------------------------------------
via: http://www.unixmen.com/shellinabox-a-web-based-ajax-terminal-emulator/
作者:[SK][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://www.unixmen.com/author/sk/
[1]:https://code.google.com/p/shellinabox/wiki/shellinaboxd_man
[2]:https://code.google.com/p/shellinabox/

View File

@ -0,0 +1,186 @@
How to migrate MySQL to MariaDB on Linux
================================================================================
Since the Oracle's acquisition of MySQL, a lot of MySQL developers and users moved away from MySQL due to Oracle's more closed-door stance on MySQL development and maintenance. The community-driven outcome of such movement is a fork of MySQL, called MariaDB. Led by original MySQL developers, the development of MariaDB follows the open-source philosophy and makes sure of [its binary compatibility with MySQL][1]. The Linux distributions such as Red Hat families (Fedora, CentOS, RHEL), Ubuntu and Mint, openSUSE and Debian already started to use and support MariaDB as a drop-in replacement of MySQL.
If you want to migrate your database from MySQL to MariaDB, this article is what you are looking for. Fortunately, due to their binary compatibility, MySQL-to-MariaDB migration process is pretty much straightforward. If you follow the steps below, the migration from MySQL to MariaDB will most likely be painless.
### Prepare a MySQL Database and a Table ###
For demonstration purpose, let's create a test MySQL database and one table in the database before doing the migration. Skip this step if you already have existing MySQL database(s) to migrate to MariaDB. Otherwise proceed as follows.
Log in into MySQL from a terminal by typing your MySQL root user password.
$ mysql -u root -p
Create a database and a table.
mysql> create database test01;
mysql> use test01;
mysql> create table pet(name varchar(30), owner varchar(30), species varchar(20), sex char(1));
Add some records to the table.
mysql> insert into pet values('brandon','Jack','puddle','m'),('dixie','Danny','chihuahua','f');
Then quit the MySQL database.
### Backup the MySQL Database ###
The next step is to back up existing MySQL database(s). Use the following mysqldump command to export all existing databases to a file. Before running this command, make sure that binary logging is enabled in your MySQL server. If you don't know how to enable binary logging, see the instructions toward the end of the tutorial.
$ mysqldump --all-databases --user=root --password --master-data > backupdb.sql
![](https://farm6.staticflickr.com/5775/20555772385_21b89335e3_b.jpg)
Now create a backup of my.cnf file somewhere in your system before uninstalling MySQL. This step is optional.
$ sudo cp /etc/mysql/my.cnf /opt/my.cnf.bak
### Uninstall MySQL Package ###
First, you need to stop the MySQL service.
$ sudo service mysql stop
or:
$ sudo systemctl stop mysql
or:
$ sudo /etc/init.d/mysql stop
Then go ahead and remove MySQL packages and configurations as follows.
On RPM based system (e.g., CentOS, Fedora or RHEL):
$ sudo yum remove mysql* mysql-server mysql-devel mysql-libs
$ sudo rm -rf /var/lib/mysql
On Debian based system (e.g., Debian, Ubuntu or Mint):
$ sudo apt-get remove mysql-server mysql-client mysql-common
$ sudo apt-get autoremove
$ sudo apt-get autoclean
$ sudo deluser mysql
$ sudo rm -rf /var/lib/mysql
### Install MariaDB Package ###
The latest CentOS/RHEL 7 and Ubuntu (14.04 or later) contain MariaDB packages in their official repositories. In Fedora, MariaDB has become a replacement of MySQL since version 19. If you are using an old version or LTS type like Ubuntu 13.10 or earlier, you still can install MariaDB by adding its official repository.
[MariaDB website][2] provide an online tool to help you add MariaDB's official repository according to your Linux distribution. This tool provides steps to add the MariaDB repository for openSUSE, Arch Linux, Mageia, Fedora, CentOS, RedHat, Mint, Ubuntu, and Debian.
![](https://farm6.staticflickr.com/5809/20367745260_073020b910_c.jpg)
As an example, let's use the Ubuntu 14.04 distribution and CentOS 7 to configure the MariaDB repository.
**Ubuntu 14.04**
$ 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'
$ sudo apt-get update
$ sudo apt-get install mariadb-server
**CentOS 7**
Create a custom yum repository file for MariaDB as follows.
$ sudo vi /etc/yum.repos.d/MariaDB.repo
----------
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/5.5/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
----------
$ sudo yum install MariaDB-server MariaDB-client
After all necessary packages are installed, you may be asked to type a new password for root user account. After setting the root password, don't forget to recover my.cnf backup file.
$ sudo cp /opt/my.cnf /etc/mysql/
Now start MariaDB service as follows.
$ sudo service mariadb start
or:
$ sudo systemctl start mariadb
or:
$ sudo /etc/init.d/mariadb start
### Importing MySQL Database(s) ###
Finally, we have to import the previously exported database(s) back to MariaDB server as follows.
$ mysql -u root -p < backupdb.sql
Enter your MariaDB's root password, and the database import process will start. When the import process is finished, it will return to a command prompt.
To check whether or not the import process is completed successfully, log in into MariaDB server and perform some sample queries.
$ mysql -u root -p
----------
MariaDB [(none)]> show databases;
MariaDB [(none)]> use test01;
MariaDB [test01]> select * from pet;
![](https://farm6.staticflickr.com/5820/20562243721_428a9a12a7_b.jpg)
### Conclusion ###
As you can see in this tutorial, MySQL-to-MariaDB migration is not difficult. MariaDB has a lot of new features than MySQL, that you should know about. As far as configuration is concerned, in my test case, I simply used my old MySQL configuration file (my.cnf) as a MariaDB configuration file, and the import process was completed fine without any issue. My suggestion for the configuration is that you read the documentation on MariaDB configuration options carefully before the migration, especially if you are using specific MySQL configurations.
If you are running more complex setup with tons of tables and databases including clustering or master-slave replication, take a look at the [more detailed guide][3] by the Mozilla IT and Operations team, or the [official MariaDB documentation][4].
### Troubleshooting ###
1. While running mysqldump command to back up databases, you are getting the following error.
$ mysqldump --all-databases --user=root --password --master-data > backupdb.sql
----------
mysqldump: Error: Binlogging on server not active
By using "--master-data", you are trying to include binary log information in the exported output, which is useful for database replication and recovery. However, binary logging is not enabled in MySQL server. To fix this error, modify your my.cnf file, and add the following option under [mysqld] section.
log-bin=mysql-bin
Save my.cnf file, and restart the MySQL service:
$ sudo service mysql restart
or:
$ sudo systemctl restart mysql
or:
$ sudo /etc/init.d/mysql restart
--------------------------------------------------------------------------------
via: http://xmodulo.com/migrate-mysql-to-mariadb-linux.html
作者:[Kristophorus Hadiono][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://xmodulo.com/author/kristophorus
[1]:https://mariadb.com/kb/en/mariadb/mariadb-vs-mysql-compatibility/
[2]:https://downloads.mariadb.org/mariadb/repositories/#mirror=aasaam
[3]:https://blog.mozilla.org/it/2013/12/16/upgrading-from-mysql-5-1-to-mariadb-5-5/
[4]:https://mariadb.com/kb/en/mariadb/documentation/