<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US"><generator uri="https://jekyllrb.com/" version="4.1.1">Jekyll</generator><link href="https://jorp.xyz/feed.xml" rel="self" type="application/atom+xml" /><link href="https://jorp.xyz/" rel="alternate" type="text/html" hreflang="en-US" /><updated>2023-07-28T14:38:49-04:00</updated><id>https://jorp.xyz/feed.xml</id><title type="html">jorp.xyz</title><subtitle></subtitle><author><name>jordan pisaniello</name><email>jorp@jorp.xyz</email></author><entry><title type="html">ex374</title><link href="https://jorp.xyz/posts/ex374/" rel="alternate" type="text/html" title="ex374" /><published>2023-07-28T10:30:08-04:00</published><updated>2023-07-28T10:30:08-04:00</updated><id>https://jorp.xyz/posts/ex374</id><content type="html" xml:base="https://jorp.xyz/posts/ex374/"><![CDATA[<p><a href="https://www.credly.com/badges/c6621a92-c588-42bf-b306-011e137fd0d5/public_url">Another one</a> bites the dust. Well, as I said in my <a href="https://jorp.xyz/posts/ex288/">last certification post</a>, successful time management <em>is</em> a moving target. I’ve been MIA for a few months now focusing on some other things, but I will continue to march on!</p>

<p>For anyone looking for advice on the Red Hat Certified Specialist in Developing Automation with Ansible Automation Platform (EX374) exam (wow, what mouthful), I will just parrot the usual “focus on <a href="https://www.redhat.com/en/services/training/red-hat-certified-specialist-developing-automation-ansible-automation-platform-exam?section=objectives">the objectives</a>” line.</p>]]></content><author><name>jordan pisaniello</name><email>jorp@jorp.xyz</email></author><category term="red hat" /><category term="certification" /><category term="ansible" /><summary type="html"><![CDATA[Another one bites the dust. Well, as I said in my last certification post, successful time management is a moving target. I’ve been MIA for a few months now focusing on some other things, but I will continue to march on!]]></summary></entry><entry><title type="html">ansiblefest 2022</title><link href="https://jorp.xyz/posts/ansiblefest-2022/" rel="alternate" type="text/html" title="ansiblefest 2022" /><published>2022-10-27T06:14:25-04:00</published><updated>2022-10-27T06:14:25-04:00</updated><id>https://jorp.xyz/posts/ansiblefest-2022</id><content type="html" xml:base="https://jorp.xyz/posts/ansiblefest-2022/"><![CDATA[<p>Better late than never? It’s been a lot longer than I would like to get a new post out… but as you all know, life happens. A lot of good things fortunately, so no complaints here.</p>

<hr />

<p>I had a great time at AnsibleFest 2022 in Chicago. I’ve never been to this city, but the rivers were really neat:
<img src="assets/riverwalk.jpg" alt="" /></p>

<p>It’s great to be at conferences in person again, virtual gatherings just don’t provide the same experience. I got to banter about industry, meet a lot of interesting folks, and learned some new best practices.</p>

<p>There were some great talks out there, but one that stood out to me (and will to you if you’re a tinkerer) was Jeff Geerling’s ‘<a href="https://www.jeffgeerling.com/blog/2022/automating-my-homelab-ansible-ansiblefest-2022">Automating my Homelab with Ansible</a>’. I even got to meet the man himself:
<img src="assets/me-and-jeff-geerling.jpg" alt="" /></p>

<p>Here’s a quick grab from the keynote kick-off, the room was <em>packed</em>:
<img src="assets/presentation.jpg" alt="" /></p>

<p>I didn’t take many pictures, so here’s a giant Ansible ‘A’ from the venue:
<img src="assets/ansible-logo.jpg" alt="" /></p>]]></content><author><name>jordan pisaniello</name><email>jorp@jorp.xyz</email></author><summary type="html"><![CDATA[Better late than never? It’s been a lot longer than I would like to get a new post out… but as you all know, life happens. A lot of good things fortunately, so no complaints here.]]></summary></entry><entry><title type="html">generate fact report with ansible</title><link href="https://jorp.xyz/posts/generate-fact-report-with-ansible/" rel="alternate" type="text/html" title="generate fact report with ansible" /><published>2022-06-09T08:05:01-04:00</published><updated>2022-06-09T08:05:01-04:00</updated><id>https://jorp.xyz/posts/generate-fact-report-with-ansible</id><content type="html" xml:base="https://jorp.xyz/posts/generate-fact-report-with-ansible/"><![CDATA[<p>So you’ve been asked to gather a report of several metrics of some servers you manage. It needs to be readable, so tabular output would be best. What can we do with ansible?</p>

<p>Well, we can leverage facts to get the data we desire, and then output them locally to a template csv.</p>

<p>Create a local jinja2 csv template file with the fields desired. In my case, we’ll be gathering mostly hardware specific information:</p>

<p><code class="language-plaintext highlighter-rouge">servers.csv.j2</code>:</p>

<figure class="highlight"><pre><code class="language-jinja" data-lang="jinja">hostname,system_vendor,product_name,platform,memory(mb),number_of_cpus
<span class="cp">{%</span> <span class="k">for</span> <span class="nv">h</span> <span class="ow">in</span> <span class="nv">ansible_play_hosts</span> <span class="cp">%}</span>
<span class="cp">{{</span> <span class="nv">h</span> <span class="cp">}}</span>,<span class="cp">{{</span> <span class="nv">hostvars</span><span class="p">[</span><span class="nv">h</span><span class="p">][</span><span class="s1">'ansible_system_vendor'</span><span class="p">]</span> <span class="cp">}}</span>,<span class="cp">{{</span> <span class="nv">hostvars</span><span class="p">[</span><span class="nv">h</span><span class="p">][</span><span class="s1">'ansible_product_name'</span><span class="p">]</span> <span class="cp">}}</span>,<span class="cp">{{</span> <span class="nv">hostvars</span><span class="p">[</span><span class="nv">h</span><span class="p">][</span><span class="s1">'ansible_distribution'</span><span class="p">]</span> <span class="cp">}}</span> <span class="cp">{{</span> <span class="nv">hostvars</span><span class="p">[</span><span class="nv">h</span><span class="p">][</span><span class="s1">'ansible_distribution_version'</span><span class="p">]</span> <span class="cp">}}</span>,<span class="cp">{{</span> <span class="nv">hostvars</span><span class="p">[</span><span class="nv">h</span><span class="p">][</span><span class="s1">'ansible_memtotal_mb'</span><span class="p">]</span> <span class="cp">}}</span>,<span class="cp">{{</span> <span class="nv">hostvars</span><span class="p">[</span><span class="nv">h</span><span class="p">][</span><span class="s1">'ansible_processor_vcpus'</span><span class="p">]</span> <span class="cp">}}</span>
<span class="cp">{%</span> <span class="k">endfor</span> <span class="cp">%}</span></code></pre></figure>

<p>Now, we’ll form our playbook as such:</p>

<p><code class="language-plaintext highlighter-rouge">playbook.yml</code>:</p>

<figure class="highlight"><pre><code class="language-yaml" data-lang="yaml"><span class="pi">-</span> <span class="na">hosts</span><span class="pi">:</span> <span class="s">all</span>
  <span class="na">become</span><span class="pi">:</span> <span class="s">yes</span>
  <span class="na">gather_facts</span><span class="pi">:</span> <span class="s">yes</span>

  <span class="na">tasks</span><span class="pi">:</span>
    <span class="pi">-</span> <span class="na">name</span><span class="pi">:</span> <span class="s">output to template</span>
      <span class="na">template</span><span class="pi">:</span>
        <span class="na">src</span><span class="pi">:</span> <span class="s">servers.csv.j2</span>
        <span class="na">dest</span><span class="pi">:</span> <span class="s">servers.csv</span>
      <span class="na">delegate_to</span><span class="pi">:</span> <span class="s">localhost</span></code></pre></figure>

<p>Note: This example will require you to have the same credentials locally as well as remotely. If your user account locally differs from your remote account used for fact gathering, you’ll need to play around with your <code class="language-plaintext highlighter-rouge">ansible.cfg</code> and likely <code class="language-plaintext highlighter-rouge">ansible-vault</code> along with inventory variables to manage separate passwords.</p>

<p>Here’s an example of the resulting local <code class="language-plaintext highlighter-rouge">servers.csv</code> file:</p>
<pre><code class="language-csv">hostname,system_vendor,product_name,platform,memory(mb),number_of_cpus
server1,QEMU,Standard PC (Q35 + ICH9, 2009),CentOS 9,3719,2
server2,QEMU,Standard PC (Q35 + ICH9, 2009),CentOS 9,7125,4
</code></pre>]]></content><author><name>jordan pisaniello</name><email>jorp@jorp.xyz</email></author><category term="ansible" /><summary type="html"><![CDATA[So you’ve been asked to gather a report of several metrics of some servers you manage. It needs to be readable, so tabular output would be best. What can we do with ansible?]]></summary></entry><entry><title type="html">ansible become method fallback</title><link href="https://jorp.xyz/posts/ansible-become-method-fallback/" rel="alternate" type="text/html" title="ansible become method fallback" /><published>2022-02-06T06:52:34-05:00</published><updated>2022-02-06T06:52:34-05:00</updated><id>https://jorp.xyz/posts/ansible-become-method-fallback</id><content type="html" xml:base="https://jorp.xyz/posts/ansible-become-method-fallback/"><![CDATA[<p>Let’s say you have the following hypothetical environment which contains two subsets of servers:</p>

<ul>
  <li>Internal servers: configured to use Centrify/AD for authentication (<code class="language-plaintext highlighter-rouge">dzdo</code> for your <code class="language-plaintext highlighter-rouge">become</code> method)</li>
  <li>DMZ servers: configured with traditional sudoers files since access to internal AD is not available (<code class="language-plaintext highlighter-rouge">sudo</code> for your become method)</li>
</ul>

<p>Assuming our inventory can’t be grouped by some trait like hostname, network segment, etc, what is the fastest (and laziest) way we can run our playbook against all these hosts?</p>

<p>Disclaimer: You should probably work on creating a stronger inventory. The following serves as a workaround only.</p>

<p><code class="language-plaintext highlighter-rouge">playbook.yml</code>:</p>

<div class="language-yaml highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="pi">-</span> <span class="na">hosts</span><span class="pi">:</span> <span class="s">all</span>
  <span class="na">become</span><span class="pi">:</span> <span class="s">no</span>
  <span class="na">become_method</span><span class="pi">:</span> <span class="s">dzdo</span>
  <span class="na">gather_facts</span><span class="pi">:</span> <span class="s">no</span>

  <span class="na">tasks</span><span class="pi">:</span>
    <span class="c1"># fall back to sudo if centrify isn't configured</span>
    <span class="pi">-</span> <span class="na">name</span><span class="pi">:</span> <span class="s">get hw info</span>
      <span class="na">block</span><span class="pi">:</span>
        <span class="pi">-</span> <span class="na">name</span><span class="pi">:</span> <span class="s">try with dzdo</span>
          <span class="na">gather_facts</span><span class="pi">:</span>
      <span class="na">rescue</span><span class="pi">:</span>
        <span class="pi">-</span> <span class="na">name</span><span class="pi">:</span> <span class="s">fallback to sudo</span>
          <span class="na">vars</span><span class="pi">:</span>
            <span class="na">ansible_become_method</span><span class="pi">:</span> <span class="s">sudo</span>
          <span class="na">gather_facts</span><span class="pi">:</span>
      <span class="na">become</span><span class="pi">:</span> <span class="s">yes</span>
</code></pre></div></div>

<p>If our server isn’t configured with Centrify for AD authentication, the playbook will fallback and attempt to use <code class="language-plaintext highlighter-rouge">sudo</code>.</p>]]></content><author><name>jordan pisaniello</name><email>jorp@jorp.xyz</email></author><category term="ansible" /><summary type="html"><![CDATA[Let’s say you have the following hypothetical environment which contains two subsets of servers:]]></summary></entry><entry><title type="html">backup your iphone on fedora linux 35</title><link href="https://jorp.xyz/posts/backup-your-iphone-on-fedora-linux-35/" rel="alternate" type="text/html" title="backup your iphone on fedora linux 35" /><published>2021-11-02T04:46:40-04:00</published><updated>2021-11-02T04:46:40-04:00</updated><id>https://jorp.xyz/posts/backup-your-iphone-on-fedora-linux-35</id><content type="html" xml:base="https://jorp.xyz/posts/backup-your-iphone-on-fedora-linux-35/"><![CDATA[<p>the following were used in this guide:</p>
<ul>
  <li>Fedora Linux 35</li>
  <li>iPhone X
    <ul>
      <li>iOS 15.1</li>
    </ul>
  </li>
  <li>libimobiledevice 1.3.1</li>
</ul>

<h3 id="install-dependencies">install dependencies:</h3>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>dnf <span class="nb">install</span> <span class="nt">-y</span> libtool automake autoconf libplist-devel libusbmuxd-devel openssl-devel
</code></pre></div></div>

<h4 id="install-libimobiledevice-glue">install <code class="language-plaintext highlighter-rouge">libimobiledevice-glue</code></h4>

<p>from source:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>git clone https://github.com/libimobiledevice/libimobiledevice-glue.git
<span class="nb">cd </span>libimobiledevice-glue
./autogen.sh
make
<span class="nb">sudo </span>make <span class="nb">install</span>
</code></pre></div></div>

<h3 id="install-libimobiledevice">install <code class="language-plaintext highlighter-rouge">libimobiledevice</code></h3>
<p>from source:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>git clone https://github.com/libimobiledevice/libimobiledevice.git
<span class="nb">cd </span>libimobiledevice
<span class="nv">PKG_CONFIG_PATH</span><span class="o">=</span>/usr/local/lib/pkgconfig ./autogen.sh
make
<span class="nb">sudo </span>make <span class="nb">install</span>
</code></pre></div></div>

<h2 id="backing-up">backing up</h2>

<p>(optional, but recommended) enable encryption with specified password</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>idevicebackup2 backup encryption on PASSWORD
</code></pre></div></div>

<p>backup your device</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>idevicebackup2 backup /path/to/iphone_backup
</code></pre></div></div>

<h2 id="restoring">restoring</h2>
<p>“Find My iPhone” must be disabled before proceeding:</p>

<p><code class="language-plaintext highlighter-rouge">Settings</code> &gt; <code class="language-plaintext highlighter-rouge">Apple ID</code> (The very first entry with your name) &gt; <code class="language-plaintext highlighter-rouge">Find My</code> &gt; <code class="language-plaintext highlighter-rouge">Find My iPhone</code> &gt; <code class="language-plaintext highlighter-rouge">Off</code></p>

<p>the <code class="language-plaintext highlighter-rouge">--reboot</code> flag passed below will reboot your device after the restore is complete</p>

<h4 id="the-same-device">the same device</h4>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>idevicebackup2 restore <span class="nt">--system</span> <span class="nt">--settings</span> <span class="nt">--reboot</span> <span class="nt">--password</span> PASSWORD /path/to/iphone_backup
</code></pre></div></div>

<h4 id="to-a-new-device">to a new device</h4>
<p>for this, you’ll need to specify the source UUID of your old device. you can get this by plugging in your old device via usb and running:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>idevice_id
</code></pre></div></div>

<p>then, run the below:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>idevicebackup2 <span class="nt">--source</span> SOURCE_UUID restore <span class="nt">--system</span> <span class="nt">--settings</span> <span class="nt">--reboot</span> <span class="nt">--password</span> PASSWORD /path/to/iphone_backup/
</code></pre></div></div>]]></content><author><name>jordan pisaniello</name><email>jorp@jorp.xyz</email></author><category term="fedora" /><category term="iphone" /><summary type="html"><![CDATA[the following were used in this guide: Fedora Linux 35 iPhone X iOS 15.1 libimobiledevice 1.3.1]]></summary></entry><entry><title type="html">install webtrees on rocky linux 8</title><link href="https://jorp.xyz/posts/install-webtrees-on-rocky-linux-8/" rel="alternate" type="text/html" title="install webtrees on rocky linux 8" /><published>2021-10-07T11:43:04-04:00</published><updated>2021-10-07T11:43:04-04:00</updated><id>https://jorp.xyz/posts/install-webtrees-on-rocky-linux-8</id><content type="html" xml:base="https://jorp.xyz/posts/install-webtrees-on-rocky-linux-8/"><![CDATA[<p>used in this tutorial:</p>
<ul>
  <li>Rocky Linux 8 Minimal (x86_64) <a href="https://download.rockylinux.org/pub/rocky/8/isos/x86_64/">ISO | Torrent</a></li>
  <li><a href="https://github.com/fisharebest/webtrees/releases/tag/2.0.17">webtrees 2.0.17</a></li>
  <li>php 7.4</li>
  <li>mariadb 10.3</li>
</ul>

<p>patch and reboot the server:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>dnf upgrade <span class="nt">-y</span> <span class="o">&amp;&amp;</span> reboot
</code></pre></div></div>

<h2 id="install-packages">install packages</h2>

<p>since the latest version of webtrees (2.0.17) at the time of writing this (2021-10-07) only supports up to php 7.4, we’ll have to enable the php 7.4 module:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>dnf module <span class="nb">enable </span>php:7.4 <span class="nt">-y</span>
</code></pre></div></div>
<p>the next minor release of webtrees (2.1.0) will support php 8.0 and later, since php 7.4 will stop receiving security support <a href="https://www.php.net/supported-versions.php">in about a year</a>.</p>

<p>next, install all neccesary packages:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>dnf install -y vim nginx php wget mariadb-server policycoreutils-python-utils php-gd php-intl php-zip php-mysqlnd
</code></pre></div></div>

<h2 id="enable-services">enable services</h2>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>systemctl enable nginx mariadb --now
</code></pre></div></div>

<h2 id="open-the-firewall">open the firewall</h2>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>firewall-cmd <span class="nt">--zone</span><span class="o">=</span>public <span class="nt">--permanent</span> <span class="nt">--add-service</span><span class="o">={</span>http,https,mysql<span class="o">}</span>
</code></pre></div></div>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>firewall-cmd <span class="nt">--reload</span>
</code></pre></div></div>

<h2 id="configure-the-database">configure the database</h2>

<p>complete the secure mysql install:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>mysql_secure_installation
</code></pre></div></div>

<p>connect to mysql and create service account user ‘webtrees’ (replace ‘password’ below with something more secure please):</p>
<div class="language-sql highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">create</span> <span class="k">user</span> <span class="s1">'webtrees'</span><span class="o">@</span><span class="s1">'localhost'</span> <span class="n">identified</span> <span class="k">by</span> <span class="s1">'password'</span><span class="p">;</span>
</code></pre></div></div>
<div class="language-sql highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">grant</span> <span class="k">all</span> <span class="k">privileges</span> <span class="k">on</span> <span class="n">webtrees</span><span class="p">.</span><span class="o">*</span> <span class="k">to</span> <span class="s1">'webtrees'</span><span class="o">@</span><span class="s1">'localhost'</span><span class="p">;</span>
</code></pre></div></div>
<div class="language-sql highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">flush</span> <span class="k">privileges</span><span class="p">;</span>
</code></pre></div></div>

<h2 id="configure-the-web-server">configure the web server</h2>

<p>test that nginx via browser:
<img src="assets/01-nginx-test.png" alt="" /></p>

<p>or by using <code class="language-plaintext highlighter-rouge">curl</code>:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl http://localhost
</code></pre></div></div>
<p>(optional) remove default webserver files:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">rm</span> <span class="nt">-f</span> /usr/share/nginx/html/<span class="k">*</span>
</code></pre></div></div>

<p>download webtrees and <code class="language-plaintext highlighter-rouge">unzip</code> it to nginx web server directory:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>wget https://github.com/fisharebest/webtrees/releases/download/2.0.17/webtrees-2.0.17.zip
</code></pre></div></div>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>unzip webtrees-2.0.17.zip <span class="nt">-d</span> /usr/share/nginx/html/
</code></pre></div></div>

<p>now you’ll need to make sure webtrees has correct permissions for the data directory. change the selinux context on the following directory and make sure correct permissions are set:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>semanage fcontext <span class="nt">-a</span> <span class="nt">-t</span> httpd_sys_rw_content_t <span class="s2">"/usr/share/nginx/html/webtrees/data(/.*)?"</span>
</code></pre></div></div>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>restorecon <span class="nt">-R</span> <span class="nt">-v</span> /usr/share/nginx/html/webtrees/data
</code></pre></div></div>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">chmod </span>777 /usr/share/nginx/html/webtrees/data
</code></pre></div></div>

<h2 id="install-webtrees">install webtrees</h2>
<p>navigate to your web browser to complete installation:</p>
<div class="language-text highlighter-rouge"><div class="highlight"><pre class="highlight"><code>http://SERVER_IP/webtrees/
</code></pre></div></div>

<p><img src="assets/02-webtrees-setup-wizard.png" alt="" />
<img src="assets/03-webtrees-setup-wizard.png" alt="" />
make sure to select “MySQL”:
<img src="assets/04-webtrees-setup-wizard.png" alt="" />
fill in the appropriate data from the database setup step:
<img src="assets/05-webtrees-setup-wizard.png" alt="" />
complete the administrator account sign up as neccesary:
(note: it may take a moment or two after clicking ‘next’)
<img src="assets/06-webtrees-setup-wizard.png" alt="" />
create your first family tree and enjoy!
<img src="assets/07-webtrees-setup-wizard.png" alt="" /></p>

<h2 id="optional-additional-nginx-configuration">(optional) additional <code class="language-plaintext highlighter-rouge">nginx</code> configuration</h2>
<p>you may want to modify your <code class="language-plaintext highlighter-rouge">nginx</code> configuration to use ‘<a href="https://webtrees.net/faq/urls/">pretty URLs</a>’ (this is purely preference):</p>

<h4 id="before">before:</h4>

<p><img src="assets/08-webtrees-before-url.png" alt="" /></p>

<p>replace <code class="language-plaintext highlighter-rouge">/etc/nginx/nginx.conf</code> on your server with <a href="nginx.conf">my modified version</a></p>

<p>additionally you’ll need to add the following line to <code class="language-plaintext highlighter-rouge">/usr/share/nginx/html/webtrees/data/config.ini.php</code>:</p>
<div class="language-text highlighter-rouge"><div class="highlight"><pre class="highlight"><code>rewrite_urls="1"
</code></pre></div></div>
<h4 id="after">after:</h4>

<p><img src="assets/09-webtrees-after-url.png" alt="" /></p>

<h2 id="closing">closing</h2>

<p>today you learned how to install webtrees on Rocky Linux 8. please note that this installation is <strong>NOT</strong> secure. for now, I’m leaving it as an exercise to the reader to configure HTTPS.</p>

<p>on the webtrees end, all you need to do is change the line containing ‘base_url’ in <code class="language-plaintext highlighter-rouge">/usr/share/nginx/html/webtrees/data/config.ini.php</code> to the following:</p>
<div class="language-text highlighter-rouge"><div class="highlight"><pre class="highlight"><code>base_url="https://www.example.com/webtrees"
</code></pre></div></div>]]></content><author><name>jordan pisaniello</name><email>jorp@jorp.xyz</email></author><category term="genealogy" /><category term="webtrees" /><category term="rocky linux" /><category term="nginx" /><summary type="html"><![CDATA[used in this tutorial: Rocky Linux 8 Minimal (x86_64) ISO | Torrent webtrees 2.0.17 php 7.4 mariadb 10.3]]></summary></entry><entry><title type="html">write iso directly to flash drive</title><link href="https://jorp.xyz/posts/write-iso-directly-to-flash-drive/" rel="alternate" type="text/html" title="write iso directly to flash drive" /><published>2021-08-21T08:03:53-04:00</published><updated>2021-08-21T08:03:53-04:00</updated><id>https://jorp.xyz/posts/write-iso-directly-to-flash-drive</id><content type="html" xml:base="https://jorp.xyz/posts/write-iso-directly-to-flash-drive/"><![CDATA[<p>Here’s a dumb problem you’ve never had:</p>

<p>You need to download an ISO to create a bootable flash drive, but you don’t have enough storage left on your system.</p>

<p>What can you do?</p>

<h3 id="wget-to-the-rescue"><code class="language-plaintext highlighter-rouge">wget</code> to the rescue</h3>

<p><code class="language-plaintext highlighter-rouge">wget</code> retrieves files by using popular application layer protocols found within the Internet protocol suite via the commandline. A traditional <code class="language-plaintext highlighter-rouge">wget</code> workflow involves specifying a remote source to download and optionally explicitly specifying an output location like so:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo </span>wget <span class="s2">"https://example.com/file"</span> <span class="nt">-O</span> /some/local/location
</code></pre></div></div>

<p>Since <a href="https://en.wikipedia.org/wiki/Everything_is_a_file">everything is a file</a>, including attached devices, we can write the the downloaded file <em>directly</em> to our attached device.</p>

<h4 id="demo">demo</h4>

<p>I’ll be using a live ISO of Fedora 34 in my example along with <code class="language-plaintext highlighter-rouge">/dev/sdc</code> on my system. Be sure you specify the <em>correct</em> device (triple-check, then check again).</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>lsblk /dev/sdc
</code></pre></div></div>
<div class="language-text highlighter-rouge"><div class="highlight"><pre class="highlight"><code>NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sdc      8:32   1 57.3G  0 disk
└─sdc1   8:33   1 57.3G  0 part
</code></pre></div></div>

<p>write the ISO straight to your device:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo </span>wget <span class="s2">"https://download.fedoraproject.org/pub/fedora/linux/releases/34/Workstation/x86_64/iso/Fedora-Workstation-Live-x86_64-34-1.2.iso"</span> <span class="nt">-O</span> /dev/sdc
</code></pre></div></div>
<div class="language-text highlighter-rouge"><div class="highlight"><pre class="highlight"><code>...
Length: 2007367680 (1.9G) [application/octet-stream]
Saving to: ‘/dev/sdc’

/dev/sdc                                             100%[=====================================================================================================================&gt;]   1.87G  11.5MB/s    in 4m 35s

2021-08-21 16:30:22 (6.95 MB/s) - ‘/dev/sdc’ saved [2007367680/2007367680]
</code></pre></div></div>

<p>note the new partitions</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>lsblk /dev/sdc
</code></pre></div></div>
<div class="language-text highlighter-rouge"><div class="highlight"><pre class="highlight"><code>NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sdc      8:32   1 57.3G  0 disk
├─sdc1   8:33   1  1.9G  0 part
├─sdc2   8:34   1  9.9M  0 part
└─sdc3   8:35   1 20.9M  0 part
</code></pre></div></div>

<p>optionally you can use <code class="language-plaintext highlighter-rouge">qemu-kvm</code> to verify your device is indeed bootable</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo </span>qemu-kvm <span class="nt">-drive</span> <span class="nv">format</span><span class="o">=</span>raw <span class="nt">-hdb</span> /dev/sdc
</code></pre></div></div>

<p><img src="assets/boot-from-live.png" alt="" /></p>

<p>While this might not be very practical, it’s a neat little “did you know?” that showcases some of the best featues of Unix architecture.</p>

<hr />

<h4 id="further-reading">further reading</h4>

<p><code class="language-plaintext highlighter-rouge">wget</code> can do a whole bunch that I couldn’t possibly cover here, so I encourage you to <a href="https://www.gnu.org/software/wget/">learn more</a> if you’re interested.</p>

<ul>
  <li><a href="https://yarchive.net/comp/linux/everything_is_file.html">‘everything is a stream of bytes’</a></li>
  <li><a href="https://ieeexplore.ieee.org/document/6771909"><em>The UNIX system: Program design in the UNIX environment</em></a></li>
</ul>]]></content><author><name>jordan pisaniello</name><email>jorp@jorp.xyz</email></author><category term="wget" /><summary type="html"><![CDATA[Here’s a dumb problem you’ve never had:]]></summary></entry><entry><title type="html">fedora, btrfs, and hibernation</title><link href="https://jorp.xyz/posts/fedora-btrfs-and-hibernation/" rel="alternate" type="text/html" title="fedora, btrfs, and hibernation" /><published>2021-07-31T08:48:33-04:00</published><updated>2021-07-31T08:48:33-04:00</updated><id>https://jorp.xyz/posts/fedora-btrfs-and-hibernation</id><content type="html" xml:base="https://jorp.xyz/posts/fedora-btrfs-and-hibernation/"><![CDATA[<p>Here’s how to hibernate to disk when using the automatic partitioning scheme in Fedora 34 (btrfs+zram), optionally with luks enabled.</p>

<p>Originally this post was a lot longer, detailing each and every step suited for you to copy and paste. I decided to go ahead and <a href="https://github.com/jorp/fedora_hibernate">automate the whole process with ansible</a> instead.</p>

<p>A few things to keep in mind:</p>
<ul>
  <li>only run this after you’ve audited the playbook and understand what it’s doing</li>
  <li>you’re using this at your own risk</li>
  <li>Secure Boot must be disabled</li>
  <li>this has only been tested with Fedora 34</li>
</ul>

<h3 id="faq">FAQ</h3>

<ul>
  <li>Where can I read more about <em>why</em> I can’t do this anymore?
    <ul>
      <li><a href="https://pagure.io/fedora-workstation/blob/master/f/hibernationstatus.md">Pagure</a></li>
      <li><a href="https://www.reddit.com/r/Fedora/comments/r4a4so/interesting_fedora_does_not_support_hibernation/">Reddit</a></li>
    </ul>
  </li>
  <li>Does btrfs make a difference?</li>
</ul>

<p>Yes, you may notice the steps to create a swapfile are different than what you’re used to. We’ll have to use kernel 5.0+, and set <code class="language-plaintext highlighter-rouge">NOCOW</code> in order to gain <a href="https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ed46ff3d423780fa5173b38a844bf0fdb210a2a7">btrfs swapfile support</a>. More information is available on the <a href="https://btrfs.wiki.kernel.org/index.php/FAQ#Does_Btrfs_support_swap_files.3F">btrfs wiki</a> along with the <a href="https://wiki.archlinux.org/title/Btrfs#Swap_file">ArchWiki</a>.</p>

<h4 id="process">Process</h4>

<p>Below provides a very high level overview of the process, for more detail, check out <a href="https://github.com/jorp/fedora_hibernate">my ansible playbook</a>.</p>

<ul>
  <li>create an empty swapfile
    <ul>
      <li>set its attributes to <code class="language-plaintext highlighter-rouge">NOCOW</code> (<code class="language-plaintext highlighter-rouge">chattr +C</code>)</li>
      <li>allocate the swapfile to be the same size as your system’s memory
        <ul>
          <li>note: you may be okay with a swap partition <a href="https://wiki.archlinux.org/title/Power_management/Suspend_and_hibernate#About_swap_partition/file_size">smaller</a> than the size of your memory</li>
        </ul>
      </li>
    </ul>
  </li>
  <li>set up a Linux swap area on your swapfile</li>
  <li>enable your swapfile for paging and swapping</li>
  <li>update <code class="language-plaintext highlighter-rouge">/etc/fstab</code> with your swapfile information</li>
  <li>since there’s already an existing swap target (default zram device), create  <code class="language-plaintext highlighter-rouge">systemd</code> overrides to avoid false positive errors about swap size.</li>
  <li>get the physical swap offset by running <a href="https://github.com/osandov/osandov-linux/blob/master/scripts/btrfs_map_physical.c">btrfs_map_physical.c</a>, as recommended by the <a href="https://wiki.archlinux.org/title/Power_management/Suspend_and_hibernate#Hibernation_into_swap_file_on_Btrfs">ArchWiki</a>.
    <ul>
      <li>since this step includes running some C program from the internet, I’ve opted to use a container (you should be auditing the code regardless though)</li>
    </ul>
  </li>
  <li>calculate the real swap offset
    <ul>
      <li>this is done by dividing the physical swap offset from above by the system’s page size</li>
    </ul>
  </li>
  <li>construct resume arguments for grub
    <ul>
      <li>use the uuid of your swapfile along with the swap offset calculated above</li>
      <li>use <code class="language-plaintext highlighter-rouge">grubby</code> to update kernel arguments to include <code class="language-plaintext highlighter-rouge">resume</code> and <code class="language-plaintext highlighter-rouge">resume_offset</code></li>
    </ul>
  </li>
  <li>add the resume module to <code class="language-plaintext highlighter-rouge">dracut</code> and regenerate the initramfs
    <ul>
      <li>add resume module under <code class="language-plaintext highlighter-rouge">/etc/dracut.conf.d/resume.conf</code></li>
      <li><code class="language-plaintext highlighter-rouge">dracut -f</code></li>
    </ul>
  </li>
</ul>

<p>After this, you’ll need to reboot and test hibernation with:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo systemctl hibernate
</code></pre></div></div>

<p>If you’re on GNOME, and would like hibernation back in in the status menu, check out the <a href="https://extensions.gnome.org/extension/755/hibernate-status-button/">Hibernate Status Button</a> GNOME shell extension.</p>]]></content><author><name>jordan pisaniello</name><email>jorp@jorp.xyz</email></author><category term="ansible" /><category term="fedora" /><category term="hibernate" /><category term="btrfs" /><category term="luks" /><summary type="html"><![CDATA[Here’s how to hibernate to disk when using the automatic partitioning scheme in Fedora 34 (btrfs+zram), optionally with luks enabled.]]></summary></entry><entry><title type="html">rocky linux 8.4 ga</title><link href="https://jorp.xyz/posts/rocky-linux-8.4-ga/" rel="alternate" type="text/html" title="rocky linux 8.4 ga" /><published>2021-06-21T07:29:08-04:00</published><updated>2021-06-21T07:29:08-04:00</updated><id>https://jorp.xyz/posts/rocky-linux-8.4-ga</id><content type="html" xml:base="https://jorp.xyz/posts/rocky-linux-8.4-ga/"><![CDATA[<p>I’m honored to share the Rocky Linux 8.4 is officially stable! This couldn’t have been done without the absolutely incredible community that’s come together to make this possible. The last 7 months have been incredibly busy with family, work, grad school, Rocky Linux, professional development, and side projects. I’m honestly still in disbelief that this is actually happening.</p>

<p>You can read more about the release <a href="https://forums.rockylinux.org/t/rocky-linux-8-4-available-now">here</a>. Looking forward to what the future holds!</p>

<p>A HUGE thank you to our community that made this possible.</p>]]></content><author><name>jordan pisaniello</name><email>jorp@jorp.xyz</email></author><category term="rocky linux" /><summary type="html"><![CDATA[I’m honored to share the Rocky Linux 8.4 is officially stable! This couldn’t have been done without the absolutely incredible community that’s come together to make this possible. The last 7 months have been incredibly busy with family, work, grad school, Rocky Linux, professional development, and side projects. I’m honestly still in disbelief that this is actually happening.]]></summary></entry><entry><title type="html">rocky linux 8.3 rc1</title><link href="https://jorp.xyz/posts/rocky-linux-8.3-rc1/" rel="alternate" type="text/html" title="rocky linux 8.3 rc1" /><published>2021-05-01T02:40:05-04:00</published><updated>2021-05-01T02:40:05-04:00</updated><id>https://jorp.xyz/posts/rocky-linux-8.3-rc1</id><content type="html" xml:base="https://jorp.xyz/posts/rocky-linux-8.3-rc1/"><![CDATA[<p>Well, you may or may not know that I’m involved in <a href="https://rockylinux.org">Rocky Linux</a>. Words really can’t describe how hard our amazing community has worked towards our first ever release candidate. You can find download links and more information on our forums <a href="https://forums.rockylinux.org/t/rocky-linux-8-3-rc1-available-now">here</a>. This is just the beginning though, so stick around to see what we have in store.</p>]]></content><author><name>jordan pisaniello</name><email>jorp@jorp.xyz</email></author><category term="rocky linux" /><summary type="html"><![CDATA[Well, you may or may not know that I’m involved in Rocky Linux. Words really can’t describe how hard our amazing community has worked towards our first ever release candidate. You can find download links and more information on our forums here. This is just the beginning though, so stick around to see what we have in store.]]></summary></entry></feed>