<?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: Eli</title>
    <description>The latest articles on DEV Community by Eli (@eli_xciv).</description>
    <link>https://dev.to/eli_xciv</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%2F95923%2Fca26f768-1b97-4645-b9a1-7d6bcd740a04.png</url>
      <title>DEV Community: Eli</title>
      <link>https://dev.to/eli_xciv</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/eli_xciv"/>
    <language>en</language>
    <item>
      <title>Supporting Apple Devices on the Web...</title>
      <dc:creator>Eli</dc:creator>
      <pubDate>Thu, 10 Jun 2021 00:12:51 +0000</pubDate>
      <link>https://dev.to/eli_xciv/supporting-apple-devices-on-the-web-3fdp</link>
      <guid>https://dev.to/eli_xciv/supporting-apple-devices-on-the-web-3fdp</guid>
      <description>&lt;p&gt;I'm a System Admin by trade and Software Developer by heart. I've primarily been focused on system side development and automation. Primarily Python, some Java and a lot of scripting. About a year or two ago I decided to foray into Web Development. Why? It was completely different for me, and why not? All the cool kids are doing it. So I tried React, I did NOT have any Javascript experience and the learning curve was wayyy to steep. I almost stopped doing web side projects because of React (No, I'm not blaming React). React has it's uses but it's not for me (At least right now). By happenstance I stumbled upon Svelte. I felt at home. Everything just made sense for me using the framework. After working with Svelte and actually moving the needle on a side web project or two, at this point I have a much tighter grasp on the front end environment and the entire framework of frameworks. But this post isn't about React or Svelte..... this is much bigger than that.&lt;/p&gt;

&lt;p&gt;One of my side projects was trying to conduct webcam capture and making a video stream all client side. Turns out prior to the &lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder"&gt;MediaRecorder API&lt;/a&gt; this was done primarily server side? Before full client side support everything was done using WebRTC which from my research requires server side. Which would not fit my requirements. So anywho, I'm an adventurous person, lets go. I develop a sample app using the MediaRecorder API. I primarily use Chrome as a browser so I did all my development based upon Chrome. As soon as I get a prototype I figure it's time to make sure there's cross-browser compatibility. Edge (because it's now based on Chrome engine) worked well, no problems. Then using Safari on my iMac nothing works. So I launch the developer tools and there is no MediaRecorder API, it's undefined. Now mind you, I'm new to web development but I've known there's been some cross-compatability issues, which is why there are polyfills. But this is different. After some research I found &lt;a href="https://webkit.org/blog/11353/mediarecorder-api/"&gt;this blog post from the WebKit website&lt;/a&gt;. Cool hopefully it'll be supported soon? It says that it's in the iOS 14.3 Beta... Wait I didn't even think about mobile.&lt;/p&gt;

&lt;p&gt;Now, I borrowed my parents android tablet to test my prototype... it worked. The MediaRecorder API was supported in Chrome on Android. Cool lets try Apple. I tried Safari though I knew it wasn't going to work. It didn't. Though I can turn it on in the Technology Preview Section.... but I wouldn't want my users to have to do that. Then I used Chrome on iOS..... naively I expected this to work. It also didn't. I was taken aback. Time to research again. Turns out Apple forces all browsers on their platform to use the same underlying engine, of which is also based upon WebKit. Great.&lt;/p&gt;

&lt;p&gt;Now here's the kicker for me, I have a side project and prototype that I wanted to release and now I'm faced with either dropping support entirely for Apple Safari on desktop and all.. yes all! iOS devices, or at least waiting until the MediaRecorder API is supported and established. Which is who knows when. I can implement a server side capability to bypass this issue, but I don't want to do that and have to manage another thing. I did find an audio polyfill for this, but it didn't support video....&lt;/p&gt;

&lt;p&gt;All in all, why does it take so long for Apple to support API's that seem like they should be standard? I already know a lot of the answers....&lt;/p&gt;

&lt;p&gt;But, if anyone has any suggestions on being able to accomplish MediaRecorder capabilities without the API please let me know. Or else my side project will just gather dust thanks to Apple.&lt;/p&gt;

&lt;p&gt;P.S. I'm an avid Apple user.... and an avid Linux User. I used both my iMac and a laptop running Arch Linux. This blog was written on my Arch machine...&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>apple</category>
      <category>programming</category>
      <category>sideprojects</category>
    </item>
    <item>
      <title>From Ghost Blog to Static Site</title>
      <dc:creator>Eli</dc:creator>
      <pubDate>Fri, 21 May 2021 11:07:16 +0000</pubDate>
      <link>https://dev.to/eli_xciv/from-ghost-blog-to-static-site-pke</link>
      <guid>https://dev.to/eli_xciv/from-ghost-blog-to-static-site-pke</guid>
      <description>&lt;p&gt;I've always liked the Ghost Blogging platform since it was released years ago. I like it's editor, CMS, among other things. However, I don't like that I can't host it as a static site (SS). I want to be able to use the like of Netlify, Github/Gitlab pages or any other static hosting provider. I started googling and found Ned's &lt;a href="https://www.nedmcclain.com/static-ghost-site/" rel="noopener noreferrer"&gt;blog post&lt;/a&gt;. He explained his requirements which was exactly what I was looking for. He didn't explain everything, but did a good job at the overview, and so I did some of my own edits.&lt;/p&gt;

&lt;p&gt;Note: SS version of ghost does remove some features, so check Ned's list to make sure you don't need them. I didn't because I was going for simple, and I mean really simple.&lt;/p&gt;

&lt;p&gt;Basically the pipeline for doing a Static Site from Ghost is as follows&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;  Setup a local instance of Ghost (I'm using a container w/ &lt;code&gt;podman&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;  Create the site per your wants&lt;/li&gt;
&lt;li&gt;  Create a Static Site from the local ghost installation&lt;/li&gt;
&lt;li&gt;  Host the static site (We'll go over using Github pages, but you could use anything else)&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Setting up local Ghost installation
&lt;/h2&gt;

&lt;p&gt;I'm using podman so.... I can get up and running with one command....&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;podman run -d --name ghost -e url=https://localhost:8080 -p 8080:2368 ghost
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now I can point my browser to &lt;code&gt;https://localhost:8080&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Creating your site
&lt;/h2&gt;

&lt;p&gt;Checkout the Ghost docs to set up your site. I'm doing a simple blog using the Attila Theme, modified of course.&lt;/p&gt;

&lt;h2&gt;
  
  
  Creating the static site
&lt;/h2&gt;

&lt;p&gt;Now this is the bread and butter. There's a nifty npm package called &lt;code&gt;ghost-static-site-generator&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;(sudo) npm install -g ghost-static-site-generator
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That command will install a utility called &lt;code&gt;gssg&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Now &lt;code&gt;gssg&lt;/code&gt; will basically go to our local ghost installation and pull down a static version of the site.&lt;/p&gt;

&lt;h2&gt;
  
  
  Hosting + Git
&lt;/h2&gt;

&lt;p&gt;I'm using github, follow their &lt;a href="https://pages.github.com/" rel="noopener noreferrer"&gt;guide&lt;/a&gt; to create a Github pages repo.&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 &amp;lt;your_pages_repo&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;** Edit the Settings for your repo to deploy the &lt;code&gt;/docs&lt;/code&gt; folder from your repo&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Feli-xciv.github.io%2Fcontent%2Fimages%2F2021%2F05%2FScreenshot_2021-05-20-Build-software-better--together.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Feli-xciv.github.io%2Fcontent%2Fimages%2F2021%2F05%2FScreenshot_2021-05-20-Build-software-better--together.png" alt="settings"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now we're going to get a static site into &lt;code&gt;/docs&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;gssg ---domain "https://localhost:8080" --url "https://eli-xciv.github.io" --dest docs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now all you need to do is to commit and push the repo to Github and it will publish your static site.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git add . ; git commit -m "First commit of Ghost Static Site"; git push -u origin master
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Voila! in a second or so, your static site is hosted on github.io!&lt;/p&gt;




&lt;h2&gt;
  
  
  Extras
&lt;/h2&gt;

&lt;p&gt;In my repo I've created a script under &lt;code&gt;bin/migrate.sh&lt;/code&gt; that will run the migration, and commit it to github in on fell swoop.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#!/bin/bash
printf -v date '%(%Y-%m-%d %H:%M:%S)T\n' -1

gssg ---domain "https://localhost:8080" --url "https://eli-xciv.github.io" --dest docs

git add .

git commit -m "Blog Update: $date"

git push
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>ghost</category>
      <category>staticsite</category>
      <category>podman</category>
      <category>containers</category>
    </item>
    <item>
      <title>Finding an Archinstall Bug</title>
      <dc:creator>Eli</dc:creator>
      <pubDate>Thu, 20 May 2021 17:05:53 +0000</pubDate>
      <link>https://dev.to/eli_xciv/finding-an-archinstall-bug-43lg</link>
      <guid>https://dev.to/eli_xciv/finding-an-archinstall-bug-43lg</guid>
      <description>&lt;p&gt;I had an older laptop that I've been neglecting to reinstall Arch Linux on, and I came across the new Arch Installer (&lt;code&gt;archinstall&lt;/code&gt;). So I decided to try it out.&lt;/p&gt;

&lt;p&gt;I used the ArchLinux liveCD (About 2-3 months old) and booted it up. Since my LiveCD was not a newer one, &lt;code&gt;archinstall&lt;/code&gt; was not available at default. So I updated the repo's with &lt;code&gt;pacman -Sy&lt;/code&gt; and lo-and-behold I could install it with &lt;code&gt;pacman -S archinstall&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;I ran &lt;code&gt;archinstall guided&lt;/code&gt; to get a feel for it and I made it to the partitioning scheme. At which point, &lt;code&gt;archinstall&lt;/code&gt; quit stating...&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ArchInstall currently only supports machines booted with UEFI. MBR &amp;amp; GRUB support is coming in version 2.2.0!
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Great....&lt;/p&gt;

&lt;p&gt;So I decided to checkout their Github project to see where they're at and I found&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--BvOCd_W_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://eli-xciv.github.io/content/images/size/w1000/2021/05/Screenshot_2021-05-20-archlinux-archinstall.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--BvOCd_W_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://eli-xciv.github.io/content/images/size/w1000/2021/05/Screenshot_2021-05-20-archlinux-archinstall.png" alt="github-issue" width="800" height="186"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Legacy Support was closed! Okay, wait. Lets go look at it....&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3QEL_npo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://eli-xciv.github.io/content/images/size/w1000/2021/05/Screenshot_2021-05-20-archlinux-archinstall-1-.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3QEL_npo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://eli-xciv.github.io/content/images/size/w1000/2021/05/Screenshot_2021-05-20-archlinux-archinstall-1-.png" alt="github-closed" width="800" height="231"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Whoooooo, it's in master and should be completed. Lets check it out (literally w/ git).&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/archlinux/archinstall
cd archlinux
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;cool we got master, now lets install the requirements.....&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;python install
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now we can run this with python. &lt;code&gt;python -m archinstall guided&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;I followed the prompt and this time it didn't complain about &lt;code&gt;MBR&lt;/code&gt;. So cool lets select the default partitioning scheme.&lt;/p&gt;

&lt;p&gt;...&lt;/p&gt;

&lt;p&gt;Great, all config items are set, now let it rip,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Error: New partition never showed up after adding new partition on /dev/sda (timeout 10 seconds).
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;What!? - Okay maybe it's a fluke, lets run it again.&lt;/p&gt;

&lt;p&gt;Same error....&lt;/p&gt;

&lt;p&gt;Okay.... well lets look at &lt;code&gt;/dev/sda&lt;/code&gt;. There's a partition there but that's from the OS I'm trying to write over.... well lets remove it since it'll be overwritten anyway.. and verify it's removed&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$lsblk
/dev/sda
|-&amp;gt; /dev/sda1
$
$parted /dev/sda rm 1
$
$lsblk
/dev/sda
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now lets run &lt;code&gt;python -m archinstall guided&lt;/code&gt; again...&lt;/p&gt;

&lt;p&gt;Everything completes. Yay! Time to go report this to the &lt;code&gt;archinstall&lt;/code&gt; folks.&lt;/p&gt;

&lt;p&gt;And I did. &lt;a href="https://github.com/archlinux/archinstall/issues/478"&gt;Here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So, if there is a will, there's a way!&lt;br&gt;
Thanks for reading!&lt;/p&gt;

</description>
      <category>archlinux</category>
      <category>archinstall</category>
      <category>linux</category>
    </item>
    <item>
      <title>Dynamic DNS with Netlify</title>
      <dc:creator>Eli</dc:creator>
      <pubDate>Sat, 29 Jun 2019 15:56:42 +0000</pubDate>
      <link>https://dev.to/eli_xciv/dynamic-dns-with-netlify-28eb</link>
      <guid>https://dev.to/eli_xciv/dynamic-dns-with-netlify-28eb</guid>
      <description>&lt;p&gt;I purchased a domain for remote access to my home a while ago, but it was just sitting there for about a year. So I decided to do something about it. &lt;/p&gt;

&lt;p&gt;Looking at the different dynamic DNS providers, I didn't really like what they offered, or it cost $$. And I'm sort of a cheap-skate. I had used Netlify for a side project and liked what they offer. So I looked into housing my DNS with them. Turns out, most, if not everything they do is available over API. Unfortunately their API spec (&lt;a href="https://open-api.netlify.com"&gt;https://open-api.netlify.com&lt;/a&gt;) didn't have what I wanted. So I went digging &lt;/p&gt;

&lt;p&gt;I opened up the Chrome debugger and looked at the network requests that the page was doing to update DNS records, turns out it's pretty simple. The End point for DNS's is&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;https://api.netlify.com/api/v1/dns_zones/example_com/dns_records&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;At this end point you can add new records following this convention&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
    dns_zone_id: "11111111111111111",
     errors: [],
     flag: null,
     hostname: "example.com",
     id: "1111111111111111111",
     managed: false
     port: null
     priority: null
     site_id: null
     tag: null
     ttl: 3600
     type: "A"
     value: "1.1.1.1"
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;And to delete a record all you have to do is to send a &lt;code&gt;DELETE&lt;/code&gt; request to&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;https://api.netlify.com/api/v1/dns_zones/example_com/dns_records/&amp;lt;id&amp;gt;&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;So with this new found knowledge, I wrote some python running as a cron job on my raspberrypi to update my DNS with my home IP. If you want you can check out the code here.&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--A9-wwsHG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/eli-xciv"&gt;
        eli-xciv
      &lt;/a&gt; / &lt;a href="https://github.com/eli-xciv/netlify-dns-client"&gt;
        netlify-dns-client
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Netlify DNS Updater
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;h1&gt;
netlify-dns-client&lt;/h1&gt;
&lt;p&gt;Netlify DNS updater&lt;/p&gt;
&lt;p&gt;This is a simple script that you can use to update the 'A' record on Netlify's DNS service.&lt;/p&gt;
&lt;p&gt;The primary use for this is running on a raspberry pi (Debian Stretch). It's also only really used for dynamic home IP's. I may try to expand it into a full-fledged client.&lt;/p&gt;
&lt;h2&gt;
Usage&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;export NETLIFY_API_TOKEN="&amp;lt;YOUR_TOKEN&amp;gt;"&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;export NETLIFY_URL="www.example.com"&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Run the script. You can also run it as cron job.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
Future&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Expand the client to support more domains other than &lt;code&gt;.com&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Add ability for CNAME, MX records etc.&lt;/li&gt;
&lt;li&gt;Better usability&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
Contributions&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Fork it&lt;/li&gt;
&lt;li&gt;Make changes&lt;/li&gt;
&lt;li&gt;Submit Pull Request&lt;/li&gt;
&lt;li&gt;I will merge&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;

  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/eli-xciv/netlify-dns-client"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;



&lt;p&gt;P.S. I've been a lurker on dev.to for about a year, and finally decided to write.  Hopefully everyone will enjoy this information!&lt;/p&gt;

</description>
      <category>netlify</category>
      <category>api</category>
      <category>python</category>
    </item>
  </channel>
</rss>
