<?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: Andrea Pavone</title>
    <description>The latest articles on DEV Community by Andrea Pavone (@andp97).</description>
    <link>https://dev.to/andp97</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%2F237408%2F053b6b22-5635-47b0-aef7-5443ee6cdb0c.jpeg</url>
      <title>DEV Community: Andrea Pavone</title>
      <link>https://dev.to/andp97</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/andp97"/>
    <language>en</language>
    <item>
      <title>Cloudflare as a Dynamic DNS🌩</title>
      <dc:creator>Andrea Pavone</dc:creator>
      <pubDate>Sun, 07 Mar 2021 19:22:39 +0000</pubDate>
      <link>https://dev.to/andp97/cloudflare-as-a-dynamic-dns-5768</link>
      <guid>https://dev.to/andp97/cloudflare-as-a-dynamic-dns-5768</guid>
      <description>&lt;p&gt;If you need to have a DNS record that point to a Dynamic IP (&lt;a href="https://it.wikipedia.org/wiki/Dynamic_DNS"&gt;DDNS&lt;/a&gt;), for example, you home IP address, this tool allow you to accomplish this job!&lt;/p&gt;

&lt;p&gt;For do this this we need &lt;a href="https://github.com/andp97/cloudflare-dynamic-ip"&gt;cloudflare-dynamic-ip&lt;/a&gt; tool allow you to simply have a specific DNS record such as &lt;code&gt;home.example.com&lt;/code&gt; that point to your dynamic IP.&lt;/p&gt;

&lt;h3&gt;
  
  
  Requirements
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;  Domain Name&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://www.cloudflare.com/"&gt;Cloudflare Account&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  Raspberry Pi4 or any other Linux Based OS&lt;/li&gt;
&lt;li&gt;  &lt;code&gt;composer&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;code&gt;php-7.3&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Installation
&lt;/h3&gt;

&lt;p&gt;Clone the Github &lt;a href="https://github.com/andp97/cloudflare-dynamic-ip#installation"&gt;repo&lt;/a&gt;, install dependencies, set API Token and set a cron job every 15min that run this script and you’re done!🚀&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/andp97/cloudflare-dynamic-ip.git
cd cloudflare-dynamic-ip
INSTALL_PATH=$(pwd)
composer install --no-dev
nano .env
echo -e "*/15 * * * * $INSTALL_PATH/cf-ip 2&amp;gt;&amp;amp;1 &amp;gt; /dev/null\n"
crontab -e
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can also execute this script via bash&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#Get dns record name from env and target ip from remote host (https://ip.andreapavone.com) 

./cf-ip

#Passing parameters to the script

./cf-ip &amp;lt;dns_record_name&amp;gt; &amp;lt;target_ip&amp;gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On &lt;code&gt;.env&lt;/code&gt; file you can set:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;code&gt;CLOUDFLARE_TOKEN&lt;/code&gt; (see how can you generate token here:
&lt;a href="https://support.cloudflare.com/hc/en-us/articles/200167836-Managing-API-Tokens-and-Keys"&gt;https://support.cloudflare.com/hc/en-us/articles/200167836-Managing-API-Tokens-and-Keys&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;  &lt;code&gt;CLOUDFLARE_ZONE_NAME&lt;/code&gt; or &lt;code&gt;CLOUDFLARE_ZONE_ID&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;code&gt;DNS_RECORD_NAME&lt;/code&gt; is the subdomain that you prefer to use (for
example: &lt;strong&gt;home&lt;/strong&gt;.example.com). If you prefer to be safer use a
randomized token for the &lt;code&gt;DNS_RECORD_NAME&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Update
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git pull
composer update
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>cloudflare</category>
      <category>ddns</category>
      <category>raspberrypi</category>
    </item>
    <item>
      <title>Docker high disk space usage 💾 📈</title>
      <dc:creator>Andrea Pavone</dc:creator>
      <pubDate>Sun, 24 Jan 2021 16:16:51 +0000</pubDate>
      <link>https://dev.to/andp97/docker-heavy-disk-space-usage-4gp3</link>
      <guid>https://dev.to/andp97/docker-heavy-disk-space-usage-4gp3</guid>
      <description>&lt;h3&gt;
  
  
  Did you find an heavy disk space usage on your server and you don't know what is the root cause?
&lt;/h3&gt;

&lt;p&gt;If you do some tests with Docker or you're running some containers on your machine, the cause of this abnormal disk space usage might be just Docker 🐋!&lt;/p&gt;

&lt;p&gt;For example on my Raspberry Pi 4 I've seen an heavy space usage on &lt;code&gt;/var/lib/docker/&lt;/code&gt; directory, specially on &lt;code&gt;overlay2&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;root@rpi4:/home/user# du -h -d 1 /var/lib/docker/
2,6M    /var/lib/docker/image
15G     /var/lib/docker/overlay2
5,2M    /var/lib/docker/containers
...
17G     /var/lib/docker/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To fix this issue you can employ this command &lt;code&gt;docker system prune&lt;/code&gt; see an example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;root@rpi4:/home/user# docker system prune
WARNING! This will remove:
  - all stopped containers
  - all networks not used by at least one container
  - all dangling images
  - all dangling build cache

Are you sure you want to continue? [y/N] y
Deleted Containers:
64086f34849c92aa2aed8a8757d7c395fbd4a2d77103174bd23a9efc8e0ec333
7be7eda3b32971f39cf08629eaf6d8f42c2677d02f220e0a09a4d955fb0ff5bb
aef03c9d804ae46ed17fa3ecd602a6d335f810a025204f208b3d78186ef26864

Total reclaimed space: 14.04GB
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;a href="https://andreapavone.com/2021/01/liberare-spazio-su-docker/"&gt;Do you want more information or simply read this article in original language (Italian 🇮🇹)?&lt;/a&gt;
&lt;/h3&gt;

</description>
      <category>docker</category>
      <category>ubuntu</category>
      <category>opensource</category>
      <category>raspberrypi</category>
    </item>
    <item>
      <title>IP Camera NVR for Home surveillance with [Docker 🐋️ + Raspberry 🍓️ + S3] in just 5min🚀️! </title>
      <dc:creator>Andrea Pavone</dc:creator>
      <pubDate>Fri, 24 Apr 2020 22:35:47 +0000</pubDate>
      <link>https://dev.to/andp97/ip-camera-nvr-for-home-surveillance-with-docker-raspberry-s3-in-just-5min-oa</link>
      <guid>https://dev.to/andp97/ip-camera-nvr-for-home-surveillance-with-docker-raspberry-s3-in-just-5min-oa</guid>
      <description>&lt;p&gt;In this article we're going to configure a NVR server for saving home IP Camera video on Raspberry PI 4 and keep a copy of them on AWS S3 Storage.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Install Docker on RaspberryPi
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo su -
curl -fsSL https://get.docker.com -o get-docker.sh
sh get-docker.sh
usermod -aG docker pi
systemctl status docker
● docker.service - Docker Application Container Engine
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2. Download Kerberos.io container and run them
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker pull kerberos/kerberos
docker run --name camera1 -p 80:80 -p 8889:8889 -d kerberos/kerberos
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Double check, container is running correctly?&lt;br&gt;
&lt;/p&gt;

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

CONTAINER ID        IMAGE                 COMMAND             CREATED             STATUS              PORTS                                            NAMES
aef03c9d804a        kerberos/kerberos     "sh /run.sh"        10 days ago         Up 10 days          0.0.0.0:80-&amp;gt;80/tcp, 0.0.0.0:8889-&amp;gt;8889/tcp       camera1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3. Kerberos.io configuration
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Go to &lt;a href="http://your_raspberry_ip/"&gt;http://your_raspberry_ip/&lt;/a&gt; follow the configuration step and set admin user/password. (Currentrly this app support only 1 user)&lt;/li&gt;
&lt;li&gt;Login&lt;/li&gt;
&lt;li&gt;Go to &lt;strong&gt;Configuration&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Set the RTSP camera URL, resolution and frame rate. (&lt;a href="https://www.ispyconnect.com/man.aspx?n=Generic"&gt;Most common camera rstp URL&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;Open the Dashboard and see the Live Stream from your camera and the lastest records activities&lt;/li&gt;
&lt;li&gt;Go to Configuration &amp;gt; Advanced &amp;gt; S3 and set Bucket, folder, publicKey and privateKey&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8Onzqglw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/jd33h5zefoe9mqm0oxoi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8Onzqglw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/jd33h5zefoe9mqm0oxoi.png" alt="Dashboard Image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Do you like Kubernetes?&lt;/strong&gt;&lt;br&gt;
You can deploy &lt;a href="http://doc.kerberos.io/architectures#kerberos-enterprise--5-kerberos-agents"&gt;Kerberos on Kubernetes&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://andreapavone.com/2020/04/home-ip-cam-docker-raspberry-pi-4/"&gt;See Other...&lt;/a&gt;&lt;/p&gt;

</description>
      <category>docker</category>
      <category>raspberrypi</category>
      <category>aws</category>
      <category>s3</category>
    </item>
  </channel>
</rss>
