<?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="3.10.0">Jekyll</generator><link href="https://www.erickcantu.com/atom.xml" rel="self" type="application/atom+xml" /><link href="https://www.erickcantu.com/" rel="alternate" type="text/html" hreflang="en-US" /><updated>2026-03-17T22:10:54+00:00</updated><id>https://www.erickcantu.com/atom.xml</id><title type="html">An Intersection of Engineering, Agriculture, Data Science and Innovation</title><subtitle>Explore the fusion of engineering, agriculture, and innovation with Erick, a Data Scientist navigating the crossroads of expertise to create sustainable, efficient solutions..</subtitle><author><name>Erick Cantu</name></author><entry><title type="html">Fedora 39 - Python - Conda - Mamba</title><link href="https://www.erickcantu.com/fedora%2039/python/conda/spyder-ide/2024/01/20/Mamba-Installation.html" rel="alternate" type="text/html" title="Fedora 39 - Python - Conda - Mamba" /><published>2024-01-20T00:00:00+00:00</published><updated>2023-06-27T00:00:00+00:00</updated><id>https://www.erickcantu.com/fedora%2039/python/conda/spyder-ide/2024/01/20/Mamba-Installation</id><content type="html" xml:base="https://www.erickcantu.com/fedora%2039/python/conda/spyder-ide/2024/01/20/Mamba-Installation.html"><![CDATA[<p>In this post I review the steps I follow to setup my workflow for <em>Python3</em>. I use mamba as package and environment manager, and <em>Spyder-IDE</em> as my choice of an Integrated Development Environment.</p>

<h2 id="install-mamba-python3-in-fedora39">Install Mamba (python3) in Fedora39.</h2>

<ol>
  <li>
    <p>Download the bash script to install <em>miniforge</em> from <em>conda-forge</em>. Yes,  now miniforge contains mamba and its the recomended way to do it. Detail instructions are located at:  <a href="https://github.com/conda-forge/miniforge">GitHub - conda-forge/miniforge: A conda-forge distribution.</a></p>

    <p>As noticed before, I have a folder named Build for downloading and building the software that I need.</p>

    <p><strong>Do not forget to update Fedora before installing something.</strong></p>

    <div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo </span>dnf update
</code></pre></div>    </div>

    <div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">mkdir</span> ~/Build/mamba
<span class="nb">cd</span> ~/Build/mamba
wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh
bash Miniforge3-Linux-x86_64.sh
</code></pre></div>    </div>
  </li>
  <li>
    <p>Follow the instructions instructions in the bash script, prompted in the screen. Because I am a single user, I kept the default settings. Adjust as needed.  The installation’s location is: <code class="language-plaintext highlighter-rouge">~/miniforge3/</code></p>
  </li>
  <li>
    <p>Use <code class="language-plaintext highlighter-rouge">mamba</code> instructions the same way as <code class="language-plaintext highlighter-rouge">conda</code>. <strong><em>Most</em></strong> of them work the same way, be aware of what you are doing.  Here are some handy examples:</p>

    <p>Create an environment with Python 3.9 use:</p>

    <div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>mamba create <span class="nt">-n</span> python39 <span class="nv">python</span><span class="o">=</span>3.9
</code></pre></div>    </div>

    <p>Do not forget to activate the environment before working on your projects, and installing the required libraries. Also do not forget to deactivate the environment after you are done.</p>

    <div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>mamba activate python39
</code></pre></div>    </div>

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

    <p>To install a single library, for example <em>pandas</em>, do:</p>

    <div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>mamba <span class="nb">install </span>pandas
</code></pre></div>    </div>

    <p>To install a list of libraries saved in the file <em>requirements.txt</em> use:</p>

    <div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>mamba <span class="nb">install</span> <span class="nt">--file</span> requirements.txt
</code></pre></div>    </div>

    <p>Here is the <em>requirements.txt</em> content:</p>

    <blockquote>
      <p>altair==4.1.0<br />
jupyterlab==3.2.6<br />
ipywidgets==7.6.5<br />
matplotlib==3.5.1<br />
pandas==1.3.5<br />
jupyterlab-dash==0.1.0a3<br />
seaborn==0.11.1<br />
python-dotenv==0.19.0<br />
psycopg2==2.9.3<br />
SQLAlchemy==1.4.25<br /></p>
    </blockquote>
  </li>
</ol>

<h2 id="installation-and-first-steps-in-spyder-ide">Installation and first steps in Spyder-IDE</h2>

<p>I grew up as a Data Scientist using RStudio. Without it, I would not have follow  this career path. Since then I have been looking for an IDE that provides the same functionality that RStudio offers; in Python. This is where Spyder comes into play.  I am not a fan of Jupyter Notebooks.</p>

<ol>
  <li>
    <p>Use mamba to install Spyder. Follow the conda instructions at: <a href="https://docs.spyder-ide.org/current/installation.html#conda-based-distributions">Installation Guide; Spyder 5 documentation</a></p>

    <div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>mamba create <span class="nt">-c</span> conda-forge <span class="nt">-n</span> spyder-env spyder numpy scipy pandas matplotlib sympy cython
</code></pre></div>    </div>

    <p><strong><em>Notice</em></strong> the <code class="language-plaintext highlighter-rouge">-c</code> command to force the source at <em>conda-forge</em>, and not to i.e. Anaconda. At the same time other libraries were also installed.</p>
  </li>
  <li>
    <p>Activate the <em>spyder-env</em> environment and install the required additional plugins. Line profiler, Notebook and Terminal. The first as its name suggests, aids in line <a href="https://en.wikipedia.org/wiki/Profiling_(computer_programming)">profiling </a>. The second allows the interaction with Jupyter Notebooks. And the last one integrates a terminal to the IDE.</p>

    <div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>mamba activate spyder-env
mamba <span class="nb">install </span>spyder-line-profiler spyder-notebook spyder-terminal <span class="nt">-c</span> conda-forge
</code></pre></div>    </div>
  </li>
  <li>
    <p>Launch Spyder-IDE from the terminal; remember to activate the spyder-env .</p>

    <div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>mamba activate spyder-env
spyder
</code></pre></div>    </div>
  </li>
  <li>
    <p>Here is the RStudio Window Layout for the <a href="/data_science/eda/2022/08/16/EDA.html">Exploratory Data Analysis - Seattle, WA</a> Project. <img src="/assets/images/posts/mamba_spyder/rstudio_window_layout.png" alt="Rstudio - Window - Layout in SpyderIDE" /></p>

    <p>And here is the updated version:)</p>

    <p><img src="/assets/images/posts/mamba_spyder/personal_window_layout.png" alt="My - Window - Layout in SypderIDE" /></p>
  </li>
  <li>
    <p>Selecting the correct Kernell.</p>

    <p>By default Spyder uses the Python version in which it was installed. In the Spyder installation, I did not specified, it used the latest version installed in Fedora; 3.12.1.</p>

    <p>To select the correct kernel to run your project. Select Preferences from the Tools menu and go to the Python interpreter section, there chose the appropriate interpreter. For details see <a href="https://docs.spyder-ide.org/current/faq.html#using-existing-environment">Sypder-IDE FAQ; using existing environment</a></p>
  </li>
  <li>
    <p>To finish. Save your work. Close the Sypder-IDE window and in the terminal deactivate the environment.</p>

    <div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>mamba deactivate
</code></pre></div>    </div>
  </li>
  <li>
    <p><strong>Final Notice</strong></p>

    <p>This Spyder-IDE setup has a big problem running in Fedora. It shows the following <em>Warning:</em></p>

    <div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>❯ spyder
Warning: Ignoring <span class="nv">XDG_SESSION_TYPE</span><span class="o">=</span>wayland on Gnome. Use <span class="nv">QT_QPA_PLATFORM</span><span class="o">=</span>wayland to run on Wayland anyway.
fromIccProfile: failed minimal tag size sanity
</code></pre></div>    </div>

    <p>The root of this problem is the display version that by default the Fedora39 Workstation standard version comes with. Since Fedora25 is Wayland instead of Xorg11. Sypder is setup by default to display its interface in Xorg. And, although the IDE is displayed, the produced graphs appear as a black box.  This is an ongoing issue to be solve. The work around is to save the images as pdf or png files and open them in a separate program. This kills the benefits of having an IDE. So, be aware of this issue. I will update this post once I find a solution.</p>
  </li>
</ol>

<p>Additional information:</p>

<p><a href="https://mamba.readthedocs.io/en/latest/index.html">Welcome to Mamba’s documentation!</a></p>

<p><a href="https://github.com/conda-forge/miniforge">GitHub - conda-forge/miniforge: A conda-forge distribution.</a></p>

<p><a href="https://www.spyder-ide.org/">Spyder - IDE for scientific programming in Python</a></p>

<p><a href="https://www.cbtnuggets.com/blog/technology/devops/wayland-vs-xorg-wayland-replace-xorg">Wayland vs. Xorg: Will Wayland Replace Xorg?</a></p>]]></content><author><name>Erick Cantu</name></author><category term="Fedora 39" /><category term="Python" /><category term="Conda" /><category term="Spyder-IDE" /><category term="Fedora 39" /><category term="Work Station" /><category term="Computer Setup" /><category term="Python3" /><category term="Conda" /><category term="Mamba" /><category term="Miniforge" /><category term="Data Science Workstation Setup" /><summary type="html"><![CDATA[In this post I review the steps I follow to setup my workflow for Python3. I use mamba as package and environment manager, and Spyder-IDE as my choice of an Integrated Development Environment.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://www.erickcantu.com/assets/images/posts/latex/ecantu_Create_a_captivating_website_top_banner_utilizing_the_en_a9ca0251-5ec3-43f6-8b95-7bf41c9874ad.png" /><media:content medium="image" url="https://www.erickcantu.com/assets/images/posts/latex/ecantu_Create_a_captivating_website_top_banner_utilizing_the_en_a9ca0251-5ec3-43f6-8b95-7bf41c9874ad.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Fedora 38 Setup - Part IV - WSL</title><link href="https://www.erickcantu.com/fedora%2038/wsl/work%20station%20setup/2023/06/26/Fedora-Setup-V4.html" rel="alternate" type="text/html" title="Fedora 38 Setup - Part IV - WSL" /><published>2023-06-26T00:00:00+00:00</published><updated>2023-06-27T00:00:00+00:00</updated><id>https://www.erickcantu.com/fedora%2038/wsl/work%20station%20setup/2023/06/26/Fedora-Setup-V4</id><content type="html" xml:base="https://www.erickcantu.com/fedora%2038/wsl/work%20station%20setup/2023/06/26/Fedora-Setup-V4.html"><![CDATA[<p>From time to time, I need to use a windows laptop to run a native program there.  Nowadays, Windows allows us to have a Linux kernel running as a subsystem. There are plently of examples on how to install Ubuntu, as its available in the Windows Store. However as discussed previously, I like much better Fedora.</p>

<p>In this post I document how to setup Fedora 38 in WSL. The setup is based on information from <a href="https://learn.microsoft.com/en-us/windows/wsl/install">Install WSL | Microsoft Learn</a> and from <a href="https://dev.to/bowmanjd/install-fedora-on-windows-subsystem-for-linux-wsl-4b26">Install Fedora 37 or earlier on Windows Subsystem for Linux (WSL) - DEV Community</a>.</p>

<h1 id="installing-fedora-38-container-based-build">Installing Fedora 38 Container Based Build</h1>

<ol>
  <li>
    <p>Ensure that Virtual Maschine is enabled in the BIOS and in Windows. 
For the first step follow the computer manufacturer. Then follow the steps in <a href="https://learn.microsoft.com/en-us/windows/wsl/install">Install WSL | Microsoft Learn</a>.</p>
  </li>
  <li>
    <p>Ensure WSL2 is running in Windows:</p>

    <div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>wsl <span class="nt">--set-default-version</span> 2
</code></pre></div>    </div>

    <p>If errors arise, consult google or youtube to find how to setup WSL 2 in windows. Just search for <em>How to setup WSL2</em>. As an alternative you can read <a href="https://learn.microsoft.com/en-us/windows/wsl/install">Install WSL | Microsoft Learn</a>.</p>
  </li>
  <li>
    <p>Download the latestest Fedora Container Base build from <a href="https://koji.fedoraproject.org/koji/packageinfo?packageID=26387">Koji Fedora</a> eg. <a href="https://koji.fedoraproject.org/koji/buildinfo?buildID=2217818">Fedora-Container-Base-38-20230619.0</a>. Be sure that the State has a green check mark and not a yellow <em>X</em> or red <em>-</em>. As this mean that the build was either canlleded or failed.  Download the <a href="https://kojipkgs.fedoraproject.org//packages/Fedora-Container-Base/38/20230619.0/images/Fedora-Container-Base-38-20230619.0.x86_64.tar.xz">Fedora-Container-Base-38-20230619.0.x86_64.tar.xz</a> file and extract it, eg. WinRar. The content from the folder with the HEX name should containt the layer.tar file.  This is the required file to install Fedora.</p>
  </li>
  <li>
    <p>Create a folder where Fedora will be installed. eg: C:\Users\User\AppData\Local\WSL2\Fedora38</p>
  </li>
  <li>
    <p>Import the Fedora distribution into WSL. In this example, I am naming it Fedora38</p>

    <div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>wsl <span class="nt">--import</span> Fedora38 C:<span class="se">\U</span>sers<span class="se">\U</span>ser<span class="se">\A</span>ppData<span class="se">\L</span>ocal<span class="se">\W</span>SL2 C:<span class="se">\U</span>sers<span class="se">\U</span>ser<span class="se">\D</span>ownloads<span class="se">\l</span>ayer.tar
</code></pre></div>    </div>
  </li>
  <li>
    <p>Now review the installed distros:</p>

    <div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>wsl <span class="nt">-l</span> <span class="nt">-v</span>
  NAME        STATE           VERSION
<span class="k">*</span> Ubuntu      Stopped         2
  Fedora38    Stopped         2
</code></pre></div>    </div>

    <p>In this case Ubuntu is also installed. the <em>-v</em> parameter checks for the version. Ensure it is 2. Remembered that it was setup like that in Step number 2.</p>
  </li>
  <li>
    <p>Setup the Fedora38 as the default distribution:</p>

    <div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>wsl <span class="nt">-s</span> Fedora38
</code></pre></div>    </div>
  </li>
  <li>
    <p>To lunch it now  just type</p>

    <div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>wsl
</code></pre></div>    </div>
  </li>
  <li>
    <p>If you want to run other installed distro, eg. Ubuntu run:</p>

    <div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>wsl <span class="nt">-d</span> Ubuntu
</code></pre></div>    </div>

    <p>Review the list of installed distros to find the correct name, see point 6.</p>
  </li>
  <li>
    <p>In widnows I use <a href="[GitHub - erickCantu/PowerShell_OhMP: A Template for Oh My Posh for Windows Powershell](https://github.com/erickCantu/PowerShell_OhMP)">Oh My Posh</a> with <a href="https://www.microsoft.com/store/productId/9N0DX20HK701">Windows Terminal</a>, there you can open a Terminal with Fedora, Powershell, Ubuntu, etc.</p>
  </li>
  <li>
    <p>If you want to find which other distros can be installed from terminal run:</p>

    <div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>wsl <span class="nt">--list</span> <span class="nt">--online</span>
</code></pre></div>    </div>
  </li>
</ol>

<h2 id="aferter-install-setup">Aferter install setup</h2>

<p>There are additional steps to completelly setup Fedora in wsl.  These are not required from distros on the online list.</p>

<ol>
  <li>
    <p>When running Fedora the first time, it will run as root. Be carefull on what you do.</p>
  </li>
  <li>
    <p>Update the distro</p>

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

    <p>If you cannot update the distro, there are issues resolving the DNS. See the <em>Ensure DNS is functioning</em> in the post <a href="https://dev.to/bowmanjd/install-fedora-on-windows-subsystem-for-linux-wsl-4b26">Install Fedora 37 or earlier on Windows Subsystem for Linux (WSL) - DEV Community</a></p>
  </li>
  <li>
    <p>Install basic system utilities</p>

    <div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>dnf <span class="nb">install </span>util-linux
</code></pre></div>    </div>

    <p>Exit the distro</p>

    <div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">exit</span>
</code></pre></div>    </div>

    <p>and therminate it in PowerShell:</p>

    <div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>wsl <span class="nt">-t</span> Fedora38
</code></pre></div>    </div>

    <p>restart Fedora38</p>
  </li>
  <li>
    <p>It is not recomended to run root as default. Create a user with sudo previledges.</p>

    <div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>dnf <span class="nb">install </span>passwd
useradd <span class="nt">-G</span> wheel newuser
passwd newuser
</code></pre></div>    </div>

    <p>Exit and reboot Fedora distro as in step 3.</p>
  </li>
  <li>
    <p>Lunch Fedora38 with the <em>newuser</em></p>

    <div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>wsl <span class="nt">-u</span> newuser
</code></pre></div>    </div>
  </li>
  <li>
    <p>If the seupt worked properly you should now see:</p>

    <div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="o">[</span>newuser@computername WindowsUser]<span class="err">$</span>
</code></pre></div>    </div>

    <p>instead of</p>

    <div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="o">[</span>root@computername WindowsUser]<span class="err">$</span>
</code></pre></div>    </div>

    <p>check for the sudo previledges:</p>

    <div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo cat</span> /etc/shadow
</code></pre></div>    </div>

    <p>You should get the information regarding the users, it should include the <em>newuser</em> information.</p>
  </li>
  <li>
    <p>Setup the user as default login.</p>

    <div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">printf</span> <span class="s2">"</span><span class="se">\n</span><span class="s2">[user]</span><span class="se">\n</span><span class="s2">default = newuser</span><span class="se">\n</span><span class="s2">"</span> | <span class="nb">sudo tee</span> <span class="nt">-a</span> /etc/wsl.conf
</code></pre></div>    </div>

    <p>This code adds the new user to the <em>wsl.conf</em> file</p>
  </li>
  <li>
    <p>Restart Fedora38 as in step 3. And you are done.</p>
  </li>
</ol>

<h2 id="additional-steps">Additional Steps</h2>

<p>The Fedora Container Base build has just the basic information lets install neofetch to find the current information</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo </span>dnf <span class="nb">install </span>neofetch
neofetch


             .<span class="s1">',;::::;,'</span><span class="nb">.</span>                newuser@WINDOWS-COMPUTER-NAME
        .<span class="s1">';:cccccccccccc:;,.            ---------------------
      .;cccccccccccccccccccccc;.         OS: Fedora Linux 38 (Container     
    .:cccccccccccccccccccccccccc:.       Kernel: 5.15.90.1-microsoft-st   
  .;ccccccccccccc;.:dddl:.;ccccccc;.     Uptime: 8 mins
 .:ccccccccccccc;OWMKOOXMWd;ccccccc:.    Packages: 417 (rpm)
.:ccccccccccccc;KMMc;cc;xMMc:ccccccc:.   Shell: bash 5.2.15
,cccccccccccccc;MMM.;cc;;WW::cccccccc,   Terminal: Windows Terminal
:cccccccccccccc;MMM.;cccccccccccccccc:   CPU: Intel i7-5500U (4) @ 2.39
:ccccccc;oxOOOo;MMM0OOk.;cccccccccccc:   Memory: 302MiB / 3868MiB
cccccc:0MMKxdd:;MMMkddc.;cccccccccccc;
ccccc:XM0'</span><span class="p">;</span>cccc<span class="p">;</span>MMM.<span class="p">;</span>cccccccccccccccc<span class="s1">'
ccccc;MMo;ccccc;MMW.;ccccccccccccccc;
ccccc;0MNc.ccc.xMMd:ccccccccccccccc;
cccccc;dNMWXXXWM0::cccccccccccccc:,
cccccccc;.:odl:.;cccccccccccccc:,.
:cccccccccccccccccccccccccccc:'</span><span class="nb">.</span>
.:cccccccccccccccccccccc:<span class="p">;</span>,..
  <span class="s1">'::cccccccccccccc::;,.
</span></code></pre></div></div>

<p>There a re only 417 installed packages.</p>

<p>Install fedora documentation.</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">grep</span> <span class="nt">-v</span> nodocs /etc/dnf/dnf.conf | <span class="nb">sudo tee</span> /etc/dnf/dnf.conf
<span class="nb">sudo </span>dnf <span class="nb">install</span> <span class="nt">-y</span> man man-pages
</code></pre></div></div>

<p>These ensure that the manual pages are installed. It requires to reinstall all packages.</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">for </span>pkg <span class="k">in</span> <span class="si">$(</span>dnf repoquery <span class="nt">--installed</span> <span class="nt">--qf</span> <span class="s2">"%{name}"</span><span class="si">)</span><span class="p">;</span> <span class="k">do </span><span class="nb">sudo </span>dnf reinstall <span class="nt">-qy</span> <span class="nv">$pkg</span><span class="p">;</span> <span class="k">done</span>
</code></pre></div></div>

<p>Clean the installation</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo </span>dnf clean all
</code></pre></div></div>

<h2 id="zsh">ZSH</h2>

<p>Follow the steps in <a href="https://www.erickcantu.com/fedora%2038/kde/work%20station%20setup/2023/05/04/Fedora-Setup.html">Fedora 38 Setup - KDE - Server Version | An Intersection of Engineering, Agriculture, Data Science and Innovation</a> to setup ZSH</p>

<p>The following packages and steps are required.</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>dnf <span class="nb">install </span>util-linux-user
chsh <span class="nt">-s</span> <span class="si">$(</span>which zsh<span class="si">)</span>
</code></pre></div></div>

<h2 id="save-the-distribution">Save the distribution</h2>

<p>We can backup the distribution. It allows to save the distro current state. This is achived by running in PowerShell the following commands:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">mkdir </span>BackupWSL
<span class="nb">cd</span> .<span class="se">\B</span>ackupWSL
wsl <span class="nt">--export</span> Fedora38 20230626_Fedora38_WSL.tar 

</code></pre></div></div>

<p>The command takes several minutes. Be patient.</p>]]></content><author><name>Erick Cantu</name></author><category term="Fedora 38" /><category term="WSL" /><category term="Work Station Setup" /><category term="Fedora 38" /><category term="Work Station" /><category term="Computer Setup" /><category term="WSL" /><category term="Windows" /><category term="Data Science Workstation Setup" /><summary type="html"><![CDATA[From time to time, I need to use a windows laptop to run a native program there. Nowadays, Windows allows us to have a Linux kernel running as a subsystem. There are plently of examples on how to install Ubuntu, as its available in the Windows Store. However as discussed previously, I like much better Fedora.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://www.erickcantu.com/assets/images/posts/latex/ecantu_Create_a_captivating_website_top_banner_utilizing_the_en_a9ca0251-5ec3-43f6-8b95-7bf41c9874ad.png" /><media:content medium="image" url="https://www.erickcantu.com/assets/images/posts/latex/ecantu_Create_a_captivating_website_top_banner_utilizing_the_en_a9ca0251-5ec3-43f6-8b95-7bf41c9874ad.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Fedora 38 Setup - Part III - TeX</title><link href="https://www.erickcantu.com/fedora%2038/worksation%20version/work%20station%20setup/2023/06/18/Fedora-Setup-V3.html" rel="alternate" type="text/html" title="Fedora 38 Setup - Part III - TeX" /><published>2023-06-18T00:00:00+00:00</published><updated>2023-06-17T00:00:00+00:00</updated><id>https://www.erickcantu.com/fedora%2038/worksation%20version/work%20station%20setup/2023/06/18/Fedora-Setup-V3</id><content type="html" xml:base="https://www.erickcantu.com/fedora%2038/worksation%20version/work%20station%20setup/2023/06/18/Fedora-Setup-V3.html"><![CDATA[<p>In this post I review the steps to setup LaTeX with its flavor LuaLaTeX, TeXStudio and Pandoc.</p>

<hr />

<h2 id="texlive-and-others">Texlive and others</h2>

<p>Fedora provides different levels of TeXLive. From bare minimal to full.  These common packages are texlive-scheme-basic, texlive-scheme-medium and texlive-scheme-full. Also there are the contex, gust, minimal and textex. I am starting wih the basic and installing packages as needed.</p>

<div class="language-zsh highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo </span>dnf <span class="nb">install </span>pandoc texlive-scheme-basic texstudio 
</code></pre></div></div>

<p>I used LuaLaTeX to create my resume and to write letters. The letters have an specific structure, eg. my and recipent information, topic, date and its content.</p>

<p>The templates require additional libraries and fonts. These are the following:</p>

<div class="language-zsh highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo </span>dnf <span class="nb">install </span>texlive-tcolorbox texlive-fontawesome texlive-academicons texlive-silence texlive-sourcesanspro texlive-cormorantgaramond texlive-tex-gyre texlive-babel-german texlive-babel-spanish 
</code></pre></div></div>

<p>To automate letters creation, eg. Job applications, I save the dynamic information in a Markdown file, in yaml format. This file is passed then to LuaLaTeX with Pandoc aid.</p>

<div class="language-zsh highlighter-rouge"><div class="highlight"><pre class="highlight"><code>pandoc metadata.md <span class="nt">--template</span> letter_template.tex <span class="nt">--pdf-engine</span><span class="o">=</span>lualatex <span class="nt">-o</span> output.pdf
</code></pre></div></div>

<p>The code creates a pdf file (output.pdf) based in a latex template (letter_template.tex) and a yaml structure in markdown file format (metadata.md).</p>

<hr />

<h3 id="pdf-edition">PDF edition</h3>

<p>Some times I need to add or remove pages to a PDf file. For this purpose I use pdftk-java. It  is an implementation available in Fedora from the pdftk program written in C.</p>

<p>Here is a use case example. 
I want to create a new file (output.pdf) that will have the pages 6 to 15 from the <em>bigfile_with15pages.pdf</em> file. 
The code to extract these pages is the following:</p>

<div class="language-zsh highlighter-rouge"><div class="highlight"><pre class="highlight"><code>pdftk bigfile_with15pages.pdf <span class="nb">cat </span>6-end output output.pdf 
</code></pre></div></div>

<p>The comand uses the parameter <em>cat</em> to extract pages 6 to 15 from the <em>bigfile_with15pages.pdf</em> file. And it saves them in output.pdf</p>

<p>Other use case is the joining several pdf files. It is also achieved with the parameter <em>cat</em>. Here is an example:</p>

<div class="language-zsh highlighter-rouge"><div class="highlight"><pre class="highlight"><code>pdftk resume.pdf certificates.pdf <span class="nb">cat </span>output resume_with_certificates.pdf 
</code></pre></div></div>

<p>The command joints the files <em>resume.pdf</em> and <em>certificates.pdf</em>. They are joined in order of apperance. The parameter <em>output</em> generates the <em>resume_with_certificates.pdf</em>.</p>

<hr />

<h3 id="pdf-file-size">PDF file size</h3>

<p>Reduce a pdf its size. it is playing with the image resolution. In the following example is setup for an image of 180-x 180 psi. With a jpeg compression of 40%.</p>

<div class="language-zsh highlighter-rouge"><div class="highlight"><pre class="highlight"><code>convert <span class="nt">-density</span> 180x180 <span class="nt">-quality</span> 60 <span class="nt">-compress</span> jpeg base.pdf output_base.pdf 
</code></pre></div></div>]]></content><author><name>Erick Cantu</name></author><category term="Fedora 38" /><category term="Worksation Version" /><category term="Work Station Setup" /><category term="Fedora 38" /><category term="Work Station" /><category term="Computer Setup" /><category term="TeX" /><category term="LaTeX" /><category term="Lua" /><category term="Pandoc" /><category term="Data Science Workstation Setup" /><summary type="html"><![CDATA[In this post I review the steps to setup LaTeX with its flavor LuaLaTeX, TeXStudio and Pandoc.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://www.erickcantu.com/assets/images/posts/latex/ecantu_Create_a_captivating_website_top_banner_utilizing_the_en_a9ca0251-5ec3-43f6-8b95-7bf41c9874ad.png" /><media:content medium="image" url="https://www.erickcantu.com/assets/images/posts/latex/ecantu_Create_a_captivating_website_top_banner_utilizing_the_en_a9ca0251-5ec3-43f6-8b95-7bf41c9874ad.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Fedora 38 Setup - Part II - Workstation Version</title><link href="https://www.erickcantu.com/fedora%2038/worksation%20version/work%20station%20setup/2023/05/09/Fedora-Setup-V2.html" rel="alternate" type="text/html" title="Fedora 38 Setup - Part II - Workstation Version" /><published>2023-05-09T00:00:00+00:00</published><updated>2023-05-10T00:00:00+00:00</updated><id>https://www.erickcantu.com/fedora%2038/worksation%20version/work%20station%20setup/2023/05/09/Fedora-Setup-V2</id><content type="html" xml:base="https://www.erickcantu.com/fedora%2038/worksation%20version/work%20station%20setup/2023/05/09/Fedora-Setup-V2.html"><![CDATA[<p>WELL.. The KDE server version did not work well. The computer reboot when streaming while the CPU got temperatures around 61°C. Installing NVIDIA drivers did not resolved the issue. Black screens came after booting.. A possibility could be, missing the configuration in the boot setup to use the NVIDIA driver instead of the nouveau divers. Additionally there was mouse freezing, which could be fixed by using the solaar package. Bud did not had the opportunity to test it. I tried the KDE ISO version whit the same results than using the server version.</p>

<p>So, I am trying GNOME.  After installing the Workstation ISO and setting up as in the previous post, the rebooting problem remains. It seems that is a recurring problem with the nouveau drivers (<a href="https://retrace.fedoraproject.org/faf/reports/617657/">ABRT Analytics - Report #617657 - xorg-x11-drv-nouveau in gf100_gr_reset</a>). This means that NVIDIA drivers are required; at least is what I presume. While using Ubuntu and loading the proprietary NVIDIA drivers, the workstation worked without any issues. In this post I am documenting how to install them.</p>

<p><em>The post image was created with midjourney. Prompt: /imagine Create an abstract paint that illustrates the fusion of engineering and innovation with Data Science, navigating the crossroads of expertise to create sustainable and efficient solutions using oil as the medium, with the impasto technique, emphasizing depth and contrast, and featuring a stunning midnight blue color palette. –no Letters, Text, Signature, Watermark, Logo, Stamp, Branding, Trademark, Copyright, Registered Trademark, Human, Person, People. –aspect 7:4 –s 750 –v 5 –q 2</em></p>

<hr />

<h2 id="fixing-logitech-drivers">Fixing Logitech drivers</h2>

<p>Before starting with configuring with the video card drivers, I setup the Logitech mouse.</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo </span>dnf update
<span class="nb">sudo </span>dnf <span class="nb">install </span>solaar 
</code></pre></div></div>

<hr />

<h2 id="install-nvidia-drivers">Install NVIDIA Drivers</h2>

<p>I followed the how to documentation in <a href="https://rpmfusion.org/Howto/NVIDIA?highlight=%28%5CbCategoryHowto%5Cb%29">Howto/NVIDIA - RPM Fusion</a>. The documentation provides all the required steps before and after the drivers configuration. Read the complete page before installing the drivers.</p>

<h3 id="configure-rpm-fusion">Configure RPM Fusion</h3>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo </span>dnf update
<span class="nb">sudo </span>dnf <span class="nb">install </span>https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-<span class="si">$(</span>rpm <span class="nt">-E</span> %fedora<span class="si">)</span>.noarch.rpm https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-<span class="si">$(</span>rpm <span class="nt">-E</span> %fedora<span class="si">)</span>.noarch.rpm
<span class="nb">sudo </span>dnf groupupdate core
</code></pre></div></div>

<h3 id="secure-boot">Secure Boot</h3>

<ol>
  <li>
    <p>Install <em>akmods</em> package.</p>

    <div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo </span>dnf <span class="nb">install </span>akmods
</code></pre></div>    </div>
  </li>
  <li>
    <p>Read the README file to review the proper steps to follow.</p>

    <div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>nano /usr/share/doc/akmods/README.secureboot
</code></pre></div>    </div>
  </li>
  <li>
    <p>Enroll process with Akmods</p>

    <div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo</span> /usr/sbin/kmodgenca
</code></pre></div>    </div>
  </li>
  <li>
    <p>Enter the certificate information</p>

    <div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nt">-----</span>
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter <span class="s1">'.'</span>, the field will be left blank.
<span class="nt">-----</span>
Organization Name <span class="o">(</span>eg, company<span class="o">)</span> <span class="o">[</span>akmods <span class="nb">local</span><span class="o">]</span>: erickcantu
Organizational Unit Name <span class="o">(</span>eg, section<span class="o">)</span> <span class="o">[</span>akmods]:ecantu
Email Address <span class="o">[</span>akmods@localhost.localdomain]:erick@erickcantu
Locality Name <span class="o">(</span>eg, city<span class="o">)</span> <span class="o">[</span>None]:
State or Province Name <span class="o">(</span>full name<span class="o">)</span> <span class="o">[</span>None]:
Country Name <span class="o">(</span>2 letter code<span class="o">)</span> <span class="o">[</span>XX]:
Common Name <span class="o">(</span>eg, your name or your server<span class="s1">'s hostname) [akmods local signing CA]:
</span></code></pre></div>    </div>
  </li>
  <li>
    <p>Enroll new keypair with certificate and enter its password. It will be asked when the computer reboots.</p>

    <div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo </span>mokutil <span class="nt">--import</span> /etc/pki/akmods/certs/public_key.der
input password: 
input password again: 
</code></pre></div>    </div>
  </li>
  <li>
    <p>Rebooting the system is needed for MOK to enroll the new public key. BE SURE YOU HAVE A WIRED KEYBOARD!!!</p>

    <p>On next boot MOK Management is launched and you have to choose
“Enroll MOK”.</p>

    <p>Choose “Continue” to enroll the key or “View key 0” to show the keys
already enrolled.</p>

    <p>Confirm enrollment by selecting “Yes”.</p>

    <p>You will be invited to enter the password generated above.
WARNING: keyboard is mapped to QWERTY!</p>

    <p>The new key is enrolled, and system ask you to reboot.</p>

    <p>You can confirm the enrollment of the new keypair once the system
rebooted with:</p>

    <div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>mokutil <span class="nt">--list-enrolled</span> | <span class="nb">grep </span>Issuer
</code></pre></div>    </div>

    <p>or with:</p>

    <div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo </span>mokutil <span class="nt">--test-key</span> /etc/pki/akmods/certs/public_key.der
</code></pre></div>    </div>

    <p>which should return</p>

    <div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>/etc/pki/akmods/certs/public_key.der is already enrolled
</code></pre></div>    </div>
  </li>
</ol>

<h4 id="house-keeping">House keeping</h4>

<p>I already have 10 enrolled keys, which I have been creating in the last days. Lets remove the ones that are not needed. For details see: <a href="https://askubuntu.com/questions/805152/is-it-possible-to-delete-an-
enrolled-key-using-mokutil-without-the-original-der">uefi - Is it possible to delete an enrolled key using mokutil without the original .der file? - Ask Ubuntu</a></p>

<ol>
  <li>
    <p>Create a mokkeys directory.</p>

    <div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">mkdir </span>mokkeys
<span class="nb">cd </span>mokkeys
</code></pre></div>    </div>
  </li>
  <li>
    <p>List the enrolled keys by exporting them to the mokkeys directory. I use zsh, therefore the <em>lsa</em> command. Use <em>ll</em> in bash.</p>

    <div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>mokutil <span class="nt">--export</span>
lsa
</code></pre></div>    </div>
  </li>
  <li>
    <p>Review the keys content. Be careful to select only the keys that are not needed. You do not want to re-install everything again.</p>

    <div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>mokutil <span class="nt">-l</span> | less
</code></pre></div>    </div>
  </li>
  <li>
    <p>Delete they selected keys by erasing the files name <em>MOK000x.der</em>. The command is going to ask you for a password that is needed after rebooting. Use the same password for each key. Ideally the same one that was used to enroll them.</p>

    <div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo </span>mokutil <span class="nt">--delete</span> MOK000x.der
</code></pre></div>    </div>
  </li>
  <li>
    <p>You need to reboot the system. You will come to the blue screen that is going to ask you if you want to delete the selected keys. You do this part in a bash. Not per individual key. Reboot the system.</p>
  </li>
</ol>

<h3 id="install-nvida-drivers-from-rpm-fusion">Install NVIDA Drivers from RPM Fusion</h3>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo </span>dnf update <span class="nt">-y</span>
<span class="nb">sudo </span>dnf <span class="nb">install </span>akmod-nvidia
</code></pre></div></div>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Installed:
  akmod-nvidia-3:530.41.03-1.fc38.x86_64                                                                  
  egl-gbm-1.1.0-4.fc38.x86_64                                                                             
  egl-wayland-1.1.11-3.fc38.x86_64                                                                        
  nvidia-settings-3:530.41.03-1.fc38.x86_64                                                               
  xorg-x11-drv-nvidia-3:530.41.03-1.fc38.x86_64                                                           
  xorg-x11-drv-nvidia-cuda-libs-3:530.41.03-1.fc38.x86_64                                                 
  xorg-x11-drv-nvidia-kmodsrc-3:530.41.03-1.fc38.x86_64                                                   
  xorg-x11-drv-nvidia-libs-3:530.41.03-1.fc38.x86_64                                                      
  xorg-x11-drv-nvidia-power-3:530.41.03-1.fc38.x86_64      
</code></pre></div></div>

<p>The documentation provides a suggestion to install cuda. But, I will try with <a href="https://rpmfusion.org/Howto/CUDA?highlight=%28%5CbCategoryHowto%5Cb%29">Howto/CUDA - RPM Fusion</a> in the next post.</p>

<p>Reboot the computer.</p>

<h3 id="it-boot-to-a-black-screen">IT BOOT TO A BLACK SCREEN</h3>

<p>It happened again, the same bug as with the KDE version. The boot was to a black screen. This bug is well documented, and according to RPM Fusion documentation, the solution is in place. However, for the 530.41.03 driver version is not. You need to run the commands that are part of the <a href="https://rpmfusion.org/Howto/NVIDIA?highlight=%28%5CbCategoryHowto%5Cb%29#KMS">KMS (Kernel Mode Setting”)</a>. Now I wonder if I should go back to the minimalist KDE server version.</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo </span>grubby <span class="nt">--update-kernel</span><span class="o">=</span>ALL <span class="nt">--args</span><span class="o">=</span><span class="s1">'nvidia-drm.modeset=1'</span>
</code></pre></div></div>

<h3 id="ensure-the-suspend-command-works">Ensure the suspend command works</h3>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo </span>dnf <span class="nb">install </span>xorg-x11-drv-nvidia-power
<span class="nb">sudo </span>systemctl <span class="nb">enable </span>nvidia-<span class="o">{</span><span class="nb">suspend</span>,resume,hibernate<span class="o">}</span>
</code></pre></div></div>

<p>The package is already installed. I presume the configuration is also available. Will see if there are any issues after it suspends.</p>

<h3 id="video-acceleration">Video Acceleration</h3>

<p>Video reproduction or streaming requires video acceleration. No need for additional ffmpeg drivers or media drivers. The following code is enough.</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo </span>dnf <span class="nb">install </span>nvidia-vaapi-driver libva-utils vdpauinfo
</code></pre></div></div>

<h3 id="nouveau-verification">Nouveau verification</h3>

<p>Review that Nouveau is not running the following code should produce nothing.</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>lsmod |grep nouveau
</code></pre></div></div>

<h3 id="change-monitor-scale-options">Change monitor scale options</h3>

<p>By default in Fedora you can scale by 100%. This means that you can select 100% or 200% scale in the display menu. It is not possible to select something in between, e.g. 150%. This can be modified by running:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>gsettings <span class="nb">set </span>org.gnome.mutter experimental-features <span class="s2">"['scale-monitor-framebuffer']"</span>
</code></pre></div></div>

<p>See: <a href="https://www.omglinux.com/how-to-enable-fractional-scaling-fedora/">How to Enable Fractional Scaling on Fedora Linux - OMG! Linux</a></p>

<hr />

<p>In the next posts, I will review installing LaTeX, modifying GNOME, maybe trying Hyland, but definitely trying  EWW Widgets. Also we will review CUDA; this is going to be intersting.</p>]]></content><author><name>Erick Cantu</name></author><category term="Fedora 38" /><category term="Worksation Version" /><category term="Work Station Setup" /><category term="Fedora 38" /><category term="Work Station" /><category term="Computer Setup" /><category term="Root Expansion" /><category term="Data Science Workstation Setup" /><summary type="html"><![CDATA[WELL.. The KDE server version did not work well. The computer reboot when streaming while the CPU got temperatures around 61°C. Installing NVIDIA drivers did not resolved the issue. Black screens came after booting.. A possibility could be, missing the configuration in the boot setup to use the NVIDIA driver instead of the nouveau divers. Additionally there was mouse freezing, which could be fixed by using the solaar package. Bud did not had the opportunity to test it. I tried the KDE ISO version whit the same results than using the server version.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://www.erickcantu.com/assets/images/posts/fedora38_KDE/ecantu_Create_an_abstract_paint_that_illustrates_the_fusion_of__0af24d51-1ddd-4b05-99e1-fb2ef32ee269.png" /><media:content medium="image" url="https://www.erickcantu.com/assets/images/posts/fedora38_KDE/ecantu_Create_an_abstract_paint_that_illustrates_the_fusion_of__0af24d51-1ddd-4b05-99e1-fb2ef32ee269.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Fedora 38 Setup - KDE - Server Version</title><link href="https://www.erickcantu.com/fedora%2038/kde/work%20station%20setup/2023/05/04/Fedora-Setup.html" rel="alternate" type="text/html" title="Fedora 38 Setup - KDE - Server Version" /><published>2023-05-04T00:00:00+00:00</published><updated>2023-05-06T00:00:00+00:00</updated><id>https://www.erickcantu.com/fedora%2038/kde/work%20station%20setup/2023/05/04/Fedora-Setup</id><content type="html" xml:base="https://www.erickcantu.com/fedora%2038/kde/work%20station%20setup/2023/05/04/Fedora-Setup.html"><![CDATA[<p>I have run Ubuntu on and off through the years,  almost since the beginning around 17 years ago. Back then it was great. It helped me to get into the Linux world. Nowadays, it seems just boot-loaded.  Specially the eternity that takes to update the libraries. And, I do not like today’s gnome in a Workstation. To me it is great in a laptop where a track pad is available. But not for a dedicated mouse.  I know I could use a different flavor, but how old the libraries are in it, is a no in today’s world.</p>

<p>For some time I tried with Linux Mint and popOS in a laptop.  It was fine, still gnome in a laptop. But, since the beginning of the year I have been using Fedora 37 on an old Surface Go2,  it runs amazing; for a Surface Go2 with 3Gb of RAM. No complains, 12 Gb of space to run in comparison to the 30 somethings of Windows. It came back to life, yes the camera still does not work as intended, but everything else is great. Thanks to the people in  <a href="https://github.com/linux-surface/linux-surface">GitHub - linux-surface/linux-surface: Linux Kernel for Surface Devices</a>. It is an amazing work.</p>

<p>With all these in mind and because I decided, “Finally”, to move to Linux as my main driver and have Windows as backup. And, since Fedora 38 just lunched…. well here we are.  This is my personal implementation. It is mainly to document the steps that I followed.  And by no means is the best implementation. I should have stayed with the Fedora 38 Workstation; Nvidia seems not to like it (in another Post I will look into the NVIDIA drivers journey),  but its gnome….</p>

<p><em>The post image was created with midjourney. Prompt: /imagine Create an abstract paint that illustrates the fusion of engineering and innovation with Data Science, navigating the crossroads of expertise to create sustainable and efficient solutions using oil as the medium, with the impasto technique, emphasizing depth and contrast, and featuring a stunning midnight blue and dark green color palette. –no Letters, Text, Signature, Watermark, Logo, Stamp, Branding, Trademark, Copyright, Registered Trademark, Human, Person, People. –aspect 7:4 –s 750 –v 5 –q 2</em></p>

<h3 id="install-fedora-server-with-kde">Install Fedora Server with KDE</h3>

<ul>
  <li>
    <p>Download the server ISO and lunch it in <a href="https://github.com/ventoy/Ventoy">GitHub - ventoy/Ventoy: A new bootable USB solution.</a></p>
  </li>
  <li>
    <p>In the anaconda installer:</p>

    <ul>
      <li>
        <p>Create a user</p>
      </li>
      <li>
        <p>Select to install from mirror list use: <a href="https://admin.fedoraproject.org/mirrormanager/mirrors/Fedora/38">Fedora Mirrors - 38</a></p>
      </li>
      <li>
        <p>Select Software to Install. Use KDE for this Version. Unselect firefox and libreoffice.</p>
      </li>
      <li>
        <p>Select the disk to use. Use Automate version.</p>
      </li>
    </ul>
  </li>
</ul>

<h3 id="initial-configuration">Initial Configuration</h3>

<p>Because I am installing the server version and adding KDE without firefox and libreoffice, the  default size for <code class="language-plaintext highlighter-rouge">/</code> is 15Gb.  I expanded it to the maximum possible size. First update the installation and install <em>git, kitty and zsh</em>.</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="o">[</span>erick@fedora ~]<span class="nv">$ </span><span class="nb">sudo </span>dnf update <span class="nt">-y</span>
<span class="o">[</span>erick@fedora ~]<span class="nv">$ </span><span class="nb">sudo </span>dnf <span class="nb">install </span>git kitty zsh
</code></pre></div></div>

<p>Now expand root size. Fore details see: <a href="https://www.youtube.com/watch?v=MfGkBe8Y5Nk">Fedora Server Install not Using entire disk. - YouTube</a></p>

<p>I am not convinced this is the correct way to move forward with the implementation. I have the feeling that <em>home</em> is out of the scope in this implementation. And, that I am not using <em>root</em> as intended. I do not have a message board, but feel free to contact me if you have any ideas or opinions about this.</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="o">[</span>erick@fedora ~]<span class="nv">$ </span><span class="nb">sudo </span>lvdisplay
<span class="o">[</span><span class="nb">sudo</span><span class="o">]</span> password <span class="k">for </span>erick:
  <span class="nt">---</span> Logical volume <span class="nt">---</span>
  LV Path                /dev/fedora/root

<span class="o">[</span>erick@fedora ~]<span class="nv">$ </span><span class="nb">sudo </span>lvresize <span class="nt">-r</span> <span class="nt">-l</span> +100%FREE /dev/fedora/root
   Logical volume fedora/root successfully resized.
</code></pre></div></div>

<p>The first part, <em>lvdisplay</em>, provides the required path name for <em>lvresize</em>.</p>

<p>Now create a folder to build the setup. Eventually everything that needs to be build lands here.</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">mkdir </span>Build
<span class="nb">cd </span>Build
sh <span class="nt">-c</span> <span class="s2">"</span><span class="si">$(</span>curl <span class="nt">-fsSL</span> https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh<span class="si">)</span><span class="s2">"</span>

git clone https://github.com/denysdovhan/spaceship-prompt.git <span class="s2">"</span><span class="nv">$ZSH_CUSTOM</span><span class="s2">/themes/spaceship-prompt"</span> <span class="nt">--depth</span><span class="o">=</span>1
<span class="nb">ln</span> <span class="nt">-s</span> <span class="s2">"</span><span class="nv">$ZSH_CUSTOM</span><span class="s2">/themes/spaceship-prompt/spaceship.zsh-theme"</span> <span class="s2">"</span><span class="nv">$ZSH_CUSTOM</span><span class="s2">/themes/spaceship.zsh-theme"</span>

nano ~/.zshrc
</code></pre></div></div>

<p>once in nano, configure <em>oh-my-zsh</em> prompt inside <em>.zshrc</em>. Replace the <code class="language-plaintext highlighter-rouge">ZSH_THEME=XXX</code> with:</p>

<p><code class="language-plaintext highlighter-rouge">ZSH_THEME="fino"</code></p>

<p>Finally add a couple of pluggins to highlight the commands and generate auto suggestions.</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>git clone https://github.com/zsh-users/zsh-syntax-highlighting.git <span class="k">${</span><span class="nv">ZSH_CUSTOM</span><span class="k">:-</span><span class="p">~/.oh-my-zsh/custom</span><span class="k">}</span>/plugins/zsh-syntax-highlighting

git clone https://github.com/zsh-users/zsh-autosuggestions <span class="k">${</span><span class="nv">ZSH_CUSTOM</span><span class="k">:-</span><span class="p">~/.oh-my-zsh/custom</span><span class="k">}</span>/plugins/zsh-autosuggestions

nano ~/.zshrc
</code></pre></div></div>

<p>Configure the plugins inside .zshrc</p>

<p>change <code class="language-plaintext highlighter-rouge">plugins=(git)</code> to <code class="language-plaintext highlighter-rouge">plugins=(git zsh-autosuggestions zsh-syntax-highlighting)</code></p>

<h3 id="compile-zshrc">Compile .zshrc</h3>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">source</span> ~/.zshrc
</code></pre></div></div>

<h3 id="install-vivaldi-with-dnfdragora-package-installer">Install Vivaldi with dnfdragora package installer.</h3>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">mkdir </span>vivaldi
<span class="nb">cd </span>vivaldi
wget https://downloads.vivaldi.com/stable/vivaldi-stable-6.0.2979.18-1.x86_64.rpm
</code></pre></div></div>

<p>After downloading it. Go to the folder location within Dolphin. Select run with dnfdragora package installer by doing right click to the rpm file. The 6.0.2979.18-1.x86_64 version is the latest at the time this post is being publish. Review the latest version.</p>

<h3 id="install-the-following-programs-and-applications">Install the following programs and applications</h3>

<ul>
  <li>
    <p>Install AppImageLauncher follow the steps in <a href="https://github.com/TheAssassin/AppImageLauncher/wiki">Home · TheAssassin/AppImageLauncher Wiki · GitHub</a>. Use dnfdragora package installer. Same procedure as with Vivaldi</p>
  </li>
  <li>
    <p>Onlyoffice AppImage, use its <a href="https://www.onlyoffice.com/download-desktop.aspx">AppImage</a></p>
  </li>
  <li>
    <p>Marktext AppImage <a href="https://github.com/marktext/marktext/releases/latest">latest release</a></p>
  </li>
  <li>
    <p>neofetch</p>
  </li>
</ul>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo </span>dnf <span class="nb">install </span>neofetch
</code></pre></div></div>

<h3 id="setup-github">Setup GitHub</h3>

<p>Create SSH key and setup. Follow the instructions at <a href="https://docs.github.com/authentication/connecting-to-github-with-ssh">Connecting to GitHub with SSH - GitHub Docs</a>.</p>

<h3 id="setup-visual-studio-code">Setup Visual Studio Code</h3>

<p>Follow the instructions in: <a href="https://code.visualstudio.com/docs/setup/linux#_rhel-fedora-and-centos-based-distributions">Running Visual Studio Code on Linux</a></p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo </span>rpm <span class="nt">--import</span> https://packages.microsoft.com/keys/microsoft.asc
<span class="nb">sudo </span>sh <span class="nt">-c</span> <span class="s1">'echo -e "[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" &gt; /etc/yum.repos.d/vscode.repo'</span>

dnf check-update
<span class="nb">sudo </span>dnf <span class="nb">install </span>code
</code></pre></div></div>

<h3 id="install-and-configure-pyenv-inside-zshrc">Install and configure pyenv inside .zshrc</h3>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>git clone https://github.com/pyenv/pyenv.git ~/.pyenv
<span class="nb">echo</span> <span class="s1">'export PYENV_ROOT="$HOME/.pyenv"'</span> <span class="o">&gt;&gt;</span> ~/.zshrc
<span class="nb">echo</span> <span class="s1">'export PATH="$PYENV_ROOT/bin:$PATH"'</span> <span class="o">&gt;&gt;</span> ~/.zshrc
<span class="nb">echo</span> <span class="nt">-e</span> <span class="s1">'if command -v pyenv 1&gt;/dev/null 2&gt;&amp;1; then\n eval "$(pyenv init --path)"\nfi'</span> <span class="o">&gt;&gt;</span> ~/.zshrc
</code></pre></div></div>

<h3 id="install-jekyll-and-setup-for-basically-basic-jekyll-theme">Install <a href="https://jekyllrb.com">Jekyll</a> and setup for <a href="https://mmistakes.github.io/jekyll-theme-basically-basic/">Basically Basic Jekyll Theme</a></h3>

<p>Follow the installation steps <a href="https://jekyllrb.com/docs/installation/other-linux/">Jekyll on Linux</a></p>

<p>In brief install prerequisites.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo dnf install ruby ruby-devel openssl-devel redhat-rpm-config @development-tools
</code></pre></div></div>

<p>Add gems to path with:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>nano ~/.zshrc
</code></pre></div></div>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c"># Install Ruby Gems to ~/gems</span>
<span class="nb">export </span><span class="nv">GEM_HOME</span><span class="o">=</span><span class="s2">"</span><span class="si">$(</span>ruby <span class="nt">-e</span> <span class="s1">'puts Gem.user_dir'</span><span class="si">)</span><span class="s2">"</span>
<span class="nb">export </span><span class="nv">PATH</span><span class="o">=</span><span class="s2">"</span><span class="nv">$GEM_HOME</span><span class="s2">/bin:</span><span class="nv">$PATH</span><span class="s2">"</span>
<span class="nb">export </span><span class="nv">GEM_BINN</span><span class="o">=</span><span class="s2">"</span><span class="nv">$HOME</span><span class="s2">/bin"</span>
<span class="nb">export </span><span class="nv">PATH</span><span class="o">=</span><span class="s2">"</span><span class="nv">$GEM_BINN</span><span class="s2">:</span><span class="nv">$PATH</span><span class="s2">"</span>
</code></pre></div></div>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">source</span> ~/.zshrc
</code></pre></div></div>

<p>Install Jekyll and Bundler gems</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>gem update
gem install jekyll bundler
</code></pre></div></div>

<p>There was missing a library <code class="language-plaintext highlighter-rouge">make: g++: No such file or directory</code>.</p>

<p>Solve it installing</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>dnf <span class="nb">install </span>gcc-c++
</code></pre></div></div>

<p>Follow the instructions <a href="https://mmistakes.github.io/jekyll-theme-basically-basic/">Basically Basic Jekyll Theme</a>, run</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>bundle <span class="nb">install</span>
</code></pre></div></div>

<p>Ruby suggest to update it to its latest version. However a permission error was trigger.</p>

<p>A solution is to install it as a super user. However ruby shows the message: <strong>Do not run</strong> <code class="language-plaintext highlighter-rouge">bundle install</code>  <strong>with root privileges.</strong> Because the Ruby gems was installed with dnf, it was installed as superuser. The right way to update ruby gems in this case is to use Fedora dnf. But this will not have the latest version. Which may not be needed in this case.</p>

<p>A solution would be to install Ruby Gems according to  <a href="https://rubygems.org/pages/download">Download RubyGems / your community gem host</a>. But that is out of the scope of my usage.</p>

<p>So far is were we are. I am still missing  Pandoc, LuaLaTex,  pdftk, TexLive and TexStudio. Advance data science setup, yes NVIDIA drivers…</p>]]></content><author><name>Erick Cantu</name></author><category term="Fedora 38" /><category term="KDE" /><category term="Work Station Setup" /><category term="Fedora 38" /><category term="Work Station" /><category term="Computer Setup" /><category term="Root Expansion" /><category term="Data Science Workstation Setup" /><summary type="html"><![CDATA[I have run Ubuntu on and off through the years, almost since the beginning around 17 years ago. Back then it was great. It helped me to get into the Linux world. Nowadays, it seems just boot-loaded. Specially the eternity that takes to update the libraries. And, I do not like today’s gnome in a Workstation. To me it is great in a laptop where a track pad is available. But not for a dedicated mouse. I know I could use a different flavor, but how old the libraries are in it, is a no in today’s world.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://www.erickcantu.com/assets/images/posts/fedora38_KDE/ecantu_Create_an_abstract_paint_that_illustrates_the_fusion_of__8c2afd06-0892-4da2-9ad3-4aa9e5a236d2.png" /><media:content medium="image" url="https://www.erickcantu.com/assets/images/posts/fedora38_KDE/ecantu_Create_an_abstract_paint_that_illustrates_the_fusion_of__8c2afd06-0892-4da2-9ad3-4aa9e5a236d2.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Image Protms for Midjourney</title><link href="https://www.erickcantu.com/data_science/promt%20engineering/artificial%20intelligence/2023/04/28/Image-Promts_Midjourney.html" rel="alternate" type="text/html" title="Image Protms for Midjourney" /><published>2023-04-28T00:00:00+00:00</published><updated>2023-04-29T00:00:00+00:00</updated><id>https://www.erickcantu.com/data_science/promt%20engineering/artificial%20intelligence/2023/04/28/Image-Promts_Midjourney</id><content type="html" xml:base="https://www.erickcantu.com/data_science/promt%20engineering/artificial%20intelligence/2023/04/28/Image-Promts_Midjourney.html"><![CDATA[<p>The importance of having the correct prompt to recreate an image in Midjourney is the base to achieve the expected results. A bad prom;t leads to find either not the target or nice surprises.  Even when the main goal is to create an artistic image of our imagination, it is necessary to have a structure to meet our needs with the minimum use of resources.</p>

<p>With this purpose in mind, we can use a GPT solution to simplify our work. I am presenting a prompt structure. This structure is being used in ChatGPT-4 to create 3 possible prompts for Midjourney.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>I) Your role
Take the role of a Prompt Engineer with bast experience in Midjourney. 

II) The Request Context:
You will use the following structure to create prompts:
Content, Medium, Style, Lighting, Color Palette, Composition.

Unless the variables values are given to you, generate random values based in the following definitions:
Medium: insert artistic medium here.
Style: insert an Artist or Genre. 
Lighting: insert a lighting type utilized in photography or painting.
Color Palette: insert the color pallet to use, verify that matches the style type.
Composition: insert cameras models, specific lenses, photography or image types, positional elements.

III) Your work:
I will provide your with content ideas. 
With these ideas you will help to write 3 different prompts to create images and art. 
Write in natural language, utilize specific, precise, and articulated language. 
Include the following text at the end of each promt:
"--no Human, People, Person, Letters, Numbers, Text, Signature, Watermark, Logo, Stamp, Branding, Trademark, Copyright, Registered Trademark.
</code></pre></div></div>

<h3 id="example---eda-king-county-washington">Example - EDA King County Washington</h3>

<p><strong>For the EDA post, I added a new image header to the webpage. To create it, I used the following prompt.</strong></p>

<p><code class="language-plaintext highlighter-rouge">An aerial recreation of King County Seattle Washington housing. Consider key sightseeing in Seattle. To be use in a realtor marketing campaign. The target market is high income.
Medium: photo realistic image.
Style: 4K photograph 
Lighting: emphasize depth and contrast
Color Palette: early golden hour
At  the end of the prompt add  --aspect 7:4 </code></p>

<p><strong>ChatGPT-4 provided the following prompts:</strong></p>

<ol>
  <li>
    <p><code class="language-plaintext highlighter-rouge">Design a captivating aerial image of King County Seattle Washington housing, incorporating significant Seattle landmarks, intended for a realtor marketing campaign, in a photo-realistic 4K photograph with lighting that accentuates depth and contrast, and showcasing a rich midnight blue color palette. –no Human, People, Person, Letters, Numbers, Text, Signature, Watermark, Logo, Stamp, Branding, Trademark, Copyright, Registered Trademark. –aspect 7:4</code></p>
  </li>
  <li>
    <p><code class="language-plaintext highlighter-rouge">An aerial recreation of King County Seattle Washington housing. Consider key sightseeing in Seattle. To be use in a realtor marketing campaign. The target market is high income. Medium: photo realistic image Style: 4K photograph Lighting: emphasize depth and contrast Color Palette: early golden hour At the end of the prompt add –aspect 7:4</code></p>
  </li>
  <li>
    <p><code class="language-plaintext highlighter-rouge">Compose an impressive aerial representation of King County Seattle Washington housing, highlighting key attractions in Seattle, suitable for a realtor marketing campaign targeting high-income clients, as a photorealistic 4K photograph with evocative lighting that highlights depth and contrast, and featuring an early golden hour color palette. –no Human, People, Person, Letters, Numbers, Text, Signature, Watermark, Logo, Stamp, Branding, Trademark, Copyright, Registered Trademark. –aspect 7:4</code></p>
  </li>
</ol>

<p><strong>The provided prompt to Midjourney was:</strong></p>

<p><code class="language-plaintext highlighter-rouge">Compose an impressive aerial representation of King County Seattle Washington housing, highlighting key attractions in Seattle, suitable for a realtor marketing campaign targeting high-income clients, as a photorealistic 4K photograph with evocative lighting that highlights depth and contrast, and featuring an early golden hour color palette. --no Human, People, Person, Letters, Numbers, Text, Signature, Watermark, Logo, Stamp, Branding, Trademark, Copyright, Registered Trademark. --aspect 7:4 --s 750 --v 5 --q 2 </code></p>

<p><strong>And the results are:</strong>
<img src="/assets/images/posts/promts_midjourney/ecantu_Compose_an_impressive_aerial_representation_of_King_Coun_2880dd47-91d0-4b21-8ac5-0e98f1145cb3.webp" alt="image" title="Compose an impressive aerial representation of King County Seattle Washington housing, highlighting key attractions in Seattle, suitable for a realtor marketing campaign targeting high-income clients, as a photorealistic 4K photograph with evocative lighting that highlights depth and contrast, and featuring an early golden hour color palette. --no Human, People, Person, Letters, Numbers, Text, Signature, Watermark, Logo, Stamp, Branding, Trademark, Copyright, Registered Trademark. --aspect 7:4 --s 750 --v 5 --q 2 " /></p>

<h2 id="prompts-used-in-this-website">Prompts used in this website</h2>

<h3 id="kickstarter">Kickstarter</h3>

<p><code class="language-plaintext highlighter-rouge">Design a vector illustration for a website header with the topic of Kickstarter, depicting a rocket launching to symbolize project success. The style should be modern and sleek, with dramatic lighting and a strong light source coming from behind the rocket. The color palette should include contrasting shades of blues, greens, and whites to convey the excitement of innovation. Compose the image with a diagonal layout, and have the rocket take up most of the frame for a dynamic effect. --no Human, People, Person, Letters, Numbers, Text, Signature, Watermark, Logo, Stamp, Branding, Trademark, Copyright, Registered Trademark. --aspect 7:3 --s 750 --v 5 --q 2 </code></p>

<p><strong>Result:</strong></p>

<p><img src="/assets/images/posts/promts_midjourney/ecantu_Design_a_vector_illustration_for_a_website_header_with_t_73f6d8ed-d887-4070-a476-95b37d77d65d.png" alt="image" title="Design a vector illustration for a website header with the topic of Kickstarter, depicting a rocket launching to symbolize project success. The style should be modern and sleek, with dramatic lighting and a strong light source coming from behind the rocket. The color palette should include contrasting shades of blues, greens, and whites to convey the excitement of innovation. Compose the image with a diagonal layout, and have the rocket take up most of the frame for a dynamic effect. --no Human, People, Person, Letters, Numbers, Text, Signature, Watermark, Logo, Stamp, Branding, Trademark, Copyright, Registered Trademark. --aspect 7:3 --s 750 --v 5 --q 2" /></p>

<h3 id="the-green-city-solutions-group">The Green City Solutions Group</h3>

<p><code class="language-plaintext highlighter-rouge">Take a realistic 4K photograph of a 9-building complex focused on forecasting building energy demand, which includes a fast-food restaurant, standalone retail, strip mall retail, and 7 multi-family buildings. Visibly integrate solar panels, wind turbines, and heat pumps. Use warm, golden-hour sunlight for lighting to emphasize the eco-friendly nature of the buildings. The color palette should consist of earth tones, with subtle green and blue accents to symbolize energy efficiency. Compose the image with an elevated perspective, highlighting the buildings and energy sources from an interesting angle. --aspect 7:3 --no Human, People, Person, Letters, Numbers, Text, Signature, Watermark, Logo, Stamp, Branding, Trademark, Copyright, Registered Trademark. --s 750 --v 5 --q 2</code></p>

<p><img src="/assets/images/posts/promts_midjourney/ecantu_Take_a_realistic_4K_photograph_of_a_9-building_complex_f_ceff2667-a1fd-44f3-8715-2cf92c736e75.webp" alt="image" title="Take a realistic 4K photograph of a 9-building complex focused on forecasting building energy demand, which includes a fast-food restaurant, standalone retail, strip mall retail, and 7 multi-family buildings. Visibly integrate solar panels, wind turbines, and heat pumps. Use warm, golden-hour sunlight for lighting to emphasize the eco-friendly nature of the buildings. The color palette should consist of earth tones, with subtle green and blue accents to symbolize energy efficiency. Compose the image with an elevated perspective, highlighting the buildings and energy sources from an interesting angle. --aspect 7:3 --no Human, People, Person, Letters, Numbers, Text, Signature, Watermark, Logo, Stamp, Branding, Trademark, Copyright, Registered Trademark. --s 750 --v 5 --q 2" /></p>

<h3 id="image-prompts-for-midjourney">Image Prompts for Midjourney</h3>

<p><code class="language-plaintext highlighter-rouge">Create a composite landscape photograph for the header of a personal webpage, combining the mountains of Mexico, including Cañon del Sumidero, Cañón Namurachi, Cañón de Aquetzalli, and Barranca del Cobre, with the Black Forest in Germany, adding mist to create a surreal and mystical atmosphere, using a color palette of dark greens and blues, and composing the image with strong foreground elements to provide depth and scale. No text. No signature. --v 5 --s 750</code></p>

<p><img src="/assets/images/posts/promts_midjourney/ecantu_Create_a_composite_landscape_photograph_for_the_header_o_3d043cc6-3d54-42dd-bee1-c01e09cc4a45.webp" alt="image" title="Create a composite landscape photograph for the header of a personal webpage, combining the mountains of Mexico, including Cañon del Sumidero, Cañón Namurachi, Cañón de Aquetzalli, and Barranca del Cobre, with the Black Forest in Germany, adding mist to create a surreal and mystical atmosphere, using a color palette of dark greens and blues, and composing the image with strong foreground elements to provide depth and scale. No text. No signature. --v 5 --s 750" /></p>

<p>This image still had a Signature in the third variation. Which I thought the <code class="language-plaintext highlighter-rouge">No Signature</code> part at the end would have been enough. But it did not work. It lead me to better understand the negation process in Midjourney. After this image and other similar ones, I added the command <code class="language-plaintext highlighter-rouge">--no Human, People, Person, Letters, Numbers, Text, Signature, Watermark, Logo, Stamp, Branding, Trademark, Copyright, Registered Trademark.</code> instructions.</p>]]></content><author><name>Erick Cantu</name></author><category term="Data_Science" /><category term="Promt Engineering" /><category term="Artificial Intelligence" /><category term="artificial intelligence" /><category term="data science" /><category term="promts" /><category term="midjourney" /><category term="art" /><category term="imaging" /><summary type="html"><![CDATA[The importance of having the correct prompt to recreate an image in Midjourney is the base to achieve the expected results. A bad prom;t leads to find either not the target or nice surprises. Even when the main goal is to create an artistic image of our imagination, it is necessary to have a structure to meet our needs with the minimum use of resources.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://www.erickcantu.com/assets/images/posts/promts_midjourney/ecantu_Create_a_composite_landscape_photograph_for_the_header_o_35851b07-126a-45da-aa1d-25e61c565656_top.png" /><media:content medium="image" url="https://www.erickcantu.com/assets/images/posts/promts_midjourney/ecantu_Create_a_composite_landscape_photograph_for_the_header_o_35851b07-126a-45da-aa1d-25e61c565656_top.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Forecasting building energy demand</title><link href="https://www.erickcantu.com/data_science/eda/time%20series/2022/08/18/The-Green-City-Solutions-Group.html" rel="alternate" type="text/html" title="Forecasting building energy demand" /><published>2022-08-18T00:00:00+00:00</published><updated>2022-08-18T15:00:00+00:00</updated><id>https://www.erickcantu.com/data_science/eda/time%20series/2022/08/18/The-Green-City-Solutions-Group</id><content type="html" xml:base="https://www.erickcantu.com/data_science/eda/time%20series/2022/08/18/The-Green-City-Solutions-Group.html"><![CDATA[<p>Final project done at the Neuefische bootcamp. The project focuses on forecasting hourly building energy demand of 9 buildings. The used data was from the <a href="https://sites.google.com/view/citylearnchallenge">2021 CityLearn Challenge</a>, based on 4 years energy consumption and weather data.</p>

<h2 id="introduction">Introduction</h2>

<p>Since energy prices are continuing to rise and the future of the energy situation is rather uncertain, cities may want to investigate the energy consumption of different building sectors to predict future energy demand and identify areas where energy can be saved.</p>

<p>Energy demand forecasting is fundamental for an energy utility’s decision making on:</p>

<ul>
  <li>
    <p>Grid stability</p>
  </li>
  <li>
    <p>Planning power supply activities</p>
  </li>
  <li>
    <p>Reducing energy wastage</p>
  </li>
</ul>

<p>Since the data available consists of a series of energy consumption values taken sequentially with a fixed time interval over four years, time series analysis and models are ideal for this problem.</p>

<h2 id="methodology">Methodology</h2>

<p>Time series data was analyzed for trend and seasonality.</p>

<p>It seemed suitable to forecast the energy demand for 24 hours, as weather predictions get less accurate further in the future. Else, the power suppliers energy management is mainly focused on a 24 hour period.</p>

<p>Different models were applied and compared:</p>

<ul>
  <li>Baseline (last years values)</li>
  <li>Linear Regression</li>
  <li>Polynomial Regression</li>
  <li>SARIMAX</li>
  <li>Prophet</li>
  <li>TBats</li>
  <li>XGBoost</li>
  <li>Random Forest</li>
</ul>

<h2 id="main--results">Main  Results</h2>

<p>A small trend in the net energy demand over 4 years was discovered with a slight increase over the first 3 years and a decrease in the 4th year (corresponding to the trend in the weather data). A clear yearly seasonality is found with the highest energy demand in summer (due to air conditioning) and the lowest energy demand in winter (due to mild winters). Furthermore a weekly as well as a daily seasonality was identified.</p>

<p><img src="https://raw.githubusercontent.com/erickCantu/TheGreenCitySolutionsGroup/main/images/decomposition_yearly_net_energy_usage_final_presentation.png" alt="image" /></p>

<h2 id="conclusion">Conclusion</h2>

<p>Tree-based machine learning models (Random forest and XGBoost) produced forecasts with the lowest mean absolute error compared to the observed data.</p>

<p><img src="https://raw.githubusercontent.com/erickCantu/TheGreenCitySolutionsGroup/main/images/benchmark.png" alt="image" /></p>

<hr />

<h2 id="links">Links</h2>

<p>The complete project is available at the <a href="https://github.com/erickCantu/TheGreenCitySolutionsGroup">The Green City Solutions Group: Forecasting building energy demand through time series analysis and machine learning</a> GitHub repository. At the end of the analysis a presentation was done to the Neuefische team and other trainees. The presentation slides are available <a href="https://github.com/erickCantu/TheGreenCitySolutionsGroup/blob/main/Capstone_Project_Presentation.pdf">here</a>, while the presentation can be watch at: <a href="https://www.youtube.com/watch?v=jncUVXZKmCI">The energy of tomorrow - YouTube</a>.</p>]]></content><author><name>Erick Cantu</name></author><category term="Data_Science" /><category term="EDA" /><category term="Time Series" /><category term="eda" /><category term="data science" /><category term="AIcrowd" /><category term="building energy demand" /><category term="thesis" /><category term="neuefische" /><category term="bootcamp" /><summary type="html"><![CDATA[Final project done at the Neuefische bootcamp. The project focuses on forecasting hourly building energy demand of 9 buildings. The used data was from the 2021 CityLearn Challenge, based on 4 years energy consumption and weather data.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://www.erickcantu.com/assets/images/posts/green_city/ecantu_Take_a_realistic_4K_photograph_of_a_9-building_complex_f_3c8a11f4-5040-4f0d-b9ec-dec1a281d5f0.png" /><media:content medium="image" url="https://www.erickcantu.com/assets/images/posts/green_city/ecantu_Take_a_realistic_4K_photograph_of_a_9-building_complex_f_3c8a11f4-5040-4f0d-b9ec-dec1a281d5f0.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Exploratory Data Analysis - Seattle, WA</title><link href="https://www.erickcantu.com/data_science/eda/2022/08/16/EDA.html" rel="alternate" type="text/html" title="Exploratory Data Analysis - Seattle, WA" /><published>2022-08-16T00:00:00+00:00</published><updated>2022-08-16T15:00:00+00:00</updated><id>https://www.erickcantu.com/data_science/eda/2022/08/16/EDA</id><content type="html" xml:base="https://www.erickcantu.com/data_science/eda/2022/08/16/EDA.html"><![CDATA[<p>Exploratory Data Analysis (EDA) is a crucial step in the data science process that allows us to understand the structure and relationships within a dataset. It involves visualizing, summarizing, and transforming the data to uncover patterns and insights that inform the development of predictive models. Here are a few reasons why EDA is so important in data science:</p>

<ol>
  <li>
    <p>Identifying patterns and relationships: EDA helps us understand how different variables within a dataset relate to each other. This is crucial for identifying potential predictor variables and building accurate predictive models.</p>
  </li>
  <li>
    <p>Detecting outliers and anomalies: EDA can help us identify any unusual or unexpected data points, which can be critical for avoiding misleading results and improving the accuracy of our models.</p>
  </li>
  <li>
    <p>Understanding the distribution of the data: By visualizing the distribution of the data, we can gain a better understanding of the central tendency and spread of the data, which can inform the choice of statistical methods and models.</p>
  </li>
  <li>
    <p>Improving the quality of the data: EDA can help us identify issues with the data such as missing values, duplicates, or inconsistent formats. By fixing these issues, we can improve the quality of the data and increase the accuracy of our results.</p>
  </li>
  <li>
    <p>Providing insights for data cleaning and pre-processing: EDA helps us identify issues with the data that require cleaning and pre-processing, such as transforming variables to a more suitable form, or removing outlier or irrelevant data points.</p>
  </li>
</ol>

<p>In conclusion, EDA is an essential step in the data science process that provides valuable insights and improves the quality of the data. It helps us understand the structure of the data, identify potential predictor variables, and avoid misleading results. By taking the time to perform EDA, we can ensure that our data is well understood, and that our models are based on accurate and relevant data.</p>

<p><em>“The information in the relevance of EDA was generated on 20230208 using OpenAI’s ChatGPT (GPT-3.5) language model. While every effort has been made to ensure its accuracy, the information should not be considered a primary source.”</em></p>

<h2 id="utilizing-eda-to-de-tangle-seattle-us-real-state-market">Utilizing EDA to De-tangle Seattle, US Real State Market</h2>

<p>At the Neuefische bootcamp, the EDA work was performed to the house sales in the King County dataset. The dataset is publicly available at <a href="https://www.kaggle.com/datasets/harlfoxem/housesalesprediction">Kaggle</a>. To simulate a world case scenario. Different stakeholders with individual requirements were previous established by the Neuefische team (<a href="https://github.com/erickCantu/EDA_Project_KC_Housesales/blob/main/assignment.md">Asigment</a>). In this analysis I simulated a realtor company who conducted the EDA to fulfill the needs of a fictional investor named Timothy Stevens. Mr. Stevens sells houses and is interested in putting his investments in the market. He owns expensive houses in the county center, which are the analysis target. The best timing for him is within a year. He is open for renovation if profits rise with it.</p>

<h3 id="the-analysis">The analysis</h3>

<p><img src="/assets/images/posts/eda/rcpa.png" alt="image" /></p>

<p>At Red Cedar Property Advisors (RCPA) we specialize in providing the best advice to buy or sell your real state properties.  We cover the King County in Washington State.</p>

<p>Our customer Timothy Stevens asked for our advice. He is interested in selling some of his properties in the center of the County within the next year. A key question that he brought to us was: Is it worth it to renovate the properties? Although he is opened in doing it, it will only be done if there is a profit benefit.</p>

<hr />

<h4 id="main-results">Main results:</h4>

<p>The mean prices per zip code in the King County are quite disperse.  The price range goes between 2.4 and 11 million.  Because of this disperse, through the analysis I identified that anything bigger than 4 million is assumed its an outlier.</p>

<p>Unfortunately, our customer the properties in the county’s center are not reflected in these prices.  <strong>Note to the reader:</strong>  <em>In the assessment description, I did not had information on the exact location of the stakeholder properties. Because of that, I use the city of Seattle as the base for the analysis</em></p>

<h4 id="is-it-worth-to-remodel">Is it worth to remodel?</h4>

<p>Quite understandable the property and construction size correlate with the price. The bigger the property and its construction, the higher the market price. In our analysis we discover other factors that also have a slight correlation with the price in the center of the county . Current house condition and house grade (~0.63).<br />
<img src="/assets/images/posts/eda/houses_seattle_75_corr.png" alt="image" /></p>

<p>The house condition relates to the maintenance stage of the house, e.g. if it requires repair or how much work on it is required. While house grade relates on how good its construction meets the building code. From not meeting  it, to a custom design.</p>

<p>In our analysis we found that improving the house condition or grade do not had an impact in the price. This result is only valid for the center of the city of Seattle and do not represent the whole County. Therefore  RCPA gave the recommendation: do not remodel. Sell as is.</p>

<p><img src="/assets/images/posts/eda/houses_seattle_condition_mean_price.png" alt="image" /></p>

<h4 id="takeaways">Takeaways</h4>

<ul>
  <li>
    <p>The minimum price to sell is $ 675,000.</p>
  </li>
  <li>
    <p>House Condition and Grade drive the price.</p>
  </li>
  <li>
    <p>Do not remodel, it is not profitable in the city of Seattle.</p>
  </li>
</ul>

<hr />

<h2 id="links">Links</h2>

<p>The analysis is available at the <a href="https://github.com/erickCantu/EDA_Project_KC_Housesales">EDA_Project_KC_Housesales</a> GitHub repository.  At the end of the analysis a presentation was done to the Neuefische team and other trainees. This presentation is available at: <a href="https://github.com/erickCantu/EDA_Project_KC_Housesales/blob/project/eda_Seattle_City_Center_Housing_Market.pdf">EDA_Project_KC_Housesales Presentation</a>.instuctions</p>]]></content><author><name>Erick Cantu</name></author><category term="Data_Science" /><category term="EDA" /><category term="eda" /><category term="data science" /><category term="kaggle" /><category term="house market" /><category term="king county" /><category term="neuefische" /><category term="bootcamp" /><summary type="html"><![CDATA[Exploratory Data Analysis (EDA) is a crucial step in the data science process that allows us to understand the structure and relationships within a dataset. It involves visualizing, summarizing, and transforming the data to uncover patterns and insights that inform the development of predictive models. Here are a few reasons why EDA is so important in data science:]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://www.erickcantu.com/assets/images/posts/eda/ecantu_Compose_an_impressive_aerial_representation_of_King_Coun_42b67d7e-5593-4921-a3a8-30cc99f48cc2.png" /><media:content medium="image" url="https://www.erickcantu.com/assets/images/posts/eda/ecantu_Compose_an_impressive_aerial_representation_of_King_Coun_42b67d7e-5593-4921-a3a8-30cc99f48cc2.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Predicting Success in Kickstarter with Machine Learning</title><link href="https://www.erickcantu.com/data_science/maschine%20learning/2022/06/30/Predicting-Project-Success-Kickstarter-ML.html" rel="alternate" type="text/html" title="Predicting Success in Kickstarter with Machine Learning" /><published>2022-06-30T00:00:00+00:00</published><updated>2022-06-30T15:00:00+00:00</updated><id>https://www.erickcantu.com/data_science/maschine%20learning/2022/06/30/Predicting-Project-Success-Kickstarter-ML</id><content type="html" xml:base="https://www.erickcantu.com/data_science/maschine%20learning/2022/06/30/Predicting-Project-Success-Kickstarter-ML.html"><![CDATA[<p>Machine learning has revolutionized our ability to predict outcomes by leveraging vast amounts of data to uncover hidden patterns and trends. By continually refining predictive models and adapting to new data, machine learning has not only enhanced the accuracy of predictions but also propelled innovation across industries, ultimately paving the way for a smarter, more efficient future.</p>

<h2 id="machine-learning-to-predict-kickstarter-success">Machine Learning to Predict Kickstarter Success</h2>

<p>As part of the Neuefische data science bootcamp, we learn different Machine Learning algorithms, methods and models. We applied them in our second project. Which I conducted it with my colleague Sue Leen Wong. In our <em>Machine Leaning</em> project we analyzed data to predict the success of launching a crowdfunding project in <a href="https://www.kickstarter.com">Kickstarter</a>.</p>

<hr />

<h2 id="the-project">The Project</h2>

<h4 id="introduction">Introduction</h4>

<p>Kickstarter, founded in 2009, is a crowdfunding platform where project creators can raise money from the public, circumventing traditional avenues of investment. It has an all-or-nothing funding model, whereby a project is only funded if it meets its goal amount; otherwise no funds are collected.</p>

<p>A huge variety of factors contribute to the success or failure of a project on Kickstarter. Some of these factors are able to be quantified or categorized, which allows for the construction of a model to attempt to predict whether a project will succeed or not.</p>

<p>The goal of this project is to predict if a Kickstart project will succeed or fail through using Exploratory Data Analysis and supervised Machine Learning models.</p>

<p>More generally, the aim is to help potential project creators as well as potential investors assess what their chances of success on Kickstarter will be.</p>

<h4 id="the-stakeholder">The Stakeholder</h4>

<p>Mr. Jacoby Stevens</p>

<ul>
  <li>
    <p>Retired entrepreneur</p>
  </li>
  <li>
    <p>Likes supporting crowdfunding projects</p>
  </li>
  <li>
    <p>Is looking for the next big idea</p>
  </li>
  <li>
    <p>Would like us to predict for him the likelihood of success or  failure</p>
  </li>
  <li>
    <p>Wants to support the projects most likely to succeed</p>
  </li>
</ul>

<h4 id="baseline-model">Baseline Model</h4>

<ul>
  <li>
    <p>Projects based in USA are likely to be successful</p>
  </li>
  <li>
    <p>Evaluation Metric:
We train the model based on precision. Precision is the ratio of correctly predicted positives out of all of the results that were predicted positive.</p>
  </li>
  <li>
    <p>Score for baseline model:
Precision = 57.8%, Accuracy = 55.2%</p>
  </li>
</ul>

<h4 id="takeaways-and-future-work">Takeaways and Future Work</h4>

<ul>
  <li>
    <p>Improvement in accuracy from 55.2% to 72.0% over the baseline model with XGBoost.</p>
  </li>
  <li>
    <p>Best project categories to invest are:</p>

    <ul>
      <li>
        <p>Comics, dance or publishing categories</p>
      </li>
      <li>
        <p>Projects featured as “staff pick” when launched</p>
      </li>
      <li>
        <p>Projects from Hong Kong, Japan or Great Britain</p>
      </li>
    </ul>
  </li>
  <li>
    <p>Worst project categories to invest are:</p>

    <ul>
      <li>
        <p>Technology</p>
      </li>
      <li>
        <p>Food</p>
      </li>
    </ul>
  </li>
</ul>

<hr />

<h2 id="links">Links</h2>

<p>The analysis is available at the <a href="https://github.com/erickCantu/Predicting_Kickstarter_Project_Success">Predicting Kickstarter Project Success with Machine Learning</a> GitHub repository. At the end of the analysis a presentation was done to the Neuefische team and other trainees. This presentation is available at: <a href="https://github.com/erickCantu/Predicting_Kickstarter_Project_Success/blob/main/Kickstarter_Project_Staff_Meeting_Presentation.pdf">ML to predict Kickstarter success</a>.</p>]]></content><author><name>Erick Cantu</name></author><category term="Data_Science" /><category term="Maschine Learning" /><category term="eda" /><category term="data science" /><category term="kickstarter" /><category term="logistic regression" /><category term="decisions trees" /><category term="neuefische" /><category term="xgboost" /><category term="adaboost" /><category term="bootcamp" /><summary type="html"><![CDATA[Machine learning has revolutionized our ability to predict outcomes by leveraging vast amounts of data to uncover hidden patterns and trends. By continually refining predictive models and adapting to new data, machine learning has not only enhanced the accuracy of predictions but also propelled innovation across industries, ultimately paving the way for a smarter, more efficient future.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://www.erickcantu.com/assets/images/posts/kickstarter/ecantu_Design_a_vector_illustration_for_a_website_header_with_t_4b6a29c8-3dba-4f9e-b7fe-7e7e16ea12c4.png" /><media:content medium="image" url="https://www.erickcantu.com/assets/images/posts/kickstarter/ecantu_Design_a_vector_illustration_for_a_website_header_with_t_4b6a29c8-3dba-4f9e-b7fe-7e7e16ea12c4.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry></feed>