Posts

Showing posts from September, 2020

How to reset the Drupal 8 admin user frontend password?

Image
In this post we will know, how can we reset the Drupal 8 frontend admin user password. It is very easy just you have the server access to run the following commands -  Generate a new password  First, you have to generate a password hash that is valid for your site. Execute the following commands from the command line, in the Drupal 8 root directory:  php core/scripts/password-hash.sh 'your-new-pass-here' Output:  password: your-new-pass-here hash: $S$EV4QAYSIc9XNZD9GMNDwMpMJXPJzz1J2dkSH6KIGiAVXvREBy.9E   Be careful not to include more or less characters as the hash. These hashes look somewhat like -   $S$EV4QAYSIc9XNZD9GMNDwMpMJXPJzz1J2dkSH6KIGiAVXvREBy.9E.   We will use the generated password later.  Update the user password.  Now you need to update the user password, in our case we need update the Administrator password, fortunately the UID for Administrator is 1 equal to previous versions of Drupal.   With the new password we need run the following SQL statement UPDATE users

How to deploy Java Springboot application in Ubuntu 16.04/18.04

Image
  Hello Friends Today, I am going to show you how can we deploy a Java Spring-boot application in Ubuntu 16.04/18.04 Step 1: SSH to your server Step 2: Once you logged into server, update the Ubuntu packages sudo apt-get update Step 3: Install the Java package. It is required to run Jenkins. To add the PPA, It contains the Java sudo add-apt-repository ppa:webupd8team/java Press Enter key to continue. It will created the keyring Step 4: Update and Package after keyrings added and Run the Java Installation sudo apt-get update sudo apt install oracle-java8-installer Step 6: Click OK to accept License Agreement Click Yes to accept Oracle Binary Code License terms. Verify the installed Java version java -version javac -version Step 7: Next, we will install the maven, as it is the build tool for Java applications. sudo apt-get install maven -y Step 8: Now as we are going to deploy Java Spring-boot application. For this demo in going to clone a sample Java Spring-boot application from the GIT

Ubuntu default Firewall UFW (Uncomplicated Firewall) Command-Line

Image
  UFW - Uncomplicated Firewall The default firewall configuration tool for Ubuntu is ufw. Developed to ease iptablesfirewall configuration, ufw provides a user friendly way to create an IPv4 or IPv6 host-based firewall. By default UFW is disabled. Gufw is a GUI that is available as a frontend. Basic Syntax and Examples Default rules are fine for the average home user When you turn UFW on, it uses a default set of rules (profile) that should be fine for the average home user. That's at least the goal of the Ubuntu developers. In short, all 'incoming' is being denied, with some exceptions to make things easier for home users. Enable and Disable  Enable UFW  To turn UFW on with the default set of rules:  sudo ufw enable To check the status of UFW:  sudo ufw status verbose The output should be like this: youruser@yourcomputer:~$ sudo ufw status verbose  sudo] password for youruser:  Status: active  Logging: on (low)  Default: deny (incoming), allow (outgoing)  New profiles: ski

Firewalld Command - Useful firewall-cmd Examples (RHEL based)

Image
  Image Source: techmint Useful firewall-cmd Examples  (Source: thegreekdiary.com) 1. List all zones Use the following command to list information for all zones. Only partial output is displayed.  firewall-cmd --list-all-zones Output: work  target: default  icmp-block-inversion: no  interfaces:  sources:  services: dhcpv6-client ssh  ports:  protocols:  masquerade: no  forward-ports:  sourceports:  icmp-blocks:  rich rules: drop  target: DROP  icmp-block-inversion: no  interfaces:  sources:  services:  ports:  protocols:  masquerade: no forward-ports:  sourceports:  icmp-blocks:  rich rules:  ..... Public is the default zone set, if you do not change it. To check the currently set default zone use the below command: firewall-cmd --get-default-zone public 2. List allowed service and ports on the system To show currently allowed service on your system use the below command.  firewall-cmd --list-services dhcpv6-client ssh   To list the ports that are open on your system:  firewall-cmd --l

How to deploy NODE.JS application on Ubuntu 16.04/18.04

Image
Hi Friends, Today, we are going to deploy NodeJS sample application from GITHUB so you have a basic idea, How can we deploy NodeJS application in Ubuntu 16.04/18.04 Requirement:  Installation of NodeJS  Installation of GIT (If not installed)  GITHUB Sample application URL – https://github.com/contentful/the-example-app.nodejs Step 1: Install the curl package  [If not already installed] sudo apt-get update sudo apt-get install curl -y Step 2: Add the NodeJS PPA for install the NodeJS curl -sL https://deb.nodesource.com/setup_8.x | sudo bash -     [PPA for Long Term Support (LTS) version] Step 3: Install the NodeJS package sudo apt-get install nodejs -y Step 4: Clone the repository to root directory sudo -i git clone https://github.com/contentful/the-example-app.nodejs.git Step 5: Now install the npm package from where package.json is – cd the-example-app.nodejs npm install Step 6: Now finally run the NodeJS application [this application will run on port 3000, make sure port allow on Fir

How to setup Ansible and setup a lab of simple Ansible Playbook?

Image
  How to install Ansible on Ubuntu 18.04/16.04/14.04 First step: Update the Ubuntu packages sudo apt-get update ; apt-get upgrade Now install Ansible by simple command sudo apt-get install ansible Verify the Ansible and Python Installed or not ansible --version python --version Create an inventory file where added all the host. Like – inventory [webserver] 52.66.239.76 52.66.235.128 13.233.67.129 # 13.233.122.239 ansible_user=ec2-user # 13.127.93.201 ansible_user=ec2-user Before proceed. We will generate and ssh public to which will be added to our all host in authorize_keys. To generate the ssh public key on Ansible machine. We will run the following command. ssh-keygen This command with generate a id_rsa.pub and id_rsa key under .ssh folder. We will copy the contents of id_rsa.pub and paste in each hosts mentioned under inventory file and append the contents under host user .ssh/authorize_keys. Make sure host_key_ckecking = flase is to be uncommented. (This line is in file under /etc