Merge pull request #24 from LCTT/master

Update Repository
This commit is contained in:
joeren 2014-07-28 08:18:12 +08:00
commit 87175716d7
20 changed files with 1149 additions and 1308 deletions

View File

@ -1,8 +1,11 @@
主流搜索引擎闯入Linux命令行世界
================================================================================
LCTT译注这里我们姑且认为您身处能够访问Internet的地方
为什么会有人要从终端搜索互联网上的东西我不清楚这里头可能有许多的原因。但是因为没人要求答案总比没人知道答案少令人失望一点。这里列出了一些流行的搜索引擎的命令行工具可以让你们通过Linux终端来访问它们。
### 1. Google ###
让我们从一个巨头开始吧Bing好吧只是开个玩笑事实上应该是Google。坦白讲你根本不需要使用命令行工具来进行Google搜索。只需要简简单单的一个命令
$ xdg-open https://www.google.com/search?q="[query]"
@ -84,11 +87,12 @@ Twitter是迎合潮流的一个很好的搜索引擎。我们已经在[如何在
#### Adrien Brochard ####
我是一位来自法国的Linux爱好者。在尝试了多个发行版后我最后认可了Archlinux。然而我一直在试着通过积累一些知识和技巧来改善我的系统。
--------------------------------------------------------------------------------
via: http://xmodulo.com/2014/06/access-popular-search-engines-command-line-linux.html
译者:[GOLinux](https://github.com/GOLinux) 校对:[校对者ID](https://github.com/校对者ID)
译者:[GOLinux](https://github.com/GOLinux) 校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出

View File

@ -1,8 +1,9 @@
怎样去查找并杀掉非法的MySQL查询
怎样把坏的MySQL查询找到并杀死
================================================================================
有时,相关数据库系统的复杂性可能被压倒.幸运地,这种复杂性是一种优势,与 MySQL工具一起管理查询. 在本教程中, 我将向你们展示 **怎样去查找并杀掉任何非法的MySQL查询**.
为了浏览当前正在运行的查询, 登陆到MySQL终端然后运行show processlist命令:
有时关系型相关数据库系统的复杂性会把你搞晕不过幸运的是使用MySQL工具来管理查询就就可以避免这些复杂性。 在本教程中,我将向你们展示 **怎样去查找并杀掉任何非法的MySQL查询**
为了浏览当前正在运行的查询登陆到MySQL终端然后运行show processlist命令:
mysql> show processlist;
@ -16,10 +17,10 @@
+--------+--------+-----------------+---------+---------+-------+-------+------------------+-----------+---------------+-----------+
4 rows in set (0.03 sec)
首先 你应该查看'Time'项, 这里记录了进程执行 "doing the thing it's doing" 操作的秒数. command项处于Sleep
状态的进程正在等待查询, 因此,它并没有消耗任何资源. 对于其他任何进程而言Time超过一定的秒数表明出现问题.
首先你应该查看'Time'项,这里记录了进程执行 "做其当做的事情" 操作的秒数。command项处于Sleep
状态的进程表示其正在等待接受查询因此它并没有消耗任何资源。对于其他任何进程而言Time超过一定的秒数表明出现问题。
这种情况下,只能通过运行show processlist命令来查询.如果我们有一个糟糕的写查询,让我们来看看情况如何:
上面的例子中唯一运行的查询是我们的show processlist命令。让我们来看看如果我们有一个写的很烂的查询是怎么样的:
mysql> show processlist;
@ -35,19 +36,19 @@
+--------+--------+-----------------+-----------+---------+-------+--------------+----------------------------------+-----------+---------------+-----------+
6 rows in set (0.00 sec)
啊哈!现在我们看到这里的查询几乎运行了30s. 如果我们不想让它继续运行,可以使用它的'Id'去执行kill命令:
啊哈!现在我们看到有一个查询运行了将近30秒。如果我们不想让它的进程继续运行可以将它的'Id'传递给kill命令:
mysql> kill 132033;
Query OK, 0 rows affected (0.00 sec)
mysql>
(注意 由于我们没有改变任何数据,MySQL总是报告0行被影响.)
(注意 由于我们没有改变任何数据MySQL总是报告0行被影响。)
明智的使用kill命令能够清除积压的查询.记住,但那不是一种永久的方法 - 如果这些查询来自你的应用,你需要去重写它们,或者将继续看到相同的问题.
明智的使用kill命令能够清除积压的查询。然而,要记住的是,那不是一种永久的方法 - 如果这些查询来自你的程序,你需要去重写它们,或者将继续看到相同的问题不断出现。
### 另请参阅 ###
关于不同‘Command的MySQL文档:
关于不同‘命令的MySQL文档:
- [https://dev.mysql.com/doc/refman/5.7/en/thread-commands.html][1]
@ -55,7 +56,7 @@
via: http://xmodulo.com/2014/07/find-kill-misbehaving-mysql-queries.html
译者:[hunanchenxingyu](https://github.com/hunanchenxingyu) 校对:[校对者ID](https://github.com/校对者ID)
译者:[hunanchenxingyu](https://github.com/hunanchenxingyu) 校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出

View File

@ -1,10 +1,10 @@
如何在Ubuntu14.04中禁用叠加滚动条【小贴士】
[小技巧]如何在Ubuntu14.04中禁用叠加滚动条
================================================================================
![](http://180016988.r.cdn77.net/wp-content/uploads/2014/04/Ubuntu-14.042-790x493.jpeg)
Hello 伙计们,
这是一个如何在Ubuntu中禁用叠加滚动条的小贴士。注意,在本文中不是删除叠加功能,相反,你将启用或禁用它。
这是一个如何在Ubuntu中禁用叠加滚动条的小技巧。注意,在本文中讲的不是删除叠加功能,而是告诉你如何启用或禁用它。
### 禁用 ###

View File

@ -1,6 +1,6 @@
@@ -1,63 +0,0 @@
Linux基础如何在命令行中查看目录的大小
Linux基础如何在命令行中查看目录的大小
=====================================================================
这是写给Liunx新用户的一系列文章中的第一篇在这系列文章我将会写一些对新用户来说非常好用的**Linux基础命令**。
**注意**本文的目标读者是仅有小量甚至是没有任何Linux命令行使用经验的读者。
@ -59,7 +59,7 @@ Linux基础如何在命令行中查看目录的大小
via: http://www.unixmen.com/linux-basics-find-size-directory-commands/
译者:[cvsher](https://github.com/cvsher) 校对:[校对者ID](https://github.com/校对者ID)
译者:[cvsher](https://github.com/cvsher) 校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出

View File

@ -1,3 +1,4 @@
乌龙茶 占坑
Valve SteamOS: A Linux-based Gaming Operating System Announced
================================================================================
![](http://s0.cyberciti.org/images/faq/2013/09/steam-os.jpg)
@ -31,4 +32,4 @@ via: http://www.cyberciti.biz/linux-games/valve-announces-linux-based-steamos/
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:http://store.steampowered.com/livingroom/SteamOS/
[1]:http://store.steampowered.com/livingroom/SteamOS/

View File

@ -1,593 +0,0 @@
translating by disylee 20140701
110 Fun Open Source Games and Apps
================================================================================
Once again, we're celebrating the arrival of summer with a list of some of the best open source games available. We've updated [last year's list][1] with some new arrivals, as well as getting rid of some of the older games that are no longer under active development. You'll find arcade, board, casual, puzzle, educational, first-person shooter, music, racing, role-playing, adventure, simulator and strategy games, as a well as a few apps that aren't really games but are still a lot of fun.
This year, more open source games than ever before are now available for mobile devices, primarily Android devices. Hopefully, this trend will continue in coming years.
Please note that this list is not a ranking. The apps are arranged in categories and listed alphabetically within each category.
If you would like to suggest a game for next year's version of the list, feel free to make note in the comments section below.
### Arcade Games ###
#### 1. [Andy's Super Great Park][2] ####
Retrieve balloons while avoiding obstacles as you ride a roller coaster. Comes with 25 main levels, plus 18 more levels you can unlock by getting a high score. Operating System: Windows, Linux, Android.
#### 2. [Armagetron Advanced][3] ####
A 3D Tron clone, this game challenges you to guide your light cycle so that opponents run into a wall before you do. It supports single-player or networked games with up to 16 players. Operating System: Windows, Linux, OS X, Android.
#### 3. [BZFlag][4] ####
Also known as "Battle Zone Capture the Flag," BZFlag is a popular online tank game. In development since 1992, it features 3D graphics, multiple game modes and competitive multi-player matches. Operating System: Windows, Linux, OS X.
#### 4. [Chromium B.S.U.][5] ####
Don't let the name fool you—it has nothing to do with the Chromium browser. It's a fast-paced, top-scrolling shooter where the difficulty is set so that games will last less than fifteen minutes. Operating System: Windows, Linux.
#### 5. [The Legend of Edgar][6] ####
Legend of Edgar is an old-school platform game where the hero must overcome obstacles and enemies in order to accomplish his quest. It includes lots of different weapons and large levels. Operating System: Windows, Linux, OS X.
#### 6. [JVGS][7] ####
Instead of highly detailed graphics, JVGS takes a minimalist approach where stick figures cross a landscape that looks like it was hand-drawn in pencil. The main character in this highly unusual game is a poet who is losing his memories. Operating System: Windows, Linux, OS X.
#### 7. [No Gravity][8] ####
This space-based arcade shooter takes players to the year 8002 where they must complete a variety of missions. Related, but not free, games are also available for Android and iOS. Operating System: Windows, Linux, OS X.
#### 8. [Open Sonic][9] ####
Based on the Sonic the Hedgehog games, Open Sonic offers cooperative gameplay where the user can control three characters at once. Only two levels are available in the original game, but several fans have built mods that offer additional play. Operating System: Windows, Linux, OS X.
#### 9. [Powermanga][10] ####
Similar to the old arcade game Galaga, Powermanga is a 2D, top-scrolling space shooter. It's got more than 41 levels, and it can run on older hardware. Operating System: Linux.
#### 10. [Scorched3D][11] ####
Scorched3D is a modern take on the DOS game Scorched Earth, and it's noteworthy for its excellent graphics. You can play in single-player mode or connect to one of the many online servers for multi-player action. Operating System: Windows, Linux, OS X.
#### 11. [Sonic Robo Blast 2][12] ####
Another Sonic-inspired platform game, SRB2 is a 3D platform game built using the Doom engine. It includes three different playable characters and more than twenty levels. Operating System: Linux.
#### 12. [SuperTux][13] ####
SuperTux is a lot like the old Mario Bros. games, but with Tux the Linux penguin as the hero. It's a 2D side-scrolling platform game with nine different bad guys and 26 levels to play. Operating System: Windows, Linux, OS X.
#### 13. [Those Funny Funguloids][14] ####
This one-of-a-kind game challenges players to collect mushrooms in space. The website proclaims, "Never before has collecting mushrooms been this mildly entertaining. At least not in outer space. It's more of a lifestyle than a game, really." Operating System: Windows, Linux.
#### 14. [Teeworlds][15] ####
This online game describes itself as a "retro multiplayer shooter." It's a side-scrolling 2D game with support for up to 16 players and several different game modes. Operating System: Windows, Linux, OS X.
#### 15. [XMoto][16] ####
In this game, you ride a motorbike through a side-scrolling landscape while collecting strawberries and avoiding the spiky "wreckers." It's harder than it looks! Operating System: Windows, Linux, OS X.
#### 16. [Yo Frankie!][17] ####
Created with the Blender open source 3D animation tool, Yo Frankie! features characters from the open source movie Peach. Players must guide Frankie, a sugar glider, or Momo, a monkey, over, around and through the obstacles in a highly detailed 3D environment. Operating System: Windows, Linux, OS X.
### Board Games ###
#### 17. [Domination][18] ####
Java-based Domination brings the board game Risk to your PC or Android device. The latest version lets you play against your Google+ friends through the Google Play Game Services Real-time Multiplayer feature. Operating System: Windows, Linux, OS X, Android.
#### 18. [GNU Backgammon][19] ####
This "world-class" backgammon engine gets better every time you play against it, and it can analyze your play to help you get better. The interface is very nice with customizable graphics. Operating System: Windows, Linux, OS X.
#### 19. [Scrabble 3D][20] ####
With this variation of Scrabble you can choose your own board—the classic version, Superscrabble, 3D Scrabble or your own custom board. Play against the AI or connect to an online server for multi-player games. Operating System: Windows, Linux, OS X.
#### 20. [PokerTH][21] ####
This high-quality Texas Hold 'Em app features an excellent, customizable interface. To play online and see how you rank against other players, register online at Poker-Heroes.com. Operating System: Windows, Linux, OS X, Android.
#### 21. [PySolFC][22] ####
Did you know there were more than 1,000 variations of Solitaire? This huge collection features "games that use the 52 card International Pattern deck, games for the 78 card Tarock deck, eight and ten suit Ganjifa games, Hanafuda games, Matrix games, Mahjongg games, and games for an original hexadecimal-based deck." Operating System: Windows, Linux, OS X.
### Casual and Puzzle Games ###
#### 22. [2048][23] ####
In this simple but addictive puzzle game, the player moves blocks around to combine like numbers. You win when you hit 2048. Operating System: Online, iOS, Android.
#### 23. [Billiards][24] ####
Billiards aims to be realistic enough to let you practice cue sports when you don't have a table available. It has a good-looking 3D interface, but also runs in 2D for systems without a good graphics processor. Operating System: Linux.
#### 24. [Cube Trains][25] ####
Lay tracks to connect tunnels and bridges while maneuvering around obstacles. You can play the many built-in levels or create one of your own. Operating System: Windows, Linux, OS X.
#### 25. [Enigma][26] ####
Similar to the old Oxyd and Rock'n'Roll games, Enigma challenges users to find identical stones amid mazes, traps, laser beams and other obstacles. With more than 1,000 levels, this is one puzzle game that will keep you occupied for a long, long time. Operating System: Windows, Linux, OS X.
#### 26. [Fish Fillets NG][27] ####
In this puzzle game, players must try to find a safe way out of each of the 70 levels. Along the way, fish and other underwater residents offer humorous commentary on the user's progress. Operating System: Windows, Linux, OS X.
#### 27. [Frozen Bubble][28] ####
One of the oldest bubble shooter games around, Frozen Bubble features Tux the Linux Penguin and more than 100 levels for single-players. You can also play against two to five other players via a LAN or the Internet. Operating System: Windows, Linux.
#### 28. [GnomeGames][29] ####
This collection includes fifteen different casual games that you can play in five minutes or less. It includes Sudoku, a minesweeper game, Mahjong, a version of Reversi and more. Operating System: Linux.
#### 29. [I Have No Tomatoes][30] ####
How many tomatoes can you smash in ten minutes? This "extreme leisure time activity" comes from the same team as Those Funny Funguloids. Operating System: Windows, Linux.
#### 30. [KDE Games][31] ####
This is the collection of casual games for the KDE desktop. It includes a solitaire variation, a version of breakout, a golf game, a version of Risk, a minesweeper, sudoku and more. Operating System: Windows, Linux.
#### 31. [Neverball][32] ####
In this game, players must tilt the floor to guide a ball through an obstacle course. The game includes lots of levels or you can design your own. Operating System: Windows, Linux, OS X.
#### 32. [Pingus][33] ####
Did you spend hours playing Lemmings back in the 90s? If so, Pingus is for you. It's a remake of Lemmings (with penguins instead of lemmings) with 77 different levels. Operating System: Windows, Linux, OS X.
#### 33. [Pushover][34] ####
This puzzle game features ants who can push over dominoes arranged in various patterns. The player must get all the dominoes to fall and send the special trigger through the exit in order to get to the next level. Operating System: Windows.
#### 34. [Zaz][35] ####
Another bubble shooter, Zaz challenges you to hit balls as they travel along a preset path. The twist is that your shooter is also traveling along a path, making things just a little more difficult. Operating System: Windows, Linux.
### Educational Games ###
#### 35. [ChildsPlay][36] ####
Designed for those age five and under, ChildsPlay helps teach sounds, letters, numbers and basic keyboard skills. It also includes some games like memory, pong and pacman. Operating System: Windows, Linux, OS X.
#### 36. [GBrainy][37] ####
Exercise your mind with GBrainy's logic, word, math and memory games. It's fun and educational for players of all ages. Operating System: Windows, Linux.
#### 37. [GCompris][38] ####
Made for children ages 2 to 10, GCompris includes more than 100 different activities, most of them educational. It includes math, geography, science, reading, keyboarding and art games, plus chess, sudoku, memory and much more. Operating System: Windows, Linux.
#### 38. [TuxMath][39] ####
Solve arithmetic problems quickly before the incoming comets kill the penguins. This simple game reinforces math facts for elementary age students. Operating System: Windows, Linux, OS X.
### First-Person Shooter Games ###
#### 39. [Alien Arena][40] ####
Built "for fraggers by fraggers," Alien Arena is an intense deathmatch shooter with a retro sci-fi theme. Many different sites offer hosted servers for online games, and there are also plenty of fan sites with playing tips and more. Operating System: Linux, Windows, OS X.
#### 40. [AssaultCube][41] ####
Because of its light weight, AssaultCube can run on older hardware, despite its very good realistic graphics. It supports single-player or multi-player games and includes 26 different maps and 12 different game modes. Operating System: Linux, Windows, OS X.
#### 41. [Classic Nexuiz][42] ####
Downloaded more than 6 million times, Nexuiz is one of the most popular open source shooter games. A few years ago, a new closed-source version of the game was created, but you can still download the classic version from the link above or from SourceForge. Operating System: Windows, Linux, OS X.
#### 42. [OpenArena][43] ####
This multi-player game is a clone of Quake III Arena and features 13 different weapons, 51 arenas, 18 player characters and 12 types of games. The project's owners warn, "Due to violent and occasional racy content, it's unsuitable for children under the age of 17." Operating System: Windows, Linux, OS X.
#### 43. [Red Eclipse][44] ####
This casual first-person shooter has received excellent reviews. Features include Parkour, impulse boosts, dashing, several game modes and a built-in level editor. Operating System: Windows, Linux, OS X.
#### 44. [Tremulous][45] ####
This award-winning game mixes elements of a real-time strategy game with a first-person shooter. Users can choose to play as aliens or humans, always with the goal of eliminating the other team. Operating System: Windows, Linux, OS X, XBox.
#### 45. [TrueCombat][46] ####
TrueCombat claims to be "perhaps the best free tactical-realism shooter. EVER." It's a modern world combat simulator with two opposing teams. Note that in order to use it, you will also need Wolfenstein: Enemy Terriroty (see below). Operating System: Windows, Linux, OS X
#### 46. [Unvanquished][47] ####
Forked from Tremulous, Unvanquished pits "technologically advanced humans against hordes of highly adaptable aliens." It's under very active development with a new release every month. Operating System: Windows, Linux, OS X
#### 47. [Warsow][48] ####
The self-proclaimed "most fast-paced sport on the Web," Warsow is a cartoonish shooter featuring "Rocketlauncher-wielding pigs and lasergun-carrying cyberpunks." Unlike most shooters, it doesn't have a lot of blood and guts, and the emphasis is on movement. Operating System: Windows, Linux, OS X.
#### 48. [Wolfenstein: Enemy Terriorty][49] ####
Although there are several proprietary Wolfenstein games, this one is open source. It's a World War II-era game that pits the Axis against the Allies. Operating System: Windows, Linux, OS X
#### 49. [World of Padman][50] ####
Based on the Quake engine, this shooter is very cartoonish with little gore. Quite a few online servers are available, or you can play offline. Operating System: Windows, Linux.
#### 50. [Xonotic][51] ####
Xonotic was forked from the classic version of Nexuiz. It has more than 22 different maps, 16 weapons and lots of different gameplay modes. Operating System: Windows, Linux, OS X.
#### 51. [Zero Ballistics][52] ####
Part first-person shooter, part tank game, Zero Ballistics is set in a picturesque mountain environment and has more than 81 different tank setups available. Play deathmatch, team deathmatch or the unique beaconstrike game mode. Operating System: Windows, Linux, OS X.
### Music Games ###
#### 52. [Frets on Fire][53] ####
Frets on Fire is a lot like Guitar Hero, and it can even play Guitar Hero songs (though other songs are available as well). No worries if you don't have a guitar controller—you can also play with the keyboard. Operating System: Windows, Linux, OS X.
#### 53. [StepMania][54] ####
This is a free version of Dance Dance Revolution, which challenges users to stay in rhythm to the beat of the music. You can use dance pads (if you have them) to play, or you can just use the keyboard. Operating System: Windows, Linux/Unix, OS X, XBox.
#### 54. [Ultrastar Deluxe][55] ####
If karaoke is your thing, you'll love Ultrastar Deluxe. For this game, you must sing along to the music on pitch and in the correct rhythm. It comes with more than 10,000 songs included. Operating System: Windows, Linux, OS X.
### Racing Games ###
#### 55. [Extreme Tux Racer][56] ####
Tux Racer is a much-loved older game that features Tux the Linux penguin sliding down a mountain on his belly. Extreme Tux Racer updates the classic game for today's players. Operating System: Windows, Linux, OS X.
#### 56. [Speed Dreams][57] ####
This fork of the TORCS auto-racing game (see below) features an updated UI and many new cars and tracks. As in TORCS, the visuals are excellent. Operating System: Windows, Linux.
#### 57. [SuperTuxKart][58] ####
This cartoonish racer features Tux the Linux Penguin and friends driving go karts. Guide them around the tracks, while avoiding a horde of silly obstacles. Operating System: Windows, Linux, OS X.
#### 58. [TORCS][59] ####
Short for "The Open Racing Care Simulator," TORCS is an outstanding realistic racing game with a large fan base. Race alone or against friends on one of the many tracks available. Operating System: Windows, Linux, OS X.
#### 59. [Ultimate Stunts][60] ####
Inspired by the classic DOS game Stunts, Ultimate Stunts requires players to guide vehicles across broken bridges, jumps, loops, corkscrews and other obstacles. It allows offers the option of designing your own track with even more crazy stunts. Operating System: Windows, Linux, OS X.
#### 60. [VDrift][61] ####
As much a simulator as a racing game, VDrift introduces players to world of drift racing with a realistic physics engine. It includes more than 45 cars, more than 45 tracks, and support for a wide variety of controllers. Operating System: Windows, Linux, OS X.
### Role-Playing and Adventure Games ###
#### 61. [Crossfire][62] ####
Sometimes described as a cross between NetHack and Gauntlet, Crossfire is an arcade adventure game with very old-school graphics. It has more than 3,000 different maps featuring more than 150 different monsters. Operating System: Windows, Linux, OS X.
#### 62. [Epic Inventor][63] ####
Epic Inventor describes itself as a "side-scrolling action RPG." It's similar to Minecraft with simple, pixelated graphics and open-ended play. Operating System: Windows, Linux.
#### 63. [Excalibur: Morganna's Revenge][64] ####
This time-traveling epic puts you in the role of a futuristic space marine who must travel back to the time of King Arthur and Camelot. The graphics aren't anything special (think Minecraft), but the storyline and gameplay are good. Operating System: Windows, Linux, OS X.
#### 64. [Flare][65] ####
Inspired by Diablo, this role-playing game places the emphasis on combat. It's still an alpha release but is playable. Operating System: Windows, Linux, OS X.
#### 65. [Lips of Suna][66] ####
For adults only, this "tongue-in-cheek action RPG" features "violence, crude humor, nudity and other themes you can rarely see in other games anymore." It offers lots of action and a constantly changing landscape. Operating System: Windows, Linux.
#### 66. [The Mana World][67] ####
This is a massively multiplayer online role-playing game (MMORPG) that isn't so massive. (At the time of writing there were 31 people playing.) Still, it's a good attempt to create an ever-expanding world full of monsters, quests and mini-games. Operating System: Windows, Linux, OS X.
#### 67. [NetHack][68]注:此链接原文有错误,和上面的链接地址一样了 ####
One of the classics, NetHack is an intricate dungeon crawler with extremely simple graphics. It's been called one of the 100 best video games of all time. Operating System: Windows, Linux, Classic Mac.
#### 68. [PlaneShift][69] ####
Set in the fantasy realm of Yliakum, this unique online role-playing game features ten different races and a well-developed world with its own economy, government, religion and rules. It's playable but still in the early stages of development. Operating System: Windows, Linux, OS X.
#### 69. [Ryzom][70] ####
One of the better open source MMORPGs, award-winning Ryzom is set on the treelike planet of Atys, where several different races of beings interact and sometimes come into conflict. You can play for free, but those who choose to subscribe get some special benefits. Operating System: Windows, Linux, OS X.
#### 70. [Stendhal][71] ####
This online role-playing game aims to be more friendly than most. The website explains, "You may be asked to help protect land, feed the hungry, heal the sick, make someone happy, solve a puzzle or simply lend a hand." Operating System: Windows, Linux, OS X.
#### 71. [Summoning Wars][72] ####
Up to eight people can play this fantasy role-playing game at once. There's a trailer for the game at Youtube that lets you see it in action. Operating System: Windows, Linux, OS X.
### Simulator Games ###
#### 72. [FlightGear][73] ####
Extremely realistic, FlightGear is a top-notch flight simulator that rivals proprietary software. It includes accurate terrain for the entire world and lifelike models of 20,000 airports and numerous aircraft. Operating System: Windows, Linux, OS X, others.
#### 73. [Golems][74] ####
With this physics simulator you can build almost anything you want and see how it would act in the real world. It's great for learning about basic machines, building robots, and inventing contraptions of all kinds. Operating System: Windows, Linux, OS X.
#### 74. [LinCity NG][75] ####
Based on the original SimCity game, LinCity NG challenges players to build a sustainable metropolis with a thriving economy. Note that because it is based on older code, the graphics are similar to old DOS games. Operating System: Windows, Linux, OS X.
#### 75. [Micropolis/OLPC SimCity][76] ####
Another SimCity imitator, Micropolis is a Java-based city simulator. It also features fairly old-school graphics rather than the 3D look of newer SimCity games. Operating System: Windows, Linux, OS X.
#### 76. [Minetest][77] ####
Extremely similar to Minecraft, Minetest is set in an infinite world of basic building blocks. Players can explore, mine or craft new objects as they see fit. Operating System: Windows, Linux, OS X.
#### 77. [Pioneer][78] ####
Pioneer describes itself as "a game of lonely space adventure." It transports players to an open-ended world where they decide what to do and where to go. Operating System: Windows, Linux, OS X.
#### 78. [Oolite][79] ####
Based on Elite, Oolite is a space simulator where you can trade with other spacefarers or become embroiled in combat. It's been around for quite a while, and many expansions are available. Operating System: Windows, Linux, OS X.
#### 79. [OpenCity][80] ####
This 3D city simulator does not aim to be a SimCity clone, but does offer a similar style of play. It's fairly basic but is playable. Operating System: Windows, Linux, OS X.
#### 80. [OpenTTD][81] ####
Based on Transport Tycoon Deluxe, OpenTTD invites players to build a transportation empire. It supports up to 255 players at once and improves on the original TTD in many ways. Operating System: Windows, Linux, OS X.
#### 81. [Rigs of Rods][82] ####
This vehicle simulator with a unique soft-body physics engine enjoys a very active and enthusiastic fan base. Use it to create land, sea or air vehicles and drive or fly them around the country. Operating System: Windows, Linux, OS X.
#### 82. [Simutrans][83] ####
This transportation simulator offers the option of connecting to online games hosted throughout the world. Use buses, trucks, trains, trams, ships, airplanes, monorails, maglevs or other vehicles to move people and goods where they need to go. Operating System: Windows, Linux, OS X.
#### 83. [Vega Strike][84] ####
This is another space simulator that lets you trade and fight throughout the galaxy. You choose whether to fly a trade route, accept a bounty-hunting mission, turn pirate or just explore the vastness of space. Operating System: Windows, Linux, OS X.
### Strategy Games ###
#### 84. [0 A.D.][85] ####
Now in its 16th alpha release, 0 A.D. is an award-winning civilization-building game that strives for historical accuracy. Choose to play as the Carthaginians, Celts, Greeks, Iberians, Mauryans, Persians or Romans. Operating System: Linux, Windows, OS X.
#### 85. [Advanced Strategic Command][86] ####
This turn-based strategy game is based on the Battle Isle series. Players battle on a grid-like landscape in single- or multi-player games. Operating System: Windows, Linux.
#### 86. [Battle for Wesnoth][87] ####
This turn-based tactical strategy game puts players in a mythic world where they fight to reclaim the throne. Orcs, elves, necromancers and hundreds of other familiar high fantasy characters populate a large environment. Supports both single- and multi-player games. Operating System: Linux, Windows, OS X, iOS.
#### 87. [BosWars][88] ####
This futuristic real time strategy game requires players to build up energy stores and an economy in order to support military battles. Play against the computer opponent or connect over a LAN for multi-player games. Operating System: Windows, Linux, BSD, OS X.
#### 88. [CommanderStalin][89] ####
This variation of BosWars is set in Stalin's Soviet Union. Be prepared for the inevitable Nazi attack! Operating System: Windows, Linux.
#### 89. [FreeCol][90] ####
Inspired by the games Colonization and Civilization, FreeCol is a turn-based civilization-building strategy game. You start in the New World in 1492 and win by creating an independent country with free speech. Operating System: Windows, Linux, OS X.
#### 90. [FreeCiv][91] ####
Also inspired by Civilization, this turn-based strategy game starts in the stone age and ends in the space age. It includes 50 playable units and 541 nations and comes with several playable scenarios. Operating System: Windows, Linux, OS X.
#### 91. [FreeOrion][92] ####
While it isn't a clone or remake, FreeOrion is loosely based on the Master of Orion games. It's a turn-based strategy game set in space. Operating System: Windows, Linux, OS X.
#### 92. [Glest][93] ####
The forces of Tech battle the forces of Magic in this real-time strategy game. While it's still available for download, most Linux distributions now include the fork Megaglest (see below) instead of this older project. Operating System: Windows, Linux.
#### 93. [Globulation 2][94] ####
This real-time civilization-building strategy game aims to reduce the need for micro-management and allow players to focus on strategy. Single- or multi-player games and a level editor are available. Operating System: Windows, Linux.
#### 94. [Hedgewars][95] ####
One of the more lighthearted strategy games around, Hedgewars features "the antics of pink hedgehogs with attitude as they battle from the depths of hell to the depths of space." Features 31 environments, 48 set maps, infinite randomly generated maps, 55 weapons, 280 costumes and support for up to 8 players at once. Operating System: Windows, Linux, OS X, iOS.
#### 95. [Kernel Panic][96] ####
Set in a digital landscape, Kernel Panic is a real-time strategy game with Tron-like graphics. All the resources are free, so players don't need to worry about building an economy—only about fighting against the other hackers on the network. Operating System: Linux, Windows
#### 96. [Liquid War][97] ####
Way back in 2002, Liquid War was named the "most original Linux Game," and it's still worth a look. Control a liquid army as you try to consume your enemies. Operating System: Windows, Linux, OS X.
#### 97. [MegaGlest][98] ####
This fork of Glest adds five new teams to the original Tech and Magic: Egypt, Indians, Norsemen, Persian or Romans. It offers 17 different map types, both single- and multi-player games, and tutorials for new players. Operating System: Windows, Linux.
#### 98. [Pax Brittanica][99] ####
Up to four players can battle at once using the same keyboard on this submarine strategy game. The controls are easy to learn (you only use one button), but the gameplay can be very intense. Operating System: Windows, Linux, OS X.
#### 99. [Spring: 1944][100] ####
This World War II strategy game offers realistic units and strengths. Choose to play as the U.S., Germany, the U.S.S.R. or Great Britain. Operating System: Linux.
#### 100. [UFO: Alien Invasion][101] ####
Seventy years in the future, a secret organization struggles to defend earth from vicious alien invaders. Play as the humans or the aliens in single-player or multi-player combat. Operating System: Windows, Linux, OS X.
#### 101. [Unknown Horizons][102] ####
In this civilization-building strategy game, the emphasis is on building a strong economy. You start with a handful of settlers and resources on an isolated archipelago and work to build a thriving city. Operating System: Windows, Linux, OS X.
#### 102. [Warzone 2100][103] ####
Can you rebuild Earth after nuclear devastation? This game offers an unusually large tech tree and single- or multi-player games. Operating System: Windows, Linux, OS X.
#### 103. [Widelands][104] ####
Inspired by Settlers II, Widelands is another real-time strategy game that challenges players to build a civilization. It features three tribes—Barbarians, Imperials, and Atlanteans—and unlike most civilization games, the player doesn't tell each unit what to do but instead gives orders and delegates, more like a real ruler. Operating System: Windows, Linux, OS X.
#### 104. [Zero-K][105] ####
In this fast-moving real-time strategy game, robot armies fight a never-ending battle. Key features include more than 100 different units, a streamlined economy system, a realistic physics engine, terraforming and more. Operating System: Windows, Linux.
#### 105. [Zombies][106] ####
Can you kill all the zombies before they kill you? This turn-based game offers addictive gameplay and settings that allow the player to determine the level of gore. Operating System: OS X.
### Fun Non-Games ###
#### 106. [Celestia][107] ####
Perfect for budding astronomers and wanna-be astronauts, Celestia allows you to see the sky as it would appear at any point in time from any point in the known universe. Take a quick trip to Jupiter or plot your starwatching for the evening. Operating System: Windows, Linux, OS X.
#### 107. [Electric Sheep][108] ####
Inspired by the Philip K. Dick novel Do Androids Dream of Electric Sheep? this screensaver connects your system to thousands of others to create abstract designs and patterns. Vote for your favorite patterns to see them reappear more often. Operating System: Windows, Linux, OS X, Android, iOS.
#### 108. [LCARS 24][109] ####
If you've got an old PC around the house (and who doesn't), why not turn it into a Star Trek-themed conversation piece. With this app, you get an alarm clock and file manager with graphics that look like they came right off the Enterprise. Operating System: Windows, DOS.
#### 109. [Stellarium][110] ####
Turn your PC into a planetarium. Stellarium can display the night skies from any point on earth at any time, and it's used by many planetariums to power their displays. Operating System: Windows, Linux, OS X.
#### 110. [Tux Paint][111] ####
Tux Paint makes it easy for pre-schoolers to create their own "drawings" on the computer. It features an interface with big buttons, fun sound effects and friendly characters. Operating System: Windows, Linux, OS X.
--------------------------------------------------------------------------------
via: http://www.datamation.com/open-source/110-fun-open-source-games-and-apps-1.html
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:http://www.datamation.com/open-source/101-most-fun-open-source-games-and-apps-1.html
[2]:http://www.stuff-o-matic.com/asgp/
[3]:http://armagetronad.org/index.php
[4]:http://bzflag.org/
[5]:http://chromium-bsu.sourceforge.net/
[6]:http://www.parallelrealities.co.uk/p/legend-of-edgar.html
[7]:http://www.penguspy.com/jvgs/
[8]:http://www.nogravitythegame.com/classic/
[9]:http://opensnc.sourceforge.net/home/index.php
[10]:http://linux.tlk.fr/games/Powermanga/
[11]:http://www.scorched3d.co.uk/
[12]:http://www.srb2.org/
[13]:http://supertux.lethargik.org/
[14]:http://funguloids.sourceforge.net/
[15]:http://www.teeworlds.com/
[16]:http://xmoto.tuxfamily.org/
[17]:http://www.yofrankie.org/
[18]:http://domination.sourceforge.net/
[19]:http://sourceforge.net/apps/mediawiki/scrabble/index.php?title=Main_Page
[20]:http://sourceforge.net/apps/mediawiki/scrabble/index.php?title=Main_Page
[21]:http://www.pokerth.net/
[22]:http://pysolfc.sourceforge.net/
[23]:http://gabrielecirulli.github.io/2048/
[24]:http://www.nongnu.org/billiards/
[25]:http://cubetrains.com/
[26]:http://www.nongnu.org/enigma/
[27]:http://fillets.sourceforge.net/
[28]:http://www.frozen-bubble.org/
[29]:http://live.gnome.org/GnomeGames
[30]:http://tomatoes.sourceforge.net/about.html
[31]:http://games.kde.org/
[32]:http://neverball.org/
[33]:http://pingus.seul.org/welcome.html
[34]:http://pushover.sourceforge.net/
[35]:http://zaz.sourceforge.net/
[36]:http://www.schoolsplay.org/
[37]:https://live.gnome.org/gbrainy
[38]:http://gcompris.net/index-en.html
[39]:http://tux4kids.alioth.debian.org/tuxmath/index.php
[40]:http://icculus.org/alienarena/rpa/
[41]:http://assault.cubers.net/
[42]:http://www.alientrap.org/games/nexuiz
[43]:http://openarena.ws/smfnews.php
[44]:http://www.redeclipse.net/
[45]:http://tremulous.net/
[46]:http://www.truecombatelite.com/
[47]:http://www.unvanquished.net/
[48]:http://www.warsow.net/
[49]:http://www.splashdamage.com/wolfet
[50]:http://worldofpadman.net/website/news
[51]:http://www.xonotic.org/
[52]:http://www.zeroballistics.com/
[53]:http://www.stepmania.com/
[54]:http://www.stepmania.com/
[55]:http://www.ultrastardeluxe.org/
[56]:http://sourceforge.net/projects/extremetuxracer/
[57]:http://www.speed-dreams.org/
[58]:http://supertuxkart.sourceforge.net/
[59]:http://torcs.sourceforge.net/
[60]:http://www.ultimatestunts.nl/
[61]:http://vdrift.net/
[62]:http://crossfire.real-time.com/intro/index.html
[63]:http://www.epicinventor.com/
[64]:http://excaliburworld.com/emr/emr3/index.html
[65]:http://flarerpg.org/media/
[66]:http://lipsofsuna.org/
[67]:http://themanaworld.org/
[68]:http://themanaworld.org/
[69]:http://www.planeshift.it/about.html
[70]:http://www.ryzom.com/en/
[71]:http://stendhalgame.org/
[72]:http://sumwars.org/wiki/Main_Page
[73]:http://www.flightgear.org/
[74]:http://www.golemgame.com/
[75]:http://lincity.sourceforge.net/
[76]:https://code.google.com/p/micropolis/
[77]:http://minetest.net/
[78]:http://pioneerspacesim.net/
[79]:http://www.oolite.org/
[80]:http://www.opencity.info/
[81]:http://www.openttd.org/en/
[82]:http://www.rigsofrods.com/content/
[83]:http://www.simutrans.com/
[84]:http://vegastrike.sourceforge.net/
[85]:http://play0ad.com/
[86]:http://www.asc-hq.org/
[87]:http://www.wesnoth.org/
[88]:http://www.boswars.org/
[89]:http://commanderstalin.sourceforge.net/
[90]:http://www.freecol.org/
[91]:http://freeciv.wikia.com/wiki/Main_Page
[92]:http://freeorion.org/index.php/Main_Page
[93]:http://glest.org/en/index.php
[94]:http://globulation2.org/wiki/Main_Page
[95]:http://www.hedgewars.org/
[96]:http://springrts.com/wiki/Kernel_Panic
[97]:http://www.ufoot.org/liquidwar/v5
[98]:http://glest.org/en/index.php
[99]:http://paxbritannica.henk.ca/
[100]:http://spring1944.net/
[101]:http://ufoai.org/wiki/News
[102]:http://www.unknown-horizons.org/
[103]:http://wz2100.net/
[104]:http://wl.widelands.org/
[105]:http://zero-k.info/
[106]:http://codenautics.com/zombies/
[107]:http://www.shatters.net/celestia/index.html
[108]:http://community.electricsheep.org/
[109]:http://lcars24.com/
[110]:http://stellarium.org/
[111]:http://tuxpaint.org/

View File

@ -1,3 +1,4 @@
Love-xuan翻译中
Best Linux Browsers
================================================================================
> Pros and cons of the best browsers for the Linux desktop, including Firefox, Chrome and other browsers.

View File

@ -1,3 +1,4 @@
translating by cvsher
Command Line Tuesdays Part Five
================================================================================
Yes, youve guessed what time it is! Its time to rrrrrrrrummmbleeeee! And this time, well learn how to work with commands. So without further ado, lets get to business.
@ -85,4 +86,4 @@ via: https://news.opensuse.org/2014/07/15/command-line-tuesdays-part-five/
[17]:
[18]:
[19]:
[20]:
[20]:

View File

@ -1,144 +0,0 @@
[bazz2 keep moving]
Linux Kernel Testing and Debugging
================================================================================
### Auto Testing Tools ###
There are several automated testing tools and test infrastructures that you can chose from based on your specific testing needs. This section is intended to be a brief overview and not a detailed guide on how to use each of these.
#### [AuToTest][1] ####
> Autotest is a framework for fully automated testing. It is designed primarily to test the Linux kernel, though it is useful for many other functions such as qualifying new hardware. It is an open source project under the GPL. Autotest works in server-client mode. Autotest server can be configured to initiate, run, and monitor tests on several target systems running the autotest client. Autotest client can be run manually on a target system or via the server. Using this framework, new test cases can be added. Please [Autotest White Paper][2] for more information.
#### Linaro Automated Validation Architecture ####
> LAVA-Test Automated Testing Framework is a framework to help with automated installation and executions of tests. For example, running LTP in LAVA framework can be accomplished with a few commands. Running lava-test tool to install LTP will automatically install any dependencies, download the source for the recent release of LTP, compile it, and install the binaries in a self-contained area so that they can be removed easily when user runs uninstall. At this point running lava-test run with ltp test option will execute LTP tests and save results with an unique id that includes the test name, time/date stamp of the test execution. These results are saved for future reference. This is a good feature to find regressions, if any, between test runs. Summary of commands to run as an example:
Show a list of tests supported by lava-test:
lava-test list-tests
Install a new test:
lava-test install ltp
Run the test:
lava-test run ltp
Check results:
lava-test results show ltp-timestamp.0
Remove tests:
lava-test uninstall ltp
### Kernel Debug Features ###
Linux kernel includes several debugging features such as kmemcheck and kmemleak.
#### kmemcheck ####
> kmemcheck is a dynamic checking tool that detects and warns about some uses of uninitialized memory. It serves the same function as Valgrind's memcheck which is a userspace memory checker, where as kmemcheck checks kernel memory. CONFIG_KMEMCHECK kernel configuration option enables the kmemcheck debugging feature. Please read the Documentation/kmemcheck.txt for information on how to configure and use this feature, and how to interpret the reported results.
#### kmemleak ####
> kmemleak can be used to detect possible kernel memory leaks in a way similar to a tracing garbage collector. The difference between the tracing garbage collector and kmemleak is that the latter doesn't free orphan objects, instead it reports them in /sys/kernel/debug/kmemleak. A similar method of reporting and not freeing is used by the Valgrind's memcheck --leak-check to detect memory leaks in user-space applications. CONFIG_DEBUG_KMEMLEAK kernel configuration option enables the kmemleak debugging feature. Please read the Documentation/kmemleak.txt for information on how to configure and use this feature, and how to interpret the reported results.
### Kernel Debug Interfaces ###
Linux kernel has support for static and dynamic debugging via configuration options, debug APIs, interfaces, and frameworks. Let's learn more about each of these starting with the static options.
### Debug Configuration Options - Static ###
Linux kernel core and several Linux kernel modules, if not all, include kernel configuration options to debug. Several of these static debug options can be enabled at compile time. Debug messages are logged in dmesg buffer.
### Debug APIs ###
An example of Debug APIs is DMA-debug which is desiged for debugging driver dma api usage errors. When enabled, it keeps track of dma mappings per device, detects unmap attempts on addresses that aren't mapped, and missing mapping error checks in driver code after dma map attempts. CONFIG_HAVE_DMA_API_DEBUG and CONFIG_DMA_API_DEBUG kernel configuration options enable this feature on architectures that provide the support. With the CONFIG_DMA_API_DEBUG option enabled, the Debug-dma interfaces are called from DMA API. For example, when a driver calls dma_map_page() to map a dma buffer, dma_map_page() will call debug_dma_map_page() to start tracking the buffer until it gets released via dma_unmap_page() at a later time. For further reading on [Detecting silent data corruptions and memory leaks using DMA Debug API ][3]
### Dynamic Debug ###
Dynamic debug feature allows dynamically enabling/disabling pr_debug(), dev_dbg(), print_hex_dump_debug(), print_hex_dump_bytes() per-callsite. What this means is, a specific debug message can be enabled at run-time to learn more about a problem that is observed. This is great because, there is no need to re-compile the kernel with debug options enabled, then install the new kernel, only to find that the problem is no longer reproduciable. Once CONFIG_DYNAMIC_DEBUG is enabled in the kernel, dynamic debug feature enables a fine grain enable/disable of debug messages. /sys/kernel/debug/dynamic_debug/control is used to specify which pr_* messages are enabled. A quick summary of how to enable dynamic debug per call level, per module level is as follows:
Enable pr_debug() in kernel/power/suspend.c at line 340:
echo 'file suspend.c line 340 +p' > /sys/kernel/debug/dynamic_debug/control
Enable dynamic debug feature in a module at module load time
> Pass in dyndbg="plmft" to modprobe at the time module is being loaded.
Enable dynamic debug feature in a module to persist across reboots
> create or change modname.conf file in /etc/modprobe.d/ to add dyndbg="plmft" option. However for drivers that get loaded from initramfs, changing modname.conf is insufficient for the dynamic debug feature to persist across reboot. For such drivers, change grub to pass in module.dyndbg="+plmft" as a module option as a kernel boot parameter.
dynamic_debug.verbose=1 kernel boot option increases the verbosity of dynamic debug messages. Please consult the Documentation/dynamic-debug-howto.txt for more information on this feature.
### Tracepoints ###
So far we talked about various static and dynamic debug features. Both static debug options and debug hooks such as the DMA Debug API are either enabled or disabled at compile time. Both of these options require a new kernel to be compiled and installed. The dynamic debug feature eliminates the need for a recompile, however the debug code is compiled in with a conditional variable that controls whether or not the debug message gets printed. It helps that the messages can be enabled at run-time, however, the conditional code is executed at run-time to determine if the message needs to be printed. Tracepoint code on the otherhand can be triggered to be included at run-time only when the tracepoint is enabled. In other words, tracepoint code is different in that, it is inactive unless it is enabled. When it is enabled, code is modified to include the tracepoint code. It doesn't add any conditional logic overhead to determine whether or not to generate a trace message.
Please read [Tips on how to implement good tracepoint code][4] for more insight into how tracing works.
### Tracepoint mechanism ###
The tracepoints use jump-labels which is a code modification of a branch.
When it is disabled, the code path looks like:
[ code ]
nop
back:
[ code ]
return;
tracepoint:
[ tracepoint code ]
jmp back;
When it is enabled, the code path looks like: (notice how the tracepoint code appears in the code path below)
[ code ]
jmp tracepoint
back:
[ code ]
return;
tracepoint:
[ tracepoint code ]
jmp back;
### Linux PM Sub-system Testing ###
Using debug, dynamic debug, and tracing, let's run a few suspend to disk PM tests. When system is suspended, kernel creates hibernation image on disk, suspends and uses the image to restore the systerm state at resume time.
Enable logging time it takes to suspend and resume each device
echo 1 > /sys/power/pm_print_times
Run suspend to disk test in reboot mode
echo reboot > /sys/power/disk
echo disk > /sys/power/state
Run suspend to disk test in shutdown mode - same as reboot, except requires powering on to resume
echo shutdown > /sys/power/disk
echo disk > /sys/power/state
Run suspend to disk test in platform mode - more extensive and tests BIOS suspend and resume paths e.g: ACPI methods will be invoked. This is the recommended mode for hibernation so BIOS is informed and aware of suspend/resume action.
echo platform > /sys/power/disk
echo disk > /sys/power/state
--------------------------------------------------------------------------------
via:http://www.linuxjournal.com/content/linux-kernel-testing-and-debugging?page=0,3
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:http://autotest.github.io/
[2]:https://github.com/autotest/autotest/wiki/WhitePaper
[3]:http://events.linuxfoundation.org/sites/events/files/slides/Shuah_Khan_dma_map_error.pdf
[4]:http://www.linuxjournal.com/content/july-2013-linux-kernel-news

View File

@ -1,90 +0,0 @@
Linux Kernel Testing and Debugging
================================================================================
### Linux PM Sub-system Testing in Simulation Mode ###
The Linux PM sub-system provides five PM test modes to test hibernation in a simulated mode. These modes allow exercising the hibernation code in various layers of the kernel without actually suspending the system. This is useful when there is a concern that suspend might not work on a specific platform and help detect errors in a simulation similar to simulating flying a plane, so to speak.
freezer - test the freezing of processes
echo freezer > /sys/power/pm_test
echo platform > /sys/power/disk
echo disk > /sys/power/state
devices - test the freezing of processes and suspending of devices
echo devices > /sys/power/pm_test
echo platform > /sys/power/disk
echo disk > /sys/power/state
platform - test the freezing of processes, suspending of devices and platform global control methods(*)
echo platform > /sys/power/pm_test
echo platform > /sys/power/disk
echo disk > /sys/power/state
processors - test the freezing of processes, suspending of devices, platform global control methods(*) and the disabling of non-boot CPUs
echo processors > /sys/power/pm_test
echo platform > /sys/power/disk
echo disk > /sys/power/state
core - test the freezing of processes, suspending of devices, platform global control methods, the disabling of non-boot CPUs and suspending of platform/system devices. Note: this mode is tested on ACPI systems.
echo core > /sys/power/pm_test
echo platform > /sys/power/disk
echo disk > /sys/power/state
### Linux PM Sub-system Trace Events ###
PM sub-system supports several tracepoints and trace events that can be enabled to trigger during run-time. I will give an overview on how to enable couple of these trace events and where to find the trace information they generate:
Enabling PM events at run-time:
cd /sys/kernel/debug/tracing/events/power
echo 1 > cpu_frequency/enable
cat /sys/kernel/debug/tracing/set_event
less /sys/kernel/debug/tracing/trace
Enabling events at boot-time kernel trace parameter with a kernel boot option:
trace_event=cpu_frequency
For more information on Linux PM testing, please consult the Documentation/power/basic-pm-debugging.txt and other documents in the same directory.
### git bisect ###
git bisect is an invaluable and powerful tool to isolate an offending commit. I will go over very basic git bisect steps.
This is how the process works:
git bisect start
git bisect bad # Current version is bad
git bisect good v3.14-rc6 # last good version
Once, one bad and one good version are specified, git bisect will start bisecting by pulling in commits between the good version and the bad. Once a set of commits are pulled in, compile the kernel, install, test, and tag the version good or bad. This process repeats until the selected commits are tested and tagged as good or bad. There can be several kernel versions to test. When the last version is tested, git bisect will flag a commit that is bad. The following useful git-bisect command can aid in using git-bisect process:
See step by step bisect progress
git bisect log
Reset git bisect can be used in case of mistakes in tagging, save git log output and replay prior to reset
git bisect reset
Replay a git-bisect log
git bisect replay git_log_output
git bisect can be run on a section of kernel source tree if the problem is clearly in that area. For example, when debugging a problem in radeon driver, running git bisect on drivers/drm/radeon will limit the scope of bisect to just the commits to drivers/drm/radeon driver.
Start git bisect on a section of a kernel tree
git bisect start drivers/drm/radeon
--------------------------------------------------------------------------------
via: http://www.linuxjournal.com/content/linux-kernel-testing-and-debugging?page=0,4
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出

View File

@ -1,138 +0,0 @@
Linux Kernel Testing and Debugging
================================================================================
### Linux Kernel Patch Testing ###
Are you try your hands on writing a kernel patch? This section will go over how to test a new patch before sending it to the Linux mailing list. Further more, we will also talk about how to send it.
Once the code is ready, compile it. Save the make output to a file to see if the new code introduced any new warnings. Address warnings, if any. Once the code compiles cleanly, install the compiled kernel and boot test. If it boots successfully, make sure there are no new errors in the dmesg, comparing it with the previous kernel dmesg. Run a few usage and stress tests. Please refer to the testing content we discussed earlier in this paper. If the patch is for fixing a specific bug, make sure the patch indeed fixes the bug. If the patch fixes the problem, make sure, other module regression tests pass. Identify regression tests for the patched module and run them. When a patch touches other architectures, cross-compile build testing is recommended. Please check the following in the source git as a reference to identify tests.
- linux_git/Documentation
- linux_git/tools/testing
- Cross-compiling reference: [Cross-compiling Linux Kernels on x86_64: A tutorial on How to Get Started][1]
Once you are satisfied with the patch testing, it is time to commit the change and generate the patch. Make sure the commit message describes the change made very clearly. It is important that the maintainer and other developers can understand what this change is all about. Once patch is ready, run scripts/checkpatch.pl on the generated patch. Address checkpatch errors and/or warnings, if any. Regenerate and repeat until the patch passes the checkpatch test. Unless the checkpatch errors are minor whitespace type, re-test the patch. Apply the patch to another instance of the kernel git to make sure patch applies cleanly.
Now you are ready to send the patch. Please run the scripts/get_maintainer.pl to identify whom the patch should be sent to. Please remember that the patch needs to be sent as a plain text, not as an attachment. Please make sure your email client can send plain text messages. Email the patch to yourself to test your client settings. Run checkpatch and apply the received patch. If these two steps pass, then you are ready to send the patch to the Linux Kernel Mailing List. git send-email is the safest way to send patches to avoid email client complications. Please make sure your .gitconfig includes sendemail with a valid smtpserver. Please consult git manpage for details.
Please refer to the following documentation in the kernel sources for rules and guidelines on sending patches:
- linux_git/Documentation/applying-patches.txt
- linux_git/Documentation/SubmitChecklist
- linux_git/Documentation/SubmittingDrivers
- linux_git/Documentation/SubmittingPatches
- linux_git/Documentation/stable_kernel_rules.txt
- linux_git/Documentation/stable_api_nonsense.txt
The following is a list of additional testing guides and resources:
- [USB Testing on Linux][2]
- [Linux Kernel Tester's Guide Chapter2][3]
- [Linux Kernel Tester's Guide][4]
- [Testing resources at eLinux.org][5]
- [eLinux Debugging Portal][6]
### Kernel test suites and projects ###
In addition to the testing resources we discussed so far, there are projects both open source and initiated by hardware vendors that are worth a mention. Each of these projects focus on specific areas of the kernel and in some cases a specific space such as, embedded or enterprise where the kernel is used. We will look at a few in this section.
[Linux Test Project][7] (LTP) test suite is a collection of tools to test reliability, robustness, and stability of Linux kernel and related features. This test suite can be customized by adding new tests and the LTP project welcomes contributions. runltp script tests the following sub-systems by default:
- filesystem stress tests
- disk I/O tests
- memory management stress tests
- ipc stress
- scheduler tests
- commands functional verification tests
- system call functional verification tests
[**LTP-DDT**][8] is an LTP based test application wth a reduced focus to test embedded device drivers.
[**Linux Driver Verification**][9] project's goals are to improve the quality of Linux device drivers, develop an integrated platform for device drivers verification, and adopt latest research outcome to enhance quality of verification tools.
### Compliance Testing ###
If you ever had to port applications from one Unix variant to another, you would understand the importance of the [Linux Standard Base (LSB)][10] and LSB compliance test suite. The LSB is a Linux Foundation workgroup created to reduce the costs of supporting Linux platform, by reducing the differences between various Linux distributions and ensuring application portability between distributions. If anything, divergence in the Unix world taught us that it is vital to avoid it in the Linux world. This is exactly the reason why you can take an rpm convert it to deb and install and run it, and how sweet is that.
### Static Analysis and Tools ###
Static analysis tools analyze the code without executing it, hence the name static analysis. There are a couple of static analysis tools that are sepcifically written for analyzing the Linux kernel code base. Sparse is a static type-checking program written specifically for the Linux kernel, by Linus Torvalds. Sparse is a semantic parser. It creates a sematic prase tree to validate C semantics. It performs lazy type evaluation. Kernel build system has support for sparse and provides a make option to compile the kernel with sparse checking enabled.
Run sparse on all kernel C files that would get re-compiled:
make C=1 allmodconfig
Run sparse on all kernel C files even when they don't need a re-compile:
make C=2 allmodconfig
Sparse resources:
- [Sparse Archive][11]
- [Sparse How To][12]
Smatch analyzes source to detect programming logic errors. It can detect logic errors such as, attempts to unlock already unlocked spinlock. It is actively used to detect logic errors in the Linux kernel sources.
Run smatch on Linux kernel:
make CHECK="~/path/to/smatch/smatch -p=kernel" C=1 bzImage modules | tee warns.txt
Please follow instructions on how to get smatch from smatch git repo and compile. Smatch is work in progress, instructions keep changing.
- [**Smatch**][12]
So what do we do about all of these semantic and logic problems found by Sparse and Smatch? Some of these problems are isolated to a routine and/or a module which can be fixed easily. However, some of these semantic issues are global in nature due to cut and paste of code. In some cases when interfaces get obsoleted or changed slightly, a mass change to update several source files becomes necessary. This is where Coccinelle comes in to rescue. Coccinelle is a program matching and transformation engine which provides the language SmPL (Semantic Patch Language) for specifying desired matches and transformations in C code. Coccinelle was initially targeted towards performing collateral evolutions in Linux.
For example, foo(int) interfaces changes to foo(int, char \*) with an optional second input parameter which can be a null. All usages of foo() will need to be updated to the new convention, which will be a very laborious task. Using Cocinelle, this task becomes easier with a script that looks for all instances of foo(parameter1) and replacing them with foo(parameter1, NULL). Once this task is done, all instances of foo() can be examined to see if passing in NULL value for parameter2 is a good assumption. For more information on Cocinelle and how it is used in fixing problems in various projects including the Linux kernel, please refer to the project page: [**Cocinelle**][13]
### References ###
We covered a lot of ground in this paper. I leave you with a few references for further reading on the topics we discussed.
- [KernelHacking][14]
- [kernel Documentation][15]
- [Linux Device Drivers, Third Edition][16]
- [Dynamic Event Tracing in Linux Kernel][17]
- [Kernel Testing: Tool and Techniques][18]
### Acknowledgements ###
I would like to thank Khalid Aziz, Oracle for his review, proof reading, and valuable suggestions for improvement. My special thanks to Mauro Chehab, Samsung and Guy Martin, Samsung for their review and feedback at various stages of writing this paper. I would like to extend my thanks to Greg Kroah-Hartman, Linux Foundation for his review. My special thanks to Ibrahim Haddad, Samsung for his support and encouragement without which, I would probably have never set out to write this paper in the first place.
----------
![](http://www.linuxjournal.com/files/linuxjournal.com/ufiles/pictures/picture-1088573.jpg)
Author:[Shuah Khan][a]
Shuah Khan is a Senior Linux Kernel Developer at Samsung's Open Source Group.
She is a Linux Kernel Contributor who focuses on IOMMU, DMA, Linux Power
Management, and PCIe, in addition to helping with stable release kernel
maintenance testing and bug fixes. Shuah has several years of Unix kernel
development experience. She has also contributed to OpenHPI, and LLDP projects.
--------------------------------------------------------------------------------
via: http://www.linuxjournal.com/content/linux-kernel-testing-and-debugging?page=0,5
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:http://events.linuxfoundation.org/sites/events/files/slides/Shuah_Khan_cross_compile_linux.pdf
[2]:http://www.linux-usb.org/usbtest/
[3]:http://kernelnewbies.org/Linux_Kernel_Tester%27s_Guide_Chapter2
[4]:http://www.kerneltravel.net/downloads/tester_guide.pdf
[5]:http://elinux.org/Test_Systems
[6]:http://elinux.org/Debugging_Portal
[7]:http://ltp.sourceforge.net/documentation/how-to/ltp.php
[8]:http://processors.wiki.ti.com/index.php/LTP-DDT
[9]:http://linuxtesting.org/project/ldv
[10]:http://www.linuxfoundation.org/collaborate/workgroups/lsb
[11]:http://codemonkey.org.uk/projects/git-snapshots/sparse/
[12]:http://smatch.sourceforge.net/
[13]:http://coccinelle.lip6.fr/
[14]:http://kernelnewbies.org/KernelHacking
[15]:http://kernelnewbies.org/Documents
[16]:http://lwn.net/Kernel/LDD3/
[17]:http://events.linuxfoundation.org/slides/lfcs2010_hiramatsu.pdf
[18]:http://events.linuxfoundation.org/images/stories/slides/elc2013_porter.pdf
[a]:http://www.linuxjournal.com/users/shuah-khan

View File

@ -1,191 +0,0 @@
7 dmesg Commands for Troubleshooting and Collecting Information of Linux Systems
================================================================================
The dmesg command displays the messages from the kernel ring buffer. A system passes multiple runlevel from where we can get lot of information like system architecture, cpu, attached device, RAM etc. When computer boots up, a kernel (core of an operating system) is loaded into memory. During that period number of messages are being displayed where we can see hardware devices detected by kernel.
![dmesg Command Examples](http://www.tecmint.com/wp-content/uploads/2014/07/dmesg-Command-Examples.png)
dmesg Command Examples
The messages are very important in terms of diagnosing purpose in case of device failure. When we connect or disconnect hardware device on the system, with the help of dmesg command we come to know detected or disconnected information on the fly. The **dmesg** command is available on most **Linux and Unix** based Operating System.
Lets throw some light on most famous tool called dmesg command with their practical examples as discussed below. The exact syntax of dmesg as follows.
# dmseg [options...]
### 1. List all loaded Drivers in Kernel ###
We can use text-manipulation tools i.e. **more**, **tail**, **less** or **grep** with dmesg command. As output of dmesg log wont fit on a single page, using dmesg with pipe more or less command will display logs in a single page.
[root@tecmint.com ~]# dmesg | more
[root@tecmint.com ~]# dmesg | less
#### Sample Output ####
[ 0.000000] Initializing cgroup subsys cpuset
[ 0.000000] Initializing cgroup subsys cpu
[ 0.000000] Initializing cgroup subsys cpuacct
[ 0.000000] Linux version 3.11.0-13-generic (buildd@aatxe) (gcc version 4.8.1 (Ubuntu/Linaro 4.8.1-10ubuntu8) ) #20-Ubuntu SMP Wed Oct 23 17:26:33 UTC 2013
(Ubuntu 3.11.0-13.20-generic 3.11.6)
[ 0.000000] KERNEL supported cpus:
[ 0.000000] Intel GenuineIntel
[ 0.000000] AMD AuthenticAMD
[ 0.000000] NSC Geode by NSC
[ 0.000000] Cyrix CyrixInstead
[ 0.000000] Centaur CentaurHauls
[ 0.000000] Transmeta GenuineTMx86
[ 0.000000] Transmeta TransmetaCPU
[ 0.000000] UMC UMC UMC UMC
[ 0.000000] e820: BIOS-provided physical RAM map:
[ 0.000000] BIOS-e820: [mem 0x0000000000000000-0x000000000009fbff] usable
[ 0.000000] BIOS-e820: [mem 0x00000000000f0000-0x00000000000fffff] reserved
[ 0.000000] BIOS-e820: [mem 0x0000000000100000-0x000000007dc08bff] usable
[ 0.000000] BIOS-e820: [mem 0x000000007dc08c00-0x000000007dc5cbff] ACPI NVS
[ 0.000000] BIOS-e820: [mem 0x000000007dc5cc00-0x000000007dc5ebff] ACPI data
[ 0.000000] BIOS-e820: [mem 0x000000007dc5ec00-0x000000007fffffff] reserved
[ 0.000000] BIOS-e820: [mem 0x00000000e0000000-0x00000000efffffff] reserved
[ 0.000000] BIOS-e820: [mem 0x00000000fec00000-0x00000000fed003ff] reserved
[ 0.000000] BIOS-e820: [mem 0x00000000fed20000-0x00000000fed9ffff] reserved
[ 0.000000] BIOS-e820: [mem 0x00000000fee00000-0x00000000feefffff] reserved
[ 0.000000] BIOS-e820: [mem 0x00000000ffb00000-0x00000000ffffffff] reserved
[ 0.000000] NX (Execute Disable) protection: active
.....
### 2. List all Detected Devices ###
To discover which hard disks has been detected by kernel, you can search for the keyword “**sda**” along with “**grep**” like shown below.
[root@tecmint.com ~]# dmesg | grep sda
[ 1.280971] sd 2:0:0:0: [sda] 488281250 512-byte logical blocks: (250 GB/232 GiB)
[ 1.281014] sd 2:0:0:0: [sda] Write Protect is off
[ 1.281016] sd 2:0:0:0: [sda] Mode Sense: 00 3a 00 00
[ 1.281039] sd 2:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[ 1.359585] sda: sda1 sda2 < sda5 sda6 sda7 sda8 >
[ 1.360052] sd 2:0:0:0: [sda] Attached SCSI disk
[ 2.347887] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null)
[ 22.928440] Adding 3905532k swap on /dev/sda6. Priority:-1 extents:1 across:3905532k FS
[ 23.950543] EXT4-fs (sda1): re-mounted. Opts: errors=remount-ro
[ 24.134016] EXT4-fs (sda5): mounted filesystem with ordered data mode. Opts: (null)
[ 24.330762] EXT4-fs (sda7): mounted filesystem with ordered data mode. Opts: (null)
[ 24.561015] EXT4-fs (sda8): mounted filesystem with ordered data mode. Opts: (null)
**NOTE**: The sda first SATA hard drive, sdb is the second SATA hard drive and so on. Search with hda or hdb in the case of IDE hard drive.
### 3. Print Only First 20 Lines of Output ###
The head along with dmesg will show starting lines i.e. dmesg | head -20 will print only 20 lines from the starting point.
[root@tecmint.com ~]# dmesg | head -20
[ 0.000000] Initializing cgroup subsys cpuset
[ 0.000000] Initializing cgroup subsys cpu
[ 0.000000] Initializing cgroup subsys cpuacct
[ 0.000000] Linux version 3.11.0-13-generic (buildd@aatxe) (gcc version 4.8.1 (Ubuntu/Linaro 4.8.1-10ubuntu8) ) #20-Ubuntu SMP Wed Oct 23 17:26:33 UTC 2013 (Ubuntu 3.11.0-13.20-generic 3.11.6)
[ 0.000000] KERNEL supported cpus:
[ 0.000000] Intel GenuineIntel
[ 0.000000] AMD AuthenticAMD
[ 0.000000] NSC Geode by NSC
[ 0.000000] Cyrix CyrixInstead
[ 0.000000] Centaur CentaurHauls
[ 0.000000] Transmeta GenuineTMx86
[ 0.000000] Transmeta TransmetaCPU
[ 0.000000] UMC UMC UMC UMC
[ 0.000000] e820: BIOS-provided physical RAM map:
[ 0.000000] BIOS-e820: [mem 0x0000000000000000-0x000000000009fbff] usable
[ 0.000000] BIOS-e820: [mem 0x00000000000f0000-0x00000000000fffff] reserved
[ 0.000000] BIOS-e820: [mem 0x0000000000100000-0x000000007dc08bff] usable
[ 0.000000] BIOS-e820: [mem 0x000000007dc08c00-0x000000007dc5cbff] ACPI NVS
[ 0.000000] BIOS-e820: [mem 0x000000007dc5cc00-0x000000007dc5ebff] ACPI data
[ 0.000000] BIOS-e820: [mem 0x000000007dc5ec00-0x000000007fffffff] reserved
### 4. Print Only Last 20 Lines of Output ###
### 4. Print Only Last 20 Lines of Output ###
The tail along with dmesg command will print only 20 last lines, this is useful in case we insert removable device.
[root@tecmint.com ~]# dmesg | tail -20
parport0: PC-style at 0x378, irq 7 [PCSPP,TRISTATE]
ppdev: user-space parallel port driver
EXT4-fs (sda1): mounted filesystem with ordered data mode
Adding 2097144k swap on /dev/sda2. Priority:-1 extents:1 across:2097144k
readahead-disable-service: delaying service auditd
ip_tables: (C) 2000-2006 Netfilter Core Team
nf_conntrack version 0.5.0 (16384 buckets, 65536 max)
NET: Registered protocol family 10
lo: Disabled Privacy Extensions
e1000: eth0 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: None
Slow work thread pool: Starting up
Slow work thread pool: Ready
FS-Cache: Loaded
CacheFiles: Loaded
CacheFiles: Security denies permission to nominate security context: error -95
eth0: no IPv6 routers present
type=1305 audit(1398268784.593:18630): audit_enabled=0 old=1 auid=4294967295 ses=4294967295 res=1
readahead-collector: starting delayed service auditd
readahead-collector: sorting
readahead-collector: finished
### 5. Search Detected Device or Particular String ###
Its difficult to search particular string due to length of dmesg output. So, filter the lines with are having string like **usb** **dma** **tty** and **memory** etc. The -i option instruct to [grep command][1] to ignore the case (upper or lower case letters).
[root@tecmint.com log]# dmesg | grep -i usb
[root@tecmint.com log]# dmesg | grep -i dma
[root@tecmint.com log]# dmesg | grep -i tty
[root@tecmint.com log]# dmesg | grep -i memory
#### Sample Output ####
[ 0.000000] Scanning 1 areas for low memory corruption
[ 0.000000] initial memory mapped: [mem 0x00000000-0x01ffffff]
[ 0.000000] Base memory trampoline at [c009b000] 9b000 size 16384
[ 0.000000] init_memory_mapping: [mem 0x00000000-0x000fffff]
[ 0.000000] init_memory_mapping: [mem 0x37800000-0x379fffff]
[ 0.000000] init_memory_mapping: [mem 0x34000000-0x377fffff]
[ 0.000000] init_memory_mapping: [mem 0x00100000-0x33ffffff]
[ 0.000000] init_memory_mapping: [mem 0x37a00000-0x37bfdfff]
[ 0.000000] Early memory node ranges
[ 0.000000] PM: Registered nosave memory: [mem 0x0009f000-0x000effff]
[ 0.000000] PM: Registered nosave memory: [mem 0x000f0000-0x000fffff]
[ 0.000000] please try 'cgroup_disable=memory' option if you don't want memory cgroups
[ 0.000000] Memory: 2003288K/2059928K available (6352K kernel code, 607K rwdata, 2640K rodata, 880K init, 908K bss, 56640K reserved, 1146920K highmem)
[ 0.000000] virtual kernel memory layout:
[ 0.004291] Initializing cgroup subsys memory
[ 0.004609] Freeing SMP alternatives memory: 28K (c1a3e000 - c1a45000)
[ 0.899622] Freeing initrd memory: 23616K (f51d0000 - f68e0000)
[ 0.899813] Scanning for low memory corruption every 60 seconds
[ 0.946323] agpgart-intel 0000:00:00.0: detected 32768K stolen memory
[ 1.360318] Freeing unused kernel memory: 880K (c1962000 - c1a3e000)
[ 1.429066] [drm] Memory usable by graphics device = 2048M
### 6. Clear dmesg Buffer Logs ###
Yes, we can clear dmesg logs if required with below command. It will clear dmesg ring buffer message logs till you executed the command below. Still you can view logs stored in **/var/log/dmesg** files. If you connect any device will generate dmesg output.
[root@tecmint.com log]# dmesg -c
### 7. Monitoring dmesg in Real Time ###
Some distro allows command tail -f /var/log/dmesg as well for real time dmesg monitoring.
[root@tecmint.com log]# watch "dmesg | tail -20"
Conclusion: The dmesg command is useful as dmesg records all the system changes done or occur in real time. As always you can man dmesg to get more information.
--------------------------------------------------------------------------------
via: http://www.tecmint.com/dmesg-commands/
原文作者:
![](http://1.gravatar.com/avatar/36c7c25164c3455f2f711b01e395de0d?s=80&d=blank&r=G)
[Narad Shrestha][a](He has over 10 years of rich IT experience which includes various Linux Distros, FOSS and Networking. Narad always believes sharing IT knowledge with others and adopts new technology with ease.)
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://www.tecmint.com/author/navin/
[1]:http://www.tecmint.com/12-practical-examples-of-linux-grep-command/

View File

@ -1,75 +0,0 @@
How to Merge Directory Trees in Linux using cp Command
================================================================================
How to merge two directory trees with similar layout into a third directory? Let us consider the following example to understand the problem.
Suppose two directories dir1 and dir2 have 3 sub-directories a, b and c in each of them. The directory layout is like below:
![Layout of input directories](http://linoxide.com/wp-content/uploads/2014/07/01.merge_dir_layout.png)
Layout of input directories
These directories a, b and c have some files in them. The output of tree command will illustrate better:
![Layout of files](http://linoxide.com/wp-content/uploads/2014/07/02.merge_file_layout.png)
Layout of files
### 1. Using cp to create merge: ###
Now we want to merge these two directories into a third directory, say “merged”.
The simplest thing that you can do to achieve this is to copy recursively the directories like below:
![Copy directories recursively to create new merge](http://linoxide.com/wp-content/uploads/2014/07/03.merge_cp_recursive.png)
Copy directories recursively to create new merge
#### 1.1 Problem with cp command and alternative: ####
The problem with this approach is that the files created inside merged directory are copy of original files, and not the original files themselves. But wait, (you might be asking yourself) what is the problem if the files are not original? So to answer your question, consider the situation where you have large number of bulky files. In that case, copying all the files might take hours.
Now lets get back and try the same with mv command instead of cp.
![Attempt to merge with mv command](http://linoxide.com/wp-content/uploads/2014/07/04.merge_mv_recursive.png)
Attempt to merge with mv command
The directories are not merged. So we cannot use mv command to merge directories like this.
Now how can you keep the original files inside “merged” directory?
### 2. The solution: ###
The cp command has a very useful option to draw us out of this situation.
The -l or --link option to cp aommand creates the hard links instead of copying the files themselves. Let us try with that.
Before trying out the hard link option to cp command, let us print the inode number of the original files.
The tree command has option to print the inodes with --inodes option:
![Display inodes of original files](http://linoxide.com/wp-content/uploads/2014/07/05.merge_display_inodes.png)
Display inodes of original files
Now we have the inodes listed here, we can proceed to creating the hard links with --link option to cp command:
![Merge directories with hard links](http://linoxide.com/wp-content/uploads/2014/07/06.merge_create_links.png)
Merge directories with hard links
#### 2.1 Verify the files: ####
Now the files are copied, let us verify if the inodes match with original files:
![Verify Inodes](http://linoxide.com/wp-content/uploads/2014/07/07.merge_verify_inodes.png)
Verify Inodes
#### 2.2 Cleanup: ####
As you can see that the files have same inodes as original files. Now the problem is solved and we have the original files inside merged directory. We can now cleanup by removing the directories dir1 and dir2.
![Remove original directories](http://linoxide.com/wp-content/uploads/2014/07/08.merge_cleanup.png)
Remove original directories
--------------------------------------------------------------------------------
via: http://linoxide.com/linux-command/merge-directory-trees-linux/
原文作者:[Raghu][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/raghu/

View File

@ -0,0 +1,615 @@
translating by disylee 20140701
110 Fun Open Source Games and Apps
110款开源游戏和应用
================================================================================
再次庆祝,伴随着一系列最好的开源游戏,我们庆祝这个夏天的到来。我们已经更新了[去年的列表][1]把新开发的添加进来,这样更好地把一些不再积极开发之中的旧游戏从列表中剔除。你会发现街机、平板、休闲、拼图、益智和第一人称射击游戏,音乐,赛车,角色扮演,冒险,模拟器和战略游戏等,它们也像一些应用程序一样并非真正的游戏但是仍然非常有趣。
今年,比以往有更多的开源游戏可用于移动设备上,主要是安卓设备上。希望未来几年,这种趋势一直保存下去。
请注意,这个列表是不按排名的。这些应用程序被放在目录中并按照字母顺序放在每个类别里。
如果你想建议明年游戏列表的版本,请随时注意在下面的评论区提出。
### Arcade Games ###
>
#### 1. [安迪的超级大公园][2] ####
当你乘坐过山车时你需要抓到气球并且避开障碍物。里面有25个等级加上18个你可以解锁的等级以获取高分。可使用操作系统WindowsLinux或者安卓。
#### 2. [Armagetron Advanced][3] ####
一个3D电子争霸克隆这个游戏激起你去指导一个光周期直到你撞上一堵墙。它支持单机模式和16人参与的网络模式。可使用操作系统WindowsLinuxOS X或者安卓。
#### 3. 塔克大战夺取旗帜 ####
众所周知的“战场夺旗”“BZflag是一个流行的在线坦克游戏。自1992年开发以来它具备3D图形化特征多种游戏模式和多人竞争比赛等特征。可使用操作系统WindowsLinuxOS X或者安卓。
#### 4. [纵向卷轴射击游戏] [5] ####
别让这个名字就把你愚弄了这和Chromium browser浏览器无关。这是一款快节奏、顶部滚动射击的游戏其难度在于设置而且这个游戏不回超过15分钟。可使用操作系统WindowsLinux。
#### 5. [埃德加的传说][6] ####
埃德加的传说是一个旧派的游戏平台主角必须通过克服障碍和敌人来完成他的任务。它包含了很多不同的武器、很多不同等级。适用操作系统WindowsLinux和OS X。
#### 6. [JVGS][7] ####
取代非常详细的图形JVGS只要一个最低限度方法使其中画中人物跨越景观看起来就像使用铅笔的手工绘制。在这个不寻常的游戏中主角是一个失去记忆的诗人。适用操作系统WindowsLinux和OS X。
#### 7. [失重力][8] ####
这是基于空间的街机射击游戏玩家需要在8002年份中他们必须完成各种各样的任务。但是这个游戏不是免费的游戏也可以在安卓和IOS中使用。适用操作系统有WindowsLinux和OS X。
#### 8. [Open Sonic][9] ####
基于刺猬索尼克游戏Open Sonic提供了合作的游戏用户可以同时控制3个字符。其中只有2个级别可以在原始游戏中使用但是很多游戏粉丝们已经建立了mods提供额外的发挥。适用操作系统Windows, Linux和OS X.
#### 9. [Powermanga][10] ####
类是于旧街机游戏Galaga,Powermanga是一款2D顶部滚动的空间射击游戏。它拥有超过41个等级并能够在旧的硬件上运行。适用操作系统Linux。
#### 10. [Scorched3D][11] ####
Scorched3D是一款现代的基于DOS的游戏Scorched星球最引人瞩目的是它出色的图形。你可以适用单机模式或者连接到许多网络服务器使用多玩家行动。适用操作系统Windows, Linux和 OS X.
#### 11. [音速机器人大爆炸][12] ####
另一款声波风格的平台游戏SRB2是一种采用了Doom引擎内置的3D平台游戏。它包括了2个不同的游戏角色和超过20个等级。适用操作系统Linux。
#### 12. [SuperTux][13] ####
SuperTux很像旧款的马里奥兄弟游戏但是是以Linux的小企鹅成为主人公。这是一个2D横向卷轴的平台游戏有9个不同的敌人和26个等级可以玩。适用操作系统Windows, Linux和OS X.
#### 13. [Those Funny Funguloids][14] ####
这是一款挑战玩家在太空手机蘑菇的游戏。该网站称“在此之前从未听说过手机蘑菇。至少不是在外太空。真的它更是一种生活而不是一个游戏。适用操作系统Windows和Linux.
#### 14. [Teeworlds][15] ####
这个在线游戏把自己描述成一个“复古的多人射击游戏”。它是一个横向卷轴的2D游戏支持多达16名选手和几个不同的游戏模式。适用操作系统Windows, Linux和 OS X.
#### 15. [X摩托][16] ####
在这个游戏中你骑着一辆摩托车通过一个侧面滚动的风景区同时收集草莓并避免高低不平的“破坏者”。这看起来是比较难适用操作系统Windows, Linux和 OS X.
#### 16. [Yo Frankie!][17] ####
通过混合开源3D动画工具创造的呦羊羊特征角色是从开源电影Peach来的。玩家必须指导羊羊糖滑翔机或者Momo一只猴子来回或者环绕并通过一个非常细致的3D环境中的障碍物。适用操作系统 Windows, Linux和 OS X.
### 棋类游戏 ###
#### 17. [Domination][18] ####
基于Java支配带来的棋牌游戏可能会对你的PC或者安卓设备造成风险。最新版本中可以让你实时与你Google+的朋友通过谷歌游戏服务发挥多人游戏服务功能。适用操作系统Windows, Linux, OS X和 Android.
#### 18. [GNU 十五子棋][19] ####
这个“世界级”十五子棋引擎让你每一次都更好地挑战它并且它会分析你的战况来帮助你玩得更好。这个借口是非常好的图形化定制。适用操作系统WindowsLinux和OS X。
#### 19. [3D 拼字游戏][20] ####
随着拼字游戏的变化你可以选择自己的电路板——经典版本。Superscrabble是一款3D的拼字游戏您可以通过它定制你自己的电路板。玩家可以对战AI或者连到在线服务器上进行多人游戏。适用操作系统Windows, Linux和 OS X.
#### 20. [PokerTH][21] ####
这是一个高质量的德州扑克牌应用程序拥有优秀的、可定制的界面。想要在线玩或者看看你和其它对手的排名只需要在Poker-Heroes.com在线注册。适用操作系统WindowsLinux和OS XAndroid系统。
#### 21. [PySolFC][22] ####
你知道吗接龙有1000多种类型这个强大的集合功能“使用52张国际格局甲板模式比赛为78张Tarock夹板8和10套装备Ganjiafa游戏花札游戏棋牌游戏、麻将游戏和原始十六进制为基础的平台”。适用操作系统: Windows, Linux和 OS X.
### 休闲益智游戏 ###
#### 22. [2048][23] ####
这个简单而上瘾的益智游戏玩家围绕着方格里喜欢的数字组合。当你将组合数字累加到2048时你就赢了。适用操作系统在线IOS或者安卓。
#### 23. [台球][24] ####
台球游戏的主要目的是当你不能够拥有一张可用的台球桌时给现实中能够让你练习球杆运动。它拥有一个好看的3D界面同时也可以在不具备良好图形界面的2D系统中运行。适用操作系统Linux。
#### 24. [立方火车][25] ####
躺在连接隧道和桥梁的铁轨然后机动绕过障碍物。你可以万很多内置等级的或者创建你属于自己的等级。适用操作系统WindowsLinux或者OS X。
#### 25. [谜语][26] ####
类似于旧Oxyd和摇滚乐的游戏谜语挑战者在相同的石头中找到迷宫陷进激光束和其他障碍。这个游戏拥有1000多个等级这也是一款益智游戏可能占用你一段很长时间。适用操作系统WindowsLinux和OS X。
#### 26. [Fish Fillets NG][27] ####
在这个益智游戏中玩家必须尝试分别在这70个等级中各找到一条安全路径。一路上鱼类和其它水下居民提供相关用户的幽默解说。适用操作系统Windows, Linux和 OS X.
#### 27. [冰冻泡泡][28] ####
这是最古老的泡沫射击游戏中的一个冰冻泡沫是以Linux小企鹅和多于100多个级别为特征的单机游戏。你也可以通过局域网或者互联网对阵2~5个玩家。适用操作系统Windows和Linux。
#### 28. [GnomeGames][29] ####
这个集合汇聚了15个不同的休闲游戏你可以在5分钟以内玩。它包括了数独一个扫雷游戏麻将一个黑白棋版本等等。适用操作系统Linux。
#### 29. [切番茄][30] ####
10分钟内你可以粉碎多少个西红柿这种“极端闲暇时间的活动”来自同一个叫做Those Funny Funguloids的团队。适用操作系统 Windows和 Linux.
#### 30. [KDE 游戏][31] ####
这是为KDE桌面准备的休闲游戏的集合。它包含了一个游戏纸牌的变化一个高尔夫游戏一个风险版本扫雷艇数度等等。适用操作系统Windows和Linux。
#### 31. [平衡球][32] ####
在这个游戏中玩家必须倾斜地板去引导球通过障碍球场。这个游戏包括很多级别并且你可以设计自己的级别。适用操作系统Windows, Linux和 OS X。
#### 32. [Pingus][33] ####
你是否还话费数个小时玩旅鼠总动员来追忆的你90年代如果这样的话Pingus会更适合你。这是旅鼠的翻拍企鹅取代了旅鼠有77个级别。适用操作系统Windows, Linux和 OS X.
#### 33. [易如反掌][34] ####
这个益智游戏的特点是蚂蚁来推排成各种团的多米若骨牌。玩家必须让所有多米诺骨牌倒下并通过出口为的是发送一个特别的触发信号来进入新的等级。适用操作系统Windows。
#### 34. [Zaz][35] ####
这是另一款泡沫射手游戏Zaz挑战你沿着他们设定的路径击中球。其转折点是你的枪炮只能沿着一条路径移动这样使事情变得有点难度了。适用操作系统Windows和Linux。
### 教育类游戏 ###
#### 35. [ChildsPlay][36] ####
这个游戏专门有5岁及一下的小孩设计ChildsPlay帮助教一些发音字母数字和基础键盘技巧。它也包括了一些游戏例如记忆乒乓球和吃豆豆。适用操作系统WindowsLinux和OS X。
#### 36. [GBrainy][37] ####
通过GBrainy的逻辑训练你的词汇、数学和记忆游戏的意识。它充满了乐趣和教育意义适合所有年龄段的人群。适用操作系统Windows和 Linux.
#### 37. [GCompris][38] ####
专为2~10岁的儿童射击 GCompris 包括了超过100多种but的活动其中大多数是教育类的。它包括数学地理科学阅读敲键盘和艺术游戏再加上国际象棋数独记忆法等等。适用操作系统Wwindows和Linux。
#### 38. [TuxMath][39] ####
在即将到来的彗星杀死企鹅之前迅速解决算数问题。这是一个简单的游戏用于强化小学学龄的数学真相。适用操作系统Windows, Linux和 OS X.
### 第一人称射击游戏 ###
#### 39. [外星人竞技场][40] ####
内置的“专为手榴弹攻击者的手榴弹”外星人竞技场是一个激烈的充满复古题材的死亡争斗射击者。许多不同的网站为线上游戏提供了托管服务器也有很多粉丝网站和玩家技巧等等。适用操作系统Linux, Windows和 OS X.
#### 40. [AssaultCube][41] ####
由于它的轻量级AssaultCube也可以在旧硬件上运行除了拥有不错的真实感图形之外。它还支持单机模式和多玩家游戏模式包括了26张不同的地图和12种不同的游戏模式。适用操作系统LinuxWwindows和OS X。
#### 41. [经典 Nexuiz][42] ####
下载量超过600万次Nexuiz是最流行的开源射击游戏之一。几年前该游戏是一个非开源版本创建的但你可以从SourceForge的链接下载经典版本。适用操作系统Windows, Linux和OS X.
#### 42. [OpenArena][43] ####
这个多玩家游戏是雷蛇之锤3的克隆它的特征是拥有13种不同的武器51个竞技场和12类游戏。该程序的拥有者发出警告“由于暴力和偶尔的不健康内容它不适合17岁一下的孩子玩”。适用操作系统Windows, Linux和 OS X.
#### 43. [Red Eclipse][44] ####
这个休闲的第一人称射击游戏已经获得极高的评价。其特点包括跑酷脉冲刺激界面华丽几种游戏模式和一个内置的关卡编辑。适用操作系统Windows, Linux和 OS X.
#### 44. [Tremulous][45] ####
这是一个屡获殊荣的游戏一款混合了即时战略游戏元素的第一射击游戏。用户可以选择扮演外星人或者人类来永久消灭其它队的对手。适用操作系统Windows, Linux, OS X和 XBox.
#### 45. [TrueCombat][46] ####
TrueCombat声称自己“也许永远是最好的免费战术写实的射击游戏。”这是一个2个对抗团队比赛的现代世界实战模拟器。请注意为了使用它你还需要德军总部敌对势力。操作系统Windows, Linux和 OS X。
#### 46. [Unvanquished][47] ####
从Tremulous分离出来不可征服的人陷入“高度适应能力人类群体的先进技术。”在非常活跃的开发环境下每个月提供了新的版本。适用操作系统Windows, Linux和 OS X。
#### 47. [Warsow][48] ####
这款自称在“在Web上节奏最快的运动”Warsow是一个卡通射击游戏具有”猪尾巴火箭炮和携带赛伯朋克”的射击游戏。不想大多数射击游戏它没有大量的血液和仇恨更多强调的是运动。适用操作系统WindowsLinux和OS x.
#### 48. [Wolfenstein: Enemy Terriorty][49]
虽然已经有好几个专有德军部队游戏但这一个是开源的。这是一个第二次世界大战时间的游戏其核心专门对抗盟军。适用操作系统WindowsLinux,OS X。
#### 49. [ Padman世界][50] ####
基于Quake引擎这个射手类似三角形状显得非常卡通化。这个游戏有相当多的在线服务器可以适用或者您也可以离线玩。适用操作系统Wwindows和Linux。
#### 50. [Xonotic][51] ####
Xonotic是经典版Nexuiz的分支。它拥有超过22种不同的地图16种武器和大量不同的游戏模式。适用操作系统Windows, Linux和OS X.
#### 51. [零导弹][52] ####
部分第一人称射击手部分坦克游戏零导弹坐落在风景如画的山区环境并已经拥有超过81个坦克体系可用。玩死斗团队死斗或者独特的beaconstrike模式。适用操作系统Windows、Linux 和 OS X。
### 音乐类游戏 ###
#### 52. [Frets on Fire][53] ####
Frets on Fire这个游戏很多地方都很像“吉它英雄”这个游戏它甚至可以起到播放“吉它英雄”里的歌曲当然其它歌曲也同样可用。如果你没有一个吉它控制器别担心你也可以适用键盘来玩。适用操作系统Windows, Linux和 OS X.
#### 53. [StepMania][54] ####
这是一个免费版本的跳舞机挑战者可以停留在某个节奏去对应音乐的节拍。你既可以适用跳舞毯如果你拥有的话去挑或者也可以适用键盘操作。适用操作系统Windows, Linux/Unix, OS X或者 XBox.
#### 54. [Ultrastar Deluxe][55] ####
如果卡拉OK是你的菜那么你就会喜欢Ultrastar Deluxe这个游戏了。在这个游戏中你必须单独唱完一首歌并且是对应正确的节拍。它包含了超过10000歌曲。适用操作系统 Windows, Linux和OS X.
### 赛车游戏 ###
#### 55. [至尊小企鹅竞赛][56] ####
Tux Racer是一款备受宠爱的旧款游戏其特征是Linux小企鹅展示他的腹部滑下山。至尊小企鹅为现在的游戏玩家更新了这款经典游戏。适用操作系统Windows, Linux和OS X.
#### 56. [Speed Dreams][57] ####
这是TORCS自动赛车游戏的分支见下文其特征是一个更新过的UI界面和许多骑车和轨道。正如TORCS视觉效果非常出色。适用操作系统Windows和 Linux.
#### 57. [SuperTuxKart][58] ####
这个卡通赛车游戏的特点是Linux小企鹅和朋友们驾驶卡丁车。沿着轨道的指引前进同时避开一堆障碍物的撞击。适用操作系统Windows, Linux和 OS X.
#### 58. [TORCS][59] ####
TROCS是"The Open Racing Care Simulator”的缩写,TORCS是一款拥有大量粉丝为基础的杰出的逼真赛车游戏。单独驾驶或与朋友在其中一条轨道中竞赛也是可选的。适用操作系统Windows, Linux和 OS X.
#### 59. [终极特技][60] ####
由经典DOS游戏Stunts的启发终极特技要求玩家去指导整个破碎的桥梁的车辆跳跃环绕等避开其它障碍。它允许提供一些选项通过更加疯狂的特技来设计自己的轨道。操作系统WindowsLinux和OS X。
#### 60. [VDrift][61] ####
类似一款模拟器的赛车游戏VDrift介绍玩家们赛车漂移的世界在一个真实的物理引擎中。它包含了超过45辆车超过45条轨道并且对各种控制器提供了支持。适用操作系统WwindowsLinuxOS X。
### 角色扮演和冒险游戏 ###
#### 61. [穿越火线][62] ####
有时被描述为NetHack 和 Gauntlet之间的穿越穿越火线是一款非常旧派的图形街机冒险游戏。它拥有超过3000张不同的地图和超过150种不同的怪物。适用操作系统Windows, Linux和 OS X.
#### 62. [Epic Inventor][63] ####
Epic Inventor将自己描述成一个"横向卷轴动作的RPG游戏。"它类似于Minecraft是一款简单的像素化图形和开放式的游戏。适用操作系统Windows和 Linux.
#### 63[神剑Morganna的复仇] [64] ####
这款时空穿梭游戏让扮演你在未来海洋空间,玩家必须穿越回到亚瑟王和克莱特的年代。这个图形界面并没有什么特别的(想想 Minecraft),但是故事情节和游戏性都很赞。适用操作系统: Windows, Linux和OS X.
#### 64. [火炬][65] ####
受Diablo启发这个角色扮演游戏的重点在于战斗。它仍然是一个开端版本但是依旧可以玩。适用操作系统Windows, Linux和 OS X.
#### 65. [苏娜之吻][66] ####
仅对成年人开发,这款"舌头在脸颊上的动作RPG"充满了“暴力、粗俗、裸体等主题”也许你在其它游戏中很少看到。它提供了大量的动作和不断变化的景观。适用操作系统Windows和 Linux.
#### 66. [The Mana World][67] ####
这是一款大型的多人在线角色扮演游戏MMORPG),但事实没有想象中庞大。在我写下这段文字的时候有31个人正在玩这个游戏。尽管这样创造一个不断扩大的世界充满了怪物、任务和迷你游戏是一个很好的尝试。适用操作系统WindowsLinux和OS X。
#### 67. [NetHack][68]注:此链接原文有错误,和上面的链接地址一样了 ####
游戏史上经典之一NetHack是一个带及其简单图形的复杂地牢履带。它被称为有史以来最好的100个视频之一。适用操作系统 Windows, Linux, 和经典Mac.
#### 68. [PlaneShift][69] ####
设置在Yliakum的梦幻世界这是一个独特的在线角色扮演游戏其特征是有10个不同的种族和一个拥有自己经济、政府、宗教和法律的发达国家。虽然可以试玩但是这款游戏还处在早期的开发阶段。适用操作系统Windows, Linux和 OS X.
#### 69. [Ryzom][70] ####
其中一个较好开源MMORPGS获得Ryzom奖是设置在一个叫Atys的树状星球其中有几种不同种族互动有时候树状星球会发生冲突。你可以自由发回但是那些选择订阅会得到特别的好处。适用操作系统Windows, Linux和 OS X.
#### 70. [Stendhal][71] ####
这个在线角色扮演游戏相比大多数同类游戏更友好。网站上解释,"你可能会被要求去帮助保护土地拯救穷人治愈病人是别人获得快乐解决难题或者直接伸出援手。适用操作系统Windows, Linux和OS X.
#### 71. [Summoning Wars][72] ####
可以多达8个人一起玩的幻想角色扮演游戏。拖车这个游戏有一个拖车你可以同时在Youtube上看到它的动作。适用操作系统Windows, Linux和 OS X.
### 模拟类游戏 ###
#### 72. [FlightGear][73] ####
FlightGear是一个极其逼真、一流的飞行模拟器并且有竞争对手的专用软件。它包括了整个世界精准的地形和20000多个机场还有众多栩栩如生的飞机模型。适用操作系统Windows, Linux, OS X和其它。
#### 73. [Golems][74] ####
有了这个物理模拟器你可以创建任何你想要的东西并看它在真实世界中如何表现。这是一个强大的基础学习机器可以制造机器人并发明各种玩意。适用操作系统Windows, Linux和 OS X.
#### 74. [LinCity NG][75] ####
基于原来的SimCity游戏LinCity NG挑战玩家去建造一个可持续发展的大都市并拥有繁华的经济状况。需要注意的是由于这个游戏是基于旧代码所以它的图形化更像久的DOS游戏。适用操作系统Windows, Linux和 OS X.
#### 75. [Micropolis/OLPC SimCity][76] ####
另一个SimCity的模仿者Micropolis是一个基于Java开发的城市模拟器。它还具有相当老派的图形界面而不是较新的3D外观模拟城市游戏。适用操作系统Windows, Linux和 OS X.
#### 76. [Minetest][77] ####
与Minecraft极其相似Minetest被设置在基础构建的一个无垠世界中。玩家可以探索矿山或者根据他们的需要制造一些新事物。适用操作系统 Windows, Linux和 OS X.
#### 77. [Pioneer][78] ####
Pioneer描述自己为“一个孤独的太空冒险游戏”。它将玩家输送到一个开放式的世界里这个世界里他们可以决定他们想做什么和去哪里。适用操作系统Windows, Linux和 OS X.
#### 78. [Oolite][79] ####
这个游戏是基于EliteOolite是一个太空模拟器你可以与其它航天员进行进行交易或者参加一场战斗。这个游戏存在了相当长的一段时间很多扩展操作系统可以使用。适用操作系统Windows, Linux和 OS X.
#### 79. [OpenCity][80] ####
这个3D城市模拟器并不是要成为一个模拟城市的克隆器但是提供类似的玩家模式。这是相当基础的但是很耐玩。适用操作系统Windows, Linux和 OS X.
#### 80. [OpenTTD][81] ####
基于豪华运输大亨OpenTTD邀请玩家去简历一个运输帝国。它支持一次多达255个玩家并可以通过很多种方式去改善原来的TTD系统。适用操作系统 Windows, Linux和 OS X.
#### 81. [Rigs of Rods][82] ####
#### 81. [Rigs of Rods][82] ####
这个车辆模拟器具有一个独特的软体物理引擎拥有一批非常积极和热情的粉丝为基础。使用它来创造陆地海洋或者空中骑车可以带着它们驾驶或者飞往全国各地。适用操作系统Windows, Linux和 OS X.
#### 82. [Simutrans][83] ####
这个交通仿真器提供了连接到互联网在线游戏主机的选项。适用公车、卡车、火车、电车、船只、飞机、单轨铁车、磁悬浮列车或者其它交通工具将人们或者货物运送到他们想抵达的地方去。适用操作系统Windows, Linux和 OS X.
#### 83. [Vega Strike][84] ####
这是另一款太空模拟器可以让你星系中交易和战斗。你可以选择是否选择飞贸易路线接受狩猎任务奖金打海盗或者探索浩瀚的太空。适用操作系统Windows, Linux和 OS X.
### 战略游戏 ###
#### 84. [0 A.D.][85] ####
现在已经更新到了第16个alpha版本了。0 A.D.是一个屡获文明建设的游戏这个游戏努力地在追溯历史的准确性。玩家可以选择迦太基人凯尔特人希腊人伊比利亚人孔雀王朝人波斯人或者罗马人进行游戏。适用操作系统Linux, Windows和 OS X.
#### 85. [Advanced Strategic Command][86] ####
这个回合制战略游戏是基于Battle Isle游戏系列。玩家在战斗网格景观可以适用单机游戏模式或者多人游戏模式。适用操作系统Windows和 Linux.
#### 86. [Battle for Wesnoth][87] ####
这个回合制战术策略游戏将玩家置身于神话世界里它们争取夺回王位。游戏中充斥着兽人、精灵、巫师和数以百计的其它充满梦幻的一个大环境。支持单人游戏和多人游戏。适用操作系统LinuxWindowsOS XIOS。
#### 87. [BosWars][88] ####
这个未来的实时战略游戏需要玩家建立能源存储和一个经济体系来支持其军事斗争。玩家可以可以通过局域网进行多人游戏来抵抗对手。适用操作系统WindowsLinux和BSDOS X。
#### 88. [CommanderStalin][89] ####
关于BosWars的变化是被设置在斯大林时期的苏联国家。为的是对不可避免的纳粹进行攻击做准备适用操作系统Windows和Linux。
#### 89. [FreeCol][90] ####
受游戏Colonization and Civilization的启发FreeCol是一款回合制文明建设的战略游戏。你可是的新世界在1492年并通过建立一个独立和言论自由的国家取胜。适用操作系统Windows, Linux和OS X.
#### 90. [FreeCiv][91] ####
这也是一个在Civilization得到启发的游戏这个回合制战略游戏开始在石器时期结束于太空时期。它包括了50个可玩单元和541国家并附带了各种可玩场景。适用操作系统Windows, Linux和 OS X.
#### 91. [FreeOrion][92] ####
尽管这不是一个克隆或者翻拍FreeOrion是一个松散的基于Master of Orion 的游戏。这是一个设置在太空的回合制战略游戏。适用操作系统Windows, Linux和 OS X.
#### 92. [Glest][93] ####
这个实时战略游戏中科技的力量和魔法的力量都在其中。虽然它任然提供下载但是大多数Linux发行版本现在包含了Megaglest的分支见下文而不是这个旧的程序。适用操作系统Windows和 Linux.
#### 93. [Globulation 2][94] ####
这个实时文明建设战略游戏用意在于减少微观管理并允许玩家集中精力于战略上。单机模式或者多用户模式游戏和关卡编辑器都是可用的。适用操作系统Windows和 Linux.
#### 94. [Hedgewars][95] ####
这是一个更轻快的战略游戏Hedgewars以“粉红刺猬从地狱深处战斗到太空深处”总共31个环境48张已经设置好的地图还可以无限制随机生成张地图55种武器280种服装最多支持8个玩家。适用操作系统Linux, OS X和iOS.
#### 95. [Kernel Panic][96] ####
这款游戏设置在数字地形中Kernel Panic是一款实时战略游戏拥有Tron-like的图形界面。所有资源都是免费的所以玩家不必担心楼宇经济只需要于其它骇客在网络上斗争。适用操作系统Linux和 Windows。
#### 96. [Liquid War][97] ####
追溯回2002年Liquid War被评委最“最原始的Linux游戏”但是仍然是值得一玩的。玩家尝试消耗敌人的能量来控制水军。适用操作系统 Windows, Linux和 OS X.
#### 97. [MegaGlest][98] ####
这个游戏是Glest的衍生在原来的Tech和Magic上增加了5个新的队伍埃及印度挪威人波斯和罗马。它提供了17中不同的地图有单机模式和多人游戏模式并为新手提供了教程。适用操作系统Windows和 Linux.
#### 98. [Pax Brittanica][99] ####
这是一款。最多可以支持4个玩家在战斗中使用同意键盘的潜艇战略游戏。这些空间简单易学你只需适用一个按钮但是这个游戏可以玩得非常激烈。适用操作系统Windows, Linux和 OS X.
#### 99. [Spring: 1944][100] ####
这是一款二战战略游戏提供了逼真的游戏单元和强度。供选择的游戏角色可以是美国德国苏联和英国。适用操作系统Linux。
#### 100. [UFO: Alien Invasion][101] ####
在未来70年一个秘密的组织正在为保卫地球不受狠毒的外星人侵略做战斗。玩家扮演人类或者外星人在单机模式或者多用户模式。适用操作系统Windows, Linux和 OS X.
#### 101. [Unknown Horizons][102] ####
在这个文明建设的战略游戏中强调的是建设一个强大的经济体制你需要在一个孤岛上利用屈指可数的定居者和资源为开始去建造一个欣欣向荣的城市。适用操作系统Windows, Linux和 OS X.
#### 102. [Warzone 2100][103] ####
你可以在核爆炸后重建地球吗这个游戏提供了一个非常强大科技树并支持单人模式或者多人模式。适用操作系统Windows, Linux,和OS X.
#### 103. [Widelands][104] ####
受Settlers II启发Widelands是另外一款实时战略游戏挑战玩家去建立一个文明国度。它的特点是具有3个部落分别为野蛮人、帝国和亚特兰蒂斯而不像大多数文明游戏玩家并没有被告知每个单元要做什么而是把下订单并委派给代表更像一个统治者的角色。适用操作系统Windows, Linux和 OS X.
#### 104. [Zero-K][105] ####
在这个快速移动的实时战略游戏中机器人军队进行着一场永无休止的战斗。主要功能包括超过100种不同的单元一个精简的经济体系逼真的物理引擎地球化等等。适用操作系统 Windows和 Linux.
#### 105. [Zombies][106] ####
你能够在在僵尸杀了你之前杀死所有僵尸吗这是一个回合制的游戏提供了令人上瘾的游戏和设置允许玩家决定挑战的级别。适用操作系统OS X、
### 有趣的非游戏类 ###
#### 106. [Celestia][107] ####
对于想成为宇航员和初露头角的天文学家,这款游戏无疑是至臻完美的, Celestia可以让你看到太空因为它会出现在任何时间和宇宙中的任何已知点。快速地到木星旅行或者画出你夜晚的观星图。适用操作系统Windows, Linux和 OS X.
#### 107. [Electric Sheep][108] ####
这个游戏的灵感来自于Philip K. Dick小说中 Do Androids Dream of Electric Sheep做电绵羊机器人的梦想?这个屏幕通过创造抽象图案和花纹来保护您的系统连接到成千上万人的系统上。投票支持你喜欢的团它们便会出现得更经常一些。适用操作系统Windows, Linux, OS X, 安卓和 iOS.
#### 108. [LCARS 24][109] ####
如果你家里有一台旧的电脑睡会没有为何不把它变成一个星际旅行为主题。有了这个应用你可以得到一个闹钟和文件管理器从图形界面看来就像来到了一个正规的企业。适用操作系统Windows和 DOS.
#### 109. [Stellarium][110] ####
把你的PC变成一个天文馆。Stellarium可以在地球上随时从任何角度随时显示夜空而且它使用许多天象仪器来为显示器供电。适用操作系统Windows, Linux和 OS X.
#### 110. [Tux Paint][111] ####
Tux Paint可以让学龄前儿童很容易地在电脑上创建自己的“图画”。它的特征是有一个借口和大按钮有趣的声音效果和友好的字符界面。适用操作系统Windows, Linux和 OS X.
--------------------------------------------------------------------------------
via: http://www.datamation.com/open-source/110-fun-open-source-games-and-apps-1.html
译者:[disylee](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:http://www.datamation.com/open-source/101-most-fun-open-source-games-and-apps-1.html
[2]:http://www.stuff-o-matic.com/asgp/
[3]:http://armagetronad.org/index.php
[4]:http://bzflag.org/
[5]:http://chromium-bsu.sourceforge.net/
[6]:http://www.parallelrealities.co.uk/p/legend-of-edgar.html
[7]:http://www.penguspy.com/jvgs/
[8]:http://www.nogravitythegame.com/classic/
[9]:http://opensnc.sourceforge.net/home/index.php
[10]:http://linux.tlk.fr/games/Powermanga/
[11]:http://www.scorched3d.co.uk/
[12]:http://www.srb2.org/
[13]:http://supertux.lethargik.org/
[14]:http://funguloids.sourceforge.net/
[15]:http://www.teeworlds.com/
[16]:http://xmoto.tuxfamily.org/
[17]:http://www.yofrankie.org/
[18]:http://domination.sourceforge.net/
[19]:http://sourceforge.net/apps/mediawiki/scrabble/index.php?title=Main_Page
[20]:http://sourceforge.net/apps/mediawiki/scrabble/index.php?title=Main_Page
[21]:http://www.pokerth.net/
[22]:http://pysolfc.sourceforge.net/
[23]:http://gabrielecirulli.github.io/2048/
[24]:http://www.nongnu.org/billiards/
[25]:http://cubetrains.com/
[26]:http://www.nongnu.org/enigma/
[27]:http://fillets.sourceforge.net/
[28]:http://www.frozen-bubble.org/
[29]:http://live.gnome.org/GnomeGames
[30]:http://tomatoes.sourceforge.net/about.html
[31]:http://games.kde.org/
[32]:http://neverball.org/
[33]:http://pingus.seul.org/welcome.html
[34]:http://pushover.sourceforge.net/
[35]:http://zaz.sourceforge.net/
[36]:http://www.schoolsplay.org/
[37]:https://live.gnome.org/gbrainy
[38]:http://gcompris.net/index-en.html
[39]:http://tux4kids.alioth.debian.org/tuxmath/index.php
[40]:http://icculus.org/alienarena/rpa/
[41]:http://assault.cubers.net/
[42]:http://www.alientrap.org/games/nexuiz
[43]:http://openarena.ws/smfnews.php
[44]:http://www.redeclipse.net/
[45]:http://tremulous.net/
[46]:http://www.truecombatelite.com/
[47]:http://www.unvanquished.net/
[48]:http://www.warsow.net/
[49]:http://www.splashdamage.com/wolfet
[50]:http://worldofpadman.net/website/news
[51]:http://www.xonotic.org/
[52]:http://www.zeroballistics.com/
[53]:http://www.stepmania.com/
[54]:http://www.stepmania.com/
[55]:http://www.ultrastardeluxe.org/
[56]:http://sourceforge.net/projects/extremetuxracer/
[57]:http://www.speed-dreams.org/
[58]:http://supertuxkart.sourceforge.net/
[59]:http://torcs.sourceforge.net/
[60]:http://www.ultimatestunts.nl/
[61]:http://vdrift.net/
[62]:http://crossfire.real-time.com/intro/index.html
[63]:http://www.epicinventor.com/
[64]:http://excaliburworld.com/emr/emr3/index.html
[65]:http://flarerpg.org/media/
[66]:http://lipsofsuna.org/
[67]:http://themanaworld.org/
[68]:http://themanaworld.org/
[69]:http://www.planeshift.it/about.html
[70]:http://www.ryzom.com/en/
[71]:http://stendhalgame.org/
[72]:http://sumwars.org/wiki/Main_Page
[73]:http://www.flightgear.org/
[74]:http://www.golemgame.com/
[75]:http://lincity.sourceforge.net/
[76]:https://code.google.com/p/micropolis/
[77]:http://minetest.net/
[78]:http://pioneerspacesim.net/
[79]:http://www.oolite.org/
[80]:http://www.opencity.info/
[81]:http://www.openttd.org/en/
[82]:http://www.rigsofrods.com/content/
[83]:http://www.simutrans.com/
[84]:http://vegastrike.sourceforge.net/
[85]:http://play0ad.com/
[86]:http://www.asc-hq.org/
[87]:http://www.wesnoth.org/
[88]:http://www.boswars.org/
[89]:http://commanderstalin.sourceforge.net/
[90]:http://www.freecol.org/
[91]:http://freeciv.wikia.com/wiki/Main_Page
[92]:http://freeorion.org/index.php/Main_Page
[93]:http://glest.org/en/index.php
[94]:http://globulation2.org/wiki/Main_Page
[95]:http://www.hedgewars.org/
[96]:http://springrts.com/wiki/Kernel_Panic
[97]:http://www.ufoot.org/liquidwar/v5
[98]:http://glest.org/en/index.php
[99]:http://paxbritannica.henk.ca/
[100]:http://spring1944.net/
[101]:http://ufoai.org/wiki/News
[102]:http://www.unknown-horizons.org/
[103]:http://wz2100.net/
[104]:http://wl.widelands.org/
[105]:http://zero-k.info/
[106]:http://codenautics.com/zombies/
[107]:http://www.shatters.net/celestia/index.html
[108]:http://community.electricsheep.org/
[109]:http://lcars24.com/
[110]:http://stellarium.org/
[111]:http://tuxpaint.org/

View File

@ -0,0 +1,145 @@
Linux 内核测试和调试 - 4
================================================================================
### 自动测试工具 ###
这里列出一些能满足不同需求的测试工具供你选择。本小节只是简单介绍个大概,并不提供详细操作指南。
#### [AuToTest][1] ####
> AuToTest 是一个全自动测试框架,存在的主要目的就是测试 Linux 内核当然也可以用来测试其他东西比如测试一块新硬件是否能稳定工作。AuToTest 是开源软件,以 GPL 方式授权,运行于 server-client 架构(即 C/S 架构)。你可以通过配置 server 端来对运行了 client 端的系统执行初始化、运行与监测工作,也可以自己在目标系统上让 client 运行起来。另外你可以为这个测试框架添加测试用例,详情请参考[AuToTest 白皮书][2]。
#### Linaro Automated Validation Architecture ####
> LAVA 自动测试框架用于自动安装于运行测试。举个例子:你在 LAVA 里面只需运行几个命令就可以跑 LTPLCTTLinux Test Project中文是 Linux 测试计划SGI发起并由IBM负责维护目的是为开源社区提供测试套件来验证Linux的可靠性、健壮性和稳定性。通过 LAVA 命令可以自动为你安装 LTP 所需要的所有依赖包,下载源码、编译编码、将 LTP 安装到某个独立的地方,方便卸载 LTP 时能移除所有二进制文件。安装好 LTP 后,运行 LAVA 命令时添加 'ltp' 选项就可以运行 LTP 测试任务了,它会将测试结果以文件方式保存下来,文件名包含测试名称、时间戳。这些测试结果可以留着供以后参考。这是个发现软件退化(如果软件退化了的话)的好方法。下面列出 LAVA 配合 LTP 使用的一些命令:
显示 LAVA 支持的测试列表:
lava-test list-tests
安装测试套件:
lava-test install ltp
运行测试:
lava-test run ltp
查看结果:
lava-test results show ltp-timestamp.0
卸载测试套件:
lava-test uninstall ltp
### 内核调试功能 ###
Linux 内核本身包含很多调试功能,比如 kmemcheck 和 kmemleak。
#### kmemcheck ####
> kmemcheck 是一个动态检查工具可以检测出一些未被初始化的内存LCTT内核态使用这些内存可能会造成系统崩溃并发出警告。它的功能与 Valgrind 类似,只是 Valgrind 运行在用户态,而 kmemchecke 运行在内核态。编译内核时加上 CONFIG_KMEMCHECK 选项打开 kmemcheck 调试功能。你可以阅读 Documentation/kmemcheck.txt 来学习如何配置使用这个功能,以及如何看懂调试结果。
#### kmemleak ####
> kmemleak 通过类似于垃圾收集器的功能来检测内核是否有内存泄漏问题。而 kmemleak 与垃圾收集器的不同之处在于前者不会释放孤儿目标LCTT不会再被使用的、应该被释放而没被释放的内存区域而是将它们打印到 /sys/kernel/debug/kmemleak 文件中。用户态的 Valgrind 也有一个类似的功能,使用 --leak-check 选项可以检测并报错内存泄漏问题,但并不释放这个孤儿内存。编译内核时使用 CONFIG_DEBUG_KMEMLEAK 选项打开 kmemcleak 调试功能。阅读 Documentation/kmemleak.txt 来学习怎么使用这个工具并读懂调试结果。
### 内核调试接口 ###
Linux 内核通过配置选项、调试用的 API、接口和框架来支持动态或静态的调试。我们现在就好好学习学习这些牛逼的功能从静态编译选项开始讲。
### 调试配置选项:静态编译 ###
大部分 Linux 内核以及内核模块都包含调试选项,你只要在编译内核或内核模块的时候添加这个静态调试选项,程序运行时后就会产生调试信息,并记录在 dmesg 缓存中。
### 调试的 API ###
调试 API 的一个很好的例子是 DMA-debug用来调试驱动是否错误使用了 DMA 提供的 API。它会跟踪每个设备的映射关系检测程序有没有试图为一些根本不存在的映射执行“取消映射”操作检测代码建立 DMA 映射后可能产生的“映射丢失”的错误。内核配置选项 CONFIG_HAVE_DMA_APT_DEBUG 和 CONFIG_DMA_API_DEBUG 可以为内核提供这个功能。其中CONFIG_DMA_API_DEBUG 选项启用后,内核调用 DMA 的 API 的同时也会调用 Debug-dma 接口。举例来说,当一个驱动调用 dma_map_page() 函数来映射一个 DMA 缓存时dma_map_page() 会调用debug_dma_map_page() 函数来跟踪这个缓存,直到驱动调用 dma_unmap_page() 来取消映射。详细内容请参考[使用 DMA 调试 API 检测潜在的数据污染和内存泄漏问题][3]。
### 动态调试 ###
动态调试功能就是你可以决定在程序运行过程中是否要 pr_debug(), dev_dbg(), print_hex_dump_debug(), print_hex_dump_bytes() 这些函数正常运行起来。什么意思?当程序运行过程中出现错误时,你可以指定程序打印有针对性的、详细的调试信息。这功能牛逼极了,我们不再需要为了添加调试代码定位一个问题,而重新编译安装内核。你可以指定 CONDIF_DYNAMIC_DEBUG 选项打开动态调试功能,然后通过 /sys/kernel/debug/dynamic_debug/control 接口指定要打印哪些调试日志。下面分别列出代码级别和模块级别打印日志的操作方法:
让 kernel/power/suspend.c 源码第340行的 pr_debug() 函数打印日志:
echo 'file suspend.c line 340 +p' > /sys/kernel/debug/dynamic_debug/control
让内核模块在加载过程中打开动态调试功能:
> 使用 modprobe 命令加在模块时加上 dyndbg='plmft' 选项。
让内核模块的动态调试功能在重启后依然有效:
> 编辑 /etc/modprobe.d/modname.conf 文件(没有这个文件就创建一个),添加 dyndbg='plmft' 选项。然而对于哪些通过 initramfs 加载的驱动来说这个配置基本无效LCTT免费奉送点比较高级的知识哈。系统启动时需要先让 initramfs 挂载一个虚拟的文件系统,然后再挂载启动盘上的真实文件系统。这个虚拟文件系统里面的文件是 initramfs 自己提供的,也就是说你在真实的文件系统下面配置了 /etc/modprobe.d/modname.conf 这个文件initramfs 是压根不去理会的。站在内核驱动的角度看:如果内核驱动在 initramfs 过程中被加载到内核,这个驱动读取到的 /etc/modprobe.d/modname.conf 是 initramfs 提供的,而不是你编辑的那个。所以会有上述“写了配置文件后重启依然无效”的结论)。对于这种刁民,呃,刁驱动,我们需要修改 grub 配置文件,在 kernel 那一行添加 module.dyndbg='plmft' 参数,这样你的驱动就可以开机启动动态调试功能了。
想打印更详细的调试信息,可以使用 dynamic_debug.verbose=1 选项。参考 Documentation/dynamic-debug-howto.txt 文件获取更多信息。
### 设置追踪点 ###
到目前为止,我们介绍了多种动态和静态调试方法。静态调试选项和静态调试钩子函数(比如 DMA Debug API需要的编译过程打开或关闭导致了一个难过的事实需要重新编译安装内核。而动态编译功能省去了“重新编译”这件麻烦事但是也有不足的地方就是调试代码引入了条件变量用于判断是否打印调试信息。这种方法可以让你在程序运行时决定是否打印日志但需要执行额外的判断过程。“追踪点”代码只会在程序运行过程中使用“追踪点”功能才会被触发。也就是说“追踪点”代码与上述说的两种方法都不一样。当用不到它时它不会运行LCTT动态调试的话代码每次都需要查看下变量然后判断是否需要打印日志而“追踪点”貌似利用某种触发机制不需要每次都去查看变量。当你需要用到它时程序的代码会把“追踪点”代码包含进去。它不会添加任何条件变量来增加系统的运行负担。
详细信息请参考[布置追踪代码的小技巧][4]。
### “追踪点”的原理 ###
追踪点使用“跳跃标签”这是一种使用分支跳转的编码修正code modification技术。
当关闭追踪点的时候,其伪代码看起来时这样的:
[ code1 ]
nop
back:
[ code2 ]
return;
tracepoint:
[ tracepoint code ]
jmp back;
当打开追踪点的时候,其伪代码看起来时这样的:(注意追踪点代码出现的位置)
[ code1 ]
jmp tracepoint
back:
[ code2 ]
return;
tracepoint:
[ tracepoint code ]
jmp back;
LCTT咳咳解释解释上面两段伪代码吧能看懂的大神请忽略这段注释。不使用追踪点时代码运行过程是code1->code2->return结束使用追踪点时代码运行过程是code1->跳到tracepoint code执行调试代码->跳回code2->return结束。两段代码的唯一区别就是第二行前者为 nop不做任何操作后者为 jmp tracepoint (跳到调试代码)。)
### Linux 电源管理子系统的测试 ###
使用静态调试、动态调试和追踪调试技术,我们来跑一下磁盘的电源管理测试。当系统被挂起时,内核会为磁盘创建一个休眠镜像,使磁盘进入休眠模式,当系统重新被唤醒时,内核又利用这个休眠镜像重新唤醒磁盘。
设置挂起设备与唤醒设备需要的时间:
echo 1 > /sys/power/pm_print_times
以 reboot 模式挂起磁盘:
echo reboot > /sys/power/disk
echo disk > /sys/power/state
以 shutdown 模式挂起磁盘 —— 与 reboot 模式一样,只是重新唤醒磁盘的话还需要电源提供。
echo shutdown > /sys/power/disk
echo disk > /sys/power/state
以 platform 模式挂起磁盘 —— 能测试更多内容,比如 BIOS 挂起和唤醒,会涉及到 ACPI 功能。我们推荐你使用这种方式,把 BIOS 也拉下水陪你玩挂起和唤醒游戏。
echo platform > /sys/power/disk
echo disk > /sys/power/state
--------------------------------------------------------------------------------
via:http://www.linuxjournal.com/content/linux-kernel-testing-and-debugging?page=0,3
译者:[bazz2](https://github.com/bazz2) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:http://autotest.github.io/
[2]:https://github.com/autotest/autotest/wiki/WhitePaper
[3]:http://events.linuxfoundation.org/sites/events/files/slides/Shuah_Khan_dma_map_error.pdf
[4]:http://www.linuxjournal.com/content/july-2013-linux-kernel-news

View File

@ -0,0 +1,90 @@
Linux 内核测试和调试 - 5
================================================================================
### 仿真环境下进行 Linux 电源管理子系统测试 ###
Linux 电源管理子系统在仿真环境下提供5种测试方式。这些方式仅仅在内核各层之间运行休眠的代码而不是真正的让系统进入休眠状态。有些平台不能挂起系统比如说我们需要模拟飞机的飞行环境这时候使用这种仿真环境就非常有用处了。
freezer - 测试停掉处理器:
echo freezer > /sys/power/pm_test
echo platform > /sys/power/disk
echo disk > /sys/power/state
devices - 测试停掉处理器以及挂起设备:
echo devices > /sys/power/pm_test
echo platform > /sys/power/disk
echo disk > /sys/power/state
platform - 测试停掉处理器、挂起设备以及平台全局控制方法(*)
echo platform > /sys/power/pm_test
echo platform > /sys/power/disk
echo disk > /sys/power/state
processors - 测试停掉处理器、挂起设备和平台全局控制方法(*),以及关闭未启动的 CPU。
echo processors > /sys/power/pm_test
echo platform > /sys/power/disk
echo disk > /sys/power/state
core - 测试停掉处理器、挂起设备和平台全局控制方法(*),关闭未启动的 CPU以及挂起平台或系统的设备。注意这个测试模式运行在 ACPI 系统。
echo core > /sys/power/pm_test
echo platform > /sys/power/disk
echo disk > /sys/power/state
### Linux 电源管理子系统追踪事件 ###
电源管理子系统在运行过程中支持多种追踪点和追踪事件。我将对如何使用这些追踪时间以及如何找到追踪信息作一个简单的介绍:
在运行时开启电源管理事件:
cd /sys/kernel/debug/tracing/events/power
echo 1 > cpu_frequency/enable
cat /sys/kernel/debug/tracing/set_event
less /sys/kernel/debug/tracing/trace
为内核启动的命令添加一个参数:
trace_event=cpu_frequency
更多信息查看 Documentation/power/basic-pm-debugging.txt 以及同目录下其他的文档。
### git bisect 命令 ###
git bisect 是一个非常有用非常强大的工具,用于将 git 上的一个 commit 分离出来。我简单过一遍它的用法。
下面是 git bisect 的用法:
git bisect start
git bisect bad # 当前版本是坏的
git bisect good v3.14-rc6 # 上个版本是好的
一旦指定好好的版本和坏的版本git bisect 就会开始把好坏两个版本之间的所有 commit 对半分,并将其中的一半提交 pull 下来。然后重新编译安装测试内核,并标记这个内核是好是坏。重复这个过程,知道某个你选好的 commit 被标记被好或者坏。我们可能需要测试多个内核版本测到最后一个版本时git bisect 会将一个 commit 标记为坏。下面的命令可以在 git bisect 分析过程中起到帮助作用:
查看 bisect 操作的过程:
git bisect log
重置 git bisect标记错误时可以用到保存 git log 的输出,重新操作上一次 bisect 的步骤:
git bisect reset
重放 git bisect 操作过程:
git bisect replay git_log_output
如果一个问题很清楚是在某个区域内git bisect 命令可以定位到一个具体的内核源码树枝干上。举个例子,在调试一个镭龙显卡驱动的问题时,为 git bisect 指定 drivers/drm/radeon 参数,可以让 git bisect 只检索对 drivers/drm/radeon 里面的文件有修改的 commit。
让 git bisect 只检索内核树的某个枝干:
git bisect start drivers/drm/radeon
--------------------------------------------------------------------------------
via: http://www.linuxjournal.com/content/linux-kernel-testing-and-debugging?page=0,4
译者:[bazz2](https://github.com/bazz2) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出

View File

@ -0,0 +1,136 @@
Linux 内核的测试和调试 - 6
================================================================================
### Linux 内核补丁测试 ###
你试过自己写内核补丁吗?本节介绍在把你的补丁包提交到 Linux 邮箱列表之前,需要做哪些操作。另外我们还会介绍如何把它发送出去。
写好代码后,编译它。把 make 过程产生的输出保存到文档中,查看新代码有没有警告信息。找到所有的警告信息,处理掉。当你的代码编译过程没有任何不正常的输出,安装这个内核,然后启动测试。如果启动正常,查看 dmesg 里面有没于错误,与老内核生成的 dmesg 日志做个比较。运行一些压力测试,请参考我们以前讲过的测试内容。如果这个补丁用于修复某个 bug请确保真的已经修复了。如果真的修复了请确保能通过系统测试。找出打你补丁的模块下面的回归测试工具运行一下。如果补丁涉及到其他架构你需要交叉编译然后测试一下。请通过下面的目录查找测试工具
- linux_git/Documentation
- linux_git/tools/testing
- 交叉编译参考:[在 x86_64 架构上交叉编译 Linux 内核:初学者教程][1]
如果你对你的补丁测试结果感到很满意,你就可以提交补丁了。请确保提交 commit 的信息要描述得非常清楚。要让内核维护者和其他开发者看懂补丁所修改的内容,这一点非常重要。生成补丁后,执行 scripts/checkpatch.pl 脚本,找到 checkpatch 是产生的错误或警告(如果有的话),修复它们。重新生成补丁,直到补丁通过这个脚本的测试。重新测试这个补丁。将本补丁用于其他的内核源码上,保证不会有冲突产生。
现在你做好提交补丁的准备了。先运行 scriptst/get_maintainer.pl 来确认你应该把补丁发给哪个内核维护者。注意不要以附件形式发送补丁,而是以纯文本形式粘贴在邮件里面。确保你的邮件客户端可以发送纯文本信息,你可以试试给自己发送一份补丁邮件来测试你的邮件客户端的功能。收到自己的邮件后,运行 checkpatch 命令并给自己的内核源码打上你的补丁。如果这两部都能通过,你就可以给 Linux 邮箱列表发送补丁了。使用 git send-email 命令是提交补丁最安全的方式,可以避免你的邮箱的兼容性问题。你的 .gitconfig 文件里面需要配置好有效的 smtp 服务器,详细操作参考 git 的帮助文档。
更多提交补丁的规矩,请参考下面的资料:
- linux_git/Documentation/applying-patches.txt
- linux_git/Documentation/SubmitChecklist
- linux_git/Documentation/SubmittingDrivers
- linux_git/Documentation/SubmittingPatches
- linux_git/Documentation/stable_kernel_rules.txt
- linux_git/Documentation/stable_api_nonsense.txt
下面是一些内核测试教程的资料:
- [USB Testing on Linux][2]
- [Linux Kernel Tester's Guide Chapter2][3]
- [Linux Kernel Tester's Guide][4]
- [Testing resources at eLinux.org][5]
- [eLinux Debugging Portal][6]
### 内核测试套件和项目 ###
除我们讨论过的测试资源之外,这里还有很多测试项目值得介绍,包括开源的和厂家自己提供的。这些项目每一个都是针对特定领域的,比如嵌入式或者企业自己使用。我们简单过一下。
[Linux 测试项目][7]LTP测试套件是一系列工具的集合用于测试内核的可靠性、健壮性和稳定性。你可以为这个项目添加自己的测试代码并且 LTP 项目欢迎你贡献自己的代码。runltp 脚本默认情况下会测试下面的子系统:
- 文件系统压力测试
- 磁盘 IO 测试
- 内存管理压力测试
- IPC进程间通信测试
- 调度器测试
- 命令的功能性验证测试
- 系统调用功能验证测试
[**LTP-DDT**][8] 是一个基于 LTP 的测试应用LCTT就是 LTP 的阉割版么),专注于测试嵌入式设备驱动。
[**Linux Driver Verification**][9] 这个项目的目标是提高 Linux 设备驱动的质量,它为设备驱动验证开发了集成环境平台,并且利用与时俱进的研究来增强验证工具的质量。
### 一致性测试 ###
如果你有将某个 Unix 平台下的应用一直到另一个平台的经验,你就能理解 [Linux Standard Base (LSB)][10] 和 LSB 一致性测试套件的重要性了。LSB 是 Linux Foundation 工作组创建的用于降低支持不同 Linux 平台所需要的开销,方法就是通过降低不同 Linux 发行版之间的差别保证应用在不同发行版之间的可移植性。前事不忘后事之师Unix 世界的分歧在 Linux 世界一定要避免。这就是为什么你可以把一个 rpm 包转化成 deb 包后还能安装并正常运行的秘密。
### 静态分析工具 ###
静态分析之所以会被称为“静态分析”,是因为这些工具只分析代码,并不执行它们。分析 Linux 内核代码的静态分析工具有很多Sparse 是 Linus Torvalds 写的专门用于检查内核静态类型的工具。它是一个语义检查器,会为 C 语言的语义建立语义检析树,执行惰性类型评估。内核编译系统支持 sparse并且为编译内核的命令提供开启 sparse 的选项。
为内核所有需要重新编译的 C 文件执行 sparse 语义检查:
make C=1 allmodconfig
为内核所有 C 文件(即使不需要重新编译)执行 sparse 语义检查:
make C=2 allmodconfig
Sparse 的资源:
- [Sparse Archive][11]
- [Sparse How To][12]
Smatch 分析程序代码的逻辑错误。它可以检测到诸如“为一个没锁上的 spinlock 执行解锁”的逻辑错误。内核源码支持 smatch
在 Linux 内核中运行 smatch
make CHECK="~/path/to/smatch/smatch -p=kernel" C=1 bzImage modules | tee warns.txt
请参考下面的资料来获取和编译 smatch。需要注意的是 smatch 是个正在发展的项目,架构会不断变化。
- [**Smatch**][12]
那么我们该怎么处理 Sparse 和 Smatch 所发现的语义和逻辑上的错误呢?一些错误可以被分离为日常问题或模块问题,可以轻易被解决。但是有些语义错误涉及到全局,因为剪切粘贴了一些代码。在一些环境中,当一些接口函数被废弃不再使用,或者仅仅做了写微小的修改,你就需要大规模更新源码。这时候你需要 Coccinelle 来帮忙。Coccinelle 使用 SmPL 语言(语义包语言)来为 C 代码提供匹配和转换代码的功能。Coccinelle 的从一开始就作为 Linux 的附属产品持续发展的。
举个例子foo(int) 函数突然变成 foo(int, char \*) 函数,多出了一个输入参数(可以把第二个参数置为 null。所有调用 foo() 函数的代码都需要更新了,这可能是个悲摧的体力活。但是使用 Coccinelle 的话,这项工作瞬间变得轻松,脚本会帮你找到调用 foo(parameter1) 的代码,然后替换成 foo(parameter1, NULL)。做完这些后,所有调用这个函数的代码都可以运行一遍,验证下第二个参数为 NULL 是否能正常工作。关于 Coccinelle 的更多信息,以及在不同项目中(当然,也包括 Linux 内核这个项目)的使用方法,请参考项目主页:[**Cocinelle**][13]。
### 参考文献 ###
本文涵盖了很多方面,这里列出一些参考文档供读者做进一步研究。
- [KernelHacking][14]
- [kernel Documentation][15]
- [Linux Device Drivers, Third Edition][16]
- [Dynamic Event Tracing in Linux Kernel][17]
- [Kernel Testing: Tool and Techniques][18]
### 鸣谢 ###
感谢来自 Oracle 的 Khalid Aziz审查校对并提供许多非常有价值的建议。感谢来自三星的 Mauro Chehab 和 Guy Martin他们给了我多次反馈。感谢来自 Linux Foundation 的 Grey Kroah-Hartman 对本文的审阅。感谢来自三星的 Ibrahim Haddad没有他的支持和鼓励我可能还不会坐下来写出这篇文章。
----------
![](http://www.linuxjournal.com/files/linuxjournal.com/ufiles/pictures/picture-1088573.jpg)
作者:[Shuah Khan][a]
Shuah Khan 是三星公司开源组的高级 Linux 内核开发工程师。
她为 Linux 内核中的 IOMMU、DMA、电源管理、PCIe 贡献代码同时维护内核为内核提供补丁包。Shuah 有多年 Unix 内核开发经验。她也为 OpenHPI 和 LLDP 项目作贡献。
--------------------------------------------------------------------------------
via: http://www.linuxjournal.com/content/linux-kernel-testing-and-debugging?page=0,5
译者:[bazz2](https://github.com/bazz2) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:http://events.linuxfoundation.org/sites/events/files/slides/Shuah_Khan_cross_compile_linux.pdf
[2]:http://www.linux-usb.org/usbtest/
[3]:http://kernelnewbies.org/Linux_Kernel_Tester%27s_Guide_Chapter2
[4]:http://www.kerneltravel.net/downloads/tester_guide.pdf
[5]:http://elinux.org/Test_Systems
[6]:http://elinux.org/Debugging_Portal
[7]:http://ltp.sourceforge.net/documentation/how-to/ltp.php
[8]:http://processors.wiki.ti.com/index.php/LTP-DDT
[9]:http://linuxtesting.org/project/ldv
[10]:http://www.linuxfoundation.org/collaborate/workgroups/lsb
[11]:http://codemonkey.org.uk/projects/git-snapshots/sparse/
[12]:http://smatch.sourceforge.net/
[13]:http://coccinelle.lip6.fr/
[14]:http://kernelnewbies.org/KernelHacking
[15]:http://kernelnewbies.org/Documents
[16]:http://lwn.net/Kernel/LDD3/
[17]:http://events.linuxfoundation.org/slides/lfcs2010_hiramatsu.pdf
[18]:http://events.linuxfoundation.org/images/stories/slides/elc2013_porter.pdf
[a]:http://www.linuxjournal.com/users/shuah-khan

View File

@ -0,0 +1,58 @@
需要在Ubuntu上安装微软办公软件去安装官方的网络应用程序
================================================== ==============================
![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/07/office-web-app-.jpg)
**这是微软办公软件及其一贯繁琐的文件指令,而不是每个人的一杯咖啡。同时这是许多工作和教育环境的主要依靠——无论是好还是坏**
通过使用[LibreOffice的应用程序套件][1]阅读、编辑和保存这些专有指令出现在Ubuntu上是有着某种程度的可能。在作家中Calc和Impress都不同程度的夸耀微软办公软件文件的协作性但在我自己的实际操作经验中谢天谢地它很简洁它并不完美。
时不时的,你会不得不使用微软办公软件,(虽然我们大多数人都心里向着开放标准,但是我们不应该无视实际问题)但你已经没有意愿去购买一个完整的微软办公软件许可证来运行这个窗口模拟器,那么微软的在线网络应用程序是完美的解决方法。
###安装微软在线办公软件上的应用程序在Ubuntu
为了使从Ubuntu的桌面访问这些在线版本更容易“Linux的网络应用程序项目”创造了一个小的、非官方的安装程序。它可以添加网络应用程序的快捷方式“荣耀书签”到您的应用程序启动器。
![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/07/microsoft-office-web-apps.jpg)
通过快捷方式相应的Microsoft Web应用程序在你默认的系统浏览器中打开不可能有比这更精美的了。听起来漂亮吗下面是你的应用程序的快捷方式
- 文档
- 表格
- 幻灯片
- Outlook
- OneDrive
- 日历
- OneNote
- 通讯录
该软件包还创建了一个新的应用程序类别来容纳这些链接,不但可以让您把这些快捷方式从其他应用程序单独分开来,而且是直接位于常见的“办公软件”应用程序下。
这些都是必不可少的吗?不见得。他们有用吗?这取决于你的工作流程。但它是不错的选择吗?一定是的。
你可以从下面的链接保存含有.deb文件安装程序其中有安装链接。适用于Ubuntu14.04 LTS和更高版本。
- [下载微软的在线办公应用(.deb)][2]
###其他可选项###
![](http://d0od.wpengine.netdna-cdn.com/wp-content/uploads/2014/04/Screen-Shot-2014-04-15-at-15.29.35-350x200.png)
类似的替代方案是[安装Chrome官方网上应用商店的在线办公应用程序][3]然后添加应用程序启动器到Linux。这次短跑中仍然会为它们创建可启动的快捷方式但那些可以被设置为打开自己的窗框而且不需要安装任何第三方软件包。
同时谷歌最近在整合完整的Office功能由于其购买了QuickOffice[到自己的文档,幻灯片和床单应用][4]。Android应用程序Quickoffice退出了舞台同时Chrome也实现了扩展。
如果你是一个深度的谷歌网络硬盘/文档的用户,那么这个解决方案可能对你是更加好了。
-------------------------------------------------- ------------------------------
via: http://www.omgubuntu.co.uk/2014/07/run-microsoft-office-web-apps-ubuntu-desktop
译者:[cereuz](https://github.com/cereuz)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:http://www.libreoffice.org/
[2]:https://docs.google.com/file/d/0ByQnaVw7riBQMjNCUFh4ZlM4Y0E/edit?usp=sharing
[3]:http://www.omgchrome.com/microsoft-brings-office-online-chrome-web-store/
[4]:http://www.omgchrome.com/quickoffice-chrome-extension-gets-name-change/

View File

@ -1,58 +0,0 @@
Ubuntu上需要用微软Office安装官方网页应用吧
================================================================================
![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/07/office-web-app-.jpg)
**尽管不想和所有人分一杯羹但是微软Office和它过分挑剔的文件格式是许多工作和教育环境的主要支持 —— 不论好坏。**
读取编辑以及保存这些专有格式在Ubuntu上可以通过[LibreOffice套件应用][1]成为可能。WriterCalc和Impress都以其能和微软Office在不同程度上互操作而引以为傲尽管以我的实际经验值得庆幸很简要它并不完美。
对于你不能舍弃使用Office文件格式的时候尽管在意识形态上我们大多数人都坚守开放标准但是我们也不应该对现实熟视无睹而你也不想要购买完整的MS Office许可证来通过WINE运行官方的微软Office在线网页应用套件是完美的解决方案。
### Ubuntu中安装微软Office在线应用 ###
要让这些在线版本更容易地在Ubuntu桌面上访问到“Linux网页应用项目”已经为你创建了一个小巧的非官方的安装器它可以为你添加网页应用快捷方式“炫书签”到应用启动器。
![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/07/microsoft-office-web-apps.jpg)
这些都没什么比把各个微软网页应用设置成快捷方式,然后通过默认的系统浏览器来打开它们更炫了。听上去很时髦?你可以为下面这些应用设置快捷方式:
- Word
- Excel
- PowerPoint
- Outlook
- OneDrive
- Calendar
- OneNote
- People
该包也创建了一个新的应用目录用来收纳链接可以让你像以往的“office”应用目录一样从中查看各个快捷方式。
这些很有必要吗?不是很必要。它们很有用吗?这取决于你的工作流程。但是,有这样的选择不是很好吗?那是当然了。
你可以从下面的链接中获取包含这些链接的.deb安装器它适用于Ubuntu 14.04以及后续版本。
- [下载微软Office网页应用(.deb)][2]
### 其它选择 ###
![](http://d0od.wpengine.netdna-cdn.com/wp-content/uploads/2014/04/Screen-Shot-2014-04-15-at-15.29.35-350x200.png)
一个类似的选择,是[从Chrome网上商店安装官方Office在线网页应用][3]然后将该应用启动器添加到Linux中。这也会为它们在Dash中创建可启动快捷方式但是这些可以设置为在它们自己的窗口框架中打开而且可以忽略安装任何第三方包。
类似地Google最近将完整的Office功能多亏了它购买了QuickOffice[加入到了它自己的DocsSlides和Sheets应用中][4]收回了安卓版QuickOffice应用并重新命名了相应的Chrome扩展。
如果你是Google Drive/Docs的重度用户这可能对你而言是个更加的解决方案。
--------------------------------------------------------------------------------
via: http://www.omgubuntu.co.uk/2014/07/run-microsoft-office-web-apps-ubuntu-desktop
译者:[GOLinux](https://github.com/GOLinux) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:http://www.libreoffice.org/
[2]:https://docs.google.com/file/d/0ByQnaVw7riBQMjNCUFh4ZlM4Y0E/edit?usp=sharing
[3]:http://www.omgchrome.com/microsoft-brings-office-online-chrome-web-store/
[4]:http://www.omgchrome.com/quickoffice-chrome-extension-gets-name-change/

View File

@ -0,0 +1,78 @@
在linux中怎样使用cp命令合并目录树
================================================================================
怎样将布局相似的两个目录树合并成新的目录树? 为理解该问题让我们思考下面的例子.
假设dir1和dir2目录中分别有3个子目录a,b和c.目录布局如下所示:
![Layout of input directories](http://linoxide.com/wp-content/uploads/2014/07/01.merge_dir_layout.png)
输入目录布局
在目录a,b和c中有一些文件tree命令的输出将能更好的说明:
![Layout of files](http://linoxide.com/wp-content/uploads/2014/07/02.merge_file_layout.png)
文件布局
### 1. 使用cp命令创建合并: ###
现在我们将这两个目录合并成一个新的目录,如"merged".完成上述操作最简单的方式就是递归
复制目录,如下图所示:
![Copy directories recursively to create new merge](http://linoxide.com/wp-content/uploads/2014/07/03.merge_cp_recursive.png)
递归复制完成新的合并
#### 1.1 cp命令和替换带来的问题: ####
这种方式所带来的问题是该合并目录中所创建的文件为原文件的副本,并非原文件本身. 别急, (你可能正在问自己) 如果不是原文件又有什么问题? 为了回答你的问题,考虑下你有很多大文件的情况
.那种情形下,复制所有的文件可能消耗数小时.
现在让我们回到刚那问题上且尝试使用mv命令而不是cp命令.
![Attempt to merge with mv command](http://linoxide.com/wp-content/uploads/2014/07/04.merge_mv_recursive.png)
企图使用mv命令进行合并操作
这些目录不能被合并.因此我们不能像这样使用mv命令去合并目录.
现在你该怎样将原文件保存到"merged"目录中?
### 2. 方法: ###
cp命令有一个非常有用的选项来帮助我们摆脱这种状况.
cp命令的-l 或 --link选项能够创建硬链接而非原文件副本.让我们尝试一下.
在我们尝试cp命令的硬链接选项前让我们查看一下原文件的inode号码.
可通过tree命令--inodes选项来查看inodes:
![Display inodes of original files](http://linoxide.com/wp-content/uploads/2014/07/05.merge_display_inodes.png)
原文件的inodes
现在我们有了inodes的列表对于cp命令可通过--link选项创建硬链接:
![Merge directories with hard links](http://linoxide.com/wp-content/uploads/2014/07/06.merge_create_links.png)
使用硬链接合并的目录
#### 2.1 验证文件: ####
现在文件已经被复制让我们验证一下inodes是否和原文件匹配:
![Verify Inodes](http://linoxide.com/wp-content/uploads/2014/07/07.merge_verify_inodes.png)
Verify Inodes
#### 2.2 清除: ####
正如你所看到的这些文件的inodes和原文件的一样.现在 那问题已经被解决,且
原文件已被复制到合并目录中.现在我们能够移除dir1和dir2目录.
![Remove original directories](http://linoxide.com/wp-content/uploads/2014/07/08.merge_cleanup.png)
移除原始目录
--------------------------------------------------------------------------------
via: http://linoxide.com/linux-command/merge-directory-trees-linux/
原文作者:[Raghu][a]
译者:[hunanchenxingyu](https://github.com/hunanchenxingyu) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://linoxide.com/author/raghu/