Weston Miller's blog https://kk6mrp.com/ Sun, 03 Jul 2022 05:40:37 +0000 Sun, 03 Jul 2022 05:40:37 +0000 Pico 3D Systems CubeX to RepRap Conversion <h2>3D Systems CubeX to RepRap Conversion</h2> <p><em>April 11, 2020</em></p> <h3>Electronics</h3> <p>The controller has been replaced with an Arduino Mega 2560 outfitted with a RAMPS 1.4 board and the screen has been replaced with a RepRapDiscount Full Graphic Smart Controller. The stepper motors are all still original.</p> <p><a href="https://reprap.org/wiki/RAMPS_1.4">https://reprap.org/wiki/RAMPS_1.4</a></p> <p><a href="https://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller">https://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller</a></p> <h3>Extruder</h3> <p>The stock extruder has been replaced with the much more trouble free E3D V6 Hotend.</p> <p><a href="https://e3d-online.com/v6-all-metal-hotend">https://e3d-online.com/v6-all-metal-hotend</a></p> <h3>Build Platform</h3> <p>I have replaced the included glass build platform with a heated bed covered with an adhesive PEI sheet. The heated bed consists of a 12 x 12 &quot; 1/4 &quot; thick milled aluminum plate with a flexible silicon heater underneath controlled by a solid state relay with the standard E3D Cartridge Thermistor.</p> <p>Aluminum Plate - <a href="https://www.mcmaster.com/9057k17">https://www.mcmaster.com/9057k17</a></p> <p>Silicon Heater - <a href="https://www.mcmaster.com/35765k613">https://www.mcmaster.com/35765k613</a></p> <p>PEI Sheet - <a href="https://www.mcmaster.com/3697n36">https://www.mcmaster.com/3697n36</a></p> <p>E3D Cartridge Thermistor - <a href="https://e3d-online.com/thermistor-cartridge">https://e3d-online.com/thermistor-cartridge</a></p> <h3>Firmware</h3> <p>The firmware is Marlin 2.0 set up for the new extruder, heated bed, and calibrated for the stepper motors.</p> <p>The M92 Calibrated Step Settings are: X87.53 Y87.42 Z1084.79 E80.12</p> <p>Currently I have disabled the display as it was acting strange powering off / preventing the controller from powering on.</p> <p>You may download the current firmware below:</p> <p><a href="http://kk6mrp.com/assets/CubeXFirmware.zip">http://kk6mrp.com/assets/CubeXFirmware.zip</a></p> Sat, 11 Apr 2020 00:00:00 +0000 https://kk6mrp.com/CubeX https://kk6mrp.com/CubeX Setting up Alpine Linux <h1>Setting Up Alpine Linux</h1> <p><a href="https://wiki.alpinelinux.org/wiki/Tutorials_and_Howtos">https://wiki.alpinelinux.org/wiki/Tutorials_and_Howtos</a></p> <p>New Server Checklist: <a href="https://drewdevault.com/new-server">https://drewdevault.com/new-server</a></p> <h3>Setting Up Users and Permissions</h3> <p><a href="https://flak.tedunangst.com/post/doas-mastery">https://flak.tedunangst.com/post/doas-mastery</a></p> <p>“Unix never says please.” – Rob Pike</p> <p>The real intent of <code>sudo</code> is to enable the root user to delegate to one or two non-root users, access to one or two specific privileged commands that they need on a regular basis. The reasoning behind this is that of the lazy sysadmin; allowing the users access to a command or two that requires elevated privileges and that they use constantly, many times per day, saves the SysAdmin a lot of requests from the users and eliminates the wait time that the users would otherwise experience. But most non-root users should never have full root access, just to the few commands that they need.</p> <p><a href="https://www.redhat.com/sysadmin/sysadmins-dont-sudo">https://www.redhat.com/sysadmin/sysadmins-dont-sudo</a></p> <p><a href="https://kifarunix.com/run-only-specific-commands-with-sudo-in-linux/">https://kifarunix.com/run-only-specific-commands-with-sudo-in-linux/</a></p> <p><a href="https://www.atrixnet.com/allow-an-unprivileged-user-to-run-a-certain-command-with-sudo/">https://www.atrixnet.com/allow-an-unprivileged-user-to-run-a-certain-command-with-sudo/</a></p> <p><a href="https://www.2daygeek.com/allow-permit-normal-user-group-to-run-certain-particular-commands-as-root-with-sudo/">https://www.2daygeek.com/allow-permit-normal-user-group-to-run-certain-particular-commands-as-root-with-sudo/</a></p> <p><a href="https://ostechnix.com/add-delete-and-grant-sudo-privileges-to-users-in-alpine-linux/">https://ostechnix.com/add-delete-and-grant-sudo-privileges-to-users-in-alpine-linux/</a></p> <p><a href="https://wiki.alpinelinux.org/wiki/Setting_up_a_new_user">https://wiki.alpinelinux.org/wiki/Setting_up_a_new_user</a></p> <h3>Enabling Repositories</h3> <pre><code class="language-bash">cat &gt; /etc/apk/repositories &lt;&lt; EOF http://dl-cdn.alpinelinux.org/alpine/v$(cat /etc/alpine-release | cut -d'.' -f1,2)/main http://dl-cdn.alpinelinux.org/alpine/v$(cat /etc/alpine-release | cut -d'.' -f1,2)/community EOF</code></pre> <p>Then update your repositories:</p> <pre><code class="language-bash">apk update</code></pre> <h3>apk Package Manager</h3> <h5>Side note: a great place to find packages is <a href="pkgs.org">https://pkgs.org/</a></h5> <p>Install a package with:</p> <pre><code class="language-bash">apk add packagename</code></pre> <p>Remove a package with:</p> <pre><code class="language-bash">apk del packagename</code></pre> <p>List installed packages with:</p> <pre><code class="language-bash">apk info</code></pre> <h3>OpenRC</h3> <p><a href="https://wiki.alpinelinux.org/wiki/Alpine_Linux_Init_System">https://wiki.alpinelinux.org/wiki/Alpine_Linux_Init_System</a></p> <h3>Firewall</h3> <p><a href="https://wiki.alpinelinux.org/wiki/How-To_Alpine_Wall">https://wiki.alpinelinux.org/wiki/How-To_Alpine_Wall</a></p> <p><a href="https://wiki.alpinelinux.org/wiki/Uncomplicated_Firewall">https://wiki.alpinelinux.org/wiki/Uncomplicated_Firewall</a></p> <h3>Tailscale</h3> <pre><code class="language-bash">apk add tailscale --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing/</code></pre> <h3>NSD</h3> <pre><code class="language-bash">apk add nsd</code></pre> <p>Start and install service:</p> <pre><code class="language-bash">rc-service nsd start // Starts service rc-update add nsd // Starts service on startup</code></pre> <p>Validate DNS Settings at <a href="https://intodns.com/">https://intodns.com/</a> or <a href="https://dnsinspect.com/">https://dnsinspect.com/</a></p> <p>Tip: If you are using a Hotspot, don't forget to clear DNS cache on that too!</p> <p><a href="https://calomel.org/nsd_dns.html">https://calomel.org/nsd_dns.html</a></p> <p><a href="https://drewdevault.com/2016/12/06/A-broad-intro-to-networking.html">https://drewdevault.com/2016/12/06/A-broad-intro-to-networking.html</a></p> <p><a href="https://www.netmeister.org/blog/dns-rrs.html">https://www.netmeister.org/blog/dns-rrs.html</a></p> <h3>Apache2</h3> <pre><code class="language-bash">apk add apache2 apache2-proxy apache2-ssl</code></pre> <p>Start and install service:</p> <pre><code class="language-bash">rc-service apache2 start // Starts service rc-update add apache2 // Starts service on startup</code></pre> <p>Uncomment the following in /etc/apache2/httpd.conf to enable mod_rewrite</p> <pre><code class="language-bash">#LoadModule rewrite_module modules/mod_rewrite.so</code></pre> <p>Then to apply your settings:</p> <pre><code class="language-bash">rc-service apache2 restart</code></pre> <h3>Uacme - SSL Certificates</h3> <p>This is way too easy for the amount of time it took to figure out.</p> <pre><code class="language-bash">apk add uacme mkdir /etc/ssl/uacme.d/ uacme -v -c /etc/ssl/uacme.d new uacme -v -c /etc/ssl/uacme.d issue kk6mrp.com *.kk6mrp.com</code></pre> <p>If you don't get the dns-01 challenge right off, press any key but 'y' and then enter.</p> <p>You can then press Ctrl+Z to put that process in the background.</p> <p>Create the following DNS record substituting key_auth for the key provided in the ACME Challenge:</p> <pre><code class="language-bash">_acme-challenge IN TXT "key_auth"</code></pre> <p>Save and reload NSD:</p> <pre><code class="language-bash">rc-service nsd stop rc-service nsd start</code></pre> <p>Enter 'fg' to return to the uacme process and type 'y' followed by return to finish the challenge.</p> <p>The resulting certificate files will be located here if the challenge completes successfully:</p> <pre><code class="language-bash">/path/to/uacme.d/kk6mrp.com/cert.pem /path/to/uacme.d/private/kk6mrp.com/key.pem</code></pre> <h3>PHP</h3> <pre><code class="language-bash">apk add php7 php7-pdo php7-apache2 php7-sqlite3 php7-gd php7-json php7-session php7-ctype</code></pre> <p>Increase the maximum upload file size from 2 Mb to 5 Mb in /etc/php7/php.ini</p> <pre><code class="language-bash">upload_max_filesize = 2M</code></pre> <p>Then to apply your settings:</p> <pre><code class="language-bash">rc-service apache2 restart</code></pre> <h3>PHP-FPM</h3> <p><a href="https://wiki.alpinelinux.org/wiki/Apache_with_php-fpm">https://wiki.alpinelinux.org/wiki/Apache_with_php-fpm</a></p> <h3>SQLite</h3> <pre><code class="language-bash">apk add sqlite</code></pre> <h3>Vim</h3> <pre><code class="language-bash">apk add vim</code></pre> <h3>Wordpress</h3> <p>To set up wordpress, download the latest version and extract:</p> <pre><code class="language-bash">curl -O https://wordpress.org/latest.tar.gz tar -zxf latest.tar.gz</code></pre> <p>Copy <a href="https://github.com/aaemnnosttv/wp-sqlite-db">db.php</a> to wordpress/wp-content/db.php and remember to change ownership to the webserver user.</p> <p>If you encounter the following error:</p> <pre><code>Your PHP installation appears to be missing the MySQL extension which is required by WordPress.</code></pre> <p>you will need to install &quot;php7-pdo_mysql&quot;</p> <pre><code class="language-bash">apk add php7-pdo_mysql</code></pre> <p>and then to fix:</p> <pre><code>PDO Driver for SQLite is missing. Your PHP installation appears not to have the right PDO drivers loaded. These are required for this version of WordPress and the type of database you have specified.</code></pre> <p>you will presumably need to install &quot;php7-pdo_sqlite&quot; but the last time I tried this I spent six hours trying to get it going only for it to start working on its own :/</p> <pre><code class="language-bash">apk add php7-pdo_sqlite</code></pre> <p>Then to apply your settings:</p> <pre><code class="language-bash">rc-service apache2 restart</code></pre> <h3>Webmail</h3> <p><a href="https://sr.ht/~migadu/alps/">https://sr.ht/~migadu/alps/</a></p> <p><a href="https://cypht.org/">https://cypht.org/</a></p> <h3>Filestash</h3> <p>Install Docker, download docker compose, install and run</p> <pre><code class="language-bash">apk add docker docker-compose addgroup username docker rc-update add docker boot service docker start docker-compose pull docker-compose up -d</code></pre> <h3>Networking with iwd</h3> <p><a href="https://gist.github.com/pojntfx/d323ade1305098d306980363237023ec">https://gist.github.com/pojntfx/d323ade1305098d306980363237023ec</a></p> <p>To set up iwd, make sure the wpa_supplicant and networking services are disabled, then perform the following:</p> <pre><code class="language-bash">apk add iwd dbus echo "[General]\nEnableNetworkConfiguration=true" &gt;&gt; /etc/iwd/main.conf rc-service iwd start rc-service dbus start rc-update add iwd boot rc-update add dbus default</code></pre> <p>To connect to a network use the following command:</p> <pre><code class="language-bash">iwctl station wlan0 connect "SSID"</code></pre> <p>Or to connect to a hidden network use:</p> <pre><code class="language-bash">iwctl station wlan0 connect-hidden "SSID"</code></pre> <h3>Creating Packages</h3> <p><a href="https://wiki.alpinelinux.org/wiki/Creating_an_Alpine_package">https://wiki.alpinelinux.org/wiki/Creating_an_Alpine_package</a></p> Mon, 02 Aug 2021 00:00:00 +0000 https://kk6mrp.com/alpine https://kk6mrp.com/alpine Pinephone with PostmarketOS Tips <h1>Pinephone Tips</h1> <h3>Install pmbootstrap Utility</h3> <pre><code class="language-bash">pip3 install --user pmbootstrap</code></pre> <p>Or update pmbootstrap with the following:</p> <pre><code class="language-bash">pip3 install --user --upgrade pmbootstrap</code></pre> <p>I have it installed in ~/.local/bin</p> <h3>Configuring a new PostMarketOS Image</h3> <pre><code class="language-bash">pmbootstrap init</code></pre> <p>Then follow the prompts to build the image.</p> <h3>Updating an existing PostMarketOS Image</h3> <pre><code class="language-bash">pmbootstrap pull</code></pre> <p>and then follow the prompts...</p> <h3>Build the PostmarketOS Image</h3> <pre><code class="language-bash">pmbootstrap install</code></pre> <p>then install to the eMMC with (using dmesg or lsblk to find the proper path of course) Make sure you format the target device and use <a href="https://github.com/dreemurrs-embedded/Jumpdrive">Jumpdrive</a> to expose the device over USB:</p> <pre><code class="language-bash">pmbootstrap install --sdcard=/dev/mmcblk</code></pre> <p>Then shutdown the pmbootstrap chroot:</p> <pre><code class="language-bash">pmbootstrap shutdown</code></pre> <p>You should be good to go!</p> Fri, 05 Feb 2021 00:00:00 +0000 https://kk6mrp.com/pinephone https://kk6mrp.com/pinephone