Cloud Network

Networking | Support | Tricks | Troubleshoot | Tips

Buymecoffe

Buy Me A Coffee
Showing posts with label Debian. Show all posts
Showing posts with label Debian. Show all posts

Monday, March 30, 2020

How To Install Git and Git-Gui on Ubuntu 18.04 LTS, Debian and Linux Mint

March 30, 2020
How To Install Git and Git-Gui on Ubuntu 18.04 LTS, Debian and Linux Mint
How To Install Git and Git-Gui on Ubuntu 18.04 LTS, Debian and Linux Mint

Offically Website of GitHub
https://github.com/git/git

Offically Website of Git
https://git-scm.com/downloads

Method 1
Installing Git
Step1 :- sudo apt update
Step2 :- sudo apt install git  OR  sudo apt-get install git-gui

Verify
Step3 :- git --version

Method 2
Installing Git from Source
Step1 :- sudo apt update
Step2 :- sudo apt install make libssl-dev libghc-zlib-dev libcurl4-gnutls-dev libexpat1-dev gettext unzip
Step3 :- cd /tmp  OR  cd /usr/src/
Step4 :- sudo wget https://github.com/git/git/archive/v2.26.0.zip -O git.zip  
      OR sudo wget https://github.com/git/git/archive/v2.26.0.tar.gz -O git.tar.gz    
Step5 :- sudo unzip git.zip
      OR sudo tar -xf git.tar.gz
Step6 :- cd git-*
Step7 :- sudo make prefix=/usr/local all
Step8 :- sudo make prefix=/usr/local install
 
ERROR
cache.h:21:10: fatal error: zlib.h: No such file or directory
 #include <zlib.h>
          ^~~~~~~~
compilation terminated.
Makefile:2387: recipe for target 'fuzz-commit-graph.o' failed
make: *** [fuzz-commit-graph.o] Error 1

SOLUTIONS   
Step1 :- sudo apt-get install libz-dev
Step2 :- sudo apt install zlib1g-dev

Step9 :- git --version

Clone the Git
Step10 :- cd ~
Step11 :- git clone https://github.com/git/git.git  OR  git clone https://github.com/git/git
Step12 :- cd git
Step13 :- sudo make prefix=/usr/local all
Step14 :- sudo make prefix=/usr/local install

Configuring Git
Step15 :- git config --global user.name "Cloud Network"
Step16 :- git config --global user.email "itcloudnet@gmail.com"

Verify
Step17 :- git config --list

configuration file of Git
Step18 :- nano ~/.gitconfig

Sunday, March 29, 2020

How To Install Node.js and npm Ubuntu 18.04, Debian and Linux Mint

March 29, 2020
How To Install Node.js and npm Ubuntu 18.04, Debian and Linux Mint
How To Install Node.js and npm Ubuntu 18.04, Debian and Linux Mint

Officially Website
https://nodejs.org/en/download/

Stable release: 12.15.0

Offically Github
https://github.com/nvm-sh/nvm

METHOD 1
Step1 :- sudo apt-get update

Step2 :- sudo apt install nodejs

Step3 :- node -v OR node --version OR nodejs -v

Step4 :- npm -v OR npm --version

METHOD 2
Installing Using PPA
sudo apt-get update

sudo apt-get upgrade

sudo apt-get install python-software-properties

curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
OR
curl -sL https://deb.nodesource.com/setup_12.x -o nodesource_setup.sh

sudo apt install nodejs

node --version
nvm --version

sudo apt install build-essential

METHOD 3
Installing Using NVM
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.35.3/install.sh | bash
nvm ls  OR nvm ls-remote
nvm install (Latest LTS)  OR nvm install --lts
nvm use (Latest LTS)
node --version
nvm ls
nvm alias default (Latest LTS)
nvm use default
nvm install node
npm install express
npm install -g express
npm link express
nvm help
nvm --version

Removing Node.js
sudo apt remove nodejs
sudo apt purge nodejs
sudo apt autoremove
sudo apt remove nodejs npm

nvm current
nvm uninstall node_version
nvm deactivate

How to Install and Configure pgAdmin 4 v4.19 on Ubuntu 18.04, Debian and Linux Mint

March 29, 2020
How to Install and Configure pgAdmin 4 v4.19 on Ubuntu 18.04, Debian and Linux Mint
How to Install and Configure pgAdmin 4 v4.19 on Ubuntu 18.04, Debian and Linux Mint

Visit the Pgadmin 4 Ubuntu download site:
https://www.pgadmin.org/download/

METHOD 1
Importing GPG key
sudo apt install wget ca-certificates

Install Pgadmin4 from Ubuntu repositories
Step1 :- wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -

Add PostgreSQL APT repository
Step2 :- sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" >> /etc/apt/sources.list.d/pgdg.list'

Updating
Step3 :- sudo apt update

Installation pgadmin4
Step4 :- sudo apt install pgadmin4 pgadmin4-apache2 -y  OR  sudo apt-get install pgadmin4 pgadmin4-apache2

Check Status
Step :- systemctl status apache2

UFW Firewall Configured
Step :- sudo ufw allow http
Step :- sudo ufw allow https

Verify Open Browser
http://[SERVERIP OR LOCALHOST OR DOMAIN]/pgadmin4/

Login with your email address and password.
Email Address :- itcloudnet@gmail.com
Password :- STRONGPASSWORD
===================================================================================================================================

METHOD 2
Creating a New User
Step5 :- useradd -m -s /bin/bash itcloudnet
Step6 :- passwd STRONGPASSWORD

Creating Log Directory
Step7 :- sudo mkdir -p /var/log/pgadmin4/ OR  sudo mkdir /var/log/pgadmin4
Step8 :- sudo mkdir -p /var/lib/pgadmin4/{sessions,storage}
OR
Step8 :- sudo mkdir -p /var/lib/pgadmin4/sessions
Step8 :- sudo mkdir /var/lib/pgadmin4/storage

Changing the Owner of all Directory
Step9 :- sudo chown -R itcloudnet:itcloudnet /var/log/pgadmin4/ /var/lib/pgadmin4/

Install Dependencies
Step10 :- sudo apt install build-essential libssl-dev libffi-dev libgmp3-dev virtualenv python-pip libpq-dev python-dev -y

Install Apache2
Step11 :- sudo apt install apache2 apache2-utils libapache2-mod-wsgi libexpat1 ssl-cert python -y

Creating Virtual Env
Step11 :- su - itcloudnet
Step12 :- virtualenv pgadmin4
Step13 :- cd pgadmin4/
Step14 :- source bin/activate

Installation pgadmin4
Step15 :- wget https://ftp.postgresql.org/pub/pgadmin/pgadmin4/v3.6/pip/pgadmin4-4.19-py2.py3-none-any.whl

Install Package through pip command
sudo apt-get install python-pip
Step16 :- pip install pgadmin4-4.19-py2.py3-none-any.whl

Creating New Configuration file
Step17 :- cd lib/python2.7/site-packages/pgadmin4/
Step18 :- nano config_local.py

Now Copy & Paste
LOG_FILE = '/var/log/pgadmin4/pgadmin4.log'
SQLITE_PATH = '/var/lib/pgadmin4/pgadmin4.db'
SESSION_DB_PATH = '/var/lib/pgadmin4/sessions'
STORAGE_DIR = '/var/lib/pgadmin4/storage'
SERVER_MODE = True

Run
Step19 :- python setup.py

Step20 :- pip install psycopg2-binary
Step21 :- sudo chown -R www-data:www-data /var/lib/pgadmin4/ OR sudo chown -R itcloudnet:itcloudnet /var/lib/pgadmin4
Step22 :- sudo chown -R www-data:www-data /var/log/pgadmin4/ OR sudo chown -R itcloudnet:itcloudnet /var/log/pgadmin4

Configure Apache2
Step23 :- cd /etc/apache2/sites-available/

Change the 'ServerName' with your own domain name
Step24 :- sudo nano pgadmin4.conf
          ServerName pgadmin.itcloudnet.blogspot.com

Now test the configuration and activate the pgAdmin4 virtual hosts
Step25 :- apachectl configtest
Step26 :- a2ensite pgadmin4

Restart Apache2 Service
Step27 :- systemctl restart apache2

URL Access
http://pgadmin.itcloudnet.blogspot.com

===================================================================================================================================
HOW TO CONNECT POSTGRESQL DB VIA or WITH PGADMIN4

Login with your email address and password
Email Address :- itcloudnet@gmail.com
Password :- STRONGPASSWORD

Step28 :- "Add New Server" Button then type PostgreSQL Server or Local details and then save.

Click on General -->
Name : postgresql-local OR localhost
Server group : Servers
Comments : Local PostgreSQl Server

Click on Connection -->
Maintenance : postgres (DB host)
Username : postgres (DB name)
password : itcloudnet$123! (DB passwrod)

Save

Thats it.........

How To Install Elasticsearch, Logstash and Kibana on Ubuntu 18.04

March 29, 2020
How To Install Elasticsearch, Logstash and Kibana on Ubuntu 18.04
How To Install Elasticsearch, Logstash and Kibana on Ubuntu 18.04

Requirment
    login: user with root privileges
    OS: Ubuntu 18.04
    RAM: 4GB
    CPU: 2
    Java: Oracle JDK 8 version

The same instructions apply for Ubuntu 17.04/16.04, Linux Mint, Debian, Kubuntu and Elementary OS

Update/upgrade
1. sudo apt update
2. sudo apt-get upgrade -y
-------------------------------------------------------
Install dependencies and java 8
1. sudo add-apt-repository ppa:webupd8team/java
2. sudo apt-get update OR sudo apt update
3. sudo apt install openjdk-8-jdk

Verify the Java
1. java -version
-------------------------------------------------------
ELASTICSEARCH

Install and configure Elasticsearch
1. cd /tmp
2. wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.5.2-amd64.deb
3. sudo dpkg -i elasticsearch-7.5.2-amd64.deb

Elasticsearch configuration file
1. sudo nano /etc/elasticsearch/elasticsearch.yml
network.host to [local, eth0]
nano /etc/init.d/elasticsearch

Locate the line:
# network.host: localhost

start and enable the service
1. sudo systemctl enable elasticsearch.service
2. sudo systemctl start elasticsearch.service
       sudo systemctl status elasticsearch.service
OR
/etc/init.d/elasticsearch start
3. /etc/init.d/elasticsearch status


Verify Elasticsearch
1. curl -X GET "localhost:9200/"

open web browser
1. http://server_ip:9200/ or http://localhost:9200/

docker run -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:5.0.0
-------------------------------------------------------
KIBANA

Now, Install and configure Kibana
1. cd /tmp
2. wget https://artifacts.elastic.co/downloads/kibana/kibana-7.5.2-amd64.deb
3. sudo dpkg -i kibana-7.5.2-amd64.deb

Configuration file Kibana
1. sudo nano /etc/kibana/kibana.yml

    Locate the following lines:
#server.host: "localhost"
#elasticsearch.url: "http://localhost:9200"
to
Change those lines to:
server.host: "SERVER_IP"
elasticsearch.hosts: "http://SERVER_IP:9200"

1. sudo sysctl -w vm.max_map_count=262144

start and enable the service
1. sudo systemctl enable kibana.service
2. sudo systemctl start kibana.service
3. sudo systemctl status kibana.service

open web browser
1. http://server_ip:5601/ or ip_address:5601
-------------------------------------------------------

LOGSTASH

Now, Install and configure Logstash
1. cd /tmp
2. wget https://artifacts.elastic.co/downloads/logstash/logstash-7.5.2.deb
3. sudo dpkg -i logstash-7.5.2.deb

Configuration file logstash
1. sudo nano /etc/logstash/logstash.yml

Locate the line:
# http.host: "127.0.0.1"

start and enable the service
1. sudo systemctl enable logstash.service
2. sudo systemctl start logstash.service
3. sudo systemctl status logstash.service

Monday, October 21, 2019

How to Upgrade MariaDB 5.5 to MariaDB 10.4 on CentOS/RHEL 7, Ubuntu 19.10 & Debian 9

October 21, 2019
How to Upgrade MariaDB 5.5 to MariaDB 10.4 on CentOS/RHEL 7, Ubuntu 19.10 & Debian 9
 
 




MariaDB is a famous MySQL community fork that gained lots of popularity after Oracle acquisition of the MySQL project.

Website:- https://downloads.mariadb.org/mariadb/+releases/

In this tutorial we are going to show you how to upgrade MariaDB 5.5 to MariaDB 10.4.8 latest stable version. You will need to have root access to the machine, where you will be performing the upgrade.

For example MariaDB 5.1 -> 5.5 -> 10.4.8

1. Backup or Dump All MariaDB Databases

As always when performing an upgrade creating backup of your existing databases is important.

You can either dump the databases with command such:
Step1:-  mysqldump -u root -ppassword --all-databases > /tmp/all-database.sql

Or alternatively, you can stop the MariaDB service with:
Step2:-  systemctl stop mysql

And copy the databases directory in a separate folder like this:
Step3:-  cp -a /var/lib/mysql/  /var/lib/mysql.bak


In case of failure of the upgrade you can use one of the above copies to restore your databases.

2. Add the MariaDB Repositorypackages are up to date

Step4:- yum update  [Redhat Linux, CentOS & Fedora]

Step5:- apt-get update  [Ubuntu, Linux Mint & Debian ]

On Redhat Linux, CentOS  & Fedora 
Step6:- vim /etc/yum.repos.d/MariaDB10.repo

Add the following text in it:
# MariaDB 10.1 CentOS repository list - created 2016-01-18 09:58 UTC
# http://mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.1/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

On Ubuntu, Linux Mint & Debian

Run the following series of commands to add the MariaDB PPA on your system:

Step7:- apt-get install software-properties-common

Step8:- apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:800xcbcb082a1bb943db

Step9:- add-apt-repository 'deb [arch=amd64,i386] http://kartolo.sby.datautama.net.id/mariadb/repo/10.1/ubuntu wily main'

Important: Don’t forget to replace the ubuntu wily with your distribution name and release.

3. Remove MariaDB 5.5

Step10:- yum remove mariadb-server mariadb mariadb-libs   [On On Redhat Linux, CentOS & Fedora]

Step11:- apt-get purge mariadb-server mariadb mariadb-libs  [On Ubuntu, Linux Mint & Debian]



Next, clean the repository cache:
Step12:-  yum clean all    [On Redhat Linux, CentOS & Fedora]
Step13:- apt-get clean all      [On Ubuntu, Linux Mint & Debian]

4. Installing MariaDB 10.4.8
Now it’s time to install the newer version of MariaDB, by using:

Step14:-  yum -y install MariaDB-server MariaDB-client   [On Redhat Linux, CentOS & Fedora]
Step15:-  apt-get install mariadb-server MariaDB-client     [On Ubuntu, Linux Mint  & Debian]

Start the MariaDB service
Step16:- systemctl start mariadb

MariaDB to automatically start after system boot
Step17:- systemctl enable mariadb

Finally run the upgrade command to upgrade MariaDB
Step18:- mysql_upgrade

To verify that the upgrade was successful
Step19:- mysql -V



How to Install Amazon Kindle Cloud Reader App on Ubuntu, Linux Mint & Debian

October 21, 2019
How to Install Amazon Kindle Cloud Reader App on Ubuntu, Linux Mint & Debian

How to Install PlayOnLinux
Step1 :- Install PlayOnLinux

Download Amazon Kindle For PC (Windows)
Step2 :- wget http://kindleforpc.amazon.com/40514/KindleForPC-installer.exe

Step3 :- Launch PlayOnLinux > Click on Install > Search for Amazon Kindle

Step4 :- Login with your Amazon account

Another Alternative Method

You can go to http://read.amazon.com, sign in and it will download your selected books which you can read in Firefox or Chrome when you're offline.

They've done a pretty decent job on how it works and no installation of extra software is needed.