From 8a721cf1f6ea95c1847737dee074efe0c0de266a Mon Sep 17 00:00:00 2001 From: ezio Date: Sun, 15 May 2016 11:20:07 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=9E=E6=94=B6=E8=BF=87=E6=9C=9F=E6=96=87?= =?UTF-8?q?=E7=AB=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...cketing System in Fedora 22 or Centos 7.md | 179 ---------- ... How to Configure OpenNMS on CentOS 7.x.md | 219 ------------ ...co Virtual Private Networking on Docker.md | 322 ------------------ ...Raspberry Pi projects for the classroom.md | 119 ------- 4 files changed, 839 deletions(-) delete mode 100644 sources/tech/20150817 How to Install OsTicket Ticketing System in Fedora 22 or Centos 7.md delete mode 100644 sources/tech/20150906 How to Configure OpenNMS on CentOS 7.x.md delete mode 100644 sources/tech/20151012 Getting Started to Calico Virtual Private Networking on Docker.md delete mode 100644 sources/tech/20151207 5 great Raspberry Pi projects for the classroom.md diff --git a/sources/tech/20150817 How to Install OsTicket Ticketing System in Fedora 22 or Centos 7.md b/sources/tech/20150817 How to Install OsTicket Ticketing System in Fedora 22 or Centos 7.md deleted file mode 100644 index 6624a3c590..0000000000 --- a/sources/tech/20150817 How to Install OsTicket Ticketing System in Fedora 22 or Centos 7.md +++ /dev/null @@ -1,179 +0,0 @@ -How to Install OsTicket Ticketing System in Fedora 22 / Centos 7 -================================================================================ -In this article, we'll learn how to setup help desk ticketing system with osTicket in our machine or server running Fedora 22 or CentOS 7 as operating system. osTicket is a free and open source popular customer support ticketing system developed and maintained by [Enhancesoft][1] and its contributors. osTicket is the best solution for help and support ticketing system and management for better communication and support assistance with clients and customers. It has the ability to easily integrate with inquiries created via email, phone and web based forms into a beautiful multi-user web interface. osTicket makes us easy to manage, organize and log all our support requests and responses in one single place. It is a simple, lightweight, reliable, open source, web-based and easy to setup and use help desk ticketing system. - -Here are some easy steps on how we can setup Help Desk ticketing system with osTicket in Fedora 22 or CentOS 7 operating system. - -### 1. Installing LAMP stack ### - -First of all, we'll need to install LAMP Stack to make osTicket working. LAMP stack is the combination of Apache web server, MySQL or MariaDB database system and PHP. To install a complete suit of LAMP stack that we need for the installation of osTicket, we'll need to run the following commands in a shell or a terminal. - -**On Fedora 22** - -LAMP stack is available on the official repository of Fedora 22. As the default package manager of Fedora 22 is the latest DNF package manager, we'll need to run the following command. - - $ sudo dnf install httpd mariadb mariadb-server php php-mysql php-fpm php-cli php-xml php-common php-gd php-imap php-mbstring wget - -**On CentOS 7** - -As there is LAMP stack available on the official repository of CentOS 7, we'll gonna install it using yum package manager. - - $ sudo yum install httpd mariadb mariadb-server php php-mysql php-fpm php-cli php-xml php-common php-gd php-imap php-mbstring wget - -### 2. Starting Apache Web Server and MariaDB ### - -Next, we'll gonna start MariaDB server and Apache Web Server to get started. - - $ sudo systemctl start mariadb httpd - -Then, we'll gonna enable them to start on every boot of the system. - - $ sudo systemctl enable mariadb httpd - - Created symlink from /etc/systemd/system/multi-user.target.wants/mariadb.service to /usr/lib/systemd/system/mariadb.service. - Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service. - -### 3. Downloading osTicket package ### - -Next, we'll gonna download the latest release of osTicket ie version 1.9.9 . We can download it from the official download page [http://osticket.com/download][2] or from the official github repository. [https://github.com/osTicket/osTicket-1.8/releases][3] . Here, in this tutorial we'll download the tarball of the latest release of osTicket from the github release page using wget command. - - $ cd /tmp/ - $ wget https://github.com/osTicket/osTicket-1.8/releases/download/v1.9.9/osTicket-v1.9.9-1-gbe2f138.zip - - --2015-07-16 09:14:23-- https://github.com/osTicket/osTicket-1.8/releases/download/v1.9.9/osTicket-v1.9.9-1-gbe2f138.zip - Resolving github.com (github.com)... 192.30.252.131 - ... - Connecting to s3.amazonaws.com (s3.amazonaws.com)|54.231.244.4|:443... connected. - HTTP request sent, awaiting response... 200 OK - Length: 7150871 (6.8M) [application/octet-stream] - Saving to: ‘osTicket-v1.9.9-1-gbe2f138.zip’ - osTicket-v1.9.9-1-gb 100%[========================>] 6.82M 1.25MB/s in 12s - 2015-07-16 09:14:37 (604 KB/s) - ‘osTicket-v1.9.9-1-gbe2f138.zip’ saved [7150871/7150871] - -### 4. Extracting the osTicket ### - -After we have successfully downloaded the osTicket zipped package, we'll now gonna extract the zip. As the default root directory of Apache web server is /var/www/html/ , we'll gonna create a directory called "**support**" where we'll extract the whole directory and files of the compressed zip file. To do so, we'll need to run the following commands in a terminal or a shell. - - $ unzip osTicket-v1.9.9-1-gbe2f138.zip - -Then, we'll move the whole extracted files to it. - - $ sudo mv /tmp/upload /var/www/html/support - -### 5. Fixing Ownership and Permission ### - -Now, we'll gonna assign the ownership of the directories and files under /var/ww/html/support to apache to enable writable access to the apache process owner. To do so, we'll need to run the following command. - - $ sudo chown apache: -R /var/www/html/support - -Then, we'll also need to copy a sample configuration file to its default configuration file. To do so, we'll need to run the below command. - - $ cd /var/www/html/support/ - $ sudo cp include/ost-sampleconfig.php include/ost-config.php - $ sudo chmod 0666 include/ost-config.php - -If you have SELinux enabled on the system, run the following command. - - $ sudo chcon -R -t httpd_sys_content_t /var/www/html/vtigercrm - $ sudo chcon -R -t httpd_sys_rw_content_t /var/www/html/vtigercrm - -### 6. Configuring MariaDB ### - -As this is the first time we're going to configure MariaDB, we'll need to create a password for the root user of mariadb so that we can use it to login and create the database for our osTicket installation. To do so, we'll need to run the following command in a terminal or a shell. - - $ sudo mysql_secure_installation - - ... - Enter current password for root (enter for none): - OK, successfully used password, moving on... - - Setting the root password ensures that nobody can log into the MariaDB - root user without the proper authorisation. - - Set root password? [Y/n] y - New password: - Re-enter new password: - Password updated successfully! - Reloading privilege tables.. - Success! - ... - All done! If you've completed all of the above steps, your MariaDB - installation should now be secure. - - Thanks for using MariaDB! - -Note: Above, we are asked to enter the root password of the mariadb server but as we are setting for the first time and no password has been set yet, we'll simply hit enter while asking the current mariadb root password. Then, we'll need to enter twice the new password we wanna set. Then, we can simply hit enter in every argument in order to set default configurations. - -### 7. Creating osTicket Database ### - -As osTicket needs a database system to store its data and information, we'll be configuring MariaDB for osTicket. So, we'll need to first login into the mariadb command environment. To do so, we'll need to run the following command. - - $ sudo mysql -u root -p - -Now, we'll gonna create a new database "**osticket_db**" with user "**osticket_user**" and password "osticket_password" which will be granted access to the database. To do so, we'll need to run the following commands inside the MariaDB command environment. - - > CREATE DATABASE osticket_db; - > CREATE USER 'osticket_user'@'localhost' IDENTIFIED BY 'osticket_password'; - > GRANT ALL PRIVILEGES on osticket_db.* TO 'osticket_user'@'localhost' ; - > FLUSH PRIVILEGES; - > EXIT; - -**Note**: It is strictly recommended to replace the database name, user and password as your desire for security issue. - -### 8. Allowing Firewall ### - -If we are running a firewall program, we'll need to configure our firewall to allow port 80 so that the Apache web server's default port will be accessible externally. This will allow us to navigate our web browser to osTicket's web interface with the default http port 80. To do so, we'll need to run the following command. - - $ sudo firewall-cmd --zone=public --add-port=80/tcp --permanent - -After done, we'll need to reload our firewall service. - - $ sudo firewall-cmd --reload - -### 9. Web based Installation ### - -Finally, is everything is done as described above, we'll now should be able to navigate osTicket's Installer by pointing our web browser to http://domain.com/support or http://ip-address/support . Now, we'll be shown if the dependencies required by osTicket are installed or not. As we've already installed all the necessary packages, we'll be welcomed with **green colored tick** to proceed forward. - -![osTicket Requirements Check](http://blog.linoxide.com/wp-content/uploads/2015/07/osticket-requirements-check1.png) - -After that, we'll be required to enter the details for our osTicket instance as shown below. We'll need to enter the database name, username, password and hostname and other important account information that we'll require while logging into the admin panel. - -![osticket configuration](http://blog.linoxide.com/wp-content/uploads/2015/07/osticket-configuration.png) - -After the installation has been completed successfully, we'll be welcomed by a Congratulations screen. There we can see two links, one for our Admin Panel and the other for the support center as the homepage of the osTicket Support Help Desk. - -![osticket installation completed](http://blog.linoxide.com/wp-content/uploads/2015/07/osticket-installation-completed.png) - -If we click on http://ip-address/support or http://domain.com/support, we'll be redirected to the osTicket support page which is as shown below. - -![osticket support homepage](http://blog.linoxide.com/wp-content/uploads/2015/07/osticket-support-homepage.png) - -Next, to login into the admin panel, we'll need to navigate our web browser to http://ip-address/support/scp or http://domain.com/support/scp . Then, we'll need to enter the login details we had just created above while configuring the database and other information in the web installer. After successful login, we'll be able to access our dashboard and other admin sections. - -![osticket admin panel](http://blog.linoxide.com/wp-content/uploads/2015/07/osticket-admin-panel.png) - -### 10. Post Installation ### - -After we have finished the web installation of osTicket, we'll now need to secure some of our configuration files. To do so, we'll need to run the following command. - - $ sudo rm -rf /var/www/html/support/setup/ - $ sudo chmod 644 /var/www/html/support/include/ost-config.php - -### Conclusion ### - -osTicket is an awesome help desk ticketing system providing several new features. It supports rich text or HTML emails, ticket filters, agent collision avoidance, auto-responder and many more features. The user interface of osTicket is very beautiful with easy to use control panel. It is a complete set of tools required for a help and support ticketing system. It is the best solution for providing customers a better way to communicate with the support team. It helps a company to make their customers happy with them regarding the support and help desk. If you have any questions, suggestions, feedback please write them in the comment box below so that we can improve or update our contents. Thank you ! Enjoy :-) - ------------------------------------------------------------------------------- - -via: http://linoxide.com/linux-how-to/install-osticket-fedora-22-centos-7/ - -作者:[Arun Pyasi][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://linoxide.com/author/arunp/ -[1]:http://www.enhancesoft.com/ -[2]:http://osticket.com/download -[3]:https://github.com/osTicket/osTicket-1.8/releases diff --git a/sources/tech/20150906 How to Configure OpenNMS on CentOS 7.x.md b/sources/tech/20150906 How to Configure OpenNMS on CentOS 7.x.md deleted file mode 100644 index f209c8e45c..0000000000 --- a/sources/tech/20150906 How to Configure OpenNMS on CentOS 7.x.md +++ /dev/null @@ -1,219 +0,0 @@ -How to Configure OpenNMS on CentOS 7.x -================================================================================ -Systems management and monitoring services are very important that provides information to view important systems management information that allow us to to make decisions based on this information. To make sure the network is running at its best and to minimize the network downtime we need to improve application performance. So, in this article we will make you understand the step by step procedure to setup OpenNMS in your IT infrastructure. OpenNMS is a free open source enterprise level network monitoring and management platform that provides information to allow us to make decisions in regards to future network and capacity planning. - -OpenNMS designed to manage tens of thousands of devices from a single server as well as manage unlimited devices using a cluster of servers. It includes a discovery engine to automatically configure and manage network devices without operator intervention. It is written in Java and is published under the GNU General Public License. OpenNMS is known for its scalability with its main functional areas in services monitoring, data collection using SNMP and event management and notifications. - -### Installing OpenNMS RPM Repository ### - -We will start from the installation of OpenNMS RPM for our CentOs 7.1 operating system as its available for most of the RPM-based distributions through Yum at their official link http://yum.opennms.org/ . - -![OpenNMS RPM](http://blog.linoxide.com/wp-content/uploads/2015/08/18.png) - -Then open your command line interface of CentOS 7.1 and login with root credentials to run the below command with “wget” to get the required RPM. - - [root@open-nms ~]# wget http://yum.opennms.org/repofiles/opennms-repo-stable-rhel7.noarch.rpm - -![Download RPM](http://blog.linoxide.com/wp-content/uploads/2015/08/26.png) - -Now we need to install this repository so that the OpenNMS package information could be available through yum for installation. Let’s run the command below with same root level credentials to do so. - - [root@open-nms ~]# rpm -Uvh opennms-repo-stable-rhel7.noarch.rpm - -![Installing RPM](http://blog.linoxide.com/wp-content/uploads/2015/08/36.png) - -### Installing Prerequisite Packages for OpenNMS ### - -Now before we start installation of OpenNMS, let’s make sure you’ve done the following prerequisites. - -**Install JDK 7** - -Its recommended that you install the latest stable Java 7 JDK from Oracle for the best performance to integrate JDK in our YUM repository as a fallback. Let’s go to the Oracle Java 7 SE JDK download page, accept the license if you agree, choose the platform and architecture. Once it has finished downloading, execute it from the command-line and then install the resulting JDK rpm. - -Else run the below command to install using the Yum from the the available system repositories. - - [root@open-nms ~]# yum install java-1.7.0-openjdk-1.7.0.85-2.6.1.2.el7_1 - -Once you have installed the Java you can confirm its installation using below command and check its installed version. - - [root@open-nms ~]# java -version - -![Java version](http://blog.linoxide.com/wp-content/uploads/2015/08/46.png) - -**Install PostgreSQL** - -Now we will install the PostgreSQL that is a must requirement to setup the database for OpenNMS. PostgreSQL is included in all of the major YUM-based distributions. To install, simply run the below command. - - [root@open-nms ~]# yum install postgresql postgresql-server - -![Installing Postgresql](http://blog.linoxide.com/wp-content/uploads/2015/08/55.png) - -### Prepare the Database for OpenNMS ### - -Once you have installed PostgreSQL, now you'll need to make sure that PostgreSQL is up and active. Let’s run the below command to first initialize the database and then start its services. - - [root@open-nms ~]# /sbin/service postgresql initdb - [root@open-nms ~]# /sbin/service postgresql start - -![start DB](http://blog.linoxide.com/wp-content/uploads/2015/08/64.png) - -Now to confirm the status of your PostgreSQL database you can run the below command. - - [root@open-nms ~]# service postgresql status - -![PostgreSQL status](http://blog.linoxide.com/wp-content/uploads/2015/08/74.png) - -To ensure that PostgreSQL will start after a reboot, use the “systemctl”command to enable start on bootup using below command. - - [root@open-nms ~]# systemctl enable postgresql - ln -s '/usr/lib/systemd/system/postgresql.service' '/etc/systemd/system/multi-user.target.wants/postgresql.service' - -### Configure PostgreSQL ### - -Locate the Postgres “data” directory. Often this is located in /var/lib/pgsql/data directory and Open the postgresql.conf file in text editor and configure the following parameters as shown. - - [root@open-nms ~]# vim /var/lib/pgsql/data/postgresql.conf - ----------- - - #------------------------------------------------------------------------------ - # CONNECTIONS AND AUTHENTICATION - #------------------------------------------------------------------------------ - - listen_addresses = 'localhost' - max_connections = 256 - - #------------------------------------------------------------------------------ - # RESOURCE USAGE (except WAL) - #------------------------------------------------------------------------------ - - shared_buffers = 1024MB - -**User Access to the Database** - -PostgreSQL only allows you to connect if you are logged in to the local account name that matches the PostgreSQL user. Since OpenNMS runs as root, it cannot connect as a "postgres" or "opennms" user by default, so we have to change the configuration to allow user access to the database by opening the below configuration file. - - [root@open-nms ~]# vim /var/lib/pgsql/data/pg_hba.conf - -Update the configuration file as shown below and change the METHOD settings from "ident" to "trust" - -![user access to db](http://blog.linoxide.com/wp-content/uploads/2015/08/84.png) - -Write and quit the file to make saved changes and then restart PostgreSQL services. - - [root@open-nms ~]# service postgresql restart - -### Starting OpenNMS Installation ### - -Now we are ready go with installation of OpenNMS as we have almost don with its prerequisites. Using the YUM packaging system will download and install all of the required components and their dependencies, if they are not already installed on your system. -So let's riun th belwo command to start OpenNMS installation that will pull everything you need to have a working OpenNMS, including the OpenNMS core, web UI, and a set of common plugins. - - [root@open-nms ~]# yum -y install opennms - -![OpenNMS Installation](http://blog.linoxide.com/wp-content/uploads/2015/08/93.png) - -The above command will ends up with successful installation of OpenNMS and its derivative packages. - -### Configure JAVA for OpenNMS ### - -In order to integrate the default version of Java with OpenNMS we will run the below command. - - [root@open-nms ~]# /opt/opennms/bin/runjava -s - -![java integration](http://blog.linoxide.com/wp-content/uploads/2015/08/102.png) - -### Run the OpenNMS installer ### - -Now it's time to start the OpenNMS installer that will create and configure the OpenNMS database, while the same command will be used in case we want to update it to the latest version. To do so, we will run the following command. - - [root@open-nms ~]# /opt/opennms/bin/install -dis - -The above install command will take many options with following mechanism. - --d - to update the database --i - to insert any default data that belongs in the database --s - to create or update the stored procedures OpenNMS uses for certain kinds of data access - - ============================================================================== - OpenNMS Installer - ============================================================================== - - Configures PostgreSQL tables, users, and other miscellaneous settings. - - DEBUG: Platform is IPv6 ready: true - - searching for libjicmp.so: - - trying to load /usr/lib64/libjicmp.so: OK - - searching for libjicmp6.so: - - trying to load /usr/lib64/libjicmp6.so: OK - - searching for libjrrd.so: - - trying to load /usr/lib64/libjrrd.so: OK - - using SQL directory... /opt/opennms/etc - - using create.sql... /opt/opennms/etc/create.sql - 17:27:51.178 [Main] INFO org.opennms.core.schema.Migrator - PL/PgSQL call handler exists - 17:27:51.180 [Main] INFO org.opennms.core.schema.Migrator - PL/PgSQL language exists - - checking if database "opennms" is unicode... ALREADY UNICODE - - Creating imports directory (/opt/opennms/etc/imports... OK - - Checking for old import files in /opt/opennms/etc... DONE - INFO 16/08/15 17:27:liquibase: Reading from databasechangelog - Installer completed successfully! - - ============================================================================== - OpenNMS Upgrader - ============================================================================== - - OpenNMS is currently stopped - Found upgrade task SnmpInterfaceRrdMigratorOnline - Found upgrade task KscReportsMigrator - Found upgrade task JettyConfigMigratorOffline - Found upgrade task DataCollectionConfigMigratorOffline - Processing RequisitionsMigratorOffline: Remove non-ip-snmp-primary and non-ip-interfaces from requisitions: NMS-5630, NMS-5571 - - Running pre-execution phase - Backing up: /opt/opennms/etc/imports - - Running post-execution phase - Removing backup /opt/opennms/etc/datacollection.zip - - Finished in 0 seconds - - Upgrade completed successfully! - -### Firewall configurations to Allow OpenNMS ### - -Here we have to allow OpenNMS management interface port 8980 through firewall or router to access the management web interface from the remote systems. So use the following commands to do so. - - [root@open-nms etc]# firewall-cmd --permanent --add-port=8980/tcp - [root@open-nms etc]# firewall-cmd --reload - -### Start OpenNMS and Login to Web Interface ### - -Let's start OpenNMS service and enable to it start at each bootup by using the below command. - - [root@open-nms ~]#systemctl start opennms - [root@open-nms ~]#systemctl enable opennms - -Once the services are up are ready to go with its web management interface. Open your web browser and access it with your server's IP address and 8980 port. - -http://servers_ip:8980/ - -Give the username and password where as the default username and password is admin/admin. - -![opennms login](http://blog.linoxide.com/wp-content/uploads/2015/08/opennms-login.png) - -After successful authentication with your provided username and password you will be directed towards the the Home page of OpenNMS where you can configure the new monitoring devices/nodes/services etc. - -![opennms home](http://blog.linoxide.com/wp-content/uploads/2015/08/opennms-home.png) - -### Conclusion ### - -Congratulations! we have successfully setup OpenNMS on CentOS 7.1. So, at the end of this tutorial, you are now able to install and configure OpenNMS with its prerequisites that included PostgreSQL and JAVA setup. So let's enjoy with the great network monitoring system with open source roots using OpenNMS that provide a bevy of features at no cost than their high-end competitors, and can scale to monitor large numbers of network nodes. - --------------------------------------------------------------------------------- - -via: http://linoxide.com/monitoring-2/install-configure-opennms-centos-7-x/ - -作者:[Kashif Siddique][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://linoxide.com/author/kashifs/ diff --git a/sources/tech/20151012 Getting Started to Calico Virtual Private Networking on Docker.md b/sources/tech/20151012 Getting Started to Calico Virtual Private Networking on Docker.md deleted file mode 100644 index 27d60729e9..0000000000 --- a/sources/tech/20151012 Getting Started to Calico Virtual Private Networking on Docker.md +++ /dev/null @@ -1,322 +0,0 @@ -Getting Started to Calico Virtual Private Networking on Docker -================================================================================ -Calico is a free and open source software for virtual networking in data centers. It is a pure Layer 3 approach to highly scalable datacenter for cloud virtual networking. It seamlessly integrates with cloud orchestration system such as openstack, docker clusters in order to enable secure IP communication between virtual machines and containers. It implements a highly productive vRouter in each node that takes advantage of the existing Linux kernel forwarding engine. Calico works in such an awesome technology that it has the ability to peer directly with the data center’s physical fabric whether L2 or L3, without the NAT, tunnels on/off ramps, or overlays. Calico makes full utilization of docker to run its containers in the nodes which makes it multi-platform and very easy to ship, pack and deploy. Calico has the following salient features out of the box. - -- It can scale tens of thousands of servers and millions of workloads. -- Calico is easy to deploy, operate and diagnose. -- It is open source software licensed under Apache License version 2 and uses open standards. -- It supports container, virtual machines and bare metal workloads. -- It supports both IPv4 and IPv6 internet protocols. -- It is designed internally to support rich, flexible and secure network policy. - -In this tutorial, we'll perform a virtual private networking between two nodes running Calico in them with Docker Technology. Here are some easy steps on how we can do that. - -### 1. Installing etcd ### - -To get started with the calico virtual private networking, we'll need to have a linux machine running etcd. As CoreOS comes preinstalled and preconfigured with etcd, we can use CoreOS but if we want to configure Calico in other linux distributions, then we'll need to setup it in our machine. As we are running Ubuntu 14.04 LTS, we'll need to first install and configure etcd in our machine. To install etcd in our Ubuntu box, we'll need to add the official ppa repository of Calico by running the following command in the machine which we want to run etcd server. Here, we'll be installing etcd in our 1st node. - - # apt-add-repository ppa:project-calico/icehouse - - The primary source of Ubuntu packages for Project Calico based on OpenStack Icehouse, an open source solution for virtual networking in cloud data centers. Find out more at http://www.projectcalico.org/ - More info: https://launchpad.net/~project-calico/+archive/ubuntu/icehouse - Press [ENTER] to continue or ctrl-c to cancel adding it - gpg: keyring `/tmp/tmpi9zcmls1/secring.gpg' created - gpg: keyring `/tmp/tmpi9zcmls1/pubring.gpg' created - gpg: requesting key 3D40A6A7 from hkp server keyserver.ubuntu.com - gpg: /tmp/tmpi9zcmls1/trustdb.gpg: trustdb created - gpg: key 3D40A6A7: public key "Launchpad PPA for Project Calico" imported - gpg: Total number processed: 1 - gpg: imported: 1 (RSA: 1) - OK - -Then, we'll need to edit /etc/apt/preferences and make changes to prefer Calico-provided packages for Nova and Neutron. - - # nano /etc/apt/preferences - -We'll need to add the following lines into it. - - Package: * - Pin: release o=LP-PPA-project-calico-* - Pin-Priority: 100 - -![Calico PPA Config](http://blog.linoxide.com/wp-content/uploads/2015/10/calico-ppa-config.png) - -Next, we'll also need to add the official BIRD PPA for Ubuntu 14.04 LTS so that bugs fixes are installed before its available on the Ubuntu repo. - - # add-apt-repository ppa:cz.nic-labs/bird - - The BIRD Internet Routing Daemon PPA (by upstream & .deb maintainer) - More info: https://launchpad.net/~cz.nic-labs/+archive/ubuntu/bird - Press [ENTER] to continue or ctrl-c to cancel adding it - gpg: keyring `/tmp/tmphxqr5hjf/secring.gpg' created - gpg: keyring `/tmp/tmphxqr5hjf/pubring.gpg' created - gpg: requesting key F9C59A45 from hkp server keyserver.ubuntu.com - apt-ggpg: /tmp/tmphxqr5hjf/trustdb.gpg: trustdb created - gpg: key F9C59A45: public key "Launchpad Datov� schr�nky" imported - gpg: Total number processed: 1 - gpg: imported: 1 (RSA: 1) - OK - -Now, after the PPA jobs are done, we'll now gonna update the local repository index and then install etcd in our machine. - - # apt-get update - -To install etcd in our ubuntu machine, we'll gonna run the following apt command. - - # apt-get install etcd python-etcd - -### 2. Starting Etcd ### - -After the installation is complete, we'll now configure the etcd configuration file. Here, we'll edit **/etc/init/etcd.conf** using a text editor and append the line exec **/usr/bin/etcd** and make it look like below configuration. - - # nano /etc/init/etcd.conf - exec /usr/bin/etcd --name="node1" \ - --advertise-client-urls="http://10.130.65.71:2379,http://10.130.65.71:4001" \ - --listen-client-urls="http://0.0.0.0:2379,http://0.0.0.0:4001" \ - --listen-peer-urls "http://0.0.0.0:2380" \ - --initial-advertise-peer-urls "http://10.130.65.71:2380" \ - --initial-cluster-token $(uuidgen) \ - --initial-cluster "node1=http://10.130.65.71:2380" \ - --initial-cluster-state "new" - -![Configuring ETCD](http://blog.linoxide.com/wp-content/uploads/2015/10/configuring-etcd.png) - -**Note**: In the above configuration, we'll need to replace 10.130.65.71 and node-1 with the private ip address and hostname of your etcd server box. After done with editing, we'll need to save and exit the file. - -We can get the private ip address of our etcd server by running the following command. - - # ifconfig - -![ifconfig](http://blog.linoxide.com/wp-content/uploads/2015/10/ifconfig1.png) - -As our etcd configuration is done, we'll now gonna start our etcd service in our Ubuntu node. To start etcd daemon, we'll gonna run the following command. - - # service etcd start - -After done, we'll have a check if etcd is really running or not. To ensure that, we'll need to run the following command. - - # service etcd status - -### 3. Installing Docker ### - -Next, we'll gonna install Docker in both of our nodes running Ubuntu. To install the latest release of docker, we'll simply need to run the following command. - - # curl -sSL https://get.docker.com/ | sh - -![Docker Engine Installation](http://blog.linoxide.com/wp-content/uploads/2015/10/docker-engine-installation.png) - -After the installation is completed, we'll gonna start the docker daemon in-order to make sure that its running before we move towards Calico. - - # service docker restart - - docker stop/waiting - docker start/running, process 3056 - -### 3. Installing Calico ### - -We'll now install calico in our linux machine in-order to run the calico containers. We'll need to install Calico in every node which we're wanting to connect into the Calico network. To install Calico, we'll need to run the following command under root or sudo permission. - -#### On 1st Node #### - - # wget https://github.com/projectcalico/calico-docker/releases/download/v0.6.0/calicoctl - - --2015-09-28 12:08:59-- https://github.com/projectcalico/calico-docker/releases/download/v0.6.0/calicoctl - Resolving github.com (github.com)... 192.30.252.129 - Connecting to github.com (github.com)|192.30.252.129|:443... connected. - ... - Resolving github-cloud.s3.amazonaws.com (github-cloud.s3.amazonaws.com)... 54.231.9.9 - Connecting to github-cloud.s3.amazonaws.com (github-cloud.s3.amazonaws.com)|54.231.9.9|:443... connected. - HTTP request sent, awaiting response... 200 OK - Length: 6166661 (5.9M) [application/octet-stream] - Saving to: 'calicoctl' - 100%[=========================================>] 6,166,661 1.47MB/s in 6.7s - 2015-09-28 12:09:08 (898 KB/s) - 'calicoctl' saved [6166661/6166661] - - # chmod +x calicoctl - -After done with making it executable, we'll gonna make the binary calicoctl available as the command in any directory. To do so, we'll need to run the following command. - - # mv calicoctl /usr/bin/ - -#### On 2nd Node #### - - # wget https://github.com/projectcalico/calico-docker/releases/download/v0.6.0/calicoctl - - --2015-09-28 12:09:03-- https://github.com/projectcalico/calico-docker/releases/download/v0.6.0/calicoctl - Resolving github.com (github.com)... 192.30.252.131 - Connecting to github.com (github.com)|192.30.252.131|:443... connected. - ... - Resolving github-cloud.s3.amazonaws.com (github-cloud.s3.amazonaws.com)... 54.231.8.113 - Connecting to github-cloud.s3.amazonaws.com (github-cloud.s3.amazonaws.com)|54.231.8.113|:443... connected. - HTTP request sent, awaiting response... 200 OK - Length: 6166661 (5.9M) [application/octet-stream] - Saving to: 'calicoctl' - 100%[=========================================>] 6,166,661 1.47MB/s in 5.9s - 2015-09-28 12:09:11 (1022 KB/s) - 'calicoctl' saved [6166661/6166661] - - # chmod +x calicoctl - -After done with making it executable, we'll gonna make the binary calicoctl available as the command in any directory. To do so, we'll need to run the following command. - - # mv calicoctl /usr/bin/ - -Likewise, we'll need to execute the above commands to install in every other nodes. - -### 4. Starting Calico services ### - -After we have installed calico on each of our nodes, we'll gonna start our Calico services. To start the calico services, we'll need to run the following commands. - -#### On 1st Node #### - - # calicoctl node - - WARNING: Unable to detect the xt_set module. Load with `modprobe xt_set` - WARNING: Unable to detect the ipip module. Load with `modprobe ipip` - No IP provided. Using detected IP: 10.130.61.244 - Pulling Docker image calico/node:v0.6.0 - Calico node is running with id: fa0ca1f26683563fa71d2ccc81d62706e02fac4bbb08f562d45009c720c24a43 - -#### On 2nd Node #### - -Next, we'll gonna export a global variable in order to connect our calico nodes to the same etcd server which is hosted in node1 in our case. To do so, we'll need to run the following command in each of our nodes. - - # export ETCD_AUTHORITY=10.130.61.244:2379 - -Then, we'll gonna run calicoctl container in our every our second node. - - # calicoctl node - - WARNING: Unable to detect the xt_set module. Load with `modprobe xt_set` - WARNING: Unable to detect the ipip module. Load with `modprobe ipip` - No IP provided. Using detected IP: 10.130.61.245 - Pulling Docker image calico/node:v0.6.0 - Calico node is running with id: 70f79c746b28491277e28a8d002db4ab49f76a3e7d42e0aca8287a7178668de4 - -This command should be executed in every nodes in which we want to start our Calico services. The above command start a container in the respective node. To check if the container is running or not, we'll gonna run the following docker command. - - # docker ps - -![Docker Running Containers](http://blog.linoxide.com/wp-content/uploads/2015/10/docker-running-containers.png) - -If we see the output something similar to the output shown below then we can confirm that Calico containers are up and running. - -### 5. Starting Containers ### - -Next, we'll need to start few containers in each of our nodes running Calico services. We'll assign a different name to each of the containers running ubuntu. Here, workload-A, workload-B, etc has been assigned as the unique name for each of the containers. To do so, we'll need to run the following command. - -#### On 1st Node #### - - # docker run --net=none --name workload-A -tid ubuntu - - Unable to find image 'ubuntu:latest' locally - latest: Pulling from library/ubuntu - ... - 91e54dfb1179: Already exists - library/ubuntu:latest: The image you are pulling has been verified. Important: image verification is a tech preview feature and should not be relied on to provide security. - Digest: sha256:73fbe2308f5f5cb6e343425831b8ab44f10bbd77070ecdfbe4081daa4dbe3ed1 - Status: Downloaded newer image for ubuntu:latest - a1ba9105955e9f5b32cbdad531cf6ecd9cab0647d5d3d8b33eca0093605b7a18 - - # docker run --net=none --name workload-B -tid ubuntu - - 89dd3d00f72ac681bddee4b31835c395f14eeb1467300f2b1b9fd3e704c28b7d - -#### On 2nd Node #### - - # docker run --net=none --name workload-C -tid ubuntu - - Unable to find image 'ubuntu:latest' locally - latest: Pulling from library/ubuntu - ... - 91e54dfb1179: Already exists - library/ubuntu:latest: The image you are pulling has been verified. Important: image verification is a tech preview feature and should not be relied on to provide security. - Digest: sha256:73fbe2308f5f5cb6e343425831b8ab44f10bbd77070ecdfbe4081daa4dbe3ed1 - Status: Downloaded newer image for ubuntu:latest - 24e2d5d7d6f3990b534b5643c0e483da5b4620a1ac2a5b921b2ba08ebf754746 - - # docker run --net=none --name workload-D -tid ubuntu - - c6f28d1ab8f7ac1d9ccc48e6e4234972ed790205c9ca4538b506bec4dc533555 - -Similarly, if we have more nodes, we can run ubuntu docker container into it by running the above command with assigning a different container name. - -### 6. Assigning IP addresses ### - -After we have got our docker containers running in each of our hosts, we'll go for adding a networking support to the containers. Now, we'll gonna assign a new ip address to each of the containers using calicoctl. This will add a new network interface to the containers with the assigned ip addresses. To do so, we'll need to run the following commands in the hosts running the containers. - -#### On 1st Node #### - - # calicoctl container add workload-A 192.168.0.1 - # calicoctl container add workload-B 192.168.0.2 - -#### On 2nd Node #### - - # calicoctl container add workload-C 192.168.0.3 - # calicoctl container add workload-D 192.168.0.4 - -### 7. Adding Policy Profiles ### - -After our containers have got networking interfaces and ip address assigned, we'll now need to add policy profiles to enable networking between the containers each other. After adding the profiles, the containers will be able to communicate to each other only if they have the common profiles assigned. That means, if they have different profiles assigned, they won't be able to communicate to eachother. So, before being able to assign. we'll need to first create some new profiles. That can be done in either of the hosts. Here, we'll run the following command in 1st Node. - - # calicoctl profile add A_C - - Created profile A_C - - # calicoctl profile add B_D - - Created profile B_D - -After the profile has been created, we'll simply add our workload to the required profile. Here, in this tutorial, we'll place workload A and workload C in a common profile A_C and workload B and D in a common profile B_D. To do so, we'll run the following command in our hosts. - -#### On 1st Node #### - - # calicoctl container workload-A profile append A_C - # calicoctl container workload-B profile append B_D - -#### On 2nd Node #### - - # calicoctl container workload-C profile append A_C - # calicoctl container workload-D profile append B_D - -### 8. Testing the Network ### - -After we've added a policy profile to each of our containers using Calicoctl, we'll now test whether our networking is working as expected or not. We'll take a node and a workload and try to communicate with the other containers running in same or different nodes. And due to the profile, we should be able to communicate only with the containers having a common profile. So, in this case, workload A should be able to communicate with only C and vice versa whereas workload A shouldn't be able to communicate with B or D. To test the network, we'll gonna ping the containers having common profiles from the 1st host running workload A and B. - -We'll first ping workload-C having ip 192.168.0.3 using workload-A as shown below. - - # docker exec workload-A ping -c 4 192.168.0.3 - -Then, we'll ping workload-D having ip 192.168.0.4 using workload-B as shown below. - - # docker exec workload-B ping -c 4 192.168.0.4 - -![Ping Test Success](http://blog.linoxide.com/wp-content/uploads/2015/10/ping-test-success.png) - -Now, we'll check if we're able to ping the containers having different profiles. We'll now ping workload-D having ip address 192.168.0.4 using workload-A. - - # docker exec workload-A ping -c 4 192.168.0.4 - -After done, we'll try to ping workload-C having ip address 192.168.0.3 using workload-B. - - # docker exec workload-B ping -c 4 192.168.0.3 - -![Ping Test Failed](http://blog.linoxide.com/wp-content/uploads/2015/10/ping-test-failed.png) - -Hence, the workloads having same profiles could ping each other whereas having different profiles couldn't ping to each other. - -### Conclusion ### - -Calico is an awesome project providing an easy way to configure a virtual network using the latest docker technology. It is considered as a great open source solution for virtual networking in cloud data centers. Calico is being experimented by people in different cloud platforms like AWS, DigitalOcean, GCE and more these days. As Calico is currently under experiment, its stable version hasn't been released yet and is still in pre-release. The project consists a well documented documentations, tutorials and manuals in their [official documentation site][2]. - --------------------------------------------------------------------------------- - -via: http://linoxide.com/linux-how-to/calico-virtual-private-networking-docker/ - -作者:[Arun Pyasi][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://linoxide.com/author/arunp/ -[1]:http://docs.projectcalico.org/ \ No newline at end of file diff --git a/sources/tech/20151207 5 great Raspberry Pi projects for the classroom.md b/sources/tech/20151207 5 great Raspberry Pi projects for the classroom.md deleted file mode 100644 index b7455d11f7..0000000000 --- a/sources/tech/20151207 5 great Raspberry Pi projects for the classroom.md +++ /dev/null @@ -1,119 +0,0 @@ -ezio - -5 great Raspberry Pi projects for the classroom -===================================================== - - -5 个很适合在课堂上演示的树莓派项目 -===================================================== - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/osdc-open-source-yearbook-lead3.png?itok=fSUS0fIt) - -### 1. 我的世界 Pi - -![](https://opensource.com/sites/default/files/lava.png) ->Courtesy of the Raspberry Pi Foundation. [CC BY-SA 4.0][1]. - -Minecraft is the favorite game of pretty much every teenager in the world—and it's one of the most creative games ever to capture the attention of young people. The version that comes with every Raspberry Pi is not only a creative thinking building game, but comes with a programming interface allowing for additional interaction with the Minecraft world through Python code. - -我的世界是世界上很多青少年最喜欢的一个游戏,而且他也是目前最能激发年轻人创造力的一款游戏。这个树莓派版上自带的我的世界不仅仅是一个具有创造性的建筑游戏,他还是一个具有编程接口、可以通过 Python 与之交互的版本。 - -Minecraft: Pi Edition is a great way for teachers to engage students with problem solving and writing code to perform tasks. You can use the Python API to build a house and have it follow you wherever you go, build a bridge wherever you walk, make it rain lava, show the temperature in the sky, and anything else your imagination can create. - -我的世界:Pi 版对于老师来说是一个非常好的教授学生解决问题和编写代码完成任务的途径。你可以使用 Python API 创建一个房子,并且一直跟随这你的脚步移动,当你需要桥梁的时候给你建造一座桥,让老天呀下雨,显示天空的温度,以及其它你可以想象到的一切东西。 - -Read more in "[Getting Started with Minecraft Pi][2]." - -详情请见 "[Getting Started with Minecraft Pi][2]." - -### 2. 反应游戏和交通灯 Reaction game and traffic lights - -![](https://opensource.com/sites/default/files/pi_traffic_installed_yellow_led_on.jpg) ->Courtesy of [Low Voltage Labs][3]. [CC BY-SA 4.0][1]. - -It's really easy to get started with physical computing on Raspberry Pi—just connect up LEDs and buttons to the GPIO pins, and with a few lines of code you can turn lights on and control things with button presses. Once you know the code to do the basics, it's down to your imagination as to what you do next! - -使用树莓派可以很轻松的进行物理计算——只需要连接几个 LED 和按钮到 开发板上的 GPIO 接口,再用几行代码你就可以按下按钮来开灯。一旦你指导了如何使用代码来做这些基本的东西,接下来就可以根据你的想象来做其它事情了。 - -If you know how to flash one light, you can flash three. Pick out three LEDs in traffic light colors and you can code the traffic light sequence. If you know how to use a button to a trigger an event, then you have a pedestrian crossing! Also look out for great pre-built traffic light add-ons like [PI-TRAFFIC][4], [PI-STOP][5], [Traffic HAT][6], and more. - -如果你知道如何让一个灯闪烁,你就可以让三个灯开始闪烁。挑选三个和交通灯一样颜色的 LED 灯,然后编写控制交通灯的代码。如果你知道如何使用按钮触发实践,那么你就可以模拟行人过马路。同时你可以参考其它已经完成的交通灯附件,比如[PI-TRAFFIC][4], [PI-STOP][5], [Traffic HAT][6],等等。 - -It's not always about the code—this can be used as an exercise in understanding how real world systems are devised. Computational thinking is a useful skill in any walk of life. - -代码并不是全部——这些联系只是让你理解真是世界里使如何完成这些事的。计算思维是一个在你一生中都会很有用的技能。 - -![](https://opensource.com/sites/default/files/reaction-game.png) ->Courtesy of the Raspberry Pi Foundation. [CC BY-SA 4.0][1]. - -Next, try wiring up two buttons and an LED and making a two-player reaction game—let the light come on after a random amount of time and see who can press the button first! - -接下来试着接通两个按钮和 LED 灯的电源,实现一个反应游戏 —— 让 LED 灯随机的点亮,然后看是最先按下按钮。 - -To learn more, check out [GPIO Zero recipes][7]. Everything you need is in [CamJam EduKit 1][8]. - -要想了解更多可以看看 [GPIO Zero recipes][7]。你所需要的资料都可以在 [CamJam EduKit 1][8] 找到。 - -### 3. 电子宠物 Sense HAT Pixel Pet - -The Astro Pi—an augmented Raspberry Pi—is going to space this December, but you haven't missed your chance to get your hands on the hardware. The Sense HAT is the sensor board add-on used in the Astro Pi mission and it's available for anyone to buy. You can use it for data collection, science experiments, games and more. Watch this Gurl Geek Diaries video from Raspberry Pi's Carrie Anne for a great way to get started—by bringing to life an animated pixel pet of your own design on the Sense HAT display: - -Astro Pi —— 一个增强版的树莓派 —— 将在 12 月问世,但是你并没有错过亲手把玩这个硬件的机会。Sense HAT 是 Astro Pi 的一个传感器扩展板,现在已经开放购买了。你可以使用它来进行数据搜集,科学实验,游戏和其它很多事。可以看看下面树莓派的 Carrie Anne 拍摄的 Gurl Geek Diaries 的视频,里面演示了一种很棒的入门途径——给生活添加一个你自己创造的生动的像素宠物: - -[video](https://youtu.be/gfRDFvEVz-w) - ->Learn more in "[Exploring the Sense HAT][9]." ->详见 "[探索 Sense HAT][9]." - -### 4. 红外鸟笼 Infrared bird box - -![](https://opensource.com/sites/default/files/ir-bird-box.png) ->Courtesy of the Raspberry Pi Foundation. [CC BY-SA 4.0][1]. - -A great exercise for the whole class to get involved with—place a Raspberry Pi and the NoIR camera module inside a bird box along with some infra-red lights so you can see in the dark, then stream video from the Pi over the network or on the internet. Wait for birds to nest and you can observe them without disturbing them in their habitat. - - - -Learn all about infrared and the light spectrum, and how to adjust the camera focus and control the camera in software. - -Learn more in "[Make an infrared bird box][10]." - -### 5. 机器人 Robotics - -![](https://opensource.com/sites/default/files/edukit3_1500-alex-eames-sm.jpg) ->Courtesy of Low Voltage Labs. [CC BY-SA 4.0][1]. - -With a Raspberry Pi and as little as a couple of motors and a motor controller board, you can build your own robot. There is a vast range of robots you can make, from basic buggies held together by sellotape and a homemade chassis, all the way to self-aware, sensor-laden metallic stallions with camera attachments driven by games controllers. - -Learn how to control individual motors with something straightforward like the RTK Motor Controller Board (£8/$12), or dive into the new CamJam robotics kit (£17/$25) which comes with motors, wheels and a couple of sensors—great value and plenty of learning potential. - -Alternatively, if you'd like something more hardcore, try PiBorg's [4Borg][11] (£99/$150) or [DiddyBorg][12] (£180/$273) or go the whole hog and treat yourself to their DoodleBorg Metal edition (£250/$380)—and build a mini version of their infamous [DoodleBorg tank][13] (unfortunately not for sale). - -Check out the [CamJam robotics kit worksheets][14]. - - ------------------------------------------------------------------------------- - -via: https://opensource.com/education/15/12/5-great-raspberry-pi-projects-classroom - -作者:[Ben Nuttall][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/bennuttall -[1]: https://creativecommons.org/licenses/by-sa/4.0/ -[2]: https://opensource.com/life/15/5/getting-started-minecraft-pi -[3]: http://lowvoltagelabs.com/ -[4]: http://lowvoltagelabs.com/products/pi-traffic/ -[5]: http://4tronix.co.uk/store/index.php?rt=product/product&product_id=390 -[6]: https://ryanteck.uk/hats/1-traffichat-0635648607122.html -[7]: http://pythonhosted.org/gpiozero/recipes/ -[8]: http://camjam.me/?page_id=236 -[9]: https://opensource.com/life/15/10/exploring-raspberry-pi-sense-hat -[10]: https://www.raspberrypi.org/learning/infrared-bird-box/ -[11]: https://www.piborg.org/4borg -[12]: https://www.piborg.org/diddyborg -[13]: https://www.piborg.org/doodleborg -[14]: http://camjam.me/?page_id=1035#worksheets