CyberKeeda In Social Media
Showing posts sorted by relevance for query ubuntu. Sort by date Show all posts
Showing posts sorted by relevance for query ubuntu. Sort by date Show all posts

How to Upgrade Ubuntu 16.04 to Ubuntu 18.04


For Linux Desktop users, this is the trending stuff all going into the Linux World.
Of Course there are a hundreds of Linux distros, but Ubuntu is one of the popular one as per distrowatch.

Ubuntu provids two types of releases

  • Standard release. 
  • Long Term Support (LTS) release. 


So what's the difference between these two ?
All it's support provided by Ubuntu aka Canonical
Standard releases for approx 1 year while Long Term Support is useful for approx 5 years.

Ubuntu 18.04 is an LTS release will be supported till 2023. 

If you are also a Ubuntu Desktop Fan and running Ubuntu 16.04, why wait let's upgrade.

But if you are running ubuntu 16.04 within your server, i recommend you to wait for a minimum of two months from release date.

Backup your data first.

We strongly recommended to backup all your important data from your Desktop to a remote location or into some external storage.

Update all your system packages.

sudo apt-get update
sudo apt-get upgrade

Install Update Manager 

sudo apt-get get install update-manager-core
Once the update-core-manager package has been installed, let's ensure it's config file is set to LTS
Open the file /etc/update-manager/release-upgrades file and make sure Prompt value is set to lts like below.
Prompt=lts

Upgrade your  Ubuntu from 16.04 to 18.04

Once you are done with the updation of file /etc/update-manager/release-upgrades updation , you are all set to upgrade your UBuntu to newer version of LTS that is 18.04.
sudo do-release-upgrade -d 
Once you have executed the upgrade command, you must stick to your computer for some more few minutes.
It will ask for few inputs from your side,  follow the prompts and choose the default ones, the entire upgrade time duration is totally dependent on your internet connectivity speed.

Once completed,  reboot your System and verify your Ubuntu Version.

lsb_release -a
You must see something like below


Distributor ID: Ubuntu
Description: Ubuntu 18.04 LTS
Release: 18.04
Codename: bionic

Read more ...

How to Create Windows 10 Bootable USB on Ubuntu or any Linux desktop



Are you looking for any desktop application on Ubuntu to create a bootable pendrive/flash drive with Windows.

WoeUSB is a simple tool that enable you to create your own usb stick windows installer from an iso image or a real DVD.


WoeUSB  package contains two programs:
  • woeusb: A command-line utility that enables you to create your own bootable Windows installation USB storage device from an existing Windows Installation disc or disk image
  • woeusbgui: A GUI wrapper of woeusb based on WxWidgets


So, lets know how install the WoeUSB on Ubuntu 
Official & updated Installation and Github link : Here
#    sudo add-apt-repository ppa:nilarimogard/webupd8
#    sudo apt update
#    sudo apt install woeusb
In case if you wish to remove that woeusb PPA, remove it from the bellow command.
#    sudo add-apt-repository --remove ppa:nilarimogard/webupd8
#    sudo apt-update
Now, WoeUSB has installed on my Ubuntu, though the interface is self explanatory still let's move ahead and know how to use it.

Open WoeUSB application and choose the USB drive and your windows iso kept within your Ubuntu.
Once you are done click install and you are done, you can monitor the progress on screen.


In case you receive a error dialogue like below, follow the below steps

Find your USB drive's mounted file system and block by running lsblk on terminal and find your device their.
To filter, look for size of your USB or name of the USB drive, below screen shot gives the picture of my USB drive ( 8 GB ) size, and named as /dev/sdc
#    lsblk

So we will unmount that partition out of the system.
Notice there  /dev/sdc is the full size of my USB disk, but the data is witten on it's /dev/sdc1 partition.
My USB disk is  /dev/sdc, ensure your USB is unmounted with the following command. Replace /dev/sdc1 with your own partition name.
#    sudo umount /dev/sdc1
Now try again from the   WoeUSB desktop application.
In case if you are willing to do the same through woeusb CLI utility, here is the way.
#    sudo woeusb -v --device /home/kunal/windows-10.iso /dev/sdc
/home/kunal/windows-10.iso  :  Replace it with your iso location.
/dev/sdc : replace it with your USB drive ( check it from lsblk )
Read more ...

How to install Sublime text editor on Ubuntu


Sublime text editor is one of the popular text editor for code, markup and prose that's the line it says on it's official website  and most of the users believe the same.
So let's know how to install it on your Ubuntu Box.

I'm using Ubuntu 18.04  while writing this blog during installation.

Install the GPG key


  #  wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add -

Make apt work using https also


  #  sudo apt-get install apt-transport-https

Select the channel to use ( Recommended Stable )
For Stable release use the below command.
  #  echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list 

For Development release use the below command.
  #  echo "deb https://download.sublimetext.com/ apt/dev/" | sudo tee /etc/apt/sources.list.d/sublime-text.list

Update apt sources and install Sublime Text


  #  sudo apt-get update #  
  #  sudo apt-get install sublime-text

To remove/uninstall sublime text editor  use the below command


  #  sudo apt-get remove sublime-text && sudo apt-get autoremove #  


Meanwhile you can anytime install it from Ubuntu Software Center,  it's also enlisted there.

Official Installation Link : Here


Read more ...

How to install E-Elasticsearch L-Logstah K-Kibana Stack on Ubuntu Linux

ELK


ELK Stack is one of the most popular log management opensource application.

It is a collection of open-source products including Elasticsearch, Logstash, and Kibana. 

All these 3 products are developed, managed and maintained by an organization named as Elastic. 


ELK Stack all together can manage and parse huge amount of log data, that can be used further for analytical, troubleshooting , central monitoring and alarming purposes using it's efficient GUI.

  • Elasticsearch is a JSON-based search and analytics engine intended for horizontal scalability and easier management.
  • Logstash is a server-side data processing interface that has the capability to collect data from several sources concurrently. It then transforms it, and then sends the data to your desired stash.
  • Kibana is used to visualize your data and navigate the Elastic Stack. 

I think, we got some idea of the components that will be used to build the entire stack.
Let's know how to install, configure and use it on Ubuntu.

Thing to note
  • For now we will be installing ElasticSearch and Kibana on the same sever.
  • To forward logs, we will install filebeat agent on one of the Linux Server.
  • We will forward syslogs here in this demo.

Installation.

  •  Install Java
OpenJDK 8 is available under default Ubuntu APT repositories, simply install Java 8 on an Ubuntu system using the below commands.
$ sudo apt update
$ sudo apt install openjdk-8-jdk openjdk-8-jre
Check Version.
$ java -version
openjdk version "1.8.0_232"
OpenJDK Runtime Environment (build 1.8.0_232-8u232-b09-0ubuntu1~18.04.1-b09)
OpenJDK 64-Bit Server VM (build 25.232-b09, mixed mode)
In case we need to set JAVA's Home directory, let's first determine where is java placed after installation then we will set the environment variable accordingly.
$ sudo update-alternatives --config java
Above command will help us to find the java path, mine look like below one and i will use the same to set my JAVA_Home.

There is only one alternative in link group java (providing /usr/bin/java): /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java Nothing to configure.

Though java is accessible from  /usr/bin/java  in case you still need to set Java home directory follow the below instructions.
$ sudo vim /etc/environment

Paste the above determined path as  JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java" at the end of the file.

$ source /etc/environment
Logout - Login to reflect the changes.
  •  Install and Configure ElasticSearch 
We will start the installation by importing and adding elasticsearch PGP Key following execution of the below commands sequentially to make elasticsearch and Kibana installation through apt-get.
$ wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -

$ sudo apt-get install apt-transport-https

$ echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-7.x.list

$ sudo apt-get update && sudo apt-get install elasticsearch
Now let's modify elasticsearch config file and make some important changes before we start our elasticsearch engine.
$ sudo vim /etc/elasticsearch/elasticsearch.yml

Uncomment “network.host” and “http.port” in order to look the config like below.

 network.host: localhost
 http.port: 9200
Save the file and start elastic search
$ sudo systemctl start elasticsearch
In case if you want to enable it during boot.
$ sudo systemctl enable elasticsearch
Confirm it's working using below curl command.
$ curl -X GET "localhost:9200"
Output will look like something below.
{
  "name" : "ubuntu",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "IoQ9BAgsS2yGxir-C6tf1w",
  "version" : {
    "number" : "7.5.1",
    "build_flavor" : "default",
    "build_type" : "deb",
    "build_hash" : "3ae9ac9a93c95bd0cdc054951cf95d88e1e18d96",
    "build_date" : "2019-12-16T22:57:37.835892Z",
    "build_snapshot" : false,
    "lucene_version" : "8.3.0",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}

So we are done with the elasticsearch installation, lets proceed to install our Kibana Dashboard.

  •  Installation and configuration of Kibana Dashboard.
It's always recommended to install Kibana after elasticsearch, we have already added elastic repository that contains kibana too, we will use apt to install it.
$ sudo apt install kibana
Uncomment the following lines to proceed further.
server.port: 5601
server.host: "localhost"
elasticsearch.hosts: ["http://localhost:9200"]
   
So we are good to start the kibana service too
$ sudo systemctl start kibana
In case you want to enable it during startup/boot.
$ sudo systemctl enable kibana
  •  Installation and configuration of Logstash.
Logstash in general has a purpose to segregate multiple logs and can be used for transformation before it send to elasticserach.

Lets Install and configure to collect logs from our filebeat agent and then sending to elasticsearch.

We can install it using below apt command
$ sudo apt install logstash
Now, lets configure it, we will start by creating few files within logstash's conf.d directory. 
We will start with by creating filebeat input config file
$ sudo cd /etc/logstash/conf.d/

$ sudo vim filebeat-input.conf
Append the below lines within the file and save it.

input {
  beats {
    port => 5443
    type => syslog
  }
}
Now create a new file by name syslog-filter.conf and add the below contents within the file and save it.
This file is responsible to filer logs in order to filer and parse to make it suitable to ingest into elasticsearch document format.
$ sudo cd /etc/logstash/conf.d/

$ sudo vim syslog-filter.conf
filter {
  if [type] == "syslog" {
    grok {
      match => { "message" => "%{SYSLOGTIMESTAMP:syslog_timestamp} %{SYSLOGHOST:syslog_hostname} %{DATA:syslog_program}(?:\[%{POSINT:syslog_pid}\])?: %{GREEDYDATA:syslog_message}" }
      add_field => [ "received_at", "%{@timestamp}" ]
      add_field => [ "received_from", "%{host}" ]
    }
    date {
      match => [ "syslog_timestamp", "MMM  d HH:mm:ss", "MMM dd HH:mm:ss" ]
    }
  }
}
Create another config file for elastic search which will be responsible to ingest data from logstash to elasticsearch
$ sudo cd /etc/logstash/conf.d/

$ sudo vim output-elasticsearch.conf
Insert the below lines and save it.
output {
  elasticsearch { hosts => ["localhost:9200"]
    hosts => "localhost:9200"
    manage_template => false
    index => "%{[@metadata][beat]}-%{+YYYY.MM.dd}"
    document_type => "%{[@metadata][type]}"
  }
}
So we are done with the logstash configuration too, lets start the logstash service too.
$ sudo systemctl start logstash
In case you want to enable it during startup/boot.
$ sudo systemctl enable logstash
  •  Installation and configuration of Filebeat Agent on Client.
Elastic Stack uses lightweight data shippers called Beats to collect data from various sources and transport them to Logstash or Elasticsearch. 

Each beat has been developed to serve specific purpose, some of them are enlisted below.
  • Filebeat: It collects and ships log files.
  • Metricbeat: It collects metrics from your systems and services.
  • Packetbeat: It collects and analyzes network data.
  • Winlogbeat: It collects Windows event logs.
  • Auditbeat: It collects Linux audit framework data and monitors file integrity.
  • Heartbeat: It monitors services for their availability with active probing.
In our current lab setup, we will use the most widely used Filebeat to parse and ship our log file to logstash and there after it will be forwarded to elasticsearch, which can be later used for analyzing data using Kibana

We can install it using below apt command
$ sudo apt install filebeat
Lets modify it's configuration file as per our requirements, let's find and modify the below lines to make it "true".
enabled: true
Now as we will be sending logs to elasticsearch via logstash, not directly to elasticsearch, we will be disabling the output section meant for elasticseach via commenting below lines
#output.elasticsearch:
  # Array of hosts to connect to.
  # hosts: ["localhost:9200"]
Now, we will enable the logstash output section. by uncommenting the below lines.
Since logstash and elasticsearch both are installed within same host, we are using localhost, this can be replaced by elasticsearch server ip/hostname.
output.logstash:
  # The Logstash hosts
  hosts: ["elk-server:5443"]
Save and exit, let's start file beat services and we are ready to ship our logs to elastic search server via logstash and successive to it, we can search our logs at kibana dashboards.
$ sudo systemctl start filebeat
In case you want to enable it during startup/boot.

$ sudo systemctl enable filebeat
Let's explore our kibana dashboard, and we will begin with creating our indexes on it.
Open your browser and open kibana server ip with port (5601)as shown below.
http://<kibana host ip>:5601


Click on "Explore my Own"

Click on Discover ( Left Panel )  then  Create Index.

Within index pattern put a string filebeat-* and click on Next Step

On next window of Step 2 , select or type @timestamp  and we are done.

Let's discover our data ingested within our newly created index, click on Discover again and we can see our data there.





Read more ...

Ubuntu : How to access Android device media files through USB


How to  access Media files from Android device, whether it's internal phone storage or external microSD card.

Steps to access Android Devices in Ubuntu, Linux Mint.

Here MTP stands for Media Transfer Protocol, which comes to existese when we connect our Smartphone through USB cable into computer/laptops.

Just Install libmtp, FUSE file system for MTP enabled devices mtpfs using below commands.

# sudo apt-get install go-mtpfs
sudo apt-get install libmtp
sudo apt-get install mtpfs mtp-tools
mtp-detect 
mtp-detect  ==> Run this command to verify your Android Device.

  • Rejack your Android device using USB cable in Ubuntu.
  • In your Android device, swipe down from above in the home screen and click Touch for more options. 
  • In the next menu, select option “Transfer File (MTP)“.
  • If required then, restart your device manager to
    sudo service udev restart

And you are done :) 




Read more ...

How to install and configure Docker-CE on Ubuntu



Installation.

  • Begin with updating your system packages and remove other versions of docker and it's dependencies.
$  sudo apt-get remove docker docker-engine docker.io containerd runc
$  sudo apt-get update
  • Prepare system to download and install docker-ce from official repositories over https.
$  sudo apt-get install \
    apt-transport-https \
    ca-certificates \
    curl \
    gnupg-agent \
    software-properties-common
$  curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
$  sudo apt-key fingerprint 0EBFCD88

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

  • Once docker repository is enabled, proceed ahead to install Docker-CE ( Community Edition.
$  sudo apt-get update
$  sudo apt-get install docker-ce docker-ce-cli containerd.io

Now docker-ce has been installed, lets start the docker daemon and enable it on boot.
$  sudo systemctl start docker
$  sudo systemctl enable docker
  • To verify the status of  docker, run the below command.
$  sudo systemctl status docker











    • In case, if you want to check your installed docker version.
    $  sudo docker -v

    Run Docker commands without sudo

    By default managing Docker requires administrator privileges. If you want to run Docker commands as a non-root user without adding sudo within yoir command you need to add your user to the docker group which is created during the installation of the Docker CE package. Add your user to docker group by below command.

    $  sudo usermod -aG docker $USER

    Logout- Login to reflect the changes.

    Read more ...

    OpenStack Installation on Ubuntu 16.04 with DevStack


    There are many ways you can create or manage Virtual Machines for your numerous lab environments.
    I can go for traditional approach ether VMware Workstation or Virtual Box but hold on, i thought why don't i go for openstack images.

    This guide will help you to install Openstack Standalone installation on a Ubuntu 16.04 Box.

    Hope you have a good internet speed too, take my words it will work like a charm.

    So first of all you must have a Linux Box with Ubuntu 16.04 OS within it and predefined scripts within DevStack will do the hard stuffs for you.

    Create a user " stack " and give it sudo privileges .

    useradd -s /bin/bash -d /opt/stack -m stack
    

    echo "stack ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
    So once you are done with the above steps, you are ready for the DevStack installation scripts.

    Switch to user stack from terminal.


    su - stack
    Now Download Devstack.

    Since we are using internet directly, we gonna download the latest version on the go from git at all.
    sudo apt-get install git -y || sudo yum install -y git
    git clone https://git.openstack.org/openstack-dev/devstack
    cd devstack

    Once downloaded, switch to devstack directory and make some required configuration changes.

    Copy local.conf file to devstack root directory
    stack@Linux-Maniac:~/devstack$ cp /opt/stack/devstack/samples/local.conf /opt/stack/devstack
    

     Change multiple passwords to one or if you can remember, keep multiple passwords for various utilities too.


    stack@Linux-Maniac:~/devstack$ vim local.conf
    
    So i had the below mentioned changes, you can make it on the same fashion too.
    [[local|localrc]]
    # Minimal Contents
    ADMIN_PASSWORD=redhat
    DATABASE_PASSWORD=$ADMIN_PASSWORD
    RABBIT_PASSWORD=$ADMIN_PASSWORD
    SERVICE_PASSWORD=$ADMIN_PASSWORD

    Once done, save the file and toggle back to the same devstack root directory and run the final script.


    stack@Linux-Maniac:~/devstack$ ./stack.sh 
    
    The entire process can take a time from 30 Min - 1 Hour or more depending upon you network internet speed.

    at the end you can see  something like that.






























    Your IP will vary offcourse, you can now login to your default dashboard login page.

    http://your.ip.here/dashboard
























    Refrnc : Openstack Officials 
    Read more ...
    Designed By Jackuna