20140822-1 选题

This commit is contained in:
DeadFire 2014-08-22 16:35:20 +08:00
parent 09abfc679e
commit df85f1f0e8
3 changed files with 476 additions and 0 deletions

View File

@ -0,0 +1,107 @@
Want To Start An Open Source Project? Here's How
================================================================================
> Our step-by-step guide.
**You have a problem. You've weighed the** [pros and cons of open sourcing your code][1], and you know [you need to start an open-source project][2] for your software. But you have no idea how to do this.
Oh, sure. You may know how to set up a GitHub account and get started, but such [mechanics][3] are actually the easy part of open source. The hard part is making anyone care enough to use or contribute to your project.
![](http://a4.files.readwrite.com/image/upload/c_fit,q_80,w_630/MTE5NDg0MDYxMTg2Mjk1MzEx.jpg)
Here are some principles to guide you in building and releasing code that others will care about.
### First, The Basics ###
You may choose to open source code for a variety of reasons. Perhaps you're looking to engage a community to help write your code. Perhaps, [like Known][4], you see "open source distribution ... as a multiplier for the small teams of developers writing the code in-house."
Or maybe you just think it's the right thing to do, [as the UK government believes][5].
Regardless of the reason, this isn't about you. Not really. For open source to succeed, much of the planning has to be about those who will use the software. As [I wrote in 2005][6], if you "want lots of people to contribute (bug fixes, extensions, etc.," then you need to "write good documentation, use an accessible programming language ... [and] have a modular framework."
Oh, and you also need to be writing software that people care about.
Think about the technology you depend on every day: operating systems, web application frameworks, databases, and so on. These are far more likely to generate outside interest and contributions than a niche technology for a particular industry like aviation. The broader the application of the technology, the more likely you are to find willing contributors and/or users.
In summary, any successful open-source project needs these things:
1. Optimal market timing (solving a real need in the market);
2. A strong, inclusive team of developers and non-developers;
3. An architecture of participation (more on that below);
4. Modular code to make it easier for new contributors to find a discrete chunk of the program to work on, rather than forcing them to scale an Everest of monolithic code;
5. Code that is broadly applicable (or a way to reach the narrower population more niche-y code appeals to);
6. Great initial source code (if you put garbage into GitHub, you'll get garbage out);
7. A permissive license—I [personally prefer Apache-style licensing][7] as it introduces the lowest barriers to developer adoption, but many successful projects (like Linux and MySQL) have used GPL licensing to great effect.
Of the items above, it's sometimes hardest for projects to actively invite participation. That's usually because this is less about code and more about people.
### "Open" Is More Than A License ###
One of the best things I've read in years on this subject comes from Vitorio Miliano ([@vitor_io][8]), a user experience and interaction designer from Austin, Texas. [Miliano points out][9] that anyone who doesn't already work on your project is a "layperson," in the sense that no matter their level of technical competence, they know little about your code.
So your job, he argues, is to make it easy to get involved in contributing to your code base. While he focuses on how to involve non-programmers in open-source projects, he identifies a few things project leads need to do to effectively involve anyone—technical or non-technical—in open source:
> 1. a way to understand the value of your project
>
> 2. a way to understand the value they could provide to the project
>
> 3. a way to understand the value they could receive from contributing to the project
>
> 4. a way to understand the contribution process, end-to-end
>
> 5. a contribution mechanism suitable for their existing workflows
Too often, project leads want to focus on the fifth step without providing an easy path to understand items 1 through 4. "How" to contribute doesn't matter very much if would-be contributors don't appreciate the "why."
On that note, it's critical, Miliano writes, to establish the value of the project with a "jargon-free description" so as to "demonstrate your accessibility and inclusiveness by writing your descriptions to be useful to everyone at all times." This has the added benefit, he avers, of signaling that documentation and other code-related content will be similarly clear.
On the second item, programmers and non-programmers alike need to be able to see exactly what you'd like from them, and then they need to be recognized for their contributions. Sometimes, as MongoDB solution architect [Henrik Ingo told me][10], "A smart person [may] come[] by with great code, but project members fail to understand it." That's not a terrible problem if the "in" group acknowledges the contribution and reaches out to understand.
But that doesn't always happen.
### Do You Really Want To Lead An Open Source Project? ###
Too many open-source project leads advertise inclusiveness but then are anything but inclusive. If you don't want people contributing code, don't pretend to be open source.
Yes, this is sometimes a function of newbie fatigue. As [one developer wrote][11] recently on HackerNews,
> Small projects get lots of, well, basically useless people who need tons of handholding to get anything accomplished. I see the upside for them, but I don't see the upside for me: if I where[sic] to help them out, I'd spend my limited available time on handholding people who apparently managed to get ms degrees in cs without being able to code instead of doing what I enjoy. So I ignore them.
While that may be a good way to maintain sanity, the attitude doesn't bode well for a project if it's widely shared.
And if you really couldn't care less about non-programmers contributing design input, or documentation, or whatever, then make that clear. Again, if this is the case, you really shouldn't be an open-source project.
Of course, the perception of exclusion is not always reality. As ActiveState vice president Bernard Golden told me over IM, "many would-be developers are intimidated by the perception of an existing 'in-crowd' dev group, even though it may not really be true."
Still, the more open source projects invest in making it easy to understand why developers should contribute, and make it inviting to do so, the how largely takes care of itself.
Lead image courtesy of [Shutterstock][12]
--------------------------------------------------------------------------------
via: http://readwrite.com/2014/08/20/open-source-project-how-to
作者:[Matt Asay][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://readwrite.com/author/matt-asay
[1]:http://readwrite.com/2014/07/07/open-source-software-pros-cons
[2]:http://readwrite.com/2014/08/15/open-source-software-business-zulily-erp-wall-street-journal
[3]:http://www.cocoanetics.com/2011/01/starting-an-opensource-project-on-github/
[4]:http://werd.io/2014/the-roi-of-building-open-source-software
[5]:https://www.gov.uk/design-principles
[6]:http://asay.blogspot.com/2005/09/so-you-want-to-build-open-source.html
[7]:http://www.cnet.com/news/apache-better-than-gpl-for-open-source-business/
[8]:https://twitter.com/vitor_io
[9]:http://opensourcedesign.is/blogging_about/import-designers/
[10]:https://twitter.com/h_ingo/status/501323333301190656
[11]:https://news.ycombinator.com/item?id=8122814
[12]:http://www.shutterstock.com/

View File

@ -0,0 +1,168 @@
15 Practical Examples of cd Command in Linux
================================================================================
In Linux **cd (Change Directory)** command is one of the most important and most widely used command for newbies as well as system administrators. For admins on a headless server, **cd** is the only way to navigate to a directory to check log, execute a program/application/script and for every other task. For newbie it is among those initial commands they make their hands dirty with.
![15 cd command examples in linux](http://www.tecmint.com/wp-content/uploads/2014/08/cd-command-in-linux.png)
15 cd command examples in linux
Thus, keeping in mind, we here bringing you **15** basic commands of **cd** using tricks and shortcuts to reduce your efforts on the terminal and save time by using these known tricks.
### Tutorial Details ###
- Command Name : cd
- Stands for : Change Directory
- Availability : All Linux Distribution
- Execute On : Command Line
- Permission : Access own directory or otherwise assigned.
- Level : Basic/Beginners
1. Change from current directory to /usr/local.
avi@tecmint:~$ cd /usr/local
avi@tecmint:/usr/local$
2. Change from current directory to /usr/local/lib using absolute path.
avi@tecmint:/usr/local$ cd /usr/local/lib
avi@tecmint:/usr/local/lib$
3. Change from current working directory to /usr/local/lib using relative path.
avi@tecmint:/usr/local$ cd lib
avi@tecmint:/usr/local/lib$
4. **(a)** Move one directory back from where you are now.
avi@tecmint:/usr/local/lib$ cd -
/usr/local
avi@tecmint:/usr/local$
4. **(b)** Change Current directory to parent directory.
avi@tecmint:/usr/local/lib$ cd ..
avi@tecmint:/usr/local$
5. Show last working directory from where we moved (use switch) as shown.
avi@tecmint:/usr/local$ cd --
/home/avi
6. Move two directory up from where you are now.
avi@tecmint:/usr/local$ cd ../ ../
avi@tecmint:/usr$
7. Move to users home directory from anywhere.
avi@tecmint:/usr/local$ cd ~
avi@tecmint:~$
or
avi@tecmint:/usr/local$ cd
avi@tecmint:~$
8. Change working directory to current working directory (seems no use of in General).
avi@tecmint:~/Downloads$ cd .
avi@tecmint:~/Downloads$
or
avi@tecmint:~/Downloads$ cd ./
avi@tecmint:~/Downloads$
9. Your present working Directory is “/usr/local/lib/python3.4/dist-packages/ ”, change it to “/home/avi/Desktop/ ”, in one line command, by moving up in the directory till / then using absolute path.
avi@tecmint:/usr/local/lib/python3.4/dist-packages$ cd ../../../../../home/avi/Desktop/
avi@tecmint:~/Desktop$
10. Change from current working directory to /var/www/html without typing in full using TAB.
avi@tecmint:/var/www$ cd /v<TAB>/w<TAB>/h<TAB>
avi@tecmint:/var/www/html$
11. Navigate from your current working directory to /etc/v__ _, Oops! You forgot the name of directory and not supposed to use TAB.
avi@tecmint:~$ cd /etc/v*
avi@tecmint:/etc/vbox$
**Note:** This will move to **vbox** only if there is only one directory starting with **v**. If more than one directory starting with **v** exist, and no more criteria is provided in command line, it will move to the first directory starting with **v**, alphabetically as their presence in standard dictionary.
12. You need to navigate to user **av** (not sure if it is avi or avt) home directory, without using **TAB**.
avi@tecmint:/etc$ cd /home/av?
avi@tecmint:~$
13. What are pushd and popd in Linux?
Pushd and popd are Linux commands in bash and certain other shell which saves current working directory location to memory and bring to the directory from memory as current working directory, respectively as well as changes directory.
avi@tecmint:~$ pushd /var/www/html
/var/www/html ~
avi@tecmint:/var/www/html$
The above command saves the current location to memory and changes to the requested directory. As soon as popd is fired, it fetch the saved directory location from memory and makes it current working directory.
avi@tecmint:/var/www/html$ popd
~
avi@tecmint:~$
14. Change to a directory containing white spaces.
avi@tecmint:~$ cd test\ tecmint/
avi@tecmint:~/test tecmint$
or
avi@tecmint:~$ cd 'test tecmint'
avi@tecmint:~/test tecmint$
or
avi@tecmint:~$ cd "test tecmint"/
avi@tecmint:~/test tecmint$
15. Change from current working directory to Downloads and list all its settings in one go.
avi@tecmint:/usr$ cd ~/Downloads && ls
.
service_locator_in.xls
sources.list
teamviewer_linux_x64.deb
tor-browser-linux64-3.6.3_en-US.tar.xz
.
...
This is our attempt, to make you aware of Linux Workings and executions in least possible words and with as much as user friendliness as it used to be before.
Thats all for now. Ill be here again with another interesting topic soon. Till then stay tuned and connected to Tecmint. Dont forget to provide us with your valuable feedback in the comments below.
--------------------------------------------------------------------------------
via: http://www.tecmint.com/cd-command-in-linux/
作者:[Avishek Kumar][a]
译者:[译者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/avishek/

View File

@ -0,0 +1,201 @@
15 Practical Examples of echo command in Linux
================================================================================
**echo** is one of the most commonly and widely used built-in command for Linux bash and C shells, that typically used in scripting language and batch files to display a line of text/string on standard output or a file.
![echo command examples](http://www.tecmint.com/wp-content/uploads/2014/08/echo-command.png)
echo command examples
The syntax for echo is:
echo [option(s)] [string(s)]
**1.** Input a line of text and display on standard output
$ echo Tecmint is a community of Linux Nerds
Outputs the following text:
Tecmint is a community of Linux Nerds
**2.** Declare a variable and echo its value. For example, Declare a variable of **x** and assign its value=**10**.
$ x=10
echo its value:
$ echo The value of variable x = $x
The value of variable x = 10
**Note:** The **-e** option in Linux acts as interpretation of escaped characters that are backslashed.
**3.** Using option **\b** backspace with backslash interpretor **-e** which removes all the spaces in between.
$ echo -e "Tecmint \bis \ba \bcommunity \bof \bLinux \bNerds"
TecmintisacommunityofLinuxNerds
**4.** Using option **\n** New line with backspace interpretor **-e** treats new line from where it is used.
$ echo -e "Tecmint \nis \na \ncommunity \nof \nLinux \nNerds"
Tecmint
is
a
community
of
Linux
Nerds
**5.** Using option **\t** horizontal tab with backspace interpretor **-e** to have horizontal tab spaces.
$ echo -e "Tecmint \tis \ta \tcommunity \tof \tLinux \tNerds"
Tecmint is a community of Linux Nerds
**6.** How about using option new Line **\n** and horizontal tab **\t** simultaneously.
$ echo -e "\n\tTecmint \n\tis \n\ta \n\tcommunity \n\tof \n\tLinux \n\tNerds"
Tecmint
is
a
community
of
Linux
Nerds
**7.** Using option **\v** vertical tab with backspace interpretor **-e** to have vertical tab spaces.
$ echo -e "\vTecmint \vis \va \vcommunity \vof \vLinux \vNerds"
Tecmint
is
a
community
of
Linux
Nerds
**8.** How about using option new Line **\n** and vertical tab **\v** simultaneously.
$ echo -e "\n\vTecmint \n\vis \n\va \n\vcommunity \n\vof \n\vLinux \n\vNerds"
Tecmint
is
a
community
of
Linux
Nerds
**Note:** We can double the vertical tab, horizontal tab and new line spacing using the option two times or as many times as required.
**9.** Using option **\r** carriage return with backspace interpretor **-e** to have specified carriage return in output.
$ echo -e "Tecmint \ris a community of Linux Nerds"
is a community of Linux Nerds
**10.** Using option **\c** suppress trailing new line with backspace interpretor **-e** to continue without emitting new line.
$ echo -e "Tecmint is a community \cof Linux Nerds"
Tecmint is a community avi@tecmint:~$
**11.** Omit echoing trailing new line using option **-n**.
$ echo -n "Tecmint is a community of Linux Nerds"
Tecmint is a community of Linux Nerdsavi@tecmint:~/Documents$
**12.** Using option **\a** alert return with backspace interpretor **-e** to have sound alert.
$ echo -e "Tecmint is a community of \aLinux Nerds"
Tecmint is a community of Linux Nerds
**Note:** Make sure to check Volume key, before firing.
**13.** Print all the files/folder using echo command (ls command alternative).
$ echo *
103.odt 103.pdf 104.odt 104.pdf 105.odt 105.pdf 106.odt 106.pdf 107.odt 107.pdf 108a.odt 108.odt 108.pdf 109.odt 109.pdf 110b.odt 110.odt 110.pdf 111.odt 111.pdf 112.odt 112.pdf 113.odt linux-headers-3.16.0-customkernel_1_amd64.deb linux-image-3.16.0-customkernel_1_amd64.deb network.jpeg
**14.** Print files of a specific kind. For example, lets assume you want to print all **.jpeg** files, use the following command.
$ echo *.jpeg
network.jpeg
**15.** The echo can be used with redirect operator to output to a file and not standard output.
$ echo "Test Page" > testpage
## Check Content
avi@tecmint:~$ cat testpage
Test Page
### echo Options ###
<table border="0" cellspacing="0">
<colgroup width="85"></colgroup>
<colgroup width="271"></colgroup>
<tbody>
<tr>
<td style="border: 1px solid #000000;" align="LEFT" height="16"><b> Options</b></td>
<td style="border: 1px solid #000000;" align="LEFT"><b> Description</b></td>
</tr>
<tr>
<td style="border: 1px solid #000000;" align="LEFT" height="16"><b> -n</b></td>
<td style="border: 1px solid #000000;" align="LEFT"> do not print the trailing newline.</td>
</tr>
<tr>
<td style="border: 1px solid #000000;" align="LEFT" height="16"><b> -e</b></td>
<td style="border: 1px solid #000000;" align="LEFT"> enable interpretation of backslash escapes.</td>
</tr>
<tr>
<td style="border: 1px solid #000000;" align="LEFT" height="16"><b> \b</b></td>
<td style="border: 1px solid #000000;" align="LEFT"> backspace</td>
</tr>
<tr>
<td style="border: 1px solid #000000;" align="LEFT" height="16"><b> \\</b></td>
<td style="border: 1px solid #000000;" align="LEFT"> backslash</td>
</tr>
<tr>
<td style="border: 1px solid #000000;" align="LEFT" height="16"><b> \n</b></td>
<td style="border: 1px solid #000000;" align="LEFT"> new line</td>
</tr>
<tr>
<td style="border: 1px solid #000000;" align="LEFT" height="16"><b> \r</b></td>
<td style="border: 1px solid #000000;" align="LEFT"> carriage return</td>
</tr>
<tr>
<td style="border: 1px solid #000000;" align="LEFT" height="16"><b> \t</b></td>
<td style="border: 1px solid #000000;" align="LEFT"> horizontal tab</td>
</tr>
<tr>
<td style="border: 1px solid #000000;" align="LEFT" height="16"><b> \v</b></td>
<td style="border: 1px solid #000000;" align="LEFT"> vertical tab</td>
</tr>
</tbody>
</table>
Thats all for now and dont forget to provide us with your valuable feedback in the comments below.
--------------------------------------------------------------------------------
via: http://www.tecmint.com/echo-command-in-linux/
作者:[Avishek Kumar][a]
译者:[译者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/avishek/