20140716-1 选题

This commit is contained in:
DeadFire 2014-07-16 10:20:20 +08:00
parent f2031c12d1
commit c38b925454
4 changed files with 349 additions and 0 deletions

View File

@ -0,0 +1,101 @@
5 Simple Ways To Make Cinnamon Feel at Home on Ubuntu
================================================================================
![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/07/des.jpg)
**The latest stable release of the popular Cinnamon desktop environment is [once again available for Ubuntu users to install][1].**
And while its good to go out of the box (or rather PPA) there are a handful of small tweaks you can make to get an even better experience.
If you dont have Cinnamon installed in Ubuntu head on over to our previous article about it.
### Change the Mint Menu Icon ###
The Mint Menu is one of the standout features of Cinnamon. Its a simple, fast and familiar way to search, open and organise your applications. By default the menu uses the Linux Mint logo on the launcher item. Since youre running the DE on Ubuntu rather than Mint you may prefer the menu to use Ubuntus familiar orange circle of friends logo instead. How? Its easy.
![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/07/min-menu.jpg)
To change the Cinnamon menu icon to the Ubuntu emblem right click on the applet and select Configure. In the Settings window that appears check Use a custom icon and enter the following to use the Ubuntu logo:
/usr/share/icons/ubuntu-mono-dark/actions/24/package-supported.svg
You can use any supported image type. Just enter the path to the icon in the field, or click the box at the end to open a file picker.
### Try Out Cinnamon Themes ###
![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/07/cinnamon-themes-zukitwo.jpg)
Like GNOME Shell Cinnamon also supports custom themes. And by that I dont mean just GTK themes for apps and window decoration, but visual styles that theme the shell as a whole — panel, menu, applets, and so on.
Cinnamon themes can be browsed, downloaded and enabled without leaving the desktop — no downloads or manual installation required. Open the Appearance pane of the Cinnamon Settings tool and select the Online Themes tab to get started.
Below are a handful of our favourite themes.
- [**Android Holo**][2] — Android 4.x style theme
- [**Zukitwo**][3] — Sleek, stylish and light
- [**Minty**][4] — Dark theme with bold green accents
- [**Metro**][5] — Based on the visual style of Windows 8.x
### Find Your Perfect Layout ###
Unity may insist that its app launcher stay bolted firmly to the side of the screen, but Cinnamon has no such qualms about letting you rearrange the desktop layout to suit your own style.
Panels can be added, edited and moved manually, or by selecting one of three preset layouts:
![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/07/traditional.jpg)
Open `Settings > Panel > Layout Options > Panel Layout` and select from one of the following:
- Traditional this is the default layout, with a panel at the bottom of the screen
- Flipped like traditional, but with panel on top of the screen
- Classic two panels, one at the top, one at the bottom
You will need to log out or restart Cinnamon before your selected changes will take effect.
### Add Panel Applets ###
![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/07/weather-applet.png)
Cinnamon embraces extensibility with the same gusto as GNOME Shell. A wealth of community add-ons and applets offering extra features and functionality, such as weather, system monitors and window management tools, are available to browse, install and enable straight form the desktop.
Right click on the panel you wish to add an applet to and select …Add Applets to the Panel. Some notable applets to check out:
- [**Weather**][6] - does what it forecasts (ho ho)
- [**Stark Menu**][7] - Clone of the Windows 7 Start Menu
- [**Screenshot**][8] — Easy way to grab screenshots with delays
### Change Date Format ###
![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/07/applet.jpg)
Cinnamons time and date applet is handy if, like me, youre prone to never remembering the date.
But it defaults to only showing the time in the 24 hour clock format. The good news is that we can tweak the time format of the clock applet fairly easily.
Right click and select the Configure option. In the settings window that appears tick the box listed beside “Use a custom date format“. Next, use an online generator tool to generate a date/time format suited to you, or use one of the presets listed below by copying and pasting the bit marked in bold:
- **%B %e, %I:%M %p** (July 13, 7:19 PM)
- **%m/%d/%Y** (07/13/2014)
- **%l:%M %p** (7:19 PM)
Changes are applied immediately, and if you make a mistake you can uncheck the custom date format option to return to the default settings.
### Going Further ###
These are just a handful of customisation choices available in Cinnamon, but we think theyre a good springboard for exploring more. Let us know what your favourite Cinnamon tweaks are in the comments section below, on Facebook or via Google+.
--------------------------------------------------------------------------------
via: http://www.omgubuntu.co.uk/2014/07/5-things-installing-cinnamon-ubuntu
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:http://www.omgubuntu.co.uk/2014/07/new-cinnamon-ubuntu-14-04-ppa-stable
[2]:http://cinnamon-spices.linuxmint.com/themes/view/122
[3]:http://cinnamon-spices.linuxmint.com/themes/view/219
[4]:http://cinnamon-spices.linuxmint.com/themes/view/25
[5]:http://cinnamon-spices.linuxmint.com/themes/view/188
[6]:http://cinnamon-spices.linuxmint.com/applets/view/17
[7]:http://cinnamon-spices.linuxmint.com/applets/view/168
[8]:http://cinnamon-spices.linuxmint.com/applets/view/35

View File

@ -0,0 +1,117 @@
How to analyze Squid logs with SARG log analyzer on CentOS
================================================================================
In a [previous tutorial][1], we show how to configure a transparent proxy with Squid on CentOS. Squid provides many useful features, but analyzing a raw Squid log file is not straightfoward. For example, how could you analyze the time stamps and the number of hits in the following Squid log?
1404788984.429 1162 172.17.1.23 TCP_MISS/302 436 GET http://facebook.com/ - DIRECT/173.252.110.27 text/html
1404788985.046 12416 172.17.1.23 TCP_MISS/200 4169 CONNECT stats.pusher.com:443 - DIRECT/173.255.223.127 -
1404788986.124 174 172.17.1.23 TCP_MISS/200 955 POST http://ocsp.digicert.com/ - DIRECT/117.18.237.29 application/ocsp-response
1404788989.738 342 172.17.1.23 TCP_MISS/200 3890 CONNECT www.google.com:443 - DIRECT/74.125.200.106 -
1404788989.757 226 172.17.1.23 TCP_MISS/200 942 POST http://clients1.google.com/ocsp - DIRECT/74.125.200.113 application/ocsp-response
1404788990.839 3939 172.17.1.23 TCP_MISS/200 78944 CONNECT fbstatic-a.akamaihd.net:443 - DIRECT/184.26.162.35 -
1404788990.846 2148 172.17.1.23 TCP_MISS/200 118947 CONNECT fbstatic-a.akamaihd.net:443 - DIRECT/184.26.162.35 -
1404788990.849 2151 172.17.1.23 TCP_MISS/200 76809 CONNECT fbstatic-a.akamaihd.net:443 - DIRECT/184.26.162.35 -
1404788991.140 611 172.17.1.23 TCP_MISS/200 110073 CONNECT fbstatic-a.akamaihd.net:443 - DIRECT/184.26.162.35
SARG (or Squid Analysis Report Generator) is a web based tool that creates reports from Squid logs. SARG provides an easy-to-understand view of network traffic handled by Squid, and it is very easy to set up and maintain. In the following tutorial, we show **how to set up SARG on a CentOS platform**.
We start the process by installing necessary dependencies using yum.
# yum install gcc make wget httpd crond
Necessary services are started and loaded at startup.
# service httpd start; service crond start
# chkconfig httpd on; chkconfig crond on
Now we download and extract SARG.
# wget http://downloads.sourceforge.net/project/sarg/sarg/sarg-2.3.8/sarg-2.3.8.tar.gz?
# tar zxvf sarg-2.3.8.tar.gz
# cd sarg-2.3.8
**NOTE**: For 64-bit Linux, the source code in log.c needs to be patched as follows.
1506c1506
< if (fprintf(ufile->file, "%s\t%s\t%s\t%s\t%"PRIi64"\t%s\t%ld\t%s\n",dia,hora,ip,url,nbytes,code,elap_time,smartfilter)<=0) {
---
> if (fprintf(ufile->file, "%s\t%s\t%s\t%s\t%"PRIi64"\t%s\t%ld\t%s\n",dia,hora,ip,url,(int64_t)nbytes,code,elap_time,smartfilter)<=0) {
1513c1513
< fprintf(fp_log, "%s\t%s\t%s\t%s\t%s\t%"PRIi64"\t%s\t%ld\t%s\n",dia,hora,user,ip,url,nbytes,code,elap_time,smartfilter);
---
> fprintf(fp_log, "%s\t%s\t%s\t%s\t%s\t%"PRIi64"\t%s\t%ld\t%s\n",dia,hora,user,ip,url,(int64_t)nbytes,code,elap_time,smartfilter);
1564c1564
< printf("LEN=\t%"PRIi64"\n",nbytes);
---
> printf("LEN=\t%"PRIi64"\n",(int64_t)nbytes);
Go ahead and build/install SARG as follows.
# ./configure
# make
# make install
After SARG is installed, the configuration file can be modified to match your requirements. The following is one example of SARG configuration.
# vim /usr/local/etc/sarg.conf
----------
access_log /var/log/squid/access.log
temporary_dir /tmp
output_dir /var/www/html/squid-reports
date_format e ## We use Europian DD-MM-YYYY format here ##
## we dont want multiple reports for single day/week/month ##
overwrite_report yes
Now it's time for a test run. We run sarg command in debug mode to find whether there is any error.
# sarg -x
If all goes well, sarg should analyze Squid logs, and create reports in /var/www/html/squid-reports. The reports should be visible in a web browser using the address http://<server-IP>/squid-reports/
![](https://farm3.staticflickr.com/2931/14631403935_4ff34e07b9_z.jpg)
![](https://farm4.staticflickr.com/3901/14629281644_fec31014c5_z.jpg)
SARG can be used to create daily, weekly and monthly reports. Time range can be specified using the "-d" parameter with possible values in the form of day-n, week-n or month-n, where n is the number of days/weeks/months to jump backward. For example, with week-1, SARG will generate a report for the previous week. With day-2, SARG will prepare reports for the previous two days.
As a demonstration, we will prepare a cron job to run SARG daily.
# vim /etc/cron.daily/sarg
----------
#!/bin/sh
/usr/local/bin/sarg -d day-1
The file needs a execution permission.
# chmod 755 /usr/local/bin/sarg
Now SARG should prepare daily reports about Squid-managed traffic. These reports can easily be accessed from the SARG web interface.
To sum up, SARG is a web based tool that analyzes Squid logs and presents the analysis in an informative way. System admins can leverage SARG to monitor what sites are being accessed, and to keep track of top visited sites and top users. This tutorial covers a working configuration for SARG. You can customize the configuration even further to match your requirements.
Hope this helps.­­­­
----------
[Sarmed Rahman][w]
- [Twitter profile][t]
- [LinkedIn profile][l]
Sarmed Rahman is an IT professional in the Internet Industry in Bangladesh. He writes tutorial articles on technology every now and then from a belief that knowledge grows through sharing. During his free time, he loves gaming and spending time with his friends.
--------------------------------------------------------------------------------
via: http://xmodulo.com/2014/07/analyze-squid-logs-sarg-log-analyzer-centos.html
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:http://xmodulo.com/2014/06/squid-transparent-web-proxy-centos-rhel.html
[w]:http://amar-linux.blogspot.com/
[t]:http://twitter.com/SarmedRahman
[l]:http://www.linkedin.com/in/sarmedrahman

View File

@ -0,0 +1,91 @@
How to check RPM package dependencies on Fedora, CentOS or RHEL
================================================================================
A typical RPM package on Red Hat-based systems requires all its dependent packages be installed to function properly. For end users, the complexity of such RPM dependency is hidden by package managers (e.g., yum or DNF) during package install/upgrade/removal process. However, if you are a sysadmin or a RPM maintainer, you need to be well-versed in RPM dependencies to maintain run-time environment for the system or roll out up-to-date RPM specs.
In this tutorial, I am going to show **how to check RPM package dependencies**. Depending on whether a package is installed or not, there are several ways to identify its RPM dependencies.
### Method One ###
One way to find out RPM dependencies for a particular package is to use rpm command. The following command lists all dependent packages for a target package.
$ rpm -qR <package-name>
![](https://farm6.staticflickr.com/5512/14659620723_4a36970efc_o.png)
Note that this command will work only if the target package is already **installed**. If you want to check package dependencies for any **uninstalled** package, you first need to download the RPM package locally (no need to install it).
To download a RPM package without installing it, use a command-line utility called `yumdownloader`. Install yumdownloader as follows.
$ sudo yum install yum-utils
Now let's check RPM depenencies of a uninstalled package (e.g., tcpdump). First download the package in the current folder with yumdownloader:
$ yumdownloader --destdir=. tcpdump
Then use rpm command with "-qpR" options to list dependencies of the downloaded package.
# rpm -qpR tcpdump-4.4.0-2.fc19.i686.rpm
### Method Two ###
You can also get a list of dependencies for a RPM package using repoquery tool. repoquery works whether or not a target package is installed. This tool is included in yum-utils package.
$ sudo yum install yum-utils
To show all required packages for a particular package:
$ repoquery --requires --resolve <package-name>
![](https://farm3.staticflickr.com/2935/14453103778_05db349b19_o.png)
For repoquery to work, your computer needs network connectivity since repoquery pulls information from Yum repositories.
### Method Three ###
The third method to show RPM package dependencies is to use rpmreaper tool. Originally this tool is developed to clean up unnecessary packages and their dependencies on RPM-based systems. rpmreaper has an ncurses-based intuitive interface for browsing installed packages and their dependency trees.
To install rpmrepater, use yum command. On CentOS, you need to [set up EPEL repo][1] first.
$ sudo yum install rpmreaper
To browser RPM dependency trees, simply run:
$ rpmreaper
![](https://farm4.staticflickr.com/3838/14636456131_99a3c26945_z.jpg)
The rpmrepater interface will show you a list of all installed packages. You can navigate the list using up/down arrow keys. Press "r" on a highlighted package to show its dependencies. You can expand the whole dependency tree by recursively pressing "r" keys on individual dependent packages. The "L" flag indicates that a given package is a "leaf", meaning that no other package depends on this package. The "o" flag implies that a given package is in the middle of dependency chain. Pressing "b" on such a package will show you what other packages require the highlighted package.
### Method Four ###
Another way to show package dependencies on RPM-based systems is to use rpmdep which is a command-line tool for generating a full package dependency graph of any installed RPM package. The tool analyzes RPM dependencies, and produce partially ordered package lists from topological sorting. The output of this tool can be fed into dotty graph visualization tool to generate a dependency graph image.
To install rpmdep and dotty on Fedora:
$ sudo yum install rpmorphan graphviz
To install the same tools on CentOS:
$ wget http://downloads.sourceforge.net/project/rpmorphan/rpmorphan/1.14/rpmorphan-1.14-1.noarch.rpm
$ sudo rpm -ivh rpmorphan-1.14-1.noarch.rpm
$ sudo yum install graphviz
To generate and plot a dependency graph of a particular installed package (e.g., gzip):
$ rpmdep.pl -dot gzip.dot gzip
$ dot -Tpng -o output.png gzip.dot
![](https://farm4.staticflickr.com/3918/14453050980_53de4e8277_z.jpg)
So far in this tutorial, I demonstrate several ways to check what other packages a given RPM package relies on. If you want to know more about .deb package dependencies for Debian-based systems, you can refer to [this guide][2] instead.
--------------------------------------------------------------------------------
via: http://xmodulo.com/2014/07/check-rpm-package-dependencies-fedora-centos-rhel.html
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:http://xmodulo.com/2013/03/how-to-set-up-epel-repository-on-centos.html
[2]:http://xmodulo.com/2013/07/how-to-check-package-dependencies-on-ubuntu-or-debian.html

View File

@ -0,0 +1,40 @@
Simple Dock GNOME Shell Extension Puts Your Fave Apps On The Desktop
================================================================================
![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/07/screenshot_815_1.jpg)
**I love GNOME Shell, but what I dont love is having to rustle through a hidden screen to get at my favourite applications or switch between those I have running. **
It may make me sound awesomely retro, like a UX luddite, or like someone who has become far too accustomed to the usability of Unity but I, like many of you reading this, like having an app launcher/switcher accessible on the desktop. Its a familiar, fast way of working.
GNOME Shell is, by design, different. It tucks everything out of the way from the messaging centre and notifications, to workspaces and the apps list. Its a minimal aesthetic that makes sense: help users focus on what matters.
But for me, my desktop needs to be more than a glorified picture frame.
### The Beauty of GNOME Shell ###
Despite my own preferences, the decision to hide apps is part of the beauty of GNOME Shell. It ships with a default desktop experience that is user friendly, sane and predictable — but also thoroughly extensible. Because of this theres a huge array of add-ons catering to every need, niche and want, including traditional app menus, desktop docks and even an Ubuntu Unity Dash clone!
In this article Im just focusing on one add-on that caters to my needs: the aptly named **Simple Dock**. Simple Dock takes the GNOME Shell apps grid and favourites bar and puts it slap bang where I want it: on the desktop.
For now it only supports being positioned on the bottom of the screen, and only offers a minimal set of settings. While minimal, I feel these cover all of my needs:
- ntelligent auto hide
- Minimise/restore application windows
- Drag-and-drop favourites
- Button to launch activities overlay
Want it? Providing youre running GNOME Shell on Ubuntu 13.10 or above you can. Just head on over to the GNOME Extensions page linked to below in a supported browser (Firefox, GNOME Web, etc.) then slide the on-page switch from off to on.
- [Simple Dock on GNOME Shell Extensions][1]
To adjust the settings of Simple Dock hit the cog icon on the GNOME Extensions webpage listing for it or through a desktop application like GNOME Tweak Tool.
--------------------------------------------------------------------------------
via: http://www.omgubuntu.co.uk/2014/07/simple-dock-gnome-shell-extension
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:https://extensions.gnome.org/extension/815/simple-dock/