SubnetCalculator version 0.1

You can calculate IPv4 subnet masks by hand if you so desire, but it is much easier to just use a SubnetCalculator!

I have coded this app to help IT colleagues. Basically it has very simple bit processes.

If you consider the subnet mask as one string then (all in binary):

Network Address AND Subnet Mask = Network ID

Network ID + 1 (binary) = First Host

Network ID + Available Hosts (binary) = Last Host

Network ID + Available Hosts (binary) + 1 (binary) = Broadcast

You can apply the mask under the Menu or just change the Number of Network bits in the combo box.

This is the first version(0.1) and coded in C#. Hope to add more features in the soonest time and would like to code in Python!

You can download it as portable app from this link

 

 

Converting a current retail version to a different current retail version of Windows Server 2012

At any time after installing Windows Server 2012, you can run Setup to repair the installation (sometimes called “repair in place”) or, in certain cases, to convert to a different edition.

You can run Setup to perform a “repair in place” on any edition of Windows Server 2012; the result will be the same edition you started with.

For Windows Server 2012 Standard, you can convert the system to Windows Server 2012 Datacenter as follows: From an elevated command prompt, determine the current edition name with the command DISM /online /Get-CurrentEdition. Make note of the edition ID, an abbreviated form of the edition name. Then run DISM /online /Set-Edition:<edition ID> /ProductKey:XXXXX-XXXXX-XXXXX-XXXXX-XXXXX /AcceptEula, providing the edition ID and a retail product key. The server will restart twice.

 

Let us suppose you have an Evaluation Version of the Windows Server and you want to convert (upgrade) it to Standard Edition:

Run the Command Prompt as Administrator then type below

C:\> DISM /online /Get-CurrentEdition

C:\> DISM /online /Get-TargetEditions

C:\> DISM /online /Set-Edition:ServerStandard /ProductKey:XXXX-XXXX-XXXX-XXXX-XXXX /AcceptEula

How to install Webmin on Ubuntu Server 16.04 and how to manage it

Webmin is a web-based interface for system administration for Unix/Linux. Using any browser that supports tables and forms (and Java for the File Manager module), you can setup user accounts, Apache, DNS, file sharing and so on.

Webmin consists of a simple web server and a number of CGI programs which directly update system files like /etc/inetd.conf and /etc/passwd. The web server and all CGI programs are written in Perl version 5, and use no non-standard Perl module

First you need add Webmin official repository and make sure that all packages are up to date.

And add the following lines:

deb http://download.webmin.com/download/repository sarge contrib
deb http://webmin.mirror.somersettechsolutions.co.uk/repository sarge contrib
Fetch and install the GPG key:

~$ sudo wget http://www.webmin.com/jcameron-key.asc

~$ sudo apt-key add jcameron-key.asc

Install Webmin with the following command:

Finally, we can access the Webmin panel using our web browser. Webmin uses 10000 as its default port. Type this into our URL address web browser. https://[ip-address]:10000 then login as superuser or root access privileges.

What is ProcessMaker and how to install it on Ubuntu Server 16.04

ProcessMaker is an open source Business Process Management (BPM) platform designed to automate workflows and improve business efficiency. Business analysts and IT users can create process maps, build web forms, set email notifications, build reports, and more. Analysts can be streamlining processes while decision makers can monitor progress with flexible dashboards and KPIs, all starting within minutes of launching the application. With mobile applications and support for RESTful APIs, the full functionality of the application can be brought with you anywhere and adds additional value to existing applications. Say goodbye to lost or delayed forms, redundant emails, and confusing excel spreadsheets and hello to efficiently managed workflows.

Installation:

Before we start the installation go ahead for LAMP installation with this link. Be informed that ProcessMaker 3 is not compatible with Php7.

Step 1:

Ubuntu 16.04 comes with PHP 7 which is not supported by ProcessMaker. However, PHP 5.6 can be installed from an alternative repository:

~$ sudo add-apt-repository ppa:ondrej/php

~$ sudo apt-get update

~$ sudo apt-get install apache2 mysql-server php5.6 php5.6-mbstring php5.6-mcrypt php5.6-mysql php5.6-xml php5.6-gd php5.6-ldap php5.6-curl php5.6-cli php5.6-soap

Step 2:

The default configuration of PHP should be able to run ProcessMaker, however, check the following settings if PHP’s configuration file php.ini has been modified.

~$ sudo nano /etc/php/5.6/apache2/php.ini

Search for the following lines and edit them using the following configurations:

file_uploads = On

short_open_tag = On

memory_limit = 512M

error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT

display_errors = Off

post_max_size = 24M

upload_max_filesize = 24M

It is also recommended to set the date.timezone to a your time zone as shown below:

date.timezone = Asia/Istanbul

Step 3:

Go to ProcessMaker’s SourceForge page and download a recent tarball of ProcessMaker and then decompress it:

~$ wget https://netix.dl.sourceforge.net/project/processmaker/ProcessMaker/3.2.1/processmaker-3.2.1-community.tar.gz

~$ sudo tar -C /opt -xzvf processmaker*

Set file permissions:

~$ cd /opt/processmaker

~$ sudo chmod -R 770 shared workflow/public_html gulliver/js gulliver/thirdparty/html2ps_pdf/cache

~$ cd workflow/engine/

~$ sudo chmod -R 770 config content/languages plugins xmlform js/labels

~$ sudo chown -R www-data:www-data /opt/processmaker

 

Step 4:

Grant a user on MySQL:

~$ mysql -u root -p

mysql> grant all on *.* to ‘USER’@’localhost’ identified by ‘PASSWORD’ with grant option;

mysql> exit;

Replace USER with the name of your MySQL user and PASSWORD with the password for that user and start the service:

~$ sudo service mysql start

 

Step 5:

Configure Apache:

Copy the sample ProcessMaker configuration file (pmos.conf.example):

~$ sudo cp /opt/processmaker/pmos.conf.example /etc/apache2/sites-available/pmos.conf

Then edit the pmos.conf file to fit your environment:

~$ sudo nano /etc/apache2/sites-available/pmos.conf

 

#processmaker virtual host

<VirtualHost your_ip_address >

ServerName “your_processmaker_domain

DocumentRoot /opt/processmaker/workflow/public_html

DirectoryIndex index.html index.php

<Directory /opt/processmaker/workflow/public_html>

Options Indexes FollowSymLinks MultiViews

AddDefaultCharset UTF-8

AllowOverride All

Require all granted

ExpiresActive On

<IfModule mod_rewrite.c>

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f

RewriteRule ^.*/(.*)$ app.php [QSA,L,NC]

</IfModule>

#Deflate filter is optional. It reduces download size, but adds slightly more CPU processing:

AddOutputFilterByType DEFLATE text/html

</Directory>

</VirtualHost>

 

Replace your_ip_address with the IP number or domain name of the server running ProcessMaker.

If your DNS or /etc/hosts has a defined domain for ProcessMaker, then use that domain for your_processmaker_domain or IP address

Step 6:

Enable site and modules:

~$ sudo a2ensite pmos.conf

~$ service apache2 reload

Enable all modules will be needed:

~$ sudo a2enmod ldap

~$ sudo a2enmod authnz_ldap

~$ sudo a2enmod deflate

~$ sudo a2enmod expires

~$ sudo a2enmod rewrite

~$ sudo a2enmod ssl

~$ sudo a2enmod vhost_alias

~$ sudo a2enmod filter

 

Step 7:

Disable the default Apache site

~$  sudo a2dissite 000-default.conf

~$  sudo service apache2 reload

Congratulation! The installation of ProcessMaker is done. Now you can browse the server link

PS: At login in Workspace you should type workflows

What is ERPNext and how to install it on Ubuntu 16.04

ERPNext is the perfect example of the software that will help companies to organize and manage the work of each department. ERPNext is an open source web-based system aimed at small and medium-sized businesses. It assists companies with accounting, project and task management, sales, purchase, inventory, CRM, administration, human resource management, manufacturing, and even website. This system is the most suitable for businesses in manufacturing, retail, and distribution spheres. Extensive functionality is integrated into a single platform for easy management.

 

Installation:

Update the system and install necessary packages

~$ apt-get update && sudo apt-get -y upgrade

~$ apt-get install wget python-minimal

Install Frappe and ERPNext with an easy script:

To download the install script run the following command:

~$ wget https://raw.githubusercontent.com/frappe/bench/master/playbooks/install.py

Start the installation by issuing the command below:

~$ python install.py –production –user frappe

The install script will install all requirements including bench, create a new user ‘frappe’ and setup a new ERPNext site.

You can sit back and relax while the script goes through the installation process.

Under the hood this python script uses Ansible playbook to install the following services, tools, and modules:

– MariaDB

– Nginx

– Nodejs

– Redis

– Supervisor

– Wkhtmltopdf

 

The installation will take some time and if it is successful, you will see something like this:

Frappe/ERPNext has been successfully installed!

Once the installation process is completed, visit your server IP address and you will see the Login screen.

That’s it. You have successfully installed ERPNext on your Ubuntu 16.06!

How to install KoboToolbox by using Docker on Ubuntu Server 16.04

KoBoToolbox is a suite of tools for field data collection for use in challenging environments. KoboToolbox is free and open source. Most of the users are the staff who are working in humanitarian crises, as well as aid professionals and researchers working in developing countries. KoboToolbox developers and researchers are based in Cambridge, MA and many other places around the world.

Installation

You can find a nice instruction on KoboToolbox GitHub site

First of all, you need to check for Docker installation by this link

Clone the repository by typing:

~$ git clone https://github.com/kobotoolbox/kobo-docker.git

It will clone the necessary documents in kobo-docker folder

~$ cd kobo-docker

The first decision to make is whether your instance (kobo) will use secure (https) or insecure (http) communications when interacting with clients.

If it is local one:

~$ nano envfile.local.txt

If it is server one

~$ nano envfile.server.txt

Fill the lines as shown below with your username and password:

Save and exit.

Then type :

For Local:

~$ ln -s docker-compose.local.yml docker-compose.yml

For Server:

~$ ln -s docker-compose.server.yml docker-compose.yml

 

~$ docker-compose pull

~$ docker-compose up

It will take some time based on connection

After it is finished you can check on your browser (for local):

http://[IP_address_of_your_machine]:8000/

Congratulations you have a fresh instance of KoboToolbox!

Use the below link for Site Administration

http://[IP_address_of_your_machine]:8000/admin/

To stop the container you can type:

~$ docker-compose stop

 

Congratulations!

What is Vagrant and how to manage it on Ubuntu Server 16.04

Vagrant is a tool for building and managing virtual machine environments in a single workflow. With an easy-to-use workflow and focus on automation, Vagrant lowers development environment setup time, increases production parity, and makes the “works on my machine” excuse a relic of the past.

If you are a developer, Vagrant will isolate dependencies and their configuration within a single disposable, consistent environment, without sacrificing any of the tools you are used to working with (editors, browsers, debuggers, etc.). Once you or someone else creates a single Vagrantfile, you just need to ~$ vagrant up and everything is installed and configured for you to work. Other members of your team create their development environments from the same configuration, so whether you are working on Linux, Mac OS X, or Windows, all your team members are running code in the same environment, against the same dependencies, all configured the same way. Say goodbye to “works on my machine” bugs.

Download & install the latest version of Vagrant & Virtual Box, by visiting Vagrant Downloads and VirtualBox Downloads.

~$ wget https://releases.hashicorp.com/vagrant/2.0.1/vagrant_2.0.1_x86_64.deb

~$ wget https://download.virtualbox.org/virtualbox/5.2.6/virtualbox-5.2_5.2.6-120293~Ubuntu~xenial_amd64.deb

Install them by:

~$ sudo dpkg -i vagrant_2.0.1_x86_64.deb

~$ sudo dpkg -i virtualbox-5.2_5.2.6-120293~Ubuntu~xenial_amd64.deb

 

Vagrant Box

A box is basically a package containing a representation of a virtual machine running a specific operating system. To be more simple, it is a base image of any Operating System or Kernel. It may be for a specific Provider.

For example: https://app.vagrantup.com/boxes/search

Providers

The Provider is the piece of software responsible for creating and managing the virtual machines used by Vagrant. The main providers are Virtualbox and VMware, but the default one is VirtualBox since it’s free and open source.

Provisioners

Provisioner will do some task(s) using the VM instance already provided. The provisioners are used to set up the virtual server, installing all necessary software and executing different tasks. The most used provisioners are : PuppetChef, and Ansible. Shell Script is also a very common option. You can find more information about vagrant provisioners here.

The Vagrantfile

The basic vagrant configuration is based in one file, the Vagrantfile. It shall be placed in your repository root. In this file you will define which base box you want a box is, basically, a package with an operational system to be run on your virtual machine.

After the installation is done, let us download one box from https://app.vagrantup.com/boxes/search with below commands

~$ mkdir vagrant-test

~$ cd vagrant-test

Let us command our first vagrant command: vagrant init

~$ vagrant init

It will create a file: Vagrantfile

Let us edit it:

~$ nano Vagrantfile

That is Ruby!

find config.vm.box = ‘base’ and change base with a image name on https://app.vagrantup.com/boxes/search

For example config.vm.box = “ubuntu/trusty64”

So it is basically

Vagrant.configure(“2”) do |config|
    config.vm.box = “ubuntu/trusty64”
end

or you can run the below command instead of changing Vagrantfile

~$ vagrant init ubuntu/trusty64

Then the final command for provisioning:

~$ vagrant up

If it gives error execute with sudo!

It will take some time to finalize it.

After it is done when you check your VirtualBox you will see there is an virtual client running.

The default username is vagrant and password is also vagrant

But you can easily reach the virtual client from host (without knowing username/password) with below ssh command:

~$ vagrant ssh

Don’t forget: To run the commands you should be in the folder! If you have another VM then you should change folder (cd ….) to execute them!

Congratulations! You have a full box in a very short time!

What is Docker and How to install on Ubuntu Server 16.04

Docker is a tool designed to make it easier to create, deploy, and run applications by using containers. Containers allow a developer to package up an application with all of the parts it needs, such as libraries and other dependencies, and ship it all out as one package. By doing so, thanks to the container, the developer can rest assured that the application will run on any other Linux machine regardless of any customized settings that machine might have that could differ from the machine used for writing and testing the code.

 

In a way, Docker is a bit like a virtual machine. But unlike a virtual machine, rather than creating a whole virtual operating system, Docker allows applications to use the same Linux kernel as the system that they’re running on and only requires applications be shipped with things not already running on the host computer. This gives a significant performance boost and reduces the size of the application.

 

A container image is a lightweight, stand-alone, executable package of a piece of software that includes everything needed to run it: code, runtime, system tools, system libraries, settings. Available for both Linux and Windows based apps, containerized software will always run the same, regardless of the environment. Containers isolate software from its surroundings, for example differences between development and staging environments and help reduce conflicts between teams running different software on the same infrastructure.

Set up the docker repository on Ubuntu

$ sudo apt-get update

$ sudo apt-get install apt-transport-https ca-certificates curl software-properties-common

$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add –

$ sudo add-apt-repository “deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable”

Check for details on this link

Install Docker CE (Community Edition)

$ sudo apt-get update

$ sudo apt-get install docker-ce docker-compose

 

The docker cli is used when managing individual containers on a docker engine. It is the client command line to access the docker daemon api.

The docker-compose cli can be used to manage a multi-container application. It also moves many of the options you would enter on the docker run cli into the docker-compose.yml file for easier reuse. It works as a front-end “script” on top of the same docker api used by docker, so you can do everything docker-compose does with docker commands and a lot of shell scripting

 

An Example:

Go for https://hub.docker.com/explore/ and choose a repo

For example, let us choose nginx 

Let us create a folder for this ~$ mkdir nginx-test

Then go in the folder ~$ cd nginx-test

Run the pull command

~$ docker pull nginx

After installation is done you can run one instance of the nginx as follows(this is the simplest way):

~$ docker run nginx

 

To print all containers on the machine (active ones)

~$ docker ps 

To print all containers on the machine

~$ docker ps -a

List all images on the machine

~$ docker images 

To remove container

~$ docker rm [contrainer_name]

Run container

~$ docker run [contrainer_name]

Stop container

~$ docker stop [contrainer_name]

Stop all containers

~$ docker stop $(docker ps -a -q)

Remove all containers

~$ docker rm $(docker ps -a -q)

How to install Snipe-IT on Ubuntu 16.04

Snipe-IT was made for IT asset management, to enable IT departments to track who has which laptop, when it was purchased, which software licenses and accessories are available, and so on.

1. Install LAMP

First of all, we need to install LAMP (Linux, Apache2, MySQL and PHP).

Go ahead and install LAMP following this link.

2. Updating Ubuntu 16.04 and installing prerequisites

Updates first:

~$ sudo apt-get update && sudo apt-get upgrade -y

Be sure you have curl command is working. If not then install it with the below command:

~$ sudo apt-get install curl

Next we are going to download composer:

~$ sudo curl -sS https://getcomposer.org/installer | php

 

Then we are going to move composer to another folder:

~$ sudo mv composer.phar /usr/local/bin/composer

~$ cd /var/www/

 

Alright, time to download snipe-it:

~$ sudo git clone https://github.com/snipe/snipe-it snipeit

~$ cd snipeit/

 

Finally we replace .env.example with .env:

~$ sudo cp .env.example .env

3. Configuring the MySQL Database

Time to create our MySQL Database:

~$ sudo mysql -u root -p

Now you need to run a couple of commands, make sure to use the EXACT commands like in the box below, replace “yourusername” and “yourpw” with your own username and password:

  • mysql> create database snipeit;
  • mysql> GRANT ALL ON *.* TO ‘your_username’@‘%’ IDENTIFIED BY ‘your_password’;
  • mysql> flush privileges;
  • mysql> exit

4. Editing the .env file

Now we are going to edit the .env config file.

~$ sudo nano .env

You need to adjust the values according to your server and the database we created earlier. Remember to enter your username and password that you set in step 3.

Don’t worry about the APP_KEY either, we are going to generate that later.

Hit CTRL+O to write and CTRL+X to exit.

5. Adjusting permissions

Now we got to adjust a couple of permissions:

~$ sudo chown -R www-data:www-data storage public/uploads

~$ sudo chmod -R 775 storage

~$ sudo chmod -R 755 public/uploads

. Installing PHP dependencies

Installing PHP dependencies:

~$ sudo apt-get install -y git unzip php php-mcrypt php-curl php-mysql php-gd php-ldap php-zip php-mbstring php-xml php-bcmath

 

 

7. Installing Composer & generating our App Key

Installing Composer:

~$ sudo composer install –no-dev –prefer-source

 

And generating our APP Key:

~$ sudo php artisan key:generate

Type yes when you get asked if you really want to run that command.

 

 

8. Editing configuration files and wrapping up

Now we are going to enable our Virtual Host:

~$ sudo nano /etc/apache2/sites-available/snipeit.example.com.conf

And paste the text in the box below:

<VirtualHost *:80>
ServerAdmin webmaster@localhost
<Directory /var/www/snipeit/public>
Require all granted
AllowOverride All
</Directory>
DocumentRoot /var/www/snipeit/public
ServerName 192.168.71.129
#Redirect permanent / https://snipeit.your-server-fqdn.com/
ErrorLog /var/log/apache2/snipeIT.error.log
CustomLog /var/log/apache2/access.log combined
</VirtualHost>

 

Change the IP(ServerName) then press CTRL+O to save and CTRL+X to exit.

Now we are going to run a couple apache commands:

~$ sudo a2ensite snipeit.example.com.conf

~$ sudo a2enmod rewrite

~$ sudo systemctl restart apache2

 

And we are going to disable the default.conf

~$ sudo a2dissite 000-default.conf

~$ sudo service apache2 restart

 

Change directory

~$ cd /etc/apache2/sites-available

 

And we are going to rename the default.conf to keep it as backup:

~$ sudo cp 000-default.conf 000-default.confTEMP

 

And finally remove it:

~$ sudo rm 000-default.conf

 

Already and finally wrapping it up with:

~$ sudo phpenmod mcrypt

~$ sudo phpenmod mbstring

~$ sudo a2enmod rewrite

~$ sudo service apache2 restart

 

9. Setup with the Web Browser

Now you are as good as done. Open a Web Browser and enter your server IP and enter:

 

Click on Next: Create Database Tables.

You will likely get an error:

 

Don’t panic, just refresh the page by hitting F5

Click on Next: Create User

Finalize everything to your liking, click F5 if you get the error again.

 

And congratulations, you are now running a powerful, completely free cloud based instance of the Snipe IT Asset Management!