20131209-1 选题

This commit is contained in:
DeadFire 2013-12-09 14:25:48 +08:00
parent 1f168da7e6
commit b9aaf47911
3 changed files with 676 additions and 0 deletions

View File

@ -0,0 +1,369 @@
How to install and configure Nagios on Linux
================================================================================
[Nagios][1] is one of the most powerful network monitoring systems, which is widely used in the industry. It can actively monitor any network, and generate audio/email warnings and alerts when any problem is detected. The check types and alert timers are fully customizable.
Another incredible capability of Nagios is that it can monitor both hosts and services e.g., it can monitor IP addresses and TCP/UDP port numbers. To explain a little, let us assume that there is a web server that we want to monitor. Nagios can check whether the server is online by running ping on the IP/name of the server as well as it can be set up to provide warnings in case the round trip time (RTT) to the server increases. Further, Nagios can also check whether TCP port 80 (web server) is reachable e.g., the server is online but Apache/IIS is not responding.
There are also 3rd party monitoring tools that are based on Nagios, such as [Centreon][2], [FAN][3] , [op5 Monitor][4], which supplement standalone Nagios engine in terms of interface, automation, and technical support.
This tutorial explains **how to install and configure Nagios on Linux**.
### Install Nagios on Debian or Ubuntu ###
On a Debian-based system, the installation in itself is a very simple process thanks to apt-get.
root@mrtg:~# apt-get install nagios3
The mail server setting can be done during Nagios installation. It can also be configured later when needed.
Note: A valid SMTP configuration is needed for Nagios to be able send email notifications.
[![](http://farm4.staticflickr.com/3809/11198373625_cdacef2275_z.jpg)][5]
As it can be seen, Nagios supports multiple options for email delivery. The most common options would be Internet Site where the server sends email directly to the recipient. Another widely used option is using smarthost or relay server, in which the server sends the email to an intermediary mail server which in turn is responsible for delivering the mail to the recipient.
Next, the domain name of the server has to be included in the next step.
[![](http://farm8.staticflickr.com/7384/11198394746_f4d42300b5_z.jpg)][6]
Finally, the password for the Nagios admin user nagiosadmin is set. This value can also be changed later.
[![](http://farm4.staticflickr.com/3759/11198378964_5d7f6638e8_z.jpg)][7]
### Install Nagios on CentOS or RHEL ###
yum is used for installation. After [setting up the repoforge repository][8], run yum as follows.
[root@mrtg ~]# yum install nagios nagios-plugins
### Requirements for Monitoring ###
In this tutorial, we want to monitor the following.
1. All Linux server will be checked every 3 minutes.
1. All Cisco Routers will be checked every 3 minutes.
1. All email alerts should go to the address sentinel@example.tst.
1. Nagios will verify 3 times before sending out any alerts just to be sure that the problem is real.
1. If the RTT to any device exceeds 100 ms and/or packet loss exceeds 20%, email alert will be generated.
The rest of the tutorial will guide you to configure Nagios on Linux.
### Nagios Configuration on Ubuntu ###
It is important to know where Nagios configuration files are located. The following table shows the location of Nagios configuration files on Debian-based systems.
/etc/nagios-plugins Customizable scripts used for monitoring
/etc/nagios3 Configuration files to add hosts, services, define checks and timers
/usr/lib/nagios/plugins Executable files used for monitoring
The following steps are inter-related. Hosts, groups for hosts and adding services to host groups are defined.
### Adding Host Template ###
The templates defining what to do with a type host is defined. We use the files provided with the installation as sample.
First, define a host template for Linux devices
root@mrtg:~# cd /etc/nagios3/conf.d
root@mrtg:/etc/nagios3/conf.d/# cp generic-host_nagios2.cfg linux-server.cfg
Edit linux-server.cfg as follows. The parts with bold font are modified.
root@mrtg:/etc/nagios3/conf.d/# vim linux-server.cfg
> define host{
> name linux-server
> notifications_enabled 1
> event_handler_enabled 1
> flap_detection_enabled 1
> failure_prediction_enabled 1
> process_perf_data 1
> retain_status_information 1
> retain_nonstatus_information 1
> check_command example-host-check ; the script to be used while checking
> check_interval 3 ; the interval between consecutive checks
> max_check_attempts 3 ; number of rechecking before generating email alerts
> notification_interval 0
> notification_period 24x7
> notification_options d,u,r
> contact_groups admins ; the group where emails will be sent
> register0
> }
Next, define a host template for Cisco devices.
root@mrtg:/etc/nagios3/conf.d/# cp linux-server.cfg cisco-device.cfg
Modify cisco-device.cfg as follows. The bold-font parts are modified.
root@mrtg:/etc/nagios3/conf.d/# vim cisco-device.cfg
> # The highlighted parts are modified
> define host{
> name cisco-device
> notifications_enabled 1
> event_handler_enabled 1
> flap_detection_enabled 1
> failure_prediction_enabled 1
> process_perf_data 1
> retain_status_information 1
> retain_nonstatus_information 1
> check_command example-host-check ; the script to be used while checking
> check_interval 3 ; the interval between consecutive checks
> max_check_attempts 3 ; number of rechecking before generating email alerts
> notification_interval 0
> notification_period 24x7
> notification_options d,u,r
> contact_groups admins ; the group where emails will be sent
> register 0
> }
### Adding Host ###
Now that the host template is defined, the actual host to be monitored is added. Again, the files provided by default are used as sample.
root@mrtg:/etc/nagios3/conf.d/# cp localhost_nagios2.cfg example.cfg
root@mrtg:/etc/nagios3/conf.d/# vim example.cfg
> # Host 1
> define host{
> use linux-server ; Name of host template to use
> host_name our-server ; The hostname to be used by nagios
> alias our-server
> address 172.17.1.23 ; The IP address of the host
> }
>
> # Host 2
> define host{
> use cisco-device ; Name of host template to use
> host_name our-router ; The hostname to be used by nagios
> alias our-router
> address 172.17.1.1 ; The IP address of the host
> }
### Host Group Definition ###
For ease of management when there are multiple hosts, it is advisable that hosts of similar types are grouped together.
root@mrtg:/etc/nagios3/conf.d/# vim hostgroups_nagios2.cfg
> definehostgroup {
> hostgroup_name linux-server ; the name of the host group
> alias Linux Servers
> members our-server ; comma separated list of members
> }
>
> definehostgroup {
> hostgroup_name cisco-device ; the name of the host group
> alias Cisco Devices
> members our-server ; comma separated list of members
> }
### Service Definition ###
First, the command example-host-check is defined with warning value of 100 ms for latency and 20% for packet loss. Critical values are 5000 ms for latency and 100% packet loss. One IPv4 ping request is transmitted.
root@mrtg:~# vim /etc/nagios-plugins/config/ping.cfg
> define command{
> command_name example-host-check
> command_line /usr/lib/nagios/plugins/check_ping -H '$HOSTADDRESS$' -w 100,20% -c 5000,100% -p 1 -4
> }
Then, the command is associated with host groups.
root@mrtg:/etc/nagios3/conf.d/# vim services_nagios2.cfg
> define service {
> hostgroup_name linux-server
> service_description Linux Servers
> check_command example-host-check
> use generic-service
> notification_interval 0 ; set 0 if you want to be renotified
> }
>
> define service {
> hostgroup_name cisco-device
> service_description Cisco Devices
> check_command example-host-check
> use generic-service
> notification_interval 0 ; set 0 if you want to be renotified
> }
### Contact Definition ###
The required address for sending email added to Nagios.
> define contact{
> contact_name root
> alias Root
> service_notification_period 24x7
> host_notification_period 24x7
> service_notification_options w,u,c,r
> host_notification_options d,r
> service_notification_commands notify-service-by-email
> host_notification_commands notify-host-by-email
> email root@localhost, sentinel@example.tst
> }
Finally, a dry run is initiated to check whether there are any configuration errors. If there are no errors, Nagios can be (re)started safely.
root@mrtg:~#nagios v /etc/nagios3/nagios.cfg
root@mrtg:~# service nagios3 restart
### Nagios Configuration on CentOS/RHEL ###
The following shows the locations of Nagios configuration files on Redhat-based systems.
> /etc/nagios/objects Configuration files to add hosts, services, define checks and timers
> /usr/lib/nagios/plugins Executable files used for monitoring
### Adding Host Template ###
A template is created to define what needs to be done for a specific type of host. The files provided with the installation is modified.
[root@mrtg objects]# cd /etc/nagios/objects/
[root@mrtg objects]# vim templates.cfg
> define host{
> name linux-server
> use generic-host
> check_period 24x7
> check_interval 3
> retry_interval 1
> max_check_attempts 3
> check_command example-host-check
> notification_period 24x7
> notification_interval 0
> notification_options d,u,r
> contact_groups admins
> register 0
> }
>
> define host{
> name cisco-router
> use generic-host
> check_period 24x7
> check_interval 3
> retry_interval 1
> max_check_attempts 3
> check_command example-host-check
> notification_period 24x7
> notification_interval 0
> notification_options d,u,r
> contact_groups admins
> register 0
> }
### Adding Hosts and Host Groups ###
The configuration file provided with by default is used as a sample. The hosts and host groups are added in the same file.
[root@mrtg objects]# cp localhost.cfg example.cfg
[root@mrtg objects]# vim example.cfg
> #Adding Linux server
> define host{
> use linux-server
> host_name our-server
> alias our-server
> address 172.17.1.23
> }
>
> #Adding Cisco Router
> define host{
> use cisco-router
> host_name our-router
> alias our-router
> address 172.17.1.1
> }
>
> # HOST GROUP DEFINITION
> define hostgroup{
> hostgroup_name linux-servers
> alias Linux Servers
> members our-server
> }
>
> define hostgroup{
> hostgroup_name cisco-router
> alias cisco-router
> members our-router
> }
### Service Definition ###
A service called example-host-check is defined with warning values of 100 ms for latency and 20% for packet loss. The critical values are 5000 ms for latency and 100% for packet loss. Only one IPv4 ping request will be transmitted.
[root@mrtg objects]# vim commands.cfg
> define command{
> command_name example-host-check
> command_line $USER1$/check_ping -H $HOSTADDRESS$ -w 100.0,20% -c 5000.0,100% -p 1 -4
> }
### Contact Definition ###
The email address where alerts will be sent is added into Nagios.
> define command{
> command_name example-host-check
> command_line $USER1$/check_ping -H $HOSTADDRESS$ -w 100.0,20% -c 5000.0,100% -p 1 -4
> }
### Contact Definition ###
The email address where alerts will be sent is added into Nagios.
[root@objects objects]# vim contacts.cfg
> define contact{
> contact_name nagiosadmin
> use generic-contact
> alias Nagios Admin
> email nagios@localhost, sentinel@example.tst
> }
Finally, we are ready to start the Nagios service. A dry run is recommended to find out errors in configuration.
[root@mrtg ~]# nagios v /etc/nagios/nagios.cfg
[root@mrtg ~]# service nagios restart
[root@mrtg ~]# chkconfig nagios on
### Access Nagios after Configuration ###
Now you are ready to use Nagios. Nagios can be accessed by opening the URL http://IP/nagios3 in case of Ubuntu/Debian or http://IP/nagios in case of CentOS/RHEL e.g. http://172.17.1.23/nagios3. The user "nagiosadmin" needs to be authenticated to access the page.
[![](http://farm4.staticflickr.com/3834/11198394806_4f4a753778_z.jpg)][9]
When Nagios is not running the way it is supposed to, the first thing to do would be to initiate a dry run.
On Debian or Ubuntu:
# nagios3 -v /etc/nagios3/nagios.cfg
On CentOS or RHEL:
# nagios -v /etc/nagios/nagios.cfg
The log file may also shed some important clue. The path to the log file is located at /var/log/nagios/nagios.log.
Hope this helps.
--------------------------------------------------------------------------------
via: http://xmodulo.com/2013/12/install-configure-nagios-linux.html
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:http://www.nagios.org/
[2]:http://www.centreon.com/
[3]:http://www.fullyautomatednagios.org/
[4]:http://www.op5.com/
[5]:http://www.flickr.com/photos/xmodulo/11198373625/
[6]:http://www.flickr.com/photos/xmodulo/11198394746/
[7]:http://www.flickr.com/photos/xmodulo/11198378964/
[8]:http://xmodulo.com/2013/01/how-to-set-up-rpmforge-repoforge-repository-on-centos.html
[9]:http://www.flickr.com/photos/xmodulo/11198394806/

View File

@ -0,0 +1,204 @@
How to integrate Google Calendar in Linux desktop
================================================================================
Google Calendar is one of the most popular web applications. One can access or sync Google Calendar across multiple devices either via web interface or with native apps. In Linux, there are several ways to access Google Calendar natively, such as by using email client plugins (e.g., Evolution or Thunderbird) or calendar apps (e.g., Sunbird or Rainlendar). These solutions, however, typically involve installing unnecessarily bulky software which you will probably not need.
If all you want is to access and get reminded by Google Calendar natively on Linux, then you can consider [Google Calendar command line interface (or gcalcli)][1], which is much more light-weight. Even better for Linux desktop, you can use gcalcli together with [Conky][2], to integrate Google Calendar into your desktop theme transparently.
In this tutorial, I will demonstrate **how to integrate Google Calendar into Linux desktop, by using gcalcli and Conky**.
### Install gcalcli on Linux ###
Before installing gcalcli, verify that you are using Python 2, as gcalcli is not compatible with Python 3.
To install gcalcli on Debian, Ubuntu or Linux Mint, use the following commands.
$ sudo apt-get install git python-pip python-gdata python-dateutil python-gflags python-vobject python-parsedatetime
$ sudo pip install google-api-python-client
$ sudo pip install apiclient urllib3
$ git clone https://github.com/insanum/gcalcli.git
$ cd gcalcli
$ sudo python setup.py install
**Note**: gcalcli is included in the standard repository of Ubuntu or Linux mint. However, that version is not updated with the latest features and bug fixes. So I recommend building gcalcli from the source, as documented above.
To install gcalcli on Fedora, CentOS or RHEL, run the following.
$ sudo yum install git python-pip python-gdata python-dateutil python-gflags python-vobject
$ sudo pip install google-api-python-client
$ sudo pip install apiclient urllib3
$ git clone https://github.com/insanum/gcalcli.git
$ cd gcalcli
$ sudo python setup.py install
### Google Authentication for gcalcli ###
To be able to access Google Calendar with gcalcli, you need to go through OAuth2 authention with your Google account, in order to grant gcalcli permission to access your Google Calendar.
The first time you run gcalcl, OAuth2 authentication will automatically be initiated. Thus run the following command to start.
$ gcalcli agenda
The command will print out a URL as shown below.
[![](http://farm4.staticflickr.com/3791/11216331146_d2c5f95963_z.jpg)][3]
At the same time, it will pop up a web browser window, and direct you to the URL. If a web browser window fails to open for any reason, you can copy and paste the URL into a web browser window manually.
If you are not logged in to your Google account, you will be asked to log in. After logging in, you will see the following message, asking you to allow gcalcl to manage your Google Calendar. Click on "Accept" button.
[![](http://farm4.staticflickr.com/3810/11216308465_1008fc1bb3_z.jpg)][4]
Enable Google Calendar API
After authentication, the next step is to enable API access for Google Calendar. gcalcli accesses your Google Calendar via Google Calendar API. In order to use Google Calendar API, however, you need to explicitly enable the API under your Google account.
First go to: [https://cloud.google.com/console][5]. Click on "API Project" under project list.
Go to "APIs & auth" --> "APIs" to see a list of Google APIs. Click on toggle button for "Calendar API" to enable the API.
Now go to "APIs & auth" --> "Registered apps" to register gcalcli app. Click on "Register app" button on the top.
[![](http://farm8.staticflickr.com/7293/11216363656_c203b6dfa2_z.jpg)][6]
Fill in the app name (e.g., "My Gcalcli"), and choose "Native" as a platform. Click on "Register" button to finalize.
This will create and show OAuth client ID and secret as follows. Make a note of this information. You can ignore the warning saying that "You have not set up your product name".
[![](http://farm3.staticflickr.com/2890/11216593546_312a564f1f_z.jpg)][7]
The result of OAuth authentication will be saved in ~/.gcalcli_oauth text file.
### Access Google Calendar from the Command Line with gcalcli ###
You are almost ready to access Google Calendar with gcalcli.
Create a gcalcli configuration file in your home directory as follows. Put OAuth client ID and secret that you obtained before, in the following format.
$ vi ~/.gcalclirc
> --client_id='XXXXXXXXXX.apps.googleusercontent.com'
> --client_secret='YYYYYYYYYYYYYYYY'
At this point, you should be able to run gcalcli from the command line.
Try the following two commands, which will print a list of your Google Calendars, and an agenda for the next 5 days, respectively.
$ gcalcli list
$ gcalcli agenda
[![](http://farm4.staticflickr.com/3780/11216465043_c8f6d8967d_z.jpg)][8]
### Integrate gcalcli with Conky ###
The final step is to integrate the output of gcalcli into your desktop theme. For that, you need Conky, which is a very powerful tool that can display a wide range of information directly on desktop theme.
First [install Conky][9] on your Linux system.
Then, create a following script somewhere in your home directory (e.g., ~/bin).
$ vi ~/bin/gcal.sh
> #!/bin/sh
>
> gcalcli --conky calw 2 |
> sed -e 's/^[(0\x71^[(B/?/g' \
> -e 's/^[(0\x78^[(B/?/g' \
> -e 's/^[(0\x6A^[(B/?/g' \
> -e 's/^[(0\x6B^[(B/?/g' \
> -e 's/^[(0\x6C^[(B/?/g' \
> -e 's/^[(0\x6D^[(B/?/g' \
> -e 's/^[(0\x6E^[(B/?/g' \
> -e 's/^[(0\x74^[(B/?/g' \
> -e 's/^[(0\x75^[(B/?/g' \
> -e 's/^[(0\x76^[(B/?/g' \
> -e 's/^[(0\x77^[(B/?/g'
$ chmod +x ~/bin/gcal.sh
**Important Note**: '^[' in the above script must be the **actual ESCAPE key** (i.e. press Ctrl-V ESC in vi editor).
This script translates VT100 escape sequences to Unicode box drawing characters. This is a [needed workaround][10] because Conky does not support ASCII line art used by gcalcli.
Finally, create a Conky configuration file in your home directory as follows.
$ vi ~/.conkyrc
> alignment top_right
> maximum_width 630
> minimum_size 330 10
> gap_x 25
> gap_y 50
>
> own_window yes
> own_window_type conky
> own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
> own_window_transparent yes
> own_window_argb_visual yes
> own_window_argb_value 0
>
> update_interval 300
> background no
>
> border_width 1
> default_color cornflowerblue
> default_outline_color white
> default_shade_color white
> double_buffer no
> draw_borders no
> draw_graph_borders no
> draw_outline no
> draw_shades no
> max_port_monitor_connections 64
> max_specials 512
> max_user_text 16384
> text_buffer_size 8096
> no_buffers yes
> out_to_console no
> uppercase no
> use_xft yes
> xftfont Bitstream Vera Sans Mono:size=10
>
> TEXT
> *** Google Calendar Agenda ***
> ${execpi 300 gcalcli --conky agenda}
> ${execpi 300 ~/bin/gcal.sh}
This Conky configuration will display an agenda and two weeks' worth of schedules of your Google Calendar, directly in your desktop theme. The displayed info is updated every 5 minutes.
Now you can activate Conky by running the following.
$ conky
You should see Google Calendar in the right side of your Linux desktop as follows.
[![](http://farm8.staticflickr.com/7390/11216377436_72d00cec49_z.jpg)][11]
Once you verify that Google Calendar shows up correctly, you can set Conky to auto-start every time you log in to your desktop.
### Set up Google Calendar Reminder ###
gcalcli can also send a reminder for any upcoming schedule in your Google Calendar. It uses notify-send command to send desktop notifications. For Google Calendar reminder, you can set up a cron job like the following.
$ crontab -l
> */10 * * * * /usr/local/bin/gcalcli remind
--------------------------------------------------------------------------------
via: http://xmodulo.com/2013/12/integrate-google-calendar-linux-desktop.html
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:https://github.com/insanum/gcalcli
[2]:http://conky.sourceforge.net/
[3]:http://www.flickr.com/photos/xmodulo/11216331146/
[4]:http://www.flickr.com/photos/xmodulo/11216308465/
[5]:https://cloud.google.com/console
[6]:http://www.flickr.com/photos/xmodulo/11216363656/
[7]:http://www.flickr.com/photos/xmodulo/11216593546/
[8]:http://www.flickr.com/photos/xmodulo/11216465043/
[9]:http://xmodulo.com/2013/12/install-configure-conky-linux.html
[10]:https://github.com/insanum/gcalcli/issues/97
[11]:http://www.flickr.com/photos/xmodulo/11216377436/

View File

@ -0,0 +1,103 @@
How to stitch photos together on Linux
================================================================================
If you are an avid photographer, you will probably have several stunning panoramic photos in your portfolio. You don't have to be a professional photographer, nor need specialized equipment to create dramatic panoramic pictures. In fact, there are quite a few picture stitch apps (online or offline, desktop or mobile), which can easily create a panoramic view of a scene from two or more overlapping pictures.
In this tutorial, I will explain **how to stitch photos together on Linux**. For that, I am going to use panoramic photo stitching software called [Hugin][1].
Hugin is an open-source (GPLv2) free panorama photo stitching tool. It is available on multiple platforms including Linux, Windows, OS X, and FreeBSD. Being open-source freeware does not mean that Hugin won't match up to other commercial photo stitchers in terms of features and quality. On the contrary, Hugin is extremely powerful, capable of creating a 360-degree panoramic image, and featuring various advanced photometric corrections and optimizations.
### Install Hugin on Linux ###
To install Hugin on Debian, Ubuntu or Linux Mint:
$ sudo apt-get install hugin
To install Hugin on Fedora:
$ sudo yum install hugin
### Launch Hugin ###
Use hugin command to launch Hugin.
$ hugin
The first thing to do is to load photos that you want to stitch together. For that, click on "Load images" button, and load (two or more) pictures to join. It should be obvious, but individual pictures need to be overlapping with each other.
[![](http://farm3.staticflickr.com/2884/11230363115_9aaaf5d8e4_z.jpg)][2]
### First Round of Photo Stitching ###
After loading pictures, click on "Align" button for the first round of stitching.
[![](http://farm8.staticflickr.com/7405/11230471403_4aab2dd708_z.jpg)][3]
Hugin will then run stitching assistant in a separate window, which analyzes common keypoints (or control points) between photos to combine the photos properly. After analysis is completed, you will see a panorama preview window, which will display panorama preview.
Switch back to the Hugin's main window. Under the "Align" button, you will see the status of photo stitching (i.e., number of control points, mean error). It will also say whether fit is good or bad.
[![](http://farm3.staticflickr.com/2838/11230471243_c59a6dd6cd_z.jpg)][4]
If it says "bad" or "really bad" fit, you can go ahead and fine-tune picture alignment as demonstrated below.
### Add or Remove Control Points ###
In the main Hugin window, go to "Control Points" tab. In this tab, Hugin shows which common control points are used to join multiple photos. It shows a pair of photos in left/right panels, and common key points between them are visualized with small boxes of the same color. You can remove any spurious points, or add new common points by hand. The more accurately matched points there are, the better quality stitching you will get. Also, if matched control points are well spread-out, they will be more helpful (than highly clustered control points).
[![](http://farm4.staticflickr.com/3706/11230392866_aeee95908d_z.jpg)][5]
Using the left/right arrow buttons located at the top-center, find a pair of photos which have least common control points. Given such a pair, try adding more common points by hand as follows.
Click one spot on a left-side photo, and then click on the corresponding identical spot on a right-side photo. Hugin will try to fine-tune the match automatically. Click on "Add" button at the bottom to add the matched pair. Repeat this process to add additional common points.
[![](http://farm4.staticflickr.com/3790/11230376534_4acfdf09c8_z.jpg)][6]
### Other Optimizations ###
You can also try re-optimization. Either click on "Re-optimize" button in the toolbar, or go to "Optimizer" tab to fine-tune the optimization.
[![](http://farm4.staticflickr.com/3830/11230470413_05dbb778d0_z.jpg)][5]
Go back to "Assistant" tab in the main Hugin window, and click on "Align" button again to see if you get a better result.
If the combined panoramic view has a wavy horizon, you can straighten out the horizon. For that, click on "Preview panorama" button in the toolbar.
[![](http://farm8.staticflickr.com/7423/11230361845_afbb2e11ea_z.jpg)][6]
Then click on "Straighten" button in the Panorama preview window.
[![](http://farm4.staticflickr.com/3750/11230470463_2b4ef3dedf_z.jpg)][7]
Once you are satisfied with the stitch result, you can go ahead, and export it to an image file. For that, go to "Stitcher" tab in the Hugin's main window, and do the following.
Adjust canvas size, and amount of crop. Also, select output format (e.g., TIFF, JPEG, PNG). Finally, click on "Stitch!" button.
[![](http://farm3.staticflickr.com/2837/11230376234_2e46342a01_z.jpg)][8]
You will be asked to save a current project file (*.pto), and then specify output file name for the stitched photo.
It will take a couple of seconds to finalize photo stitch.
Here is the output of my experiment with Hugin. This is a beautiful panoramic view of luxury beach front in Cancun, Mexico. :-)
[![](http://www.flickr.com/photos/xmodulo/11230423496/)][9]
--------------------------------------------------------------------------------
via: http://xmodulo.com/2013/12/stitch-photos-together-linux.html
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:http://hugin.sourceforge.net/
[2]:http://www.flickr.com/photos/xmodulo/11230363115/
[3]:http://www.flickr.com/photos/xmodulo/11230471403/
[4]:http://www.flickr.com/photos/xmodulo/11230471243/
[5]:http://www.flickr.com/photos/xmodulo/11230392866/
[6]:http://www.flickr.com/photos/xmodulo/11230376534/
[7]:http://www.flickr.com/photos/xmodulo/11230470413/
[8]:http://www.flickr.com/photos/xmodulo/11230361845/
[9]:http://www.flickr.com/photos/xmodulo/11230470463/
[10]:http://www.flickr.com/photos/xmodulo/11230376234/
[11]:http://www.flickr.com/photos/xmodulo/11230423496/