机器人树莓派开发机器人_我如何设置开发机器

机器人树莓派开发机器人

Every developer has a set of tools that make their life easy, without which their development life feels crippled! Over the years, I have developed my own set, which I describe in this post. The primary OS for my development related tasks is Ubuntu, and I would assume that you have one of the latest versions of Ubuntu (12.04+).

每个开发人员都有一套使他们的生活变得轻松的工具,没有这些工具,他们的开发生活就会变得残废! 多年来,我已经开发了自己的套装,我将在本文中对此进行介绍。 与开发有关的任务的主要操作系统是Ubuntu,并且我假设您拥有最新版本的Ubuntu(12.04+)。

When I started off developing, I only knew basic PHP. Setting up a development machine was as easy as installing PHP5, MySQL and changing the home directory of Apache2.

当我开始开发时,我只了解基本PHP。 设置开发机器就像安装PHP5,MySQL和更改Apache2的主目录一样容易。

But over the years I have changed as a developer and the tools that I use have evolved too- so it’s safe to say that next year, I will probably read this and smile, full of new tips and tricks.

但是这些年来,我已经成为一名开发人员,并且我使用的工具也发生了变化,因此可以肯定地说,明年,我可能会读到本书并微笑着,充满了新的技巧和窍门。

Except for Google Chrome and Sublime Text, everything else in the list can be installed through the command apt-get. Therefore, I have written a simple bash script which installs them in sequence. Note that a few (like mysql-server) require you to set certain options (like a password for the root user) before the installation can be completed.

除了Google Chrome和Sublime Text,列表中的所有其他内容都可以通过命令apt-get安装。 因此,我编写了一个简单的bash脚本,按顺序安装它们。 请注意,在完成安装之前,有一些要求(例如mysql-server )要求您设置某些选项(例如root用户的密码)。

Here’s what I absolutely need in a development machine.

这是我在开发机器中绝对需要的

谷歌浏览器 (Google Chrome)

Google Chrome

Google Chrome is undoubtedly the most popular browser out there- and rightly so. Chrome has a lot of features but the one little thing that edges it past every other browser out there is a powerful sync feature. I really like the fact that if I perform a Google search on my desktop and check my smartphone moments later, I can see it among my Chrome searches.

毫无疑问 谷歌浏览器无疑是最受欢迎的浏览器 。 Chrome具有很多功能,但它可以超越其他所有浏览器的功能还包括一项强大的同步功能。 我非常喜欢以下事实:如果我在桌面上执行Google搜索并稍后查看智能手机,我可以在Chrome搜索中看到它。

Firefox’s sync is getting there, but not quite there yet. This is the first thing that I install because many other things on my list could run into issues, which would usually require extensive Google searches to fix.

Firefox的同步正在实现,但还不完全到此。 这是我安装的第一件事,因为列表中的许多其他内容可能会出现问题,通常需要进行大量Google搜索才能解决。

Chrome扩展程序 (Chrome Extensions)

Chrome comes with a lot of features, but it’s really incomplete without the extensions that I use. The most important extension is AdBlock Plus, to remove ads from the web. When developing you need to be able to see the site as your users do to properly test changes, and according to some reports one fifth of users install ad-blocking extensions so it is nice to test both with and without ads.

Chrome具有很多功能,但是如果没有我使用的扩展程序,它真的是不完整的。 最重要的扩展是AdBlock Plus ,用于从网络上删除广告。 开发时,您需要像用户一样看到网站以正确测试更改,并且根据某些报告, 五分之一的用户安装了广告屏蔽扩展程序,因此无论有无广告都可以进行测试。

The next addon that I install is Pocket. As a developer you often find there are wonderful articles out there, but you don’t always have the time to read them- that is where Pocket comes into play. It saves these articles and syncs with your other devices so that you can read them anytime later.

我安装的下一个插件是Pocket 。 作为开发人员,您经常会发现那里有很多精彩的文章,但是您并不总是有时间阅读它们-这正是Pocket发挥作用的地方。 它可以保存这些文章并与您的其他设备同步,以便您以后可以随时阅读。

YSlow is another great extension for Chrome, which tells you why a certain page is slow. Another essential extension is Screen Capture for situations where pressing the print screen button is not enough. Lastly, I work with Todoist to manage my daily activities.

YSlow是Chrome的另一个出色扩展,它告诉您为什么某个页面运行缓慢。 屏幕捕获的另一个重要扩展功能是在按下打印屏幕按钮还不够的情况下。 最后,我与Todoist合作管理我的日常活动。

These extensions get synced once I sign into Chrome, and I don’t have to install them every single time.

登录我的Chrome浏览器后,这些扩展程序便会同步,无需每次都安装它们。

It might so happen that a new version of Ubuntu might not be compatible with the latest version of Chrome. In that case, you could either install the development version if the issue has been solved there, or install Chromium, which provides you with the same sync capabilities.

可能是这样,新版本的Ubuntu可能与最新版本的Chrome不兼容。 在这种情况下,如果在那里解决了问题,则可以安装开发版本,也可以安装Chromium ,后者为您提供了相同的同步功能。

文字编辑器 (Text editors)

Installation of many other tools and services on this list could involve editing text based configuration files. How can I do this without my favorite text editors?

在此列表上安装许多其他工具和服务可能涉及编辑基于文本的配置文件。 没有我最喜欢的文本编辑器怎么办?

Sublime Text

I prefer Sublime Text when I work on a local machine. However, when you are working on remote server, a CLI based text editor is required. Ubuntu comes installed with VI, but a more capable one is Vim (Vi Improved). After installation, I configure Vim by editing the .vimrc file to set up certain properties like tab spacing. A similar setting is tweaked in Sublime Text by changing its preference files (for either default or user levels).

在本地计算机上工作时,我更喜欢Sublime Text 。 但是,在远程服务器上工作时,需要基于CLI的文本编辑器。 Ubuntu随VI一起安装,但功能更强大的是Vim (Vi改进)。 安装后,我通过编辑.vimrc文件来设置某些属性(如制表符间距)来配置Vim。 通过更改其首选项文件(适用于默认级别或用户级别),可以在Sublime Text中调整类似的设置。

For Sublime Text, you can change the a lot of settings in the preferences file. I prefer using the Soda Dark theme.

对于Sublime Text,您可以在首选项文件中更改很多设置。 我更喜欢使用Soda Dark主题。

Next, you should try out the range of plugins available for Sublime Text.

接下来,您应该尝试Sublime Text可用的插件范围。

  • GitGutter shows in the gutter area, whether a line has been added, modified or removed, according to Git.

    Git表示, GitGutter在装订线区域显示行是否已添加,修改或删除。

  • Pylinter checks Python files for errors when they are saved and shows violations.

    Pylinter会在保存Python文件时检查错误,并显示违规情况。

  • All Autocomplete is a plugin that extends the autocomplete word list to all the files that are open. T

    All Autocomplete是一个插件,可将自动完成单词列表扩展到所有打开的文件。 Ť

These are just a few and it would take a separate post altogether to describe Sublime Text plugins. I suggest you have a look at front end specific, PHP specific or Python specific plugins for Sublime Text.

这些仅是少数几个,描述Sublime Text插件将需要单独发表。 我建议您看看Sublime Text的前端特定的PHP特定的Python特定的插件。

版本控制软件 (Version control software)

The next step is to install version control software. If you’re involved in open-source development, installing Git, Mercurial and Bazaar should suffice, as most projects use one of these three. You can skip installing Subversion because open source projects these days have largely moved on from Subversion.

下一步是安装版本控制软件。 如果您从事开源开发,则安装GitMercurialBazaar应该足够了,因为大多数项目都使用这三个项目之一。 您可以跳过安装Subversion的步骤,因为这些天开源项目在很大程度上已经从Subversion转移了。

Installing them is pretty easy with the Ubuntu Package Manager. Unless you want beta versions, you can set them up with just apt-get install. If you want unstable development versions, you might have to get a tarball from their websites and build them on your system.

使用Ubuntu软件包管理器安装它们非常容易。 除非您想要Beta版本,否则只需使用apt-get install即可设置它们。 如果要使用不稳定的开发版本,则可能必须从他们的网站上获取压缩包,然后在系统上进行构建。

数据库管理 (Database Management)

Snapshot of a database

Source: atutor.ca

资料来源: atutor.ca

Most web applications need a database for storing data. Before you install any such software, it is advisable to install a database. The most popular relational database management system is MySQL, but you may want to go ahead with something like MariaDB (which started with a fork of MySQL after Oracle stalled its development) or PostgreSQL.

大多数Web应用程序都需要一个数据库来存储数据。 在安装任何此类软件之前,建议先安装数据库。 最受欢迎的关系数据库管理系统是MySQL ,但是您可能想要使用MariaDB (在Oracle停止开发后从MySQL的分支开始)或PostgreSQL之类的东西

If you want to go with NoSQL, you may install MongoDB or Cassandra.

如果要使用NoSQL,则可以安装MongoDBCassandra

PHP,Python,Ruby,Node.js (PHP, Python, Ruby, Node.js)

After setting up a database, I get a few languages and frameworks on which popular web based projects run. PHP, Python, Ruby and Node.js are the top options. I don’t install the Java SDK unless I need to run something that specifically requires it.

设置数据库后,我获得了运行流行的基于Web的项目的几种语言和框架。 PHPPythonRubyNode.js是首选。 除非需要运行特别需要它的程序,否则我不会安装Java SDK。

Most of them have different packages to connect to databases (like php5-mysql or MySQL-Python). Make sure you install the packages that are required.

它们中的大多数具有不同的软件包以连接到数据库(例如php5-mysqlMySQL-Python )。 确保安装所需的软件包。

特定于Python的软件包 (Python specific packages)

Since I use Python as my go-to language, there are a few Python-specific packages that I install. Firstly, I install pip, which is a package manager for Python. easy_install is another package manager, which I install through pip. Then, I move ahead with the installation of django, a web framework in Python. Further, I get the package beautifulsoup, which is a parser for HTML (or even XML) documents. Lastly, ipython gets me a better python shell and ipdb helps in better debugging.

由于我使用Python作为首选语言,因此我安装了一些特定于Python的软件包。 首先,我安装pip ,它是Python的软件包管理器。 easy_install是另一个软件包管理器,我通过pip安装。 然后,我继续安装django (Python中的Web框架)。 此外,我得到了包beautifulsoup ,它是HTML(甚至XML)文档的解析器。 最后, ipython我提供了更好的python shell,而ipdb帮助进行了更好的调试。

更改Apache2主目录 (Change Apache2 home directory)

In Ubuntu, a web server in the form of apache2 is installed by default. However, one little problem is that the home directory is /var/www/ by default. The directory /var/www/ requires root privileges to create or change files. If you are working on a development machine, it becomes cumbersome to prefix sudo to each command.

在Ubuntu中,默认情况下以apache2的形式安装Web服务器。 但是,一个小问题是主目录默认为/var/www/ 。 目录/var/www/需要root特权才能创建或更改文件。 如果您在开发机器上工作,则在每个命令前添加sudo变得很麻烦。

An easy way to fix this is to shift the home directory to your home folder (/home/[username]/), so that managing files and directories is easier.

解决此问题的一种简单方法是将主目录转移到主文件夹( /home/[username]/ ),以便于管理文件和目录。

在终端中设置自定义别名 (Set up custom aliases in terminal)

If you work with the terminal often, you know there are certain monotonous commands you frequently need to type. For instance, to start a Django server with a local settings file, we need to type python manage.py runserver --settings=settinngs.local. To avoid typing this every time, you can add an alias to your ~/.bashrc file.

如果您经常使用终端,则会知道您经常需要键入某些单调的命令。 例如,要使用本地设置文件启动Django服务器,我们需要输入python manage.py runserver --settings=settinngs.local 。 为了避免每次都键入此内容,可以将别名添加到~/.bashrc文件中。

Another useful set of aliases that you could use is .. for cd ../.., ... for cd ../../../ and so on. Here’s a guide on working with .bashrc in Unix systems.

您可以使用的另一组有用的别名是..表示cd ../.....表示cd ../../../等等。 这是在Unix系统中使用.bashrc的指南

(Miscellaneous)

Whatever your level of development experience, you probably love listening to music while you work. Although some people prefer Spotify, Rdio, YouTube, or GrooveShark for streaming music, you can install VLC if you are bandwidth conscious.

无论您的开发经验水平如何,您都可能喜欢在工作时听音乐。 尽管有些人喜欢Spotify,Rdio,YouTube或GrooveShark来流音乐,但是如果您对带宽很敏感,可以安装VLC

The last program I install is one that may or may not be required in the development process. GIMP is an image processing processing software, widely regarded as an acceptable Photoshop alternative. Sometimes, a developer might be required to perform minute image processing tasks like cropping, which can be done quickly with GIMP.

我安装的最后一个程序是开发过程中可能需要或不需要的程序。 GIMP是图像处理处理软件,被广泛认为是可接受的Photoshop替代品。 有时,可能需要开发人员执行微小的图像处理任务,例如裁剪,可以通过GIMP快速完成。

With this, we come to the end of the list of software I install on a development machine.

有了这个,我们来到了我在开发机器上安装的软件列表的末尾。

Do you use something cool that I missed? Do let us know in the comments below.

您是否使用了我想念的很棒的东西? 请在下面的评论中告诉我们。

Update: added a paragraph explaining the need for AdBlock when testing.

更新:添加了一段说明测试时需要AdBlock的段落。

翻译自: https://www.sitepoint.com/set-up-development-machine/

机器人树莓派开发机器人

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值