<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Zahia Ameziani on Medium]]></title>
        <description><![CDATA[Stories by Zahia Ameziani on Medium]]></description>
        <link>https://medium.com/@zahia.amez?source=rss-5161222660dc------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*n-4TTctjNxlOduZn.jpg</url>
            <title>Stories by Zahia Ameziani on Medium</title>
            <link>https://medium.com/@zahia.amez?source=rss-5161222660dc------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 04:58:10 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@zahia.amez/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Kubernetes — Control plane components]]></title>
            <link>https://medium.com/@zahia.amez/kubernetes-control-plane-components-aaa81201a2e6?source=rss-5161222660dc------2</link>
            <guid isPermaLink="false">https://medium.com/p/aaa81201a2e6</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[kubernetes-cluster]]></category>
            <category><![CDATA[etcdctl]]></category>
            <category><![CDATA[etcd]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Zahia Ameziani]]></dc:creator>
            <pubDate>Fri, 03 Nov 2023 13:00:42 GMT</pubDate>
            <atom:updated>2023-11-03T13:00:42.057Z</atom:updated>
            <content:encoded><![CDATA[<h3>Kubernetes — Control plane components</h3><p>ETCD</p><h3>ETCD</h3><p>ETCD is a distributed key-value store that is often used in the context of managing configuration data and service discovery in distributed systems.</p><p>ETCD is a fundamental component in the Kubernetes control plane that provides reliable storage for the configuration data and state of the entire cluster. It is responsible for implementing locks within the cluster to ensure that there are no conflicts between the Masters.</p><h3><strong>Working with ETCDCTL</strong></h3><p>etcdctl is a command line client for <strong>ETCD.</strong></p><h4>Install ETCD</h4><ol><li>Download the compressed archive file choosing release <a href="https://github.com/etcd-io/etcd/releases/tag/v3.4.16">v3.4.16</a> or later.</li></ol><pre>wget https://github.com/etcd-io/etcd/releases/download/v3.4.16/etcd-v3.4.16-linux-amd64.tar.gz</pre><p>2. Unpack the archive file. This results in a directory containing the binaries.</p><pre>tar -xf etcd-v3.4.16-linux-amd64.tar</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EWy7nnkHX4GGZq8_1v3kQQ.png" /></figure><p>3. Add the executable binaries to your path. For example /usr/local/bin.</p><pre>sudo mv etcd-v3.4.16-linux-amd64/etcd* /usr/local/bin/</pre><p>4. From a shell, test that etcd is in your path</p><pre>etcd --version</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U_Zd-8eGGxiMb5klYEGDaA.png" /></figure><p>To see all the options for a specific sub-command, make use of the<strong> -h or — help</strong> flag.</p><p>For example, if you want to take a snapshot of etcd, use:</p><p>etcdctl snapshot save -h and keep a note of the mandatory global options.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*teMvurajgr4lri2UqI2Bhw.png" /></figure><h3>*****</h3><p>Thank you for reading !!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aaa81201a2e6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kubernetes — Control plane component]]></title>
            <link>https://medium.com/@zahia.amez/kubernetes-control-plane-component-09b0a9112320?source=rss-5161222660dc------2</link>
            <guid isPermaLink="false">https://medium.com/p/09b0a9112320</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[kube-apiserver]]></category>
            <category><![CDATA[kube-api-server]]></category>
            <category><![CDATA[kubernetes-cluster]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Zahia Ameziani]]></dc:creator>
            <pubDate>Tue, 31 Oct 2023 14:21:44 GMT</pubDate>
            <atom:updated>2023-10-31T14:21:44.112Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Kubernetes — </strong>Control plane<strong> component</strong></h3><p>APIServer</p><h3>API Server</h3><p>Acts as the front end for the Kubernetes control plane. The kube-apiserver is at the center of all the different tasks that need to be performed to make a change in the cluster.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8jixms2sSz-ud6FSVVaVzA.jpeg" /></figure><p>The users, management devices, and command line interfaces, all talk to the API server to interact with the Kubernetes cluster.</p><p>The API can be accessed via the kubectl command-line interface or other tools like kubeadm, and via REST calls.</p><h4><strong>Example of creating a pod</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tkKozbOvTadhu_DyVT9CcQ.jpeg" /></figure><ol><li>The request is authenticated first</li><li>The request is validated</li><li>The API server creates a pod object without assigning it to a node</li><li>The API server updates the information in the ECD server and informs the user that the pod has been created</li><li>The scheduler continuously monitors the API server and realizes that there is a new pod with no node assigned. The scheduler identifies the right node to place the new pod on and communicates that back to the kube-apiserver. The API server then updates the information in the ETCD server and passes that information to the kubelet in the appropriate worker node.</li><li>The kubelet then creates the pod on the node and instructs the container runtime engine to deploy the application image. Once done, the kubelet updates the status back to the API server, and the API server then updates the data back in the ETCD server.</li></ol><p>To summarize, the kube-apiserver is responsible for authenticating, validating requests, retrieving and updating data in the ETCD server. In fact, kube-apiserver is the only component that interacts directly with the ETCD server.</p><h3>*****</h3><p>Thank you for reading !!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=09b0a9112320" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kubernetes Architecture Overview]]></title>
            <link>https://medium.com/@zahia.amez/kubernetes-architecture-overview-f52f476caaf2?source=rss-5161222660dc------2</link>
            <guid isPermaLink="false">https://medium.com/p/f52f476caaf2</guid>
            <category><![CDATA[docker-orchestrator]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[kubernetes-cluster]]></category>
            <category><![CDATA[k8s]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Zahia Ameziani]]></dc:creator>
            <pubDate>Mon, 30 Oct 2023 13:09:00 GMT</pubDate>
            <atom:updated>2023-11-15T14:58:39.176Z</atom:updated>
            <content:encoded><![CDATA[<p>Kubernetes cluster architecture — Components and Resources</p><h3>What is Kubernetes?</h3><p>Kubernetes, often abbreviated as K8s is an open-source platform that automates the deployment, scaling, and management of containerized applications. It provides a framework for deploying and managing containers in a distributed environment.</p><p>Kubernetes was originally developed by Google and is now maintained by the Cloud Native Computing Foundation (CNCF).</p><h3>Kubernetes Architecture</h3><p>A Kubernetes cluster has two main components — the control plane and the data plane.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xRjgpb5QATxMoNhdZVZ8MQ.jpeg" /></figure><h4><strong>Control plane — Master nodes</strong></h4><p>Master is a node with Kubernetes installed in it and configured as a master. It is responsible for:</p><ul><li>Managing the cluster nodes.</li><li>Monitoring the cluster nodes.</li><li>Store information about the cluster nodes.</li><li>Orchestration of containers on the worker nodes.</li></ul><p><strong>Master node components:</strong></p><ol><li><a href="https://medium.com/@zahia.amez/kubernetes-control-plane-component-09b0a9112320">kube-APIserver.</a></li><li><a href="https://medium.com/@zahia.amez/kubernetes-control-plane-components-aaa81201a2e6">ETCD.</a></li><li>Kube-Controller-Manager.</li><li>Kube-Scheduler.</li></ol><h4>Data plane Nodes<strong> — Worker Nodes or Minions</strong></h4><p>The data plane consists of the worker nodes in the cluster.</p><p>Nodes are the individual machines (physical or virtual machines) managed by the control plane components and are responsible for running and managing the actual containerized workloads.</p><p><strong>Worker nodes components:</strong></p><ol><li>Kubelet Agent.</li><li>Container Runtime.</li><li>Kube-Proxy</li></ol><p>The separation of the control plane and data plane components is a fundamental design principle in Kubernetes that helps ensure <strong>high availability</strong>, <strong>scalability</strong>, and<strong> fault tolerance</strong>. It allows for centralized management while distributing the workloads across worker nodes in the cluster.</p><h3><strong>Components vs Resources in K8s</strong></h3><p><strong>The resources </strong>are defined in Kubernetes configuration files (<a href="https://medium.com/@zahia.amez/understand-yaml-4c8b6227d2d7">YAML</a>) and represent the objects you create and manage within a Kubernetes cluster. Here’s a list of some of the core resources in Kubernetes:</p><ul><li>Pods.</li><li>Services.</li><li>ReplicationController.</li><li>ReplicaSet.</li><li>Deployment.</li><li>StatefulSet.</li><li>DaemonSet.</li><li>Job, CronJob.</li><li>ConfigMap.</li><li>Secret.</li><li>ServiceAccount.</li><li>Namespace.</li><li>ResourceQuota.</li><li>LimitRange.</li><li>PersistentVolume (PV).</li><li>PersistentVolumeClaim (PVC).</li><li>StorageClass.</li><li>Ingress.</li><li>NetworkPolicy.</li><li>… etc.</li></ul><p><strong>The components </strong>are software components responsible for managing the overall state and operation of the cluster. They make decisions about how resources in the data plane should be scheduled, monitored, and maintained.</p><p>Here’s a list of the components in Kubernetes:</p><ul><li>kube-APIserver.</li><li>ETCD.</li><li>Kube-controller-manager.</li><li>Kube-Scheduler.</li><li>Kubelet Agent.</li><li>Container Runtime.</li><li>Kube-Proxy</li></ul><p>The resources are primarily located in the data plane as they represent the workloads and configurations that you manage, while components are distributed across both the control plane and the data plane. Components play a crucial role in orchestrating, managing, and maintaining the resources in the data plane.</p><h3>*****</h3><p>Thank you for reading!</p><p>If you have any questions, feel free to leave comments.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f52f476caaf2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TLS Basics]]></title>
            <link>https://medium.com/@zahia.amez/tls-basics-2f5fcda7cf41?source=rss-5161222660dc------2</link>
            <guid isPermaLink="false">https://medium.com/p/2f5fcda7cf41</guid>
            <category><![CDATA[tls-certificate]]></category>
            <category><![CDATA[https]]></category>
            <category><![CDATA[ssl-certificate]]></category>
            <category><![CDATA[openssl]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Zahia Ameziani]]></dc:creator>
            <pubDate>Wed, 25 Oct 2023 19:48:00 GMT</pubDate>
            <atom:updated>2023-10-25T20:12:05.870Z</atom:updated>
            <content:encoded><![CDATA[<p>This is a simple tutorial to understand and create SSL/TLS certificate</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/902/1*pNegFmauCd4by0r9PjeR_Q.png" /></figure><h3>Introduction</h3><p>PKI, or <strong>P</strong>ublic <strong>K</strong>ey <strong>I</strong>nfrastructure, is a framework of hardware, software, policies, and standards used to manage digital keys and certificates.</p><p>PKI is a fundamental technology for ensuring the security and integrity of digital communication and transactions, particularly over the Internet.</p><p>Here are some key components and concepts of PKI:</p><ul><li>Public and Private Keys</li><li>Certificate Authority (CA)</li><li>Digital Certificates</li><li>Secure communication</li></ul><h4>Public and Private Keys</h4><p>Public and private keys are essential components of asymmetric cryptography used for security and encryption purposes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/957/1*_lbLrG9B9jo_Pq1OgNGcZw.png" /><figcaption>Asymmetric Encryption</figcaption></figure><h4>Certificate Authority (CA)</h4><p>A Certificate Authority (CA/root certificate) is a trusted entity or organization responsible for issuing digital certificates.</p><h4>Digital Certificates</h4><p>Digital certificates are used in various security protocols and applications, such as SSL/TLS for securing websites, email encryption, digital signatures, and many other scenarios that require authentication and encryption on the internet.</p><p>Digital certificates come in two primary categories: <strong>server certificates</strong> and <strong>client certificates</strong>. These certificates play distinct roles in establishing secure connections and authentication in various network protocols, particularly in SSL/TLS.</p><ul><li><strong>Server certificate:</strong> used to secure the server side of a connection and establish the server’s authenticity. It ensures that clients are connecting to the legitimate server.</li><li><strong>Client certificate:</strong> used to establish the authenticity of the client or user. It ensures that the server can trust the client and that the client has the appropriate permissions to access specific resources or services.</li></ul><h3>Generate a server certificate</h3><ol><li><strong>Generate public and private key</strong></li></ol><p>There are multiple tools to create certificates</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/650/1*-FhUfIn8q_K2oSQ0VdavQQ.png" /></figure><p>In this tutorial, we are going to use OPENSSL tool</p><pre>openssl genpkey -algorithm RSA -out private-key.pem<br>openssl rsa -pubout -in private-key.pem -out public-key.pem</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2x6pUjtKTNkL-JTWv6J08A.png" /></figure><ul><li><strong>openssl</strong>: the command to invoke the OpenSSL tool.</li><li><strong>genpkey</strong>: OpenSSL command for generating private keys.</li><li><strong>algorithm RSA</strong>: generate an RSA private key. RSA is a widely used public-key cryptosystem known for its security and performance.</li><li><strong>out private-key.pem</strong>: specifies the output file, The private key is typically saved in PEM (Privacy Enhanced Mail) format, which is a commonly used format for storing cryptographic keys.</li><li><strong>rsa</strong>: openSSL command for working with RSA keys.</li><li><strong>in private-key.pem</strong>: specifies the input file, which should contain your private RSA key.</li><li><strong>pubout</strong>: This option tells OpenSSL to output the public key.</li></ul><p><strong>2. Create Certificate Signing Request (CSR)</strong></p><p>When creating a Certificate Signing Request (CSR), you need to provide specific information to the Certificate Authority (CA).</p><p>The exact information required may vary depending on the CA and the type of certificate you are requesting.</p><p>The requested information typically includes the following details:</p><ul><li>Country: The two-letter ISO country code (e.g., “EU” for EUROPE).</li><li>State or Province.</li><li>Locality.</li><li>Organization: The legal name of your organization.</li><li>Organizational Unit (OU): The department or division within your organization (e.g., Web Services)</li><li>Common Name (CN): The Fully Qualified Domain Name (FQDN) for which the certificate is being requested.</li><li>Email Address: An email address for contacting the certificate administrator or requester.</li><li>Subject Alternative Names (SANs)<strong>: </strong>If you need to secure multiple domain names or subdomains with a single certificate, you can include Subject Alternative Names in the CSR. These are additional domain names for which the certificate will be valid.</li></ul><pre>openssl req -new -key private-key.pem -out my-csr.pem -days 365</pre><ul><li><strong>req</strong>: this is the OpenSSL command for creating CSRs and managing certificate requests.</li><li><strong>new</strong>: specifies that you are generating a new CSR.</li><li><strong>key</strong>: points to the private key file.</li><li><strong>out</strong>: specifies the output file (the CSR file, in this case).</li><li><strong>days</strong>: specify an expiration date (validity period) for the certificate.</li><li><strong>out my-csr.pem</strong>: specifies the output file where the generated CSR will be saved.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*alDcSYKBKahpT4aSY1PT1A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*urOPWG0GMRvLMJvdzbH2vw.png" /></figure><p>This generates a my-csr.pem file, which is the certificate signing request that should be sent to the CA for signing.</p><p>Verify CSR content</p><pre>openssl req -text -in my-csr.pem</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T9SlIVGrOmbZ9oUbzS2l8Q.png" /></figure><p>Subject must have all DNS names that can be used to access the website.</p><p><strong>3. Sign the CSR</strong></p><p>There is two options to sign CSR :</p><p><strong>a- The certificate authorities</strong></p><p>Recommended for production use as it uses a trusted Certificate Authorities (Cas)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fg0F8Insu3E7E5VaL-ElBw.png" /><figcaption>Example of Certificate Authorities</figcaption></figure><p>The certificate authorities (root certificate) verify your details and once it checks out, they sign the certificate and send it back to you. You now have a certificate signed by a CA that the browsers trust.</p><p>Note that the CAs themselves have a set of public and private key pairs. The CAs use their private keys to sign the certificates. The public keys of all the CAs are built into the browsers. The browser uses the public key of the CA to validate that the certificate was actually signed by the CA themselves.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*90bUNdRTqOszlNR97Vdg-w.png" /><figcaption>Chrome-Example of trusted certificates</figcaption></figure><p><strong>b- Self-signed certificate</strong></p><p>Useful for testing and development environments but are not recommended for production use since they don’t provide the same level of trust as certificates issued by trusted Certificate Authorities (Cas).</p><p>Use the following command to sign the CSR and generate a self-signed certificate:</p><pre>openssl x509 -req -in my-csr.pem -signkey private-key.pem -out self-signed-certificate.pem</pre><ul><li><strong>openssl x509</strong>: This is the OpenSSL command for working with X.509 certificates, which are widely used for secure communication.</li><li><strong>signkey private-key.pem</strong>: indicates that you want to use the private key in private-key.pem to sign the CSR.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j-i2FEZbHlDDOnXVKjT3pA.png" /></figure><p>Verify signed certificate content</p><pre>openssl x509 -in self-signed-certificate.pem -text -noout</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_qR00L7U-_Arc8EnfBtJnA.png" /></figure><p>This command will display information about the self-signed certificate, including its validity period and other details.</p><p><strong>4. Establish a secure communication</strong></p><p>→ The client browser reads the certificate and uses the CAs public key to validate and retrieve the server’s public key and generate symmetric key using server&#39;s public key</p><p>→ Client use symmetric key to encrypt data</p><p>→ The communication between server is established using HTTPS protocol which uses TLS protocol to encrypt data based or RSA algorythm.</p><h3>*****</h3><p>Thank you for reading!</p><p>If you have any questions, feel free to leave comments.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2f5fcda7cf41" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understand Docker — Docker Registry]]></title>
            <link>https://medium.com/@zahia.amez/understand-docker-docker-registry-a82ea96e1232?source=rss-5161222660dc------2</link>
            <guid isPermaLink="false">https://medium.com/p/a82ea96e1232</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[registry]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[docker-repository]]></category>
            <category><![CDATA[docker-registry]]></category>
            <dc:creator><![CDATA[Zahia Ameziani]]></dc:creator>
            <pubDate>Sun, 20 Nov 2022 20:34:36 GMT</pubDate>
            <atom:updated>2022-11-20T20:34:53.012Z</atom:updated>
            <content:encoded><![CDATA[<h3>Understand Docker 3 — Docker Registry</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/683/1*OHVau8cAFX0PJiJhnVylcA.png" /><figcaption>Docker Registry</figcaption></figure><p><strong>Registry </strong>is a server side application that stores and lets you distribute docker images.</p><p>It is recommended to put the registry in a<strong> centralized</strong> location where other people can access it.</p><h3><strong>Accessing docker registries</strong></h3><p>By default, docker will not allow you to perform operations with an insecure registry. You can override by adding the following sentence within /etc/docker/daemon.json file</p><pre>$ nano /etc/docker/daemon.json<br>{“insecure-registries”:[“myredistryDNS.com:5000”]}</pre><h3><strong>Registry types</strong></h3><h4>1- <strong>Local registry</strong></h4><p>Let’s take an example of a local registry</p><ul><li>Download the registry image to local machines</li><li>Push image to docker registry</li><li>Pull images from docker registry</li></ul><pre># install a registry <br># build an image <br># run container <br>$ docker run -d -p 5000:5000 --name registry registry:2<br># verfify if the registry container is start<br>$ docker ps</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*okilCOky4YJj63vT1geGXw.png" /><figcaption>Local Registry</figcaption></figure><p>Let’s pull an image from the docker hub.</p><pre># pull ubuntu image <br>$ docker pull ubuntu</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/777/1*T9UsiUeu1YsU1Arb3ti0QQ.png" /><figcaption>Pull</figcaption></figure><p>Let’s push the ubuntu image to the local registry but, before this, we have to tag the image and specify the DNS name of the registry.</p><pre># Tag - Registry DNS name <br>$ docker image tag ubuntu:latest localhost:5000/myfirstimage<br># Push the image to local registry<br>$ docker push localhost:5000/myfirstimage</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/953/1*WMJILxZff_mWxkVhvx01QA.png" /><figcaption>Push</figcaption></figure><p>Let’s pull “myfirstimage” image from the local registry. In this case, we should specify the location of registry/name of the image.</p><pre># pull the image <br>$ docker pull localhost:5000/myfirstimage</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/760/1*fEluLCy8VtZMktTgrV4zWw.png" /><figcaption>Pull</figcaption></figure><p>Stop and remove the local registry.</p><pre># stop the registry <br>$ docker container stop registry <br># remove the registry <br>$ docker container rm -v registry</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/576/1*y5Y9Jcn8LskWzvAVslfLpw.png" /><figcaption>remove registry</figcaption></figure><h4>2- Remote registry</h4><p>There are public and private registries. Example:</p><ul><li>Docker registry : open source limited features with basic functionalities of storing docker images.</li><li>Docker trusted registry : enterprise variant for docker enterprise, with a lot of features compared to docker registry.</li><li>Private repository : AWS ECR, Azure container registry, …</li><li>Docker hub : docker based offering space for storing docker images.</li><li>…</li></ul><p><strong>Example :</strong> Docker hub registry</p><p>Authenticate to Docker hub registry, push and pull images to private repository</p><p>1- Signup to docker hub registry</p><p>2- pull and push images</p><pre># Authentification : give the name of registry<br>$ docker login</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*32EKWODWU_2uF_G8lFJxyg.png" /><figcaption>login</figcaption></figure><pre># tag existing image <br># docker tag &lt;image-name&gt; &lt;hub-username&gt;/&lt;new-image-name&gt;:&lt;version (optional)&gt;<br>$ docker tag ubuntu zahiaameziani/myubuntuinhub:v1<br># push <br>$ docker push zahiaameziani/myubuntuinhub:v1<br># pull<br>$ docker pull zahiaameziani/myubuntuinhub:v1</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/963/1*udIPJaUyTiOjhb0RX_mDCQ.png" /><figcaption>push/pull</figcaption></figure><pre># logout from docker hub<br>$ docker logout</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/594/1*S2xgfn5QUe_SFrRSX_Yd8A.png" /><figcaption>logout</figcaption></figure><p>Here, we can see the image that we push to docker hub registry.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1e3PC8tRe9UCsUENHXP7yA.png" /><figcaption>Docker Hub Restry</figcaption></figure><h3>*****</h3><p>Thank you for reading !</p><p>If you have any questions, feel free to leave comments.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a82ea96e1232" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understand Docker 2 — Docker Image]]></title>
            <link>https://medium.com/@zahia.amez/understand-docker-2-docker-image-4826969cb712?source=rss-5161222660dc------2</link>
            <guid isPermaLink="false">https://medium.com/p/4826969cb712</guid>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[docker-image]]></category>
            <category><![CDATA[dockerfiles]]></category>
            <category><![CDATA[build]]></category>
            <dc:creator><![CDATA[Zahia Ameziani]]></dc:creator>
            <pubDate>Mon, 07 Nov 2022 22:34:26 GMT</pubDate>
            <atom:updated>2022-11-07T22:34:26.288Z</atom:updated>
            <content:encoded><![CDATA[<h3><a href="https://medium.com/@zahia.amez/understand-docker-dockerfile-a304a9c0b937?source=your_stories_page-------------------------------------">Understand Docker 2 — Doc</a>ker Image</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/585/1*WzJiYilcnsviHTH08iY1Pw.png" /><figcaption>Docker Image Layers</figcaption></figure><p><strong>Docker image :</strong> file which contains all the necessary dependency and configuration which are required to run an application (executable format of an application). It acts as a set of instructions to build a Docker container, like a template. Docker images also act as the starting point when using Docker. We can find docker images in public repositories (docker hub, ECR, …).</p><h3>Create Docker image</h3><p>There are 2 ways to get a docker image</p><ol><li>Dockerfile</li></ol><pre>FROM ubuntu/apache2<strong><br></strong>EXPOSE 80<br>CMD [&quot;/usr/sbin/apache2ctl&quot;, &quot;-D&quot;, &quot;FOREGROUND&quot;]</pre><p>2. Docker registry</p><p>A <strong>Docker registry</strong> or container registry is a storage and distribution system for Docker images. we can also define it as a repository or collection of repositories used <strong>to store and access container images </strong>.The same image might have multiple different versions.</p><p><strong>Docker Registries example :</strong></p><ul><li>Docker Hub</li><li>Azure Container Registry</li><li>Google Container Registry</li><li>Amazon EC2 Container Registry</li><li>Github Container Registry</li><li>…etc</li></ul><h3>Manage Docker image with CLI</h3><pre>Docker image &lt;child command&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/843/1*taw_68hTGJvE_0oPKxeZkg.png" /><figcaption>Docker image child commands</figcaption></figure><p>Notice:</p><ul><li><strong>docker image build</strong> : to build an image from Dockerfile</li><li><strong>docker image pull </strong>: to pull an image from docker registry</li><li><strong>docker image inspect </strong>: show all information about the image(creation date, command, environment variables, architecture, os, size, …etc)</li></ul><pre><strong># Show a specific information about image <br></strong>$ docker image inspect <strong>imgname</strong> --format=’{{ .ContainerConfig.Hostname}}’</pre><pre><strong># Show all containerConfig image information<br></strong>$ docker image inspect <strong>imgname</strong> --format=’{{.ContainerConfig}}’</pre><pre><strong># Show image information in json format(key:value)<br></strong>$ docker image inspect <strong>imgname</strong> --format=’{{json .ContainerConfig}}’</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bt_V8NI1DvniQMi9QmYc7A.png" /><figcaption>docker image inspect</figcaption></figure><ul><li><strong>docker image prune : </strong>clean up unused images, by default, it clean up dangling images (images without tags and not referenced by any container)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/477/1*lgE3xr5aD2KBYAb97DTvyg.png" /><figcaption>docker image prune</figcaption></figure><ul><li><strong>docker image prune --all/-a : </strong>remove all unused images, not just dangling ones</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/898/1*d5WcBFFUH9Gbvzmd0hsUPw.png" /><figcaption>docker image prune — all</figcaption></figure><ul><li><strong>docker image prune --filter : </strong>provide filter values (e.g. ‘until=&lt;timestamp&gt;’)</li><li><strong>docker image prune --force/-f : </strong>do not prompt for confirmation</li><li><strong>docker image prune tag</strong>: make easy to identify the image</li></ul><pre><strong># Build image with tag<br></strong>$ docker build -t imgname:<strong>tag</strong> .</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G12hCkAo9x8dml_9j2cV2Q.png" /></figure><pre><strong># Tag existing image<br># Same name<br></strong>$ docker tag imgID imgname:<strong>tag<br># Different name <br></strong>$ docker tag imgname1:tag1 imgname2:tag2</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gwX0oOE9KfdL5avWQ3ITZQ.png" /><figcaption>Same name</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CHFqOXMfRHH6cDcE000Tfg.png" /><figcaption>Different name</figcaption></figure><ul><li><strong>docker image history </strong>: show between layers</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Nh1Pu-5kiNkvW9BoQLSgCA.png" /><figcaption>docker image history</figcaption></figure><h3>*****</h3><p>Thank you for reading !!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4826969cb712" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Install WordPress-MariaDB Using Bash Script — Ubuntu]]></title>
            <link>https://medium.com/@zahia.amez/install-wordpress-mariadb-using-bash-script-ubuntu-c557c5129da?source=rss-5161222660dc------2</link>
            <guid isPermaLink="false">https://medium.com/p/c557c5129da</guid>
            <category><![CDATA[ubuntu]]></category>
            <category><![CDATA[mariadb]]></category>
            <category><![CDATA[bash-script]]></category>
            <category><![CDATA[wordpress]]></category>
            <category><![CDATA[shell]]></category>
            <dc:creator><![CDATA[Zahia Ameziani]]></dc:creator>
            <pubDate>Sat, 29 Oct 2022 21:09:51 GMT</pubDate>
            <atom:updated>2022-10-29T21:10:44.458Z</atom:updated>
            <content:encoded><![CDATA[<h3>Install WordPress-MariaDB Using Bash Script — Ubuntu</h3><p>In this tutorial, we will discuss about how to create a new empty project in GitLab, clone the project to a local machine, then install WordPress and maraiDB using bash script.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*swZuq29f08CoqPiyol7lrA.png" /><figcaption>Ubuntu-Script Bash-Wordpress</figcaption></figure><h3>Prerequisite</h3><ul><li>Ubuntu OS (20.04)</li><li>G<a href="https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html">itlab personal access token</a> OR <a href="https://docs.gitlab.com/ee/ssh/index.html">SSH Key </a>.</li></ul><h3>Tutorial Steps</h3><ul><li>Create Empty Gitlab Project</li><li>Clone Gitlab Project</li><li>Install WordPress and push WordPress project to Gitlab</li></ul><h4><strong>1. Create Empty Gitlab Project</strong></h4><ul><li><a href="https://gitlab.com/users/sign_in">Login to your Gitlab account</a></li><li>Click on <strong>New project</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2z1aJ6YtIQOSimPcPgS82w.png" /><figcaption>New project</figcaption></figure><ul><li>Click on <strong>Create blanck project</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/865/1*ndlb__kJkbHg4yt7o_lakg.png" /><figcaption>Create blanck project</figcaption></figure><ul><li>Fill in tabs <strong>Project name</strong>, <strong>Project url</strong>, <strong>Visibility Level</strong> then click on <strong>Create project</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/963/1*OgQvGN3TwjwyQMRiV2GyuA.png" /><figcaption>Project Information</figcaption></figure><ul><li>Project has been created</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QoPQoDUkCvyx4-sC5_GSIA.png" /><figcaption>Empty Gitlab Project</figcaption></figure><h4>2. Clone empty Gitlab Project</h4><p>Clone the empty Gitlab project and create clone_git_project.sh file</p><pre>$ sudo nano my_git_repo.sh</pre><p>Copy this bash script to clone_git_project.sh file then you must carefully follow the instructions to create a new Wordpress project.</p><pre>#!/bin/bash<br>#################################################################<br>#            Pull Gitlab Repository<br>#################################################################<br>echo &quot;************************************************************&quot;<br>echo                 &quot;This is for Ubuntu Users&quot;<br>&quot;*****************************************************************&quot;<br>echo<br>sudo apt update -y<br>###################### Install Git<br>echo &quot;***********************************************************&quot;<br>echo                 &quot;1- Create Project Repository&quot;<br>echo &quot;***********************************************************&quot;<br>echo<br>read -p &#39;project_name [only-alphanumeric with no space] : &#39; project_name<br>echo<br>read -p &#39;project_folder_path [where to create the folder : /home/user] : &#39; project_path<br>echo<br>mkdir $project_path/$project_name<br>FOLDER=$project_path/$project_name<br>if [ -d &quot;$FOLDER&quot; ];<br>then<br>        echo<br>        echo &quot;$FOLDER is successfully created.&quot;<br>        ###################### Install Git<br>        echo &quot;*****************************************&quot;<br>        echo                &quot;2- Install Git&quot;<br>        echo &quot;*****************************************&quot;<br>        echo<br>        sudo apt install git -y<br>        ###################### Create a Token<br>        echo&quot;******************************************&quot;<br>        echo         &quot;3- Create Token or SSH Key&quot;<br>        echo &quot;*****************************************&quot;<br>        echo &quot;      ====&gt; Create Gitlab Token : <a href="https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html">https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html</a>&quot;<br>        echo<br>        echo &quot;      ====&gt; Create Gitlab SSH Key : <a href="https://docs.gitlab.com/ee/ssh/">https://docs.gitlab.com/ee/ssh/</a>&quot;<br>        ###################### Clone project<br>        echo &quot;*****************************************&quot;<br>        echo          &quot;4- Clone Gitlab Project &quot;<br>        echo &quot;*****************************************&quot;<br>        echo &quot;  =====&gt; Clone gitlab project using SSH URL or HTTPS&quot;<br>        echo<br>        read -p &#39;   * Enter &quot;ssh&quot; for SSH Key and &quot;token&quot; for a Token : &#39; clone_method</pre><pre>if [ &quot;$clone_method&quot; = &quot;ssh&quot; -o &quot;$clone_method&quot; = &quot;SSH&quot; -o &quot;$clone_method&quot; = &quot;S&quot; -o &quot;$clone_method&quot; = &quot;s&quot; ]<br>            then<br>                echo &quot;        =====&gt; Copy thr SSH URL from Gitlab&quot;<br>                read -p &#39;   * SSH URL [Please make sure that you have SSK Key installed in you Gitlab]: &#39; git_ssh_url<br>                read -p &#39;   * Git branch : &#39; git_branch<br>                git clone -b $git_branch $git_ssh_url $FOLDER</pre><pre>elif [ &quot;$clone_method&quot; = &quot;token&quot; -o &quot;$clone_method&quot; = &quot;TOKEN&quot; -o &quot;$clone_method&quot; = &quot;T&quot; -o &quot;$clone_method&quot; = &quot;t&quot; ]<br>            then<br>                echo &quot;        =====&gt; Copy HTTPS URL from Gitlab&quot;<br>                read -p &#39;   * Token name : &#39; git_token_name<br>                read -p &#39;   * Token : &#39; git_token<br>                read -p &#39;   * Git branch [default branch : main]: &#39; git_branch<br>                read -p &#39;   * HTTPS URL [Please make sure that you have a token]: &#39; git_https_url<br>                DELETE=https://<br>                git_ssh_url_without_https=${git_https_url//$DELETE/}<br>                cd $FOLDER<br>                git clone -b $git_branch <a href="https://$git_token_name:$git_token@$git_ssh_url_without_https/">https://$git_token_name:$git_token@$git_ssh_url_without_https</a> .<br>            else<br>            echo<br>            echo &quot;-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-&quot;<br>            echo &quot;Error  !!! &quot;<br>            echo &quot;You did not enter a correct answear to clone the project &quot;<br>            echo &quot;Please, re-execute the script&quot;<br>            echo<br>            echo &quot;-_-_-_--_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-&quot;<br>            echo<br>            fi<br>else<br>echo<br>echo &quot;-_-_-_--_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-&quot;<br>echo<br>echo &quot;Error  !!!               &quot;<br>echo &quot;Can not create $FOLDER &quot;<br>echo &quot;Make sure that the folder name or folder-path are correc&quot;<br>echo &quot;Please, re-execute the script           &quot;<br>echo<br>echo &quot;-_-_-_--_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-&quot;<br>echo<br>fi<br>#!/bin/bash<br>#################################################################<br>#            Pull Gitlab Repository<br>#################################################################<br>echo &quot;************************************************************&quot;<br>echo                 &quot;This is for Ubuntu Users&quot;<br>&quot;*****************************************************************&quot;<br>echo<br>sudo apt update -y<br>###################### Install Git<br>echo &quot;***********************************************************&quot;<br>echo                 &quot;1- Create Project Repository&quot;<br>echo &quot;***********************************************************&quot;<br>echo<br>read -p &#39;project_name [only-alphanumeric with no space] : &#39; project_name<br>echo<br>read -p &#39;project_folder_path [where to create the folder : /home/user] : &#39; project_path<br>echo<br>mkdir $project_path/$project_name<br>FOLDER=$project_path/$project_name<br>if [ -d &quot;$FOLDER&quot; ];<br>then<br>        echo<br>        echo &quot;$FOLDER is successfully created.&quot;<br>        ###################### Install Git<br>        echo &quot;*****************************************&quot;<br>        echo                &quot;2- Install Git&quot;<br>        echo &quot;*****************************************&quot;<br>        echo<br>        sudo apt install git -y<br>        ###################### Create a Token<br>        echo&quot;******************************************&quot;<br>        echo         &quot;3- Create Token or SSH Key&quot;<br>        echo &quot;*****************************************&quot;<br>        echo &quot;      ====&gt; Create Gitlab Token : <a href="https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html">https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html</a>&quot;<br>        echo<br>        echo &quot;      ====&gt; Create Gitlab SSH Key : <a href="https://docs.gitlab.com/ee/ssh/">https://docs.gitlab.com/ee/ssh/</a>&quot;<br>        ###################### Clone project<br>        echo &quot;*****************************************&quot;<br>        echo          &quot;4- Clone Gitlab Project &quot;<br>        echo &quot;*****************************************&quot;<br>        echo &quot;  =====&gt; Clone gitlab project using SSH URL or HTTPS&quot;<br>        echo<br>        read -p &#39;   * Enter &quot;ssh&quot; for SSH Key and &quot;token&quot; for a Token : &#39; clone_method</pre><pre>if [ &quot;$clone_method&quot; = &quot;ssh&quot; -o &quot;$clone_method&quot; = &quot;SSH&quot; -o &quot;$clone_method&quot; = &quot;S&quot; -o &quot;$clone_method&quot; = &quot;s&quot; ]<br>            then<br>                echo &quot;        =====&gt; Copy thr SSH URL from Gitlab&quot;<br>                read -p &#39;   * SSH URL [Please make sure that you have SSK Key installed in you Gitlab]: &#39; git_ssh_url<br>                read -p &#39;   * Git branch : &#39; git_branch<br>                git clone -b $git_branch $git_ssh_url $FOLDER</pre><pre>elif [ &quot;$clone_method&quot; = &quot;token&quot; -o &quot;$clone_method&quot; = &quot;TOKEN&quot; -o &quot;$clone_method&quot; = &quot;T&quot; -o &quot;$clone_method&quot; = &quot;t&quot; ]<br>            then<br>                echo &quot;        =====&gt; Copy HTTPS URL from Gitlab&quot;<br>                read -p &#39;   * Token name : &#39; git_token_name<br>                read -p &#39;   * Token : &#39; git_token<br>                read -p &#39;   * Git branch [default branch : main]: &#39; git_branch<br>                read -p &#39;   * HTTPS URL [Please make sure that you have a token]: &#39; git_https_url<br>                DELETE=https://<br>                git_ssh_url_without_https=${git_https_url//$DELETE/}<br>                cd $FOLDER<br>                git clone -b $git_branch <a href="https://$git_token_name:$git_token@$git_ssh_url_without_https/">https://$git_token_name:$git_token@$git_ssh_url_without_https</a> .<br>            else<br>            echo<br>            echo &quot;-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-&quot;<br>            echo &quot;Error  !!! &quot;<br>            echo &quot;You did not enter a correct answear to clone the project &quot;<br>            echo &quot;Please, re-execute the script&quot;<br>            echo<br>            echo &quot;-_-_-_--_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-&quot;<br>            echo<br>            fi<br>else<br>echo<br>echo &quot;-_-_-_--_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-&quot;<br>echo<br>echo &quot;Error  !!!               &quot;<br>echo &quot;Can not create $FOLDER &quot;<br>echo &quot;Make sure that the folder name or folder-path are correc&quot;<br>echo &quot;Please, re-execute the script           &quot;<br>echo<br>echo &quot;-_-_-_--_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-&quot;<br>echo<br>fi<br>cat: wordpress: Is a directory<br>#!/bin/bash<br>#################################################################<br>#            Creat Wordpress Project<br>#################################################################<br>echo &quot;************************************************************&quot;<br>echo                 &quot;This is for Ubuntu Users&quot;<br>echo &quot;************************************************************&quot;<br>echo &quot;  Create Wordpress Project &quot;<br>echo &quot;************************************************************&quot;<br>echo<br>sudo apt update -y<br>sudo apt install curl -y<br>sudo apt install wget -y<br>sudo apt autoremove -y<br>echo &quot;************************************************************&quot;<br>echo<br>echo &quot;                  Install Dependencies :  &quot;<br>echo &quot;                  - Install Apache        &quot;                        echo &quot;                  - Install PHP           &quot;<br>echo &quot;                  - Create Wordpress Project   &quot;<br>echo &quot;                  - DataBase Configuration     &quot;<br>echo &quot;                  - Install PhpMyAdmin         &quot;<br>echo<br>echo &quot;************************************************************&quot;<br>echo<br>echo &quot;                  1- Install Apache       &quot;<br>echo<br>sudo apt-get install apache2 apache2-utils -y<br>service apache2 start<br>service apache2 enable<br>echo<br>echo &quot;************************************************************&quot;<br>echo &quot;                  2- Install PHP            &quot;<br>echo<br>sudo apt-get install php libapache2-mod-php php-mysql -y</pre><pre>export DEBIAN_FRONTEND=&quot;noninteractive&quot;<br>debconf-set-selections &lt;&lt;&lt; &quot;mysql-server mysql-server/root_password password $db_root_password&quot;<br>debconf-set-selections &lt;&lt;&lt; &quot;mysql-server mysql-server/root_password_again password $db_root_password&quot;<br>sudo apt-get install mariadb-server -y<br>sudo apt-get install mariadb-client -y<br>echo<br>echo &quot;************************************************************&quot;<br>echo &quot;                  3- Create Wordpress project     &quot;<br>echo<br>read -p &#39;* path to the project folder [/home/user/myproject/]: &#39; folder<br>if [ -d &quot;$folder&quot; ];<br>then<br>    cd $folder<br>    ## Install Latest WordPress<br>    rm /var/www/html/index.*<br>    wget -c <a href="http://wordpress.org/latest.tar.gz">http://wordpress.org/latest.tar.gz</a> -P $folder<br>    tar -xzvf $folder/latest.tar.gz -C $folder<br>    rsync -av wordpress/* $folder<br>    ## Set Permissions<br>    chown -R www-data:www-data $folder<br>    chmod -R 755 $folder<br>    # can&#39;t use the root user in 5.7 anymore without becoming a sudo<br>    ## <a href="https://askubuntu.com/questions/763336/cannot-enter-phpmyadmin-as-root-mysql-5-7/763359#763359">https://askubuntu.com/questions/763336/cannot-enter-phpmyadmin-as-root-mysql-5-7/763359#763359</a><br>    ## Configure WordPress Database<br>    echo<br>    echo &quot;**************************************************&quot;<br>    echo &quot;       3- DataBase Configuration        &quot;<br>    echo<br>    echo &quot;**************************************************&quot;<br>    echo<br>    read -p &#39;   * wordpress_db_name [wp_db]: &#39; wordpress_db_name<br>    read -p &#39;   * wordpress_db_user [wp_db_user]: &#39; wordpress_db_user<br>    read -p &#39;   * db_user_password [only-alphanumeric]: &#39; db_user_password<br>    read -p &#39;   * db_root_password [only-alphanumeric]: &#39; db_root_password<br>    echo<br>    echo &quot;CREATE DATABASE $wordpress_db_name ;GRANT ALL PRIVILEGES ON $wordpress_db_name.* TO &#39;root&#39;@&#39;localhost&#39;;CREATE USER &#39;$wordpress_db_user&#39;@&#39;localhost&#39; IDENTIFIED BY &#39;$db_user_password&#39;;GRANT ALL PRIVILEGES ON $wordpress_db_name.* TO &#39;$wordpress_db_user&#39;@&#39;localhost&#39;;FLUSH PRIVILEGES;&quot; &gt; $folder/data.sql<br>    mysql -u root -p$db_root_password &lt; ./data.sql<br>    ## Add Database Credentias to wordpress<br>    cd /var/www/html/<br>    mv wp-config-sample.php wp-config.php<br>    perl -pi -e &quot;s/database_name_here/$wordpress_db_name/g&quot; wp-config.php<br>    perl -pi -e &quot;s/username_here/$wordpress_db_user/g&quot; wp-config.php<br>    perl -pi -e &quot;s/password_here/$db_user_password/g&quot; wp-config.php<br>    ## Enabling Mod Rewrite<br>    a2enmod rewrite<br>    php5enmod mcrypt<br>    echo<br>    echo &quot;**************************************************&quot;<br>    echo &quot;                  4- Install PhpMyAdmin       &quot;<br>    echo<br>    echo<br>    ## Install PhpMyAdmin<br>    apt-get install phpmyadmin -y</pre><pre>## Configure PhpMyAdmin<br>    echo &#39;Include /etc/phpmyadmin/apache.conf&#39; &gt;&gt; /etc/apache2/apache2.conf</pre><pre>## Restart Apache and Mysql<br>    echo<br>    echo &quot; ******* Restart servers&quot;<br>    echo &quot; ...........&quot;<br>    service apache2 restart<br>    service mysql restart</pre><pre>## Cleaning Download<br>    cd $pwd<br>    rm -rf $folder/latest.tar.gz<br>    rm -rf $folder/wordpress<br>    echo &quot; ...........................&quot;<br>    echo &quot;  Installation is complete.&quot;<br>    echo &quot; ...........................&quot;<br> ###### push project to gitlab<br>    echo &quot;**************************************************&quot;<br>    echo &quot;                  4 - Push Project to Gitlab    &quot;<br>    echo<br>    echo &quot; ** Do you want to push this project to gitlab ?  &quot;<br>    echo<br>    read -p &#39;      * y for yes, n for no :  &#39; push<br>    echo<br>    if [ &quot;$push&quot; = &quot;y&quot; -o &quot;$push&quot; = &quot;Y&quot; -o &quot;$push&quot; = &quot;yes&quot; -o &quot;$push&quot; = &quot;YES&quot; -o &quot;$push&quot; = &quot;Yes&quot; ]<br>    then<br>                    read -p &#39;   * Git branch : &#39; git_branch<br>                    echo<br>        read -p &#39;* path to the project folder [/home/user/myproject/]: &#39; path_project_folder<br>        cd $path_project_folder<br>        git add .<br>        git commit -m &quot;first push&quot;<br>        git push origin $git_branch<br>        echo<br>        echo &quot;**************************************************&quot;<br>        echo &quot;   Verify your gitlab repository !            &quot;<br>        echo<br>        echo<br>    elif [ &quot;$push&quot; = &quot;n&quot; -o &quot;$push&quot; = &quot;N&quot; -o &quot;$push&quot; = &quot;no&quot; -o &quot;$push&quot; = &quot;NO&quot; -o &quot;$push&quot; = &quot;No&quot; ]<br>    then<br>        echo<br>        echo &quot;**************************************************&quot;<br>        echo &quot; The project is saved only in your local host !  &quot;<br>    else<br>        echo<br>        echo &quot;-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-&quot;<br>        echo<br>        echo &quot; Error  !!! &quot;<br>        echo &quot; You did not enter a correct answear to clone the project &quot;<br>        echo &quot; Please, re-execute the script&quot;<br>        echo<br>        echo &quot;-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-&quot;<br>        echo<br>    fi<br>else<br>echo<br>echo &quot;-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-&quot;<br>echo<br>echo &quot; Error  !!!  &quot;<br>echo &quot; $folder is not correct&quot;<br>echo &quot; Please, re-execute the script&quot;<br>echo<br>echo &quot;-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-&quot;<br>echo<br>fi</pre><p>Execute the scrip tclone_git_project.sh</p><pre>$ sudo chmod +x my_git_repo.sh<br>$ sudo ./my_git_repo.sh</pre><h4>Execution results</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/748/1*aoxIaZQQiL_ySPJS_yZWBA.png" /><figcaption>my_git_repo.sh</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x5xwgAX-_QSayoLCb-04Mw.png" /><figcaption>Clone empty Gitlab Project</figcaption></figure><h4>3. Install WordPress and Push to Gitlab Repository</h4><p>Create wordpress.sh file using these commands</p><pre>$ cd /home/wordpress<br>$ sudo nano wordpress.sh</pre><p>Copy this bash script to wordpress.sh file</p><p>You have to follow the instructions carefully</p><pre>#!/bin/bash<br>#################################################################<br>#            Creat Wordpress Project<br>#################################################################<br>echo &quot;************************************************************&quot;<br>echo                 &quot;This is for Ubuntu Users&quot;<br>echo &quot;************************************************************&quot;<br>echo &quot;  Create Wordpress Project &quot;<br>echo &quot;************************************************************&quot;<br>echo<br>sudo apt update -y<br>sudo apt install curl -y<br>sudo apt install wget -y<br>sudo apt autoremove -y<br>echo &quot;************************************************************&quot;<br>echo<br>echo &quot;                  Install Dependencies :  &quot;<br>echo &quot;                  - Install Apache        &quot;                        echo &quot;                  - Install PHP           &quot;<br>echo &quot;                  - Create Wordpress Project   &quot;<br>echo &quot;                  - DataBase Configuration     &quot;<br>echo &quot;                  - Install PhpMyAdmin         &quot;<br>echo<br>echo &quot;************************************************************&quot;<br>echo<br>echo &quot;                  1- Install Apache       &quot;<br>echo<br>sudo apt-get install apache2 apache2-utils -y<br>service apache2 start<br>service apache2 enable<br>echo<br>echo &quot;************************************************************&quot;<br>echo &quot;                  2- Install PHP            &quot;<br>echo<br>sudo apt-get install php libapache2-mod-php php-mysql -y</pre><pre>export DEBIAN_FRONTEND=&quot;noninteractive&quot;<br>debconf-set-selections &lt;&lt;&lt; &quot;mysql-server mysql-server/root_password password $db_root_password&quot;<br>debconf-set-selections &lt;&lt;&lt; &quot;mysql-server mysql-server/root_password_again password $db_root_password&quot;<br>sudo apt-get install mariadb-server -y<br>sudo apt-get install mariadb-client -y<br>echo<br>echo &quot;************************************************************&quot;<br>echo &quot;                  3- Create Wordpress project     &quot;<br>echo<br>read -p &#39;* path to the project folder [/home/user/myproject/]: &#39; folder<br>if [ -d &quot;$folder&quot; ];<br>then<br>    cd $folder<br>    ## Install Latest WordPress<br>    rm /var/www/html/index.*<br>    wget -c <a href="http://wordpress.org/latest.tar.gz">http://wordpress.org/latest.tar.gz</a> -P $folder<br>    tar -xzvf $folder/latest.tar.gz -C $folder<br>    rsync -av wordpress/* $folder<br>    ## Set Permissions<br>    chown -R www-data:www-data $folder<br>    chmod -R 755 $folder<br>    # can&#39;t use the root user in 5.7 anymore without becoming a sudo<br>    ## <a href="https://askubuntu.com/questions/763336/cannot-enter-phpmyadmin-as-root-mysql-5-7/763359#763359">https://askubuntu.com/questions/763336/cannot-enter-phpmyadmin-as-root-mysql-5-7/763359#763359</a><br>    ## Configure WordPress Database<br>    echo<br>    echo &quot;**************************************************&quot;<br>    echo &quot;       3- DataBase Configuration        &quot;<br>    echo<br>    echo &quot;**************************************************&quot;<br>    echo<br>    read -p &#39;   * wordpress_db_name [wp_db]: &#39; wordpress_db_name<br>    read -p &#39;   * wordpress_db_user [wp_db_user]: &#39; wordpress_db_user<br>    read -p &#39;   * db_user_password [only-alphanumeric]: &#39; db_user_password<br>    read -p &#39;   * db_root_password [only-alphanumeric]: &#39; db_root_password<br>    echo<br>    echo &quot;CREATE DATABASE $wordpress_db_name ;GRANT ALL PRIVILEGES ON $wordpress_db_name.* TO &#39;root&#39;@&#39;localhost&#39;;CREATE USER &#39;$wordpress_db_user&#39;@&#39;localhost&#39; IDENTIFIED BY &#39;$db_user_password&#39;;GRANT ALL PRIVILEGES ON $wordpress_db_name.* TO &#39;$wordpress_db_user&#39;@&#39;localhost&#39;;FLUSH PRIVILEGES;&quot; &gt; $folder/data.sql<br>    mysql -u root -p$db_root_password &lt; ./data.sql<br>    ## Add Database Credentias to wordpress<br>    cd /var/www/html/<br>    mv wp-config-sample.php wp-config.php<br>    perl -pi -e &quot;s/database_name_here/$wordpress_db_name/g&quot; wp-config.php<br>    perl -pi -e &quot;s/username_here/$wordpress_db_user/g&quot; wp-config.php<br>    perl -pi -e &quot;s/password_here/$db_user_password/g&quot; wp-config.php<br>    ## Enabling Mod Rewrite<br>    a2enmod rewrite<br>    php5enmod mcrypt<br>    echo<br>    echo &quot;**************************************************&quot;<br>    echo &quot;                  4- Install PhpMyAdmin       &quot;<br>    echo<br>    echo<br>    ## Install PhpMyAdmin<br>    apt-get install phpmyadmin -y</pre><pre>## Configure PhpMyAdmin<br>    echo &#39;Include /etc/phpmyadmin/apache.conf&#39; &gt;&gt; /etc/apache2/apache2.conf</pre><pre>## Restart Apache and Mysql<br>    echo<br>    echo &quot; ******* Restart servers&quot;<br>    echo &quot; ...........&quot;<br>    service apache2 restart<br>    service mysql restart</pre><pre>## Cleaning Download<br>    cd $pwd<br>    rm -rf $folder/latest.tar.gz<br>    rm -rf $folder/wordpress<br>    echo &quot; ...........................&quot;<br>    echo &quot;  Installation is complete.&quot;<br>    echo &quot; ...........................&quot;<br> ###### push project to gitlab<br>    echo &quot;**************************************************&quot;<br>    echo &quot;                  4 - Push Project to Gitlab    &quot;<br>    echo<br>    echo &quot; ** Do you want to push this project to gitlab ?  &quot;<br>    echo<br>    read -p &#39;      * y for yes, n for no :  &#39; push<br>    echo<br>    if [ &quot;$push&quot; = &quot;y&quot; -o &quot;$push&quot; = &quot;Y&quot; -o &quot;$push&quot; = &quot;yes&quot; -o &quot;$push&quot; = &quot;YES&quot; -o &quot;$push&quot; = &quot;Yes&quot; ]<br>    then<br>                    read -p &#39;   * Git branch : &#39; git_branch<br>                    echo<br>        read -p &#39;* path to the project folder [/home/user/myproject/]: &#39; path_project_folder<br>        cd $path_project_folder<br>        git add .<br>        git commit -m &quot;first push&quot;<br>        git push origin $git_branch<br>        echo<br>        echo &quot;**************************************************&quot;<br>        echo &quot;   Verify your gitlab repository !            &quot;<br>        echo<br>        echo<br>    elif [ &quot;$push&quot; = &quot;n&quot; -o &quot;$push&quot; = &quot;N&quot; -o &quot;$push&quot; = &quot;no&quot; -o &quot;$push&quot; = &quot;NO&quot; -o &quot;$push&quot; = &quot;No&quot; ]<br>    then<br>        echo<br>        echo &quot;**************************************************&quot;<br>        echo &quot; The project is saved only in your local host !  &quot;<br>    else<br>        echo<br>        echo &quot;-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-&quot;<br>        echo<br>        echo &quot; Error  !!! &quot;<br>        echo &quot; You did not enter a correct answear to clone the project &quot;<br>        echo &quot; Please, re-execute the script&quot;<br>        echo<br>        echo &quot;-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-&quot;<br>        echo<br>    fi<br>else<br>echo<br>echo &quot;-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-&quot;<br>echo<br>echo &quot; Error  !!!  &quot;<br>echo &quot; $folder is not correct&quot;<br>echo &quot; Please, re-execute the script&quot;<br>echo<br>echo &quot;-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-&quot;<br>echo<br>fi</pre><p>Execute the scrip wordpress.sh</p><pre>$ cd /home/wordpress<br>$ sudo chmod +x wordpress.sh<br>$ sudo ./wordpress.sh</pre><h4>Execution results</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/892/1*ulG5SQoQ6KTr3Arr7Pt6eQ.png" /><figcaption>wordpress.sh</figcaption></figure><ul><li>DataBase configuration</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5mMZAiJf8gjheniek043Tw.png" /><figcaption>DataBase</figcaption></figure><ul><li>Push the project to Gitlab repository previously created</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nOn2Lga-zk-LYeQVLHOm4Q.png" /><figcaption>Push project</figcaption></figure><p>Here, we can see the project in Gitlab repository</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FhneZhf9RmZxn8Ut8EiyYw.png" /><figcaption>my-wordpress-website</figcaption></figure><ul><li>Let’s check MariaDB connection</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3RAKkkO1BGs9oNw7ixMrvQ.png" /><figcaption>DataBase connection</figcaption></figure><p>Now, you have successfully</p><ul><li>Created Gitlab project</li><li>Installed MariaDB</li><li>Installed Wordpress</li><li>Push Wordpress to Gitlab</li></ul><h3>*****</h3><p>Thank you for reading !!!<br>If you face any problem feel free to leave a comment !</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c557c5129da" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Composer Install — OVH Server]]></title>
            <link>https://medium.com/@zahia.amez/composer-install-ovh-server-1809e238861?source=rss-5161222660dc------2</link>
            <guid isPermaLink="false">https://medium.com/p/1809e238861</guid>
            <category><![CDATA[php]]></category>
            <category><![CDATA[ovh]]></category>
            <category><![CDATA[ovhcloud]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[composer]]></category>
            <dc:creator><![CDATA[Zahia Ameziani]]></dc:creator>
            <pubDate>Wed, 26 Oct 2022 13:54:05 GMT</pubDate>
            <atom:updated>2022-10-26T13:54:05.019Z</atom:updated>
            <content:encoded><![CDATA[<h3>Composer Install — OVH Server</h3><p>This article discusses how to install composer on the OVH server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/728/1*q7XipPT0FsnQeZ_g2P0EJA.png" /><figcaption>Composer — OVH Server</figcaption></figure><p><strong>Composer</strong> is an open source<strong> </strong>tool for dependency management in PHP. It allows you to declare the libraries your project depends on and it will manage them for you.</p><h4>Prerequisites</h4><ul><li>OVH Account</li><li>OVH Server</li><li>Terminal (Powershell)</li></ul><p>To quickly <strong>install Composer</strong> in your project directory located in OVH Server, run the following commands in your terminal</p><pre>$ cd myproject<br>$ php --version<br>$ alias php=’/usr/local/phpV<strong>ersion</strong>/bin/php’<br>$ curl -sS <a href="https://getcomposer.org/installer">https://getcomposer.org/installer</a> | php<br>$ php composer.phar install</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7V1HguLQKXvt0cYIgypopA.png" /><figcaption>Composer — OVH Server — Powershell</figcaption></figure><h3>*****</h3><p>Thank you for reading !!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1809e238861" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[DataBase Import/Export]]></title>
            <link>https://medium.com/@zahia.amez/database-import-export-e46829531804?source=rss-5161222660dc------2</link>
            <guid isPermaLink="false">https://medium.com/p/e46829531804</guid>
            <category><![CDATA[import]]></category>
            <category><![CDATA[mariadb]]></category>
            <category><![CDATA[export]]></category>
            <category><![CDATA[mysql]]></category>
            <category><![CDATA[database]]></category>
            <dc:creator><![CDATA[Zahia Ameziani]]></dc:creator>
            <pubDate>Wed, 26 Oct 2022 13:23:11 GMT</pubDate>
            <atom:updated>2022-10-26T13:23:11.229Z</atom:updated>
            <content:encoded><![CDATA[<p>This article describes how to import and export MySQL and MariaDB databases.</p><h4>Export MySQL — MariaDB database</h4><p>You can export a MySQL database to a file by using phpMyAdmin or the <strong><em>mysqldump</em></strong> table/database command line.</p><pre>$ sudo apt upgrade <br>$ sudo apt install mysql-client<br>$ mysqldump -h <strong>host </strong>-u <strong>user</strong>  -p <strong>dbname</strong> &gt; <strong>mydb</strong>.sql</pre><ul><li><strong>host:</strong> the host of the database</li><li><strong>user:</strong> is the username you can login to the database with</li><li><strong>dbname:</strong> is the name of the database to export</li><li><strong>mydb.sql:</strong> is the file in the current directory that stores the output</li></ul><p>If mysqldump throws: Unknown table ‘COLUMN_STATISTICS’ in information_schema. This is due to a new flag that is enabled by default in <strong>mysqldump 8</strong>. You can disable it by adding --column-statistics=0. The command will be :</p><pre>$ mysqldump --column-statistics=0 -h <strong>host </strong>-u <strong>user</strong>  -p <strong>dbname</strong> &gt; mydb.sql</pre><h4>Import MySQL — MariaDB database</h4><pre>$ sudo apt upgrade <br>$ sudo apt install mysql-client<br>$ mysql -h <strong>host </strong>-u <strong>user</strong>  -p <strong>dbname </strong>&lt; <strong>mydb</strong>.sql</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e46829531804" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Application Versioning Process]]></title>
            <link>https://medium.com/@zahia.amez/application-versioning-process-499240f4b01?source=rss-5161222660dc------2</link>
            <guid isPermaLink="false">https://medium.com/p/499240f4b01</guid>
            <category><![CDATA[process]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[aws-ecs]]></category>
            <category><![CDATA[gitlab-ci]]></category>
            <category><![CDATA[terraform]]></category>
            <dc:creator><![CDATA[Zahia Ameziani]]></dc:creator>
            <pubDate>Wed, 26 Oct 2022 10:11:17 GMT</pubDate>
            <atom:updated>2022-10-26T10:11:17.729Z</atom:updated>
            <content:encoded><![CDATA[<p>This Article talks about Application Versioning using Terraform, Docker, Gitlab and AWS services.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f1i2nkCFy8Y9YujpdbWbkQ.jpeg" /><figcaption>Application Versioning</figcaption></figure><p><strong>Application Versioning Process</strong></p><p>The Diagram shows the process that we can follow to deploy a given application into a pre-production environment.</p><h4>Contributors</h4><ul><li>Testing Team</li><li>Dev Team</li><li>DevOps Team</li></ul><h4>Tools</h4><ul><li><strong>Testing Team:</strong> Browser</li><li><strong>Dev Team:</strong> development tools (Atom, Git, Visual Code Studio, …)</li><li><strong>DevOps Team:</strong> AWS console (ECR, ECS EC2), Terraform, Docker</li></ul><p><strong>Downtime</strong></p><ul><li>Around 7 Mintes</li></ul><h4><strong>Process Description</strong></h4><p>We suppose that the First deployment has been done (V0.0). We need to update the application. The process is that the <strong>Testing Team</strong> tests the application (design, functions, …) and reports the result to the <strong>Dev Team</strong>. the<strong> Dev Team</strong> code V0.1 and push to Git Repository. Supposing that there is <a href="https://medium.com/@zahia.amez/gitlab-ci-build-and-push-docker-image-b061699b6d4c"><strong>.gitlab-ci.yml</strong></a><strong> </strong>file to automatically build and push the Docker images to AWS ECR. The <strong>DevOps Team </strong>retrieves the result of the docker image scan to verify the vulnerabilities and decides will or not push the image to Terraform code in order to destroy the ECS Task V0.0 and deploy V0.1.</p><p>Notice that in this process, the downtime (7 minutes) will be calculated starting from <strong>DevOps Team </strong>validate the scanned docker image.</p><h3>*****</h3><p>Thank you for reading !!!<br><br>If you have any questions, feel free to leave a comment and I will be happy to answer you.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=499240f4b01" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>