In this tutorial, I will install Odoo version 13/14 on Docker Container. Odoo is a suite of well-known open-source business software that covers all your company needs: CRM, eCommerce, inventory, point of sale, project … Next, we will install Odoo on Docker Container
Install Odoo on Docker Container
OS Host: Centos 7
Docker image: odoo:14 and Postgres
Install Odoo Docker Image
To install Odoo use the command below:
#For odoo version 14
docker pull odoo:14
# For Oddo 13
docker pull odoo:13
Install PostgreSQL Database Docker Image
Use the command below:
docker pull postgres
The output terminal is as follows:
Create Database Container
docker run -d -v odoo-db:/var/lib/postgresql/data -e POSTGRES_USER=odoo -e POSTGRES_PASSWORD=odoo -e POSTGRES_DB=postgres --name db postgres
Note:
odoo-db:/var/lib/postgresql/data – store the database data. This means after remove the container, odoo data will remain.
POSTGRES_USER=odoo– A User created for database
POSTGRES_PASSWORD=odoo – Password for the created database user
In this tutorial, How to check the dependencies of the package in Ubuntu.
How to Check Package Dependencies in Ubuntu
The default package manager in Ubuntu and Debian-based distros is APT. There are several ways to get the list of Dependencies of a Package in Ubuntu
APT Package Manager
The basic syntax of the command
sudo apt depends package_name
For example, How to check dependencies for the Nginx package
sudo apt depends nginx
The output terminal is as below
Alternatively, You can use apt-cache command
To list the dependencies of a package in Ubuntu, you can use the apt-cache command. The apt-cache command provides information about packages available in the repositories.
Please note that you may need administrative privileges (e.g., using sudo) to execute apt-cache commands.
Here’s how you can list the dependencies of a package:
sudo apt-cache depends nginx
The output terminal is as below
To get additional information on a specific package
sudo apt show nginx
sudo apt-cache show nginx
Using dpkg
If you have downloaded a DEB package on your system and want to know which dependencies will be installed along with the package
Terraform aws get started. In this tutorial, we’ll guide you through the basics of using Terraform to set up and manage your AWS resources efficiently. Terraform, a powerful Infrastructure as Code (IaC) tool, allows you to define your cloud infrastructure in configuration files, making it easier to automate and maintain.
Whether you’re new to Terraform or looking to enhance your AWS deployment strategies, this guide will provide you with essential steps and best practices to get you up and running quickly. Let’s dive into the world of Terraform on AWS and simplify your cloud infrastructure management.
Step-by-Step Guide: Terraform aws get started
Create a new AWS free tier.
Setup MFA for the root user.
Create new Admin user and configure MFA.
Install and configure AWS CLI on Mac/Linux and Windows
aws configure --profile devopsroles-demo
AWS Access Key ID [None]: XXXXZHBNJLCKKCE7EQQQ
AWS Secret Access Key [None]: fdfdfdfd43434dYlQ1il1xKNCnqwUvNHFSv41111
Default region name [None]:
Default output format [None]:
Install Terraform
Link download here: Download Terraform – Terraform by HashiCorp
After install Terraform.
C:\Users\HuuPV>terraform --version
Terraform v1.0.6
on windows_amd64
Your version of Terraform is out of date! The latest version
is 1.0.7. You can update by downloading from https://www.terraform.io/downloads.html
Conclusion
You have installed and configured Terraform AWS labs. I hope will this your helpful. Thank you for reading the DevopsRoles page! Terraform aws get started.
In this tutorial, How to Run a Local Shell Script on a Remote SSH Server. You can pass entire scripts over SSH without having the .sh file on the remote Linux server.
To run a local shell script on a remote SSH server, you can use the ssh command with the following syntax:
ssh user@remote_host 'bash -s' < local_script.sh
Here’s a breakdown of the command:
user: Replace this with the username for the remote SSH server.
remote_host: Replace this with the IP address or hostname of the remote SSH server.
local_script.sh: Replace this with the path to your local shell script that you want to run on the remote server.
Linux commands are powerful tools that allow users to interact with the operating system and perform various tasks efficiently. Whether you’re a beginner or an experienced Linux user, having a cheat sheet of commonly used commands can be invaluable. In this blog post, we’ll provide you with a handy Linux commands cheat sheet to help you navigate through your Linux journey.
System Information
Linux Commands cheat sheet for System Information. You want to query information about your system.
Commands
Description
For example
whoami
Output the current user using the Linux system
[vagrant@localhost ~]$ whoami vagrant
w
who or which systems are online especially
[vagrant@localhost ~]$ w 20:29:06 up 3 min, 1 user, load average: 0.00, 0.00, 0.00 USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT vagrant pts/0 10.0.2.2 20:27 2.00s 0.01s 0.00s w
cal
Outputs the present month’s calendar.
[vagrant@localhost ~]$ cal September 2021 Su Mo Tu We Th Fr Sa 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 27 28 29 30
date
Displaying the current date and time.
[vagrant@localhost ~]$ date Tue Sep 21 20:30:00 +07 2021
last reboot
A useful command of how many times your system restarted.
[vagrant@localhost ~]$ last reboot reboot system boot 3.10.0-1127.el7. Tue Sep 21 20:25 – 20:30 (00:04) reboot system boot 3.10.0-1127.el7. Tue Sep 21 14:42 – 17:26 (02:44) reboot system boot 3.10.0-1127.el7. Sat Sep 18 20:56 – 22:00 (01:03) reboot system boot 3.10.0-1127.el7. Sat Sep 18 14:37 – 22:00 (07:22) wtmp begins Sat Sep 18 14:37:54 2021
hostname -I
Outputs the assigned IP address your system is currently
Outputs information about the CPU and processing units.
[vagrant@localhost ~]$ lscpu Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian CPU(s): 1 On-line CPU(s) list: 0 Thread(s) per core: 1 Core(s) per socket: 1 Socket(s): 1 NUMA node(s): 1 Vendor ID: GenuineIntel CPU family: 6 …..
lsscsi
Lists out the SCSI/SATA devices like hard drives and optical drives.
[vagrant@localhost ~]$ lsscsi [0:0:0:0] disk ATA VBOX HARDDISK 1.0 /dev/sda
These commands should help you gather hardware information about your Linux system. By utilizing them, you can gain insights into the components and configurations of your machine.
Networking
Here are some commonly used commands to gather networking information in Linux:
Commands
Description
For example
ping hostname_or_IP
Useful in analyzing the responsiveness of a hostname connected to a network.
[vagrant@localhost ~]$ ping 192.168.3.4 PING 192.168.3.4 (192.168.3.4) 56(84) bytes of data. 64 bytes from 192.168.3.4: icmp_seq=1 ttl=64 time=0.017 ms 64 bytes from 192.168.3.4: icmp_seq=2 ttl=64 time=0.021 ms 64 bytes from 192.168.3.4: icmp_seq=3 ttl=64 time=0.021 ms
tcpdump
Used to dump network traffic.
[vagrant@localhost ~]$ sudo tcpdump -i eth0
netstat -r -v
Prints network routing, information, and connections.
[vagrant@localhost ~]$ netstat -r -v Kernel IP routing table Destination Gateway Genmask Flags MSS Window irtt Iface default gateway 0.0.0.0 UG 0 0 0 eth0 10.0.2.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 172.17.0.0 0.0.0.0 255.255.0.0 U 0 0 0 docker0 192.168.3.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
ip addr show
Outputs network interfaces and their related IP addresses.
ifconfig
Outputs configured network interfaces’ IP addresses.
whois domain_name
Reveals more information regarding an active domain name on the internet.
[vagrant@localhost ~]$ host huuphan.com huuphan.com has address 104.21.73.16 huuphan.com has address 172.67.137.70 huuphan.com has IPv6 address 2606:4700:3032::6815:4910 huuphan.com has IPv6 address 2606:4700:3031::ac43:8946 huuphan.com mail is handled by 10 aspmx2.googlemail.com. huuphan.com mail is handled by 1 aspmx.l.google.com. huuphan.com mail is handled by 5 alt1.aspmx.l.google.com. huuphan.com mail is handled by 10 aspmx3.googlemail.com. huuphan.com mail is handled by 5 alt2.aspmx.l.google.com.
wget file_name
Useful in downloading a file from a specified domain name
wget https://www.huuphan.com/filename.zip
ifconfig -a
Outputs all the network interface details
ifconfig eth0
Outputs eth0 configuration and address details.
ethtool eth0
Used to manage hardware and network drivers query and control settings
[vagrant@localhost ~]$ ethtool eth0 Settings for eth0: Supported ports: [ TP ] Supported link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full 1000baseT/Full Supported pause frame use: No Supports auto-negotiation: Yes Supported FEC modes: Not reported Advertised link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full 1000baseT/Full Advertised pause frame use: No Advertised auto-negotiation: Yes Advertised FEC modes: Not reported Speed: 1000Mb/s Duplex: Full Port: Twisted Pair PHYAD: 0 Transceiver: internal Auto-negotiation: on MDI-X: off (auto) Cannot get wake-on-lan settings: Operation not permitted Current message level: 0x00000007 (7) drv probe link Link detected: yes
These commands should help you gather networking information in Linux, enabling you to troubleshoot network issues, check connections, and analyze network configurations.
Archives and File Compression
Archiving and file compression are common tasks in Linux that help to organize and reduce the size of files. Here are some commonly used commands for archives and file compression:
Commands
Description
For example
tar cvf compressed_file_name.tar file_name # creating tar xvf compressed_file_name.tar file_name # extracting
creating or extracting files with .tar
[vagrant@localhost ~]$ tar cvf share.tar share share/ [vagrant@localhost ~]$ tar xvf share.tar share/
tar czf compressed_file_name.tar.gz
compresses a tar file into a gzip archive.
tar cjf archive.tar.bz2 folder
compresses a tar file inside a bz2 archive.
[vagrant@localhost ~]$ tar cjf archive.tar.bz2 share [vagrant@localhost ~]$ ll total 20 -rw-rw-r–. 1 vagrant vagrant 150 Sep 23 07:51 archive.tar.bz2
tar xjf archive.tar.bz2
extracts a tar file compressed inside a bz2 archive.
gzip, gunzip, zcat file_name
creating, extracting. or viewing files with .gz extension
These commands should help you perform file compression, archiving, and extraction tasks in Linux. The specific options may vary depending on the command and the desired operation.
Installing Packages
Installing packages is a fundamental task in Linux for adding new software and libraries to your system. The method of package installation can vary depending on the Linux distribution you are using. Here, I’ll provide an overview of package management tools commonly used in different distributions:
Commands
Description
For example
yum search keyword
Search a package installation based on specific keywords.
[vagrant@localhost ~]$ yum search nginx Loaded plugins: fastestmirror Determining fastest mirrors base: mirror.vietnix.vn epel: mirror.xeonbd.com extras: mirror.vietnix.vn updates: mirror.vietnix.vn =============== N/S matched: nginx ========== collectd-nginx.x86_64 : Nginx plugin for collectd munin-nginx.noarch : NGINX support for Munin resource monitoring nginx-all-modules.noarch : A meta package that installs all available Nginx modules nginx-filesystem.noarch : The basic directory layout for the Nginx serve ……
yum install package.rpm
The use of a YUM package manager to install and configure a package.
yum info package
To find more information about a package before optionally proceeding with its installation.
[vagrant@localhost ~]$ yum info nginx Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile base: mirror.vietnix.vn epel: mirror.xeonbd.com extras: mirror.vietnix.vn updates: mirror.vietnix.vn Available Packages Name : nginx Arch : x86_64 Epoch : 1 Version : 1.20.1 Release : 2.el7 Size : 586 k Repo : epel/x86_64 Summary : A high performance web server and reverse proxy server URL : https://nginx.org License : BSD Description : Nginx is a web server and a reverse proxy server for HTTP, SMTP, POP3 and : IMAP protocols, with a strong focus on high concurrency, performance and low : memory usage.
rpm -i package.rpm
To install a downloaded RPM package.
yum remove package
To uninstall or remove a Yum package from your system.
tar zxvf sourcecode.tar.gz cd sourcecode ./configure make make install
Command sequence to install a package software that comes as a source code.
dnf install package.rpm
Using the DNF package manager to install package software.
apt install package
Using the APT package manager to install package software.
rpm -e package.rpm
Using the RPM package manager to remove or uninstall an rpm package
Remember to use the sudo command before installation commands to execute them with administrative privileges.
Search Commands
Searching for files, directories, and text within files is a common task in Linux. Here are some commonly used search commands:
These commands should help you search for files, directories, and text within files on your Linux system. You can customize the search criteria based on your specific requirements.
SSH Logins
SSH (Secure Shell) is a widely used protocol for securely accessing remote systems over a network. Monitoring SSH logins can be important for security and auditing purposes. Here’s how you can view SSH login information:
Commands
Description
For example
ssh user_name@hostname
Connects you to a remote machine or server
ssh host
Connects you to a specified host through the default port 22.
ssh -p port user_name@hostname
Connects you to a remote machine or server through a specified port.
telnet hostname
Uses telnet’s default port 23 to connect you to a target hostname, remote machine, or server.
File Transfers and Management
File transfers and management are common tasks in Linux for organizing, moving, copying, and transferring files between different locations. Here are some commonly used commands for file transfers and management:
Commands
Description
For example
rm -r -f
To remove or delete active files and directories
du -s
Give important information regarding the disk usage (storage space) on your Linux system.
[vagrant@localhost ~]$ du -s /home/vagrant 60 /home/vagrant
Used for moving directories or files to a different system path or location.
grep, egrep, fgrep -i -v
Useful in printing lines with a matching pattern.
scp file.txt server:/tmp
To copy files to a remote server.
scp server:/home/vagrant/*.txt /tmp
to copy files from a remote server to a directory on a local machine.
scp -r server:/home/vagrant /tmp
recursively copy all the files and directories on a remote server’s directory to a target machine directory.
rsync -a /var/www /backups/
Synchronizes the content of two directories (/var/www and /backups) on the same machine.
rsync -avz /home/vagrant server:/backups/
synchronizes the content of a folder on a local machine with the content of a folder on a remote server.
These commands should help you with basic file transfers, copying, moving, renaming, and deleting files and directories in Linux. Remember to use appropriate options and double-check before performing any destructive operations like removing or overwriting files.
File and Directory Operations
Working with files and directories is a common task in Linux. Here are some commonly used commands for file and directory operations:
Commands
Description
ls
list the files and directories under and directory path.
pwd
print working directory
mkdir dir_name
create a directory with the specified name.
rm filename
delete a file with the specified name.
rm -rf directory_name
recursively and forcefully delete a directory with the specified name.
cp filename1 filename2
copy filename1 to filename2
cp -r directory1 directory2
recursively copy the content of directory1 to directory2
mv filename1 filename2
rename filename1 to filename2
ln -s /path/to/file_name link_name
To create a symbolic link (link_name) to a specified file name (file_name).
touch filename
to create a new file
more filename
open and display the contents of a specified file.
cat filename
open and display the contents of a specified file.
cat filename1 >> filename2
appends or adds the content of filename1 at the bottom of filename2.
head filename
Outputs the first ten lines of a specified file name.
tail filename
Outputs the last ten lines of a specified file name.
gpg -c filename
to encrypt a specified file.
gpg filename.gpg
to decrypt a specified file with a .gpg extension.
wc filename
Outputs the number of bytes, lines, and words of a specified file name.
cd
Takes you to the Home directory
cd /target/directory
To change directories to a specific directory name.
These commands should help you perform common file and directory operations in Linux. Be careful when using commands like “rm” or “rmdir” to avoid accidental deletion of important files or directories.
Disk Utilities and Usage
Monitoring disk usage and managing disk-related tasks are essential in Linux to ensure efficient use of storage space. Here are some commonly used disk utilities and commands for disk management and usage:
Commands
Description
For example
df -h
Display the amount of free space in the file system
Outputs the target mount point associated with all your file systems.
mount device_path mount_point
to mount a device.
mkfs -t -V
to create a new file system.
resize2fs
updating a file system, especially after lvextend*
fsck -A -N
to check and repair a file system.
pvcreate
creating a physical volume.
mount -a -t
mounting a file system.
lvcreate
creating a logical volume.
unmount -f -v
unmounting a mounted file system.
These commands and utilities will help you monitor disk usage, manage partitions, mount file systems, and perform disk-related tasks in Linux. Make sure to use appropriate administrative privileges, such as “sudo,” when required.
Environment Variables
Commands
Description
For example
env
Display all exported environment or run a program in a modified environment
This tutorial covers how to record Linux terminal commands using the scriptcommand.
This command allows you to record and replay all the activity in your terminal.
Using scriptcommands can be especially helpful when you want to create a tutorial for a set of commands.
Record Linux Terminal Commands
The script command can be run without any arguments
script
A new capturing session will start. your terminal session is saved to ./typescipt in your working directory. When you’re done, press Ctrl+D or type the exit command to drop out of the sub-shell.
The output terminal is as follows
[vagrant@localhost ~]$ script
Script started, file is typescript
[vagrant@localhost ~]$ ls
share typescript
[vagrant@localhost ~]$ whoami
vagrant
[vagrant@localhost ~]$ exit
exit
Script done, file is typescript
[vagrant@localhost ~]$
[vagrant@localhost ~]$ cat typescript
Script started on Sat 18 Sep 2021 08:59:49 PM +07
[vagrant@localhost ~]$ ls
share typescript
[vagrant@localhost ~]$ whoami
vagrant
[vagrant@localhost ~]$ exit
exit
Script done on Sat 18 Sep 2021 09:00:09 PM +07
[vagrant@localhost ~]$
You can specify a different file with a script that commands an argument:
script session_`hostname`_`whoami`
The following is the output from the terminal command:
[vagrant@localhost ~]$ script session_`hostname`_`whoami`
Script started, file is session_localhost.localdomain_vagrant
[vagrant@localhost ~]$ cat /etc/redhat-release
CentOS Linux release 7.8.2003 (Core)
[vagrant@localhost ~]$ exit
Script done, file is session_localhost.localdomain_vagrant
[vagrant@localhost ~]$
Appending to an Existing File
Use -a flag to append your commands.
script -a session_`hostname`_`whoami`
Conclusion
You have Record Linux Terminal Commands. I hope will this your helpful. Thank you for reading the DevopsRoles page!
In this tutorial, How to Pass environment variables to Docker containers. You need to pass environment variables to docker containers as a running instance of Docker. I use Docker images Postgres Databases.
Set environment variables to Docker containers
We will set a variable DB_USER and DB_PASSWORD as follows:
[vagrant@localhost ~]$ sudo docker pull ubuntu
Using default tag: latest
latest: Pulling from library/ubuntu
35807b77a593: Already exists
Digest: sha256:9d6a8699fb5c9c39cf08a0871bd6219f0400981c570894cd8cbea30d3424a31f
Status: Downloaded newer image for ubuntu:latest
docker.io/library/ubuntu:latest
[vagrant@localhost ~]$
Conclusion
You have fixed Error Pulling Image Configuration: Get Https://Xxxx : Net/Http: TLS Handshake Timeout. I hope will this your helpful. Thank you for reading the DevopsRoles page!