<?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:media="http://search.yahoo.com/mrss/"><channel><title><![CDATA[Danfercf Blog]]></title><description><![CDATA[Blog about technology, progamming and other interesting stuff.]]></description><link>https://danfercf.online/</link><image><url>https://danfercf.online/favicon.png</url><title>Danfercf Blog</title><link>https://danfercf.online/</link></image><generator>Ghost 5.25</generator><lastBuildDate>Fri, 26 Jun 2026 06:59:19 GMT</lastBuildDate><atom:link href="https://danfercf.online/rss/" rel="self" type="application/rss+xml"/><ttl>60</ttl><item><title><![CDATA[How to create a manually backup for a Ghost Blog]]></title><description><![CDATA[<blockquote>Today I will show you how you can create a manually backup <strong>remotely </strong>of your database using a docker container of PHPMyAdmin.</blockquote><p>Pre requisites:</p><!--kg-card-begin: markdown--><ul>
<li>Docker installed on your environment (Local).</li>
<li>Docker Compose installed on your environment (Local).</li>
<li>A Linux SO. (Windows Powershell also). (Local)</li>
<li>A Ghost Site (Remote) I will</li></ul>]]></description><link>https://danfercf.online/how-to-create-a-manually-backup-for-a-ghost-blog/</link><guid isPermaLink="false">63122605f821820001b0ba34</guid><dc:creator><![CDATA[Daniel Candia]]></dc:creator><pubDate>Mon, 18 Dec 2023 21:16:37 GMT</pubDate><media:content url="https://danfercf.online/content/images/2022/09/mysql-ghost-backup.jpg" medium="image"/><content:encoded><![CDATA[<blockquote>Today I will show you how you can create a manually backup <strong>remotely </strong>of your database using a docker container of PHPMyAdmin.</blockquote><img src="https://danfercf.online/content/images/2022/09/mysql-ghost-backup.jpg" alt="How to create a manually backup for a Ghost Blog"><p>Pre requisites:</p><!--kg-card-begin: markdown--><ul>
<li>Docker installed on your environment (Local).</li>
<li>Docker Compose installed on your environment (Local).</li>
<li>A Linux SO. (Windows Powershell also). (Local)</li>
<li>A Ghost Site (Remote) I will use my own Ghost Blog (<a href="https://danfercf.online/">https://danfercf.info/</a>).</li>
<li>Access to server (Ghost Site) port 3306 (Remote).</li>
<li>User and password for your Mysql Server (Remote).</li>
</ul>
<!--kg-card-end: markdown--><p>The remote environment:</p><!--kg-card-begin: markdown--><p>Hardware:</p>
<ul>
<li>AWS Ec2 instance (Micro) Free tier.</li>
<li>1 GB RAM</li>
<li>Security access enabled for incoming requests (port 3306).</li>
</ul>
<p>Software:</p>
<ul>
<li>Ghost Site: 5.12.0-alpine</li>
<li>MySQL server: 8.0</li>
<li>Ngnix: 1.15.12-alpine</li>
<li>SSL: enabled</li>
</ul>
<!--kg-card-end: markdown--><p>After that we can start, we will use a repository with a PHPMyAdmin configured using Docker Compose you can fork the repository and then you can clone it or just copy the configuration in your machine. We&apos;ll follow the 2nd option. If you choose the 1st option you can find the repository here <a href="https://github.com/danfercf1/docker-examples">https://github.com/danfercf1/docker-examples</a></p><p>The configuration that you need is:</p><!--kg-card-begin: markdown--><pre><code class="language-yaml">version: &apos;3&apos;

services:

  phpmyadmin:
        image: phpmyadmin/phpmyadmin:latest
        container_name: phpmyadmin
        restart: unless-stopped
        ports:
          - 8090:80
        environment:
          PMA_HOST: ${PMA_HOST}
</code></pre>
<!--kg-card-end: markdown--><p>You need to create a file called docker-compose.yml using the above configuration.</p><p>For example I&apos;m using a folder called Projects in my home folder: </p><p>/home/my_user/Projects/example/phpmyadmin/</p><p>I will use that folder to create the file, you can use this command to create the file</p><!--kg-card-begin: markdown--><pre><code class="language-bash">touch docker-compose.yml
</code></pre>
<!--kg-card-end: markdown--><p>Then you can put the configuration into the &#xA0;file you can use vim or nano</p><!--kg-card-begin: markdown--><pre><code class="language-bash">vim docker-compose.yml
</code></pre>
<!--kg-card-end: markdown--><p>After you saved the file you can create the <strong>.env</strong>, it is for save the environment variables for the docker image</p><!--kg-card-begin: markdown--><pre><code class="language-env">PMA_HOST=danfercf.info
</code></pre>
<!--kg-card-end: markdown--><p>This is the configuration explanation:</p><!--kg-card-begin: markdown--><ul>
<li>PMA_HOST: It is the host where is the Mysql server it should be the same that your ghost site on this case it will be <strong>danfercf.info</strong>, PHPMyadmin will make the connection to this host automatically.</li>
</ul>
<!--kg-card-end: markdown--><p>After saved the .env file we can run our PHPMyadmin container we use:</p><!--kg-card-begin: markdown--><pre><code class="language-bash">docker-compose up
</code></pre>
<!--kg-card-end: markdown--><p>After the command execution we can see something like this:</p><figure class="kg-card kg-image-card"><img src="https://danfercf.online/content/images/2022/09/image.png" class="kg-image" alt="How to create a manually backup for a Ghost Blog" loading="lazy" width="1191" height="220" srcset="https://danfercf.online/content/images/size/w600/2022/09/image.png 600w, https://danfercf.online/content/images/size/w1000/2022/09/image.png 1000w, https://danfercf.online/content/images/2022/09/image.png 1191w" sizes="(min-width: 720px) 720px"></figure><p>That&apos;s mean that your container is up and ready to use</p><p>Regarding the configuration we can access to our PHPMyadmin dashboard accessing the URL: <a href="http://localhost:8090">http://localhost:8090</a></p><p>If everything is well you can see the login screen of the manager</p><figure class="kg-card kg-image-card"><img src="https://danfercf.online/content/images/2022/09/image-1.png" class="kg-image" alt="How to create a manually backup for a Ghost Blog" loading="lazy" width="469" height="452"></figure><p>There you need to fill the inputs with the MySQL user and password to access to your MySQL server for your Ghost Site.</p><p>After a successful sign in you can see the PHPMyAdmin dashboard</p><figure class="kg-card kg-image-card"><img src="https://danfercf.online/content/images/2022/09/image-2.png" class="kg-image" alt="How to create a manually backup for a Ghost Blog" loading="lazy" width="430" height="137"></figure><p>You will continue selecting the database and doing click in the export link</p><figure class="kg-card kg-image-card"><img src="https://danfercf.online/content/images/2022/09/image-3.png" class="kg-image" alt="How to create a manually backup for a Ghost Blog" loading="lazy" width="803" height="188" srcset="https://danfercf.online/content/images/size/w600/2022/09/image-3.png 600w, https://danfercf.online/content/images/2022/09/image-3.png 803w" sizes="(min-width: 720px) 720px"></figure><p>You can choose the <strong>Quick</strong> export method and the click to go</p><figure class="kg-card kg-image-card"><img src="https://danfercf.online/content/images/2022/09/image-4.png" class="kg-image" alt="How to create a manually backup for a Ghost Blog" loading="lazy" width="1254" height="349" srcset="https://danfercf.online/content/images/size/w600/2022/09/image-4.png 600w, https://danfercf.online/content/images/size/w1000/2022/09/image-4.png 1000w, https://danfercf.online/content/images/2022/09/image-4.png 1254w" sizes="(min-width: 720px) 720px"></figure><p>And that it&apos;s all, you can save the file and you will have a backup for your Ghost blog.</p>]]></content:encoded></item><item><title><![CDATA[How I lost all my Ghost blog content and how I recovered it with Google cache]]></title><description><![CDATA[<h3 id="important-this-should-works-to-recover-your-posts-content-data">Important: This should works to recover your posts content data.</h3><p>Recently I reviewed the new features on new <a href="https://ghost.org">Ghost</a> version and I decided to jump out to the new features like the native commenting and the new search feature.</p><p>On my environment I&apos;m using a docker deployment and</p>]]></description><link>https://danfercf.online/how-i-lost-all-my-blog-content-and-how-i-recovered-it-with-google-cache/</link><guid isPermaLink="false">630ffa17f821820001b0b60d</guid><category><![CDATA[Ghost]]></category><category><![CDATA[Ghost Blog]]></category><category><![CDATA[Blog]]></category><category><![CDATA[Google Cache]]></category><category><![CDATA[Recover blog]]></category><dc:creator><![CDATA[Daniel Candia]]></dc:creator><pubDate>Fri, 02 Sep 2022 19:00:14 GMT</pubDate><media:content url="https://danfercf.online/content/images/2022/09/how-to-lost-and-recover.jpg" medium="image"/><content:encoded><![CDATA[<h3 id="important-this-should-works-to-recover-your-posts-content-data">Important: This should works to recover your posts content data.</h3><img src="https://danfercf.online/content/images/2022/09/how-to-lost-and-recover.jpg" alt="How I lost all my Ghost blog content and how I recovered it with Google cache"><p>Recently I reviewed the new features on new <a href="https://ghost.org">Ghost</a> version and I decided to jump out to the new features like the native commenting and the new search feature.</p><p>On my environment I&apos;m using a docker deployment and I&apos;m using docker compose for the orchestration. I thought that the upgrade was a change like &quot;change MySQL from 5.7 to 8.0&quot;, but it was not.</p><p>In that moment I had a configuration that I describe below</p><!--kg-card-begin: markdown--><pre><code class="language-yml">services:
  db:
      image: mysql:5.7
  ghost:
      image: ghost:5.2.3-alpine
</code></pre>
<!--kg-card-end: markdown--><p>And I was going to upgrade to</p><!--kg-card-begin: markdown--><pre><code class="language-yml">services:
  db:
      image: mysql:8.0
  ghost:
      image: ghost:5.12.0-alpine
</code></pre>
<!--kg-card-end: markdown--><p>I tested an upgrade on my local environment I everything runs very well, but I didn&apos;t realized that I didn&apos;t make a test with a DB with data saved, everything was running well and all the services raised up without any issue, after that I prepared my production deployment and I did it. The process didn&apos;t work, my Database crashed without a recover option and I couldn&apos;t do a downgrade.</p><p>After I read a lot of this problem I tried to revert all the process but my MySQL 5.7 database can&apos;t start again, I observed that there were a fatal compilation errors and the service entered in a restart bucle.</p><p>I panicked and without any ideas I decided to reinstall all from scratch and I forgot to make a backup for my old DB, and it was all, all my data was gone.</p><p>I tried to recover the data using this <a href="https://dev.mysql.com/doc/refman/5.7/en/innodb-table-import.html">https://dev.mysql.com/doc/refman/5.7/en/innodb-table-import.html</a></p><p>But on my case it did not work, why?, because I replaced my docker volume with another one, It can be useful for anyone that already have the <strong>&quot;.ibd&quot;</strong> files and the MySQL server can&apos;t start.</p><p>After some hours I beginning to think about the google cache, I remembered that I saw some websites with that feature but I didn&apos;t remember how can I access it or how I could search it.</p><p>After a few turns on the google search engine I found the solution, I searched for my site on the search box, then:</p><!--kg-card-begin: markdown--><ol>
<li>Click the three dots link</li>
<li>Click the cached button</li>
</ol>
<!--kg-card-end: markdown--><figure class="kg-card kg-image-card"><img src="https://danfercf.online/content/images/2022/09/google-cache.png" class="kg-image" alt="How I lost all my Ghost blog content and how I recovered it with Google cache" loading="lazy" width="1360" height="565" srcset="https://danfercf.online/content/images/size/w600/2022/09/google-cache.png 600w, https://danfercf.online/content/images/size/w1000/2022/09/google-cache.png 1000w, https://danfercf.online/content/images/2022/09/google-cache.png 1360w" sizes="(min-width: 720px) 720px"></figure><p>And you can access all the cached data that google save about your site, I just copied the data to the new blog posts and I recovered all the data that I lost from my DB. Fortunately I didn&apos;t have another important data on my DB.</p><p>In conclusion:</p><p>I committed 3 big mistakes:</p><!--kg-card-begin: markdown--><ul>
<li>Don&apos;t configuring a scheduled database backup.</li>
<li>Don&apos;t making a database backup before the upgrade.</li>
<li>Don&apos;t preserving the docker volume before the downgrade.</li>
</ul>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[Abenity implementation into WordPress]]></title><description><![CDATA[<p>Abenity is a platform that offers deals and discounts to a certain group of users that you have in your Abenity account, but they need to sign into the platform and they offer a SSO way to login and register your users automatically.</p><p>In this time I will show how</p>]]></description><link>https://danfercf.online/abenity-implementation-into-wordpress/</link><guid isPermaLink="false">630fb1f6cb9feb0001947e7f</guid><category><![CDATA[Abenity]]></category><category><![CDATA[Abenity Worpdress]]></category><category><![CDATA[Abenity Implementation]]></category><category><![CDATA[Wrapper Composer]]></category><dc:creator><![CDATA[Daniel Candia]]></dc:creator><pubDate>Wed, 31 Aug 2022 19:37:34 GMT</pubDate><media:content url="https://danfercf.online/content/images/2022/08/abenity-3.jpg" medium="image"/><content:encoded><![CDATA[<img src="https://danfercf.online/content/images/2022/08/abenity-3.jpg" alt="Abenity implementation into WordPress"><p>Abenity is a platform that offers deals and discounts to a certain group of users that you have in your Abenity account, but they need to sign into the platform and they offer a SSO way to login and register your users automatically.</p><p>In this time I will show how you can configure and make the implementation for Abenity library into a WordPress site using a custom short-code for Abenity links.</p><ul><li>Get the API key from <a href="https://backoffice.abenity.com/account/info/api" rel="noreferrer noopener">https://backoffice.abenity.com/account/info/api</a></li><li>Generate your ssh public key:</li></ul><!--kg-card-begin: markdown--><pre><code class="language-bash">ssh-keygen -t rsa -b 2048 -C &quot;your_email@example.com&quot;
</code></pre>
<!--kg-card-end: markdown--><p>When you finished the execution of the code it should generates a new file called <strong>/home/your_user/.ssh/id_rsa.pub</strong>. You need to copy the content code into your Abenity account <a href="https://backoffice.abenity.com/account/info/api" rel="noreferrer noopener">https://backoffice.abenity.com/account/info/api</a></p><pre><code class="language-bash">cat /home/your_user/.ssh/id_rsa.pub</code></pre><p>After you copied the public key from the file you can save the configuration</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://danfercf.online/content/images/2021/12/abenity-api.png" class="kg-image" alt="Abenity implementation into WordPress" loading="lazy"><figcaption>Abenity API integration</figcaption></figure><p>After that your setup is complete and you can implement the Abenity request API, in our case we use the PHP wrapper <a href="https://github.com/Abenity/abenity-php" rel="noreferrer noopener">https://github.com/Abenity/abenity-php</a></p><p>In order to accomplish that we need to install composer if we didn&#x2019;t install it, just follow the composer installation documentation here: <a href="https://getcomposer.org/download/" rel="noreferrer noopener">https://getcomposer.org/download/</a></p><p>And then we need to create a new file in the WordPress root directory, I&#x2019;m supposing that you are using the command line console</p><pre><code class="language-bash">touch composer.json</code></pre><p>Then add the require library in the file (you can use your prefer text editor, vim or nano to open the file):</p><pre><code class="language-json">{
    &quot;require&quot;: {
        &quot;abenity/abenity-php&quot;: &quot;^2&quot;
    }
}</code></pre><p>Then you can install the library you need to run:</p><pre><code class="language-bash">composer install</code></pre><p>In this moment we have the Abenity wrapper installed in our vendor folder and we can continue with the implementation but before it we need to obtain our private key from the file <strong>/home/your_user/.ssh/id_rsa</strong></p><pre><code class="language-bash">cat /home/your_user/.ssh/id_rsa</code></pre><p>We can copy the code in another file in order to continue the implementation we use this key in the parameter $<strong>privatekey</strong> in our implementation</p><p>We will create a new file called abenity.php</p><pre><code class="language-bash">touch abenity.php</code></pre><p>And we use this example code to make the implementation for the file</p><pre><code class="language-php">&lt;?php

$get_params = $_GET;

// Include autoloader (from Composer)
require &apos;vendor/autoload.php&apos;;

// Define Abenity API Credentials. Replace these with your values.
define(&apos;ABENITY_API_USERNAME&apos;, &apos;your_API_USERNAME&apos;);
define(&apos;ABENITY_API_PASSWORD&apos;, &apos;your_API_PASSWORD&apos;);
define(&apos;ABENITY_API_KEY&apos;, &apos;your_API_KEY&apos;);

// Create new Abenity object
$abenity = new \Abenity\ApiClient(ABENITY_API_USERNAME, ABENITY_API_PASSWORD, ABENITY_API_KEY);

// Define your private key, probably read in from a file.
$privatekey = &apos;&apos;; // HERE YOU NEED TO COPY THE PRIVATE KEY THAT WAS GENERATED IN /home/your_user/.ssh/id_rsa

// Set member profile
$member = array(
    &apos;creation_time&apos; =&gt; date(&apos;c&apos;),
    &apos;salt&apos; =&gt; rand(0,100000),
    &apos;send_welcome_email&apos; =&gt; 1,
    &apos;client_user_id&apos; =&gt; $get_params[&apos;id&apos;],
    &apos;email&apos; =&gt; $get_params[&apos;email&apos;],
    &apos;firstname&apos; =&gt; $get_params[&apos;first_name&apos;],
    &apos;lastname&apos; =&gt; $get_params[&apos;last_name&apos;],
    &apos;zip&apos; =&gt; $get_params[&apos;zip&apos;],
    &apos;country&apos; =&gt; &apos;US&apos;
);

// Attempt to SSO a member
$abenity_response = $abenity-&gt;ssoMember($member, $privatekey);

if( isset($abenity_response-&gt;status) ){
    if( $abenity_response-&gt;status == &apos;ok&apos; ){
        $abenity_url = $abenity_response-&gt;data-&gt;token_url;
        $abenity_url_exploded = explode(&apos;https://your_subdomain.abenity.com&apos;, $get_params[&apos;abenity_link&apos;]);
        if (isset($abenity_url_exploded[1])) {
            $url = $abenity_url . &apos;&amp;page_request=&apos; .$abenity_url_exploded[1];
            header(&apos;Location: &apos;.$url);
        } else {
            echo &apos;Error in url exploding&apos;;
        }
        
    }else{
        // Handle $abenity_response-&gt;error ...
        var_dump($abenity_response-&gt;error);
    }
}</code></pre><p>To finish this part we will create the short-code custom file to do the implementation for the Abenity short-code, we need to go in the console to our current theme folder for example:</p><pre><code class="language-bash">cd /var/www/vhosts/abenity/httpdocs/wp-content/themes/current_theme_name</code></pre><p>And we will create a new file called <strong>custom-shortcodes.php</strong></p><pre><code class="language-toml">touch custom-shortcodes.php</code></pre><p>We add this code in that file:</p><pre><code class="language-php">&lt;?php

function generate_abenity_link( $atts = [], $content = null, $tag = &apos;&apos; ) {
    // normalize attribute keys, lowercase
    $atts = array_change_key_case( (array) $atts, CASE_LOWER );
    $user = wp_get_current_user();
    $email = $user-&gt;data-&gt;user_email;
    $user_id = $user-&gt;ID;
    $first_name = get_user_meta($user_id, &apos;first_name&apos;, true);
    $last_name = get_user_meta($user_id, &apos;last_name&apos;, true);
    $zip = get_user_meta($user_id, &apos;zip&apos;, true);
    
    // override default attributes with user attributes
    $abenity_atts = shortcode_atts(
        array(
            &apos;link&apos; =&gt; &apos;some default link to an Abenity deal&apos;,
        ), $atts, $tag
    );

    $abenity_link = $abenity_atts[&apos;link&apos;];

    $params = [
        &apos;id&apos; =&gt; $user_id,
        &apos;abenity_link&apos; =&gt; $abenity_link,
        &apos;email&apos; =&gt; $email,
        &apos;first_name&apos; =&gt; $first_name,
        &apos;last_name&apos; =&gt; $last_name,
        &apos;zip&apos; =&gt; $zip
    ];

    $get_params = http_build_query($params);
    $url = get_site_url().&apos;/abenity.php?&apos;.$get_params;
    return &apos;&lt;div class=&quot;div_abenity&quot;&gt;&lt;p&gt;&lt;a href=&quot;&apos;.$url.&apos;&quot; target=&quot;_blank&quot; class=&quot;button_abenity&quot;&gt;Claim Your Benefit&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;&apos;;
}

add_shortcode(&apos;abenity-link&apos;, &apos;generate_abenity_link&apos;);
</code></pre><p>We finish this part after the file was saved and will continue inside our WordPress dashboard</p><p>On this way we will load the custom short-codes file using the <strong>functions.php</strong> file, on our browser we go to the theme editor: <strong>https://our_wp_url/wp-admin/theme-editor.php</strong></p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://danfercf.online/content/images/2021/12/shortcode.png" class="kg-image" alt="Abenity implementation into WordPress" loading="lazy"><figcaption>Theme editor</figcaption></figure><p>We should add the next code in the last line inside the <strong>functions.php</strong> file:</p><pre><code class="language-php">/**
 * Include custom shortcodes 
*/
include(&apos;custom-shortcodes.php&apos;);</code></pre><p>Then we upload the file using the button in the bottom part of the screen</p><p>With this, we finished the implementation and we can use the short-code opening a new post and we will add the short-code on this way:</p><pre><code class="language-markup">[abenity-link link=&quot;https://your_subdomain.abenity.com/discounts/offer/604:41189&quot;]</code></pre><p>For the explanation of the link parameter, it is a parameter to generate the Abenity link with a specific deal, that will be opened in a new window after the user clicked the Abenity link.</p><p>Well it is the end of this post, I hope this will be useful and if you have any questions please let me know in the commentaries.</p><p>Best regards.</p>]]></content:encoded></item><item><title><![CDATA[How to configure the Sendgrid Inbound Parse Webhook]]></title><description><![CDATA[<p>Sendgrid it&apos;s a platform that offers a mail service delivery and the interesting thing it&apos;s that we can configure our incoming email service in their platform.</p><p>For example: I have my domain danfercf.info and I want to receive my incoming email for the email address</p>]]></description><link>https://danfercf.online/how-to-configure-the-sendgrid-inbound-parse-webhook/</link><guid isPermaLink="false">630fb2aecb9feb0001947e8e</guid><category><![CDATA[Sendgrid]]></category><category><![CDATA[Sendgrid Parse Webhook]]></category><dc:creator><![CDATA[Daniel Candia]]></dc:creator><pubDate>Wed, 31 Aug 2022 19:37:01 GMT</pubDate><media:content url="https://danfercf.online/content/images/2022/08/sengrid.jpg" medium="image"/><content:encoded><![CDATA[<img src="https://danfercf.online/content/images/2022/08/sengrid.jpg" alt="How to configure the Sendgrid Inbound Parse Webhook"><p>Sendgrid it&apos;s a platform that offers a mail service delivery and the interesting thing it&apos;s that we can configure our incoming email service in their platform.</p><p>For example: I have my domain danfercf.info and I want to receive my incoming email for the email address support@danfercf.info in my domain and I can do that with Sendgrid, we can receive the emails in Sendgrid&apos;s service the service is called &quot;Inbound Parse Webhook&quot;.</p><p>Before to configure this feature we must configure an authenticated domain, you can follow this:</p><figure class="kg-card kg-bookmark-card"><a class="kg-bookmark-container" href="https://docs.sendgrid.com/ui/account-and-settings/how-to-set-up-domain-authentication"><div class="kg-bookmark-content"><div class="kg-bookmark-title">How to set up domain authentication</div><div class="kg-bookmark-description">Set up sender authentication to improve your deliverability and security of your emails.</div><div class="kg-bookmark-metadata"><img class="kg-bookmark-icon" src="https://docs.sendgrid.com/docs/static/sendgrid/favicons/android-icon-192x192.31ea6ab94.png" alt="How to configure the Sendgrid Inbound Parse Webhook"><span class="kg-bookmark-author">.st0{fill:#FFFFFF;} .st1{fill:#FFFFFF;} .st2{fill:#99E1F4;} .st3{fill:#1A82E2;} .st4{fill:#00B2E3;} .st5{fill:#009DD9;} .st6{opacity:0.35;fill:#FFFFFF;} .st7{opacity:0.75;fill:#FFFFFF;}</span></div></div><div class="kg-bookmark-thumbnail"><img src="https://twilio-cms-prod.s3.amazonaws.com/images/domain_authentication_assign_subuser.original.png" alt="How to configure the Sendgrid Inbound Parse Webhook"></div></a></figure><p>After that we can continue and we will follow these steps to configure the service:</p><h3 id="add-the-domain-into-the-settings-page">Add the domain into the settings page:</h3><p>For this we need to go to:<br><a href="https://app.sendgrid.com/settings/parse">https://app.sendgrid.com/settings/parse</a></p><p>And then click to &quot;Add Host &amp; URL&quot;</p><figure class="kg-card kg-image-card"><img src="https://danfercf.online/content/images/2021/12/1-webhook.png" class="kg-image" alt="How to configure the Sendgrid Inbound Parse Webhook" loading="lazy"></figure><p>After that we need to configure the input data for our domain</p><figure class="kg-card kg-image-card"><img src="https://danfercf.online/content/images/2021/12/2-add-host.png" class="kg-image" alt="How to configure the Sendgrid Inbound Parse Webhook" loading="lazy"></figure><h3 id="input-description">Input description:</h3><p>* <strong>Receiving Domain:</strong> It&apos;s the subdomain for our site (We can add some one or just receive the emails for our entire domain).</p><p>* <strong>Domain:</strong> It is the authenticated domain that was configured before.</p><p>* <strong>Destination URL:</strong> This the API URL that&apos;s accepts a POST request with the data sended by Sendgrid.</p><p>* <strong>Check incoming emails for spam:</strong> A feature from Sendgrid to check the spam for our incoming emails.</p><p>* <strong>POST the raw, full MIME message:</strong> This is the input data that was send by Sendgrid but such a raw information.</p><h3 id="input-configuration">Input configuration:</h3><p>On this part we configure the inputs:</p><p>* <strong>Receiving Domain: Blank</strong>, if we don&apos;t have a subdomain.</p><p>* <strong>Domain: my-domain.info</strong>, here we need to add our domain that will receive the incoming emails.</p><p>* <strong>Destination URL: http://example.com:7000/api/mails</strong>, for this input we add our own API url that&apos;s receives a multipart/form data and returns a 200 OK status code if everything is going well with the implementation and the data received.</p><p>* <strong>Check incoming emails for spam: Checked</strong>, it&apos;s because it useful that Sendgrid checks if we receive spam in our email accounts.</p><p>* <strong>POST the raw, full MIME message: Unchecked</strong>, we don&apos;t handle this kind of data.</p><figure class="kg-card kg-image-card"><img src="https://danfercf.online/content/images/2021/12/3-finish-configuration-1.png" class="kg-image" alt="How to configure the Sendgrid Inbound Parse Webhook" loading="lazy"></figure><p>And that&apos;s it, we just click the Add button and our configuration should be saved and we can continue with the implementation for the webhook.</p><p>PD: In the next post I will explain how to implement the webhook using NodeJS and MongoDB for save the incoming email.</p><p>Best Regards.</p>]]></content:encoded></item><item><title><![CDATA[How to install a headless JDownloader server in a Raspberry Pi 2]]></title><description><![CDATA[<p>This is a tutorial to install JDownloader such a systemd service in a Raspberry PI</p><p>Prerequisites:</p><p>Install java ffmpeg decoder, vim and unrar:</p><pre><code class="language-bash">sudo apt install -y default-jdk ffmpeg vim unrar-free
</code></pre><p>Then create a new folder and enter to the created folder</p><pre><code class="language-bash">mkdir jdownloader &amp;&amp; cd jdownloader
</code></pre><p>Download the</p>]]></description><link>https://danfercf.online/how-to-install-a-headless-jdownloader-server-in-a-raspberry-pi-2/</link><guid isPermaLink="false">630fb365cb9feb0001947ea4</guid><category><![CDATA[Raspberry]]></category><category><![CDATA[Raspberry and JDownloader]]></category><category><![CDATA[JDownloader]]></category><dc:creator><![CDATA[Daniel Candia]]></dc:creator><pubDate>Wed, 31 Aug 2022 19:36:30 GMT</pubDate><media:content url="https://danfercf.online/content/images/2022/08/raspberry-jdownloader-1.jpg" medium="image"/><content:encoded><![CDATA[<img src="https://danfercf.online/content/images/2022/08/raspberry-jdownloader-1.jpg" alt="How to install a headless JDownloader server in a Raspberry Pi 2"><p>This is a tutorial to install JDownloader such a systemd service in a Raspberry PI</p><p>Prerequisites:</p><p>Install java ffmpeg decoder, vim and unrar:</p><pre><code class="language-bash">sudo apt install -y default-jdk ffmpeg vim unrar-free
</code></pre><p>Then create a new folder and enter to the created folder</p><pre><code class="language-bash">mkdir jdownloader &amp;&amp; cd jdownloader
</code></pre><p>Download the JDownloader installer</p><pre><code class="language-bash">wget http://installer.jdownloader.org/JDownloader.jar
</code></pre><p>After that we finished the installation phase and we need to configure our JDownloader, we are start running the JDownloader executable</p><pre><code class="language-bash">java -jar JDownloader.jar -norestart
</code></pre><p>Wait if there are updates, after it finished you can stop it with CTRL+C command an you need to re run it again</p><pre><code class="language-bash">java -jar JDownloader.jar -norestart
</code></pre><p>You should wait if there is another update and then configure MyJDownloader with the credentials that you created in <a href="https://my.jdownloader.org/">https://my.jdownloader.org/</a></p><p>You need to setup your email and password</p><figure class="kg-card kg-image-card"><img src="https://danfercf.online/content/images/2022/02/myjdownloader-config.png" class="kg-image" alt="How to install a headless JDownloader server in a Raspberry Pi 2" loading="lazy"></figure><p>Then you can check if your server is online in <a href="https://my.jdownloader.org/">https://my.jdownloader.org</a></p><figure class="kg-card kg-image-card"><img src="https://danfercf.online/content/images/2022/02/myjdownloader-page.png" class="kg-image" alt="How to install a headless JDownloader server in a Raspberry Pi 2" loading="lazy"></figure><p>After that you need to stop the JDownloader headless server pressing CTRL+C in the terminal</p><p>In the next phase you can configure your JDownloader server such as SystemD service it is in order to have an unattended service and you can manage it using the services commands.</p><p>Run in the terminal</p><pre><code class="language-bash">sudo touch /etc/systemd/system/jdownloader.service &amp;&amp; sudo vim /etc/systemd/system/jdownloader.service
</code></pre><p>You should copy this configuration to the opened vim terminal, keep in mind that the ExecStart needs to point to the JDownloader executable</p><pre><code class="language-text">[Unit]
Description=JDownloader
Wants=network.target
After=network.target

[Service]
Type=simple
ExecStart=java -jar /home/pi/jdownloader/JDownloader.jar -norestart
PIDFile=/home/pi/bin/jdownloader/JDownloader.pid
User=pi
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target

</code></pre><figure class="kg-card kg-image-card"><img src="https://danfercf.online/content/images/2022/02/jdownloader-systemd.png" class="kg-image" alt="How to install a headless JDownloader server in a Raspberry Pi 2" loading="lazy"></figure><p>And that&apos;s it you can finish the configuration reloading the SystemD Daemon</p><pre><code class="language-bash">sudo systemctl daemon-reload
</code></pre><p>Start the service</p><pre><code class="language-bash">sudo systemctl start jdownloader.service
</code></pre><p>And at the end you need to enable the service</p><pre><code class="language-bash">sudo systemctl enable jdownloader.service
</code></pre><p>You can check the service status using</p><pre><code class="language-bash">sudo service jdownloader status
</code></pre><figure class="kg-card kg-image-card"><img src="https://danfercf.online/content/images/2022/02/jdownloader-systemd-finished.png" class="kg-image" alt="How to install a headless JDownloader server in a Raspberry Pi 2" loading="lazy"></figure><p>And that&apos;s it you have your JDownloader server in your Raspberry Pi and you can queue downloads using MyJDownloader from everywhere.</p>]]></content:encoded></item><item><title><![CDATA[How to add a RAM free up script into Raspbian for a Raspberry PI 2 b+]]></title><description><![CDATA[<p>On this time we create a script using a cronjob to free up RAM in our Raspberry PI, it will run every 5 hours. I made this script because I realized that Raspberry PI freezes sometimes and it&apos;s because the device it&apos;s ran out of memory.</p>]]></description><link>https://danfercf.online/how-to-add-a-ram-free-up-script-into-raspbian-for-a-raspberry-pi-2-b/</link><guid isPermaLink="false">630fb3becb9feb0001947eae</guid><category><![CDATA[Raspberry]]></category><category><![CDATA[Free RAM Raspberry]]></category><category><![CDATA[Cronjob]]></category><dc:creator><![CDATA[Daniel Candia]]></dc:creator><pubDate>Wed, 31 Aug 2022 19:35:39 GMT</pubDate><media:content url="https://danfercf.online/content/images/2022/08/raspberry-free-ram-cronjob-1-1.jpg" medium="image"/><content:encoded><![CDATA[<img src="https://danfercf.online/content/images/2022/08/raspberry-free-ram-cronjob-1-1.jpg" alt="How to add a RAM free up script into Raspbian for a Raspberry PI 2 b+"><p>On this time we create a script using a cronjob to free up RAM in our Raspberry PI, it will run every 5 hours. I made this script because I realized that Raspberry PI freezes sometimes and it&apos;s because the device it&apos;s ran out of memory.</p><p>In your home folder or where you want to create the script, you start creating the file, in the terminal we use</p><pre><code class="language-bash">touch free-ram.sh &amp;&amp; chmod +x free-ram.sh
</code></pre><p>Open the file using vim or whatever you use to edit files</p><pre><code class="language-bash">vim free-ram.sh
</code></pre><p>We add this script into the file, this script generates a log file also, it&apos;s in order to check the free RAM after runs the script</p><pre><code class="language-bash">#!/bin/bash
FILE=/var/log/free-ram.log
sync
echo 3 &gt; /proc/sys/vm/drop_caches

if test -f &quot;$FILE&quot;; then
    echo -e &quot;$(date) \n$(egrep &apos;MemFree|MemAvailable&apos; /proc/meminfo)&quot;  &gt;&gt; /var/log/free-ram.log
else
    touch /var/log/free-ram.log
    echo -e &quot;$(date) \n$(egrep &apos;MemFree|MemAvailable&apos; /proc/meminfo)&quot; &gt;&gt; /var/log/free-ram.log
fi
</code></pre><p>You can test the script using</p><pre><code class="language-bash">sudo ./free-ram.sh
</code></pre><p>After the script running process is finished you can check the results inside the log file created on &quot;/var/log/free-ram.log&quot;</p><pre><code class="language-bash">tail /var/log/free-ram.log
</code></pre><p>You can see the results</p><pre><code class="language-bash">Fri 26 Aug 11:17:18 -04 2022 
MemFree:          539644 kB
MemAvailable:     656820 kB</code></pre><p>After that we can procede to add the new task on the cronjob list</p><p>First you need to switch the user to the root user</p><pre><code class="language-bash">sudo su
</code></pre><p>Then open the crontab editor with</p><pre><code class="language-bash">crontab -e
</code></pre><p>You can something like this</p><pre><code class="language-text"># Edit this file to introduce tasks to be run by cron.
# 
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
# 
# To define the time you can provide concrete values for
# minute (m), hour (h), day of month (dom), month (mon),
# and day of week (dow) or use &apos;*&apos; in these fields (for &apos;any&apos;).
# 
# Notice that tasks will be started based on the cron&apos;s system
# daemon&apos;s notion of time and timezones.
# 
# Output of the crontab jobs (including errors) is sent through
# email to the user the crontab file belongs to (unless redirected).
# 
# For example, you can run a backup of all your user accounts
# at 5 a.m every week with:
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
# 
# For more information see the manual pages of crontab(5) and cron(8)
# 
# m h  dom mon dow   command
</code></pre><p>At the end of the file you will add the cronjob task using the absolute path of your script in my case my script is on my home folder &quot;/home/pi/projects/scripts/free-ram.sh&quot;</p><p>The file will look like this after the modification</p><pre><code class="language-text"># Edit this file to introduce tasks to be run by cron.
# 
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
# 
# To define the time you can provide concrete values for
# minute (m), hour (h), day of month (dom), month (mon),
# and day of week (dow) or use &apos;*&apos; in these fields (for &apos;any&apos;).
# 
# Notice that tasks will be started based on the cron&apos;s system
# daemon&apos;s notion of time and timezones.
# 
# Output of the crontab jobs (including errors) is sent through
# email to the user the crontab file belongs to (unless redirected).
# 
# For example, you can run a backup of all your user accounts
# at 5 a.m every week with:
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
# 
# For more information see the manual pages of crontab(5) and cron(8)
# 
# m h  dom mon dow   command
0 */5 * * * /home/pi/projects/scripts/free-ram.sh</code></pre><p>And that&apos;s it, the script will free up ram every 5 hours and you can check the logs inside the logs folder.</p>]]></content:encoded></item></channel></rss>