<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Jesus Blazquez</title>
    <description>The latest articles on DEV Community by Jesus Blazquez (@jblazquezmartin).</description>
    <link>https://dev.to/jblazquezmartin</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F885603%2F9a7bbb93-72d5-49fc-a8a3-dfe9ba6c2a87.jpeg</url>
      <title>DEV Community: Jesus Blazquez</title>
      <link>https://dev.to/jblazquezmartin</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jblazquezmartin"/>
    <language>en</language>
    <item>
      <title>Machine Learning: The Crystal Ball of Data</title>
      <dc:creator>Jesus Blazquez</dc:creator>
      <pubDate>Sun, 16 Jun 2024 19:09:23 +0000</pubDate>
      <link>https://dev.to/jblazquezmartin/machine-learning-the-crystal-ball-of-data-53ca</link>
      <guid>https://dev.to/jblazquezmartin/machine-learning-the-crystal-ball-of-data-53ca</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for &lt;a href="https://dev.to/challenges/cs"&gt;DEV Computer Science Challenge v24.06.12: One Byte Explainer&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Explainer
&lt;/h2&gt;

&lt;p&gt;Machine learning is the crystal ball of data. It sifts through vast amounts of information, learning and predicting future trends, much like nature evolves patterns over time but in record time, allowing us to find relationships in data that are beyond our comprehension.&lt;/p&gt;

&lt;h2&gt;
  
  
  Additional Context
&lt;/h2&gt;

&lt;p&gt;Machine learning is like a superpower for uncovering hidden patterns and relationships in data, almost like magic. It can detect subtle trends and connections that human minds often overlook, enabling breakthroughs in fields like healthcare, finance, and environmental science. By continuously learning and adapting, machine learning models provide insights that drive innovation and decision-making, transforming how we understand and interact with the world.&lt;br&gt;
Just as the Fibonacci sequence and the golden ratio or Benford numbers are human discoveries that show the magic implicit in nature, what new natural mechanisms can we discover with the powerful tool of machine learning?&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>cschallenge</category>
      <category>computerscience</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Dividir Dataframe en CSV s con OS y Pandas</title>
      <dc:creator>Jesus Blazquez</dc:creator>
      <pubDate>Thu, 22 Dec 2022 08:48:45 +0000</pubDate>
      <link>https://dev.to/jblazquezmartin/dividir-dataframe-en-csvs-con-os-y-pandas-56b</link>
      <guid>https://dev.to/jblazquezmartin/dividir-dataframe-en-csvs-con-os-y-pandas-56b</guid>
      <description>&lt;p&gt;Para este ejercicio se ha utlizado un ejemplo de datos de RRHH de la Comunidad de Madrid, descargado del siguiente enlace «&lt;a href="https://datos.madrid.es/egob/catalogo/300584-12-rrhh_efectivos_ult_periodo.csv%C2%AB" rel="noopener noreferrer"&gt;https://datos.madrid.es/egob/catalogo/300584-12-rrhh_efectivos_ult_periodo.csv«&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Importamos las librerias:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import os
import pandas as pd
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;con os.mkdir creamos el directorio:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;os.mkdir('data/Datos_distrito')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Listamos la carpeta de origen de datos:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;os.listdir('data')
['Datos_distrito', 'rrhh202210.csv']
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Creamos dos DF, uno con la lectura del CSV de origen de datos y otro con la seleccion de datos del Distrito Centro:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Load the data into a DataFrame
datos_df = pd.read_csv('data/rrhh202210.csv')

# Select only data for the year 2002
DistritoCentro = DistritoCentro = datos_df[datos_df.DENOMINACION_AREA == 'Distrito de Centro                                                              ']
DistritoCentro
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Debido a que los datos del campo DENOMINACION_AREA tienen un espacio posterior, debemos contar con ese espacio para que el comando anterior funcione correctamente:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdqne85e0w4yx56e0p2a8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdqne85e0w4yx56e0p2a8.png" alt="Image1" width="665" height="325"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Para solventar el problema de esta columna y eliminar el espacio en el string, ejecutamos el siguiente comando (este comando elimina los espacios anteriores y posteriores de una columna):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;datos_df['DENOMINACION_AREA'] = datos_df['DENOMINACION_AREA'].str.strip()
datos_df
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Ahora ya podemos ejecutar el comando anterior, sin el espacio en el string&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;DistritoCentro = datos_df[datos_df.DENOMINACION_AREA == 'Distrito de Centro']
DistritoCentro
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3k1zb8fq72mtaykgqvgs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3k1zb8fq72mtaykgqvgs.png" alt="Image2" width="686" height="326"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;exportamos los datos a un CSV:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Write the new DataFrame to a CSV file
DistritoCentro.to_csv('data/Datos_distrito/DistritoCentro.csv')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Para no realizar esta tarea repetitiva, distrito por distrito, podemos crear un loop que recorra los denominaciones de area y genere los ficheros.&lt;/p&gt;

&lt;p&gt;Listamos la columna «DENOMINACION_AREA» con el parametro «unique», para que solo nos muestre nombres unicos:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;datos_df['DENOMINACION_AREA'].unique()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F293hc5qecjmcvzzha2zp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F293hc5qecjmcvzzha2zp.png" alt="Image3" width="753" height="527"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Probamos toda esta informacion en un loop:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;for DENOMINACION_AREA in datos_df['DENOMINACION_AREA'].unique():
   filename='data/Datos_distrito/Distrito' +'_'+ str(DENOMINACION_AREA) + '.csv'
   print(filename)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffh6ic5xdbu3gziyayvbn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffh6ic5xdbu3gziyayvbn.png" alt="Image4" width="718" height="495"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Todo parece funcionar de forma correcta, pero antes de crear el loop y dividir la informacion por distritos, debemos realizar algunas modificaciones en los datos, ya que contienen valores nulos y mas espacios en blanco que arruinarian nuestra salida, por ello comenzaremos de nuevo con todo el origen de datos.&lt;/p&gt;

&lt;p&gt;Importamos los datos:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;datos_df_raw = pd.read_csv('data/rrhh202210.csv', on_bad_lines='skip', sep=";")
datos_df_raw
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Eliminamos los valores nulos de todo el DF:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;datos_df=datos_df_raw.dropna()
datos_df
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F77dzusc3uvgyqjlngujl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F77dzusc3uvgyqjlngujl.png" alt="Image5" width="675" height="345"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Borramos todos los espacios delante y detras de todos los string, para ello creamos una funcion que haga un loop y recorra todos los string, eliminando los espacios delante y detras:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def space_remover(dataframe):

    # iterating over the columns
    for i in dataframe.columns:

        # checking datatype of each columns
        if dataframe[i].dtype == 'object':

            # applying strip function on column
            dataframe[i] = dataframe[i].map(str.strip)
        else:

            # if condn. is False then it will do nothing.
            pass

# applying whitespace_remover function on dataframe
space_remover(datos_df)

# printing dataframe
datos_df
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqr2n9201si2cz8xlf4o6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqr2n9201si2cz8xlf4o6.png" alt="Image6" width="671" height="328"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A continuacion remplazamos todos los espacios en banco por _, en todo el DF, dado que es necesario para que el ultimo paso se ejecute de forma correcta (los espacios en blanco causan muchos problemas con la libreria Pandas, siempre es mejor eliminarlos):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;datos_df=datos_df.replace({" ": "_"}, regex=True)
datos_df
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2anvgj8fxgwc3di7gh0t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2anvgj8fxgwc3di7gh0t.png" alt="Image7" width="603" height="364"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;añadimos el resto de pasos para crear los ficheros con la informacion por distritos:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;for DENOMINACION_AREA in datos_df['DENOMINACION_AREA'].unique():

    # Select data for the distrito
    datos_area = datos_df[datos_df.DENOMINACION_AREA == DENOMINACION_AREA]

    # Write the new DataFrame to a CSV file
    filename = 'data/Datos_distrito/Distrito' + str(DENOMINACION_AREA) + '.csv'
    datos_area.to_csv(filename)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;como podemos ver se han creado lo ficheros CSV:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxmj22wgl1kq1ldduxg2b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxmj22wgl1kq1ldduxg2b.png" alt="Image8" width="540" height="353"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Y comprobamos que se ha realizado la division de forma correcta:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fua35fricmbd0namuv6t2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fua35fricmbd0namuv6t2.png" alt="Image9" width="695" height="218"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>gratitude</category>
    </item>
    <item>
      <title>How create a new field based on other numerical fields in a Pandas Dataframe</title>
      <dc:creator>Jesus Blazquez</dc:creator>
      <pubDate>Thu, 22 Dec 2022 08:31:39 +0000</pubDate>
      <link>https://dev.to/jblazquezmartin/how-create-a-new-field-based-on-other-numerical-fields-in-a-pandas-dataframe-4m6n</link>
      <guid>https://dev.to/jblazquezmartin/how-create-a-new-field-based-on-other-numerical-fields-in-a-pandas-dataframe-4m6n</guid>
      <description>&lt;p&gt;To create a new field based on other numerical fields in a pandas DataFrame, you can use the pandas.DataFrame.assign() method. This method allows you to specify a new column name and the values for the column, which can be derived from one or more existing columns in the DataFrame.&lt;/p&gt;

&lt;p&gt;For example, suppose you have a DataFrame with columns A, B, and C, and you want to create a new column called D that is equal to the sum of columns A and B. You can use the following code to do that:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import pandas as pd

df = pd.DataFrame({'A': [1, 2, 3], 'B': [4, 5, 6], 'C': [7, 8, 9]})

df = df.assign(D = df['A'] + df['B'])

print(df)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This code will create a new column D in the DataFrame with the values from columns A and B added together. The resulting DataFrame will look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   A  B  C  D
0  1  4  7  5
1  2  5  8  7
2  3  6  9  9
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Alternatively, you could also use the pandas.DataFrame.apply() method to apply a custom function to each row of the DataFrame, and create the new column based on the output of that function. For example, the following code would accomplish the same task as the code above:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import pandas as pd

df = pd.DataFrame({'A': [1, 2, 3], 'B': [4, 5, 6], 'C': [7, 8, 9]})

def sum_columns(row):
    return row['A'] + row['B']

df = df.assign(D = df.apply(sum_columns, axis=1))

print(df)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This code will also create a new column D in the DataFrame with the values from columns A and B added together. The resulting DataFrame will be the same as the one shown above.&lt;/p&gt;

</description>
      <category>inclusion</category>
      <category>diversity</category>
    </item>
    <item>
      <title>SBC ORACLE ACME PACKET HA IN AWS</title>
      <dc:creator>Jesus Blazquez</dc:creator>
      <pubDate>Fri, 01 Jul 2022 22:58:21 +0000</pubDate>
      <link>https://dev.to/jblazquezmartin/sbc-oracle-acme-packet-ha-in-aws-52hj</link>
      <guid>https://dev.to/jblazquezmartin/sbc-oracle-acme-packet-ha-in-aws-52hj</guid>
      <description>&lt;p&gt;To configure the HA utility of the Acme Packet SBCs in AWS, we must make use of the script pre-installed in the OS of our SBC, we do not need to make any changes to this script, but if we want to consult it we can access it by entering the SHELL of the SBC, writing our password, which we previously had to define for shell access:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--wEbOaQ-9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hvt5w5pgr4ofscx7iebr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wEbOaQ-9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hvt5w5pgr4ofscx7iebr.png" alt="Image description" width="445" height="73"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once inside we can consult the script:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--oo8hBiMi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kxe9jylo8d02i3y9z9cz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--oo8hBiMi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kxe9jylo8d02i3y9z9cz.png" alt="Image description" width="880" height="578"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Analyzing the script, we can see that it uses a variable to check the status of the SBC and assign which interfaces are active at that moment, so that AWS will assign the IPs to that machine, we can see in the AWS console that the IPs assigned change from one machine to another in the cluster, depending on whether one or the other is the active node.&lt;/p&gt;

&lt;p&gt;The prerequisites for this to work are to have DHCP activated in the SBC (we will assign a static IP from the AWS console), for this we must not configure IPs in Bootparam:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--KcqFJlQU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/96lumy3fbtq6597jahia.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--KcqFJlQU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/96lumy3fbtq6597jahia.png" alt="Image description" width="817" height="439"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;and we must confirm that we have the AWS DNS server IP in the SBC /etc/resolv.conf file (accessed from the shell):&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7xzm2t2e--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/as19joiql6cy354u06oe.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7xzm2t2e--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/as19joiql6cy354u06oe.png" alt="Image description" width="467" height="79"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once these points have been confirmed, for this change to be possible we need to assign a specific IAM role and a specific IAM Policy to the 2 EC2 of the node, where we need to define the variables that AWS will use to know which of the 2 cluster machines it should assign to. the IP's.&lt;br&gt;
Once the IAM Role is created, we must paste this JSON code in the IAM Policy, so that AWS can work with the script developed by Oracle for HA in AWS.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Action": [
                "ec2:DescribeAddresses",
                "ec2:DescribeNetworkInterfaces",
                "ec2:DescribeNetworkInterfaceAttribute",
                "ec2:DescribeInstanceAttribute",
                "ec2:DescribeSubnets",
                "ec2:AssignPrivateIpAddresses",
                "ec2:AssociateAddress",
                "ec2:DescribeSecurityGroups",
                "ec2:DescribeInstanceStatus"
            ],
            "Resource": "*",
            "Effect": "Allow"
        }
    ]
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We save this information and we can now test if by changing the active/passive node, all our additional IPs as well as the elastic IPs must balance between the different nodes, always being assigned to the active node at that moment.&lt;br&gt;
Also comment that at the time of assigning the additional IP's as well as the elastic IP's we must make sure that the node in which we are assigning the IP's is active.&lt;/p&gt;

&lt;p&gt;Enjoy&lt;/p&gt;

</description>
      <category>voip</category>
      <category>resilience</category>
      <category>sbc</category>
      <category>acmepacket</category>
    </item>
    <item>
      <title>How to deploy multiweb wordpress SSL certified (Let's Encrypt) in lightsail with docker-compose in 5 minutes</title>
      <dc:creator>Jesus Blazquez</dc:creator>
      <pubDate>Fri, 01 Jul 2022 16:41:13 +0000</pubDate>
      <link>https://dev.to/jblazquezmartin/how-to-deploy-multiweb-wordpress-ssl-certified-lets-encrypt-in-lightsail-with-docker-compose-in-5-minutes-4540</link>
      <guid>https://dev.to/jblazquezmartin/how-to-deploy-multiweb-wordpress-ssl-certified-lets-encrypt-in-lightsail-with-docker-compose-in-5-minutes-4540</guid>
      <description>&lt;p&gt;Deploy Centos7 in lightsail, attach static IP to your server and open this flows inside you Networking server config:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--jmfTTgb9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jtfk4icas1ghbvc1uwyj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--jmfTTgb9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jtfk4icas1ghbvc1uwyj.png" alt="Image description" width="808" height="333"&gt;&lt;/a&gt;  &lt;/p&gt;

&lt;p&gt;Now you have Lightsail done&lt;/p&gt;

&lt;p&gt;Berfore to deploy the solution you need redirect your domain to the server static IP.&lt;/p&gt;

&lt;p&gt;Access by console to your new server and install docker and docker-compose: &lt;/p&gt;

&lt;p&gt;Install docker:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;yum update &amp;amp;&amp;amp; yum install -y yum-utils device-mapper-persistent-data lvm2 &amp;amp;&amp;amp;
yum-config-manager  --add-repo https://download.docker.com/linux/centos/docker-ce.repo &amp;amp;&amp;amp;
yum install docker-ce docker-ce-cli containerd.io &amp;amp;&amp;amp;
systemctl enable docker &amp;amp;&amp;amp;
systemctl start docker 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Install docker-compose:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;yum install curl &amp;amp;&amp;amp;
curl -L "https://github.com/docker/compose/releases/download/1.23.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose &amp;amp;&amp;amp;
chmod +x /usr/local/bin/docker-compose &amp;amp;&amp;amp;
ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now make a copy of my Github repository &lt;a href="https://github.com/jblazquezmartin/docker_multiweb_https"&gt;https://github.com/jblazquezmartin/docker_multiweb_https&lt;/a&gt;, with the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git clone https://github.com/jblazquezmartin/docker_multiweb_https
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create a network in docker for nginx-proxy:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker network create nginx-proxy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run the following command inside the "nginx-proxy" directory, to launch the web server:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker-compose up -d
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;verify that it was raised correctly with the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker-compose ps
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--UBZg5Zgv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dn26cmndy0ru4k8qblf2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--UBZg5Zgv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dn26cmndy0ru4k8qblf2.png" alt="Image description" width="880" height="160"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now you must adapt the code downloaded from Github inside the «websites» directory, so that it adapts to the web(s) you want to deploy, use «websites/example.es/docker-compose.yml» as an example, you will have to adapt it to your domain:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--92mi6J3M--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zc9o1yayc6idltlywhhl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--92mi6J3M--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zc9o1yayc6idltlywhhl.png" alt="Image description" width="743" height="108"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Keep in mind that an automatic registration request for your certificate is sent to Let's Encrypt, for which you will need to fill in the "LETSENCRYPT_HOST" and "LETSENCRYPT_EMAIL" fields correctly, as well as having your domain redirected to the external IP assigned in Lightsail.&lt;/p&gt;

&lt;p&gt;Run again, inside your web directory, where you modified "docker-compose.yml", the command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker-compose up -d
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;verify that it was raised correctly with the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker-compose ps
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Z7kZZ4kH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zn66c4d29xio8k2gbcl1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Z7kZZ4kH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zn66c4d29xio8k2gbcl1.png" alt="Image description" width="630" height="101"&gt;&lt;/a&gt;&lt;br&gt;
Apache and MariaBD will be up.&lt;/p&gt;

&lt;p&gt;Now access your domain and magic!!, you have your wordpress installed with the Let's Encrypt SSL certificate configured:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VlX2Ojll--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vgcn0xjhhn7vq0u04smr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VlX2Ojll--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vgcn0xjhhn7vq0u04smr.png" alt="Image description" width="880" height="333"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Enjoy!!&lt;/p&gt;

</description>
      <category>docker</category>
      <category>dockercompose</category>
      <category>wordpress</category>
      <category>lightsail</category>
    </item>
  </channel>
</rss>
