VPN installation in Raspberry Pi

What is a VPN ?

VPN stands for Virtual Private Network. VPN extends the private network to external networks so that the users can securely interact with the systems within the private network. I will write another post with the complete details of VPN. We will be concentrating on the installation of VPN in raspberry pi in this post.

VPN is a very important requirement for every enterprises. Now a days even individual started using VPN. It is very easy to configure a VPN. Most of the large enterprises use paid VPN services. There are so many VPN service providers available in the market.

This post is about setting up a free VPN service. This can be used in small or medium scale businesses or for your personal purpose as well. I am using this VPN service from the past several years and it worked very well without any issues.

Installation of VPN in raspberry Pi

raspberrypi

I have used raspberry Pi for the installation of OpenVpn. The simplest way to install and configure VPN is raspberry Pi is using Pi-VPN. PiVPN supports two VPN backends

  • OpenVPN
  • WireGuard

While doing the installation, it asks for the user to select the preference and it installs accordingly. OpenVPN can be operated in TCP and UDP. I have used both of these protocols. From my personal experience, the best performing and stable one is UDP.

The only advantage with TCP is that we can run Open VPN in TCP port 443 and it bypasses almost all firewalls in external network. The TCP port 443 is globally open for HTTPS. So we can easily access the VPN using the same port. In this way we will not have to request for additional exceptions in the firewall to enable the VPN access.

WireGuard is a new VPN protocol. It uses a completely new protocol as compared to Open VPN. It is fast and secure. This is under development. Currently if you look at the installations, the majority share goes to Open VPN. This is mainly because it was there in the industry from several years and it already proved its capability. WireGuard will be up in the market soon.

More details about the configuration of PiVPN is described in the following URLs.

  1. PiVPN installation
  2. Additional Reference

Integration with Network

The integration is very easy. In two steps we can integrate the VPN.

  • Connect the raspberry Pi to your network using an ethernet cable
  • Create a rule in your firewall or router to allow the traffic from outside to the raspberry Pi through a NAT rule. (Create a port forwarding rule to route the requests from outside to the raspberry Pi connected to the internal network.)

Green House Farming

What is Green House Farming ?

Green House Farming is a technique in which the crops are cultivated in a controlled enclosed environment. This is basically to control the effects due to whether changes.

Advantages of Green House

  • Plants will get an environment with consistent temperature and Humidity
  • Plants will be protected from birds and other organisms
  • The moisture content in the soil will not evaporate easily
  • Easy to control pests
  • Easy to maintain the fields
  • The environment will not get affected because of the external weather

The picture of one of the greenhouses that I visited in the recent past is shared below.

greenhouse

Rose plants are cultivated in this Green House. The plants are planted in well arranged lines and drip irrigation is established across the plantation.

The newly formed rose buds are wrapped with a net protector to maintain proper shapes and protect the buds from other damages. These nets will ensure controlled development during budding. A high quality rosebud will be large in size (long bud with a well formed, heavy base). If you observe closely, you can see these nets in the buds present in the above picture. A sample image of the rose bud net is posted below.

rosebud_net

Role of Automation & AI in the modern Agriculture

Food is one of the fundamental need of any living organism. For humans in the current age, food is something that has to be purchased from the shops. Once humans became civilized, the freely available food became a commodity product. The idea behind work and salary was all for food in the earlier ages. Later it was for food, medicine and shelter. Now the priorities has changed and we all are running behind the fast moving world.

Now everyone are busy. Getting clean & good food is very difficult.

  • Vegetables are full of pesticides & chemicals
  • Meat is poisonous with antibiotics
  • Rice & grains contains harmful chemicals. People even uses plastic like materials for manufacturing similar materials
  • Water and water bodies are polluted
  • Air is polluted
  • Soil is polluted

Everything is polluted….!!!

In general, the food that we eat is not good for health and it may even take our life. What is the solution ?.

People including me are busy with their work and they don’t have time to do any cultivation. I came from an agricultural background and I have farm lands also. But now everything is unused. Now the food production is getting reduced drastically. It is basically because of the following reasons.

  • The cost of farming is high.
  • No steady income.
  • Lack of stability in the price of agricultural products and market.
  • The major share goes to the middle man
  • High labour cost. Most of the conventional farming needs more man power and the cost of man power is more in the current society.
  • Poor social status.
  • Dependency on climate and the sudden climatic changes.

Because of all these factors new generation is not even thinking about agriculture. I also moved away from agriculture because of all these factors.

Currently I stay in an apartment surrounded by farm lands. When I observed the cultivation process and the deadly harmful pesticides that they use, I got shocked. None of these vegetables are in an eatable condition. I started thinking and researching about the ways to control this.

One of the images that made me re-thing is shared below. The picture shows two oxen with their mouths masked. The reason for the mask is to avoid them eating the cabbage leaves in the farmland while ploughing the fields. Those cabbages were sprayed with highly poisonous chemicals.

pesticide_image

One of my goals in this year is to start an organic farm. Automation is required to improve the efficiency and reduce the human effort. Now my blog posts will include the updates and progress about my organic farm and my learning.

dependency xml is not available

The error “dependency xml is not available” can be resolved by installing the following packages.

For CentOS/RHEL

yum install libxml2 libxml2-devel

For Ubuntu

apt-get install libxml2-dev

How to check the performance of DNS in your network ?

I was checking for tools to benchmark the performance of DNS servers in my network. The reason behind this performance test was to identify the root cause of the internet slowness within my network. One of the good free tool that I found online is DNS Benchmark Tool.

This is a very light weight and portable tool. This is just 180KB and helps us to perform the DNS speeed test. With this tool I figured out one anonymous DNS server running in an individuals laptop also.

dns_server

I found this tool as a useful utility.

How to split a list into chunks using Python

To split a large list into smaller lists, you can use the following code snippet.

This can be easily performed by numpy.

import numpy
num_splits = 3
large_list = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]
splitted_list = numpy.array_split(large_list,num_splits);
for split in splitted_list:
    print(list(split))

 

How to find the IP address of a linux server ?

To check the IP address of a Linux server, type the following command in the terminal/commandline.

ifconfig

The below command also will help in finding the ip address.

ip addr

CDH cluster installation failing in “distributing” stage- Failure due to stall on seeded torrent

I faced this issue while distributing the downloaded packages in cloudera manager.

The solution that worked for me is to add the IP Address – Hostname mapping in all the /etc/hosts files of all the cloudera manager server and agents

/etc/hosts

192.168.0.101   cdhdatanode1