<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: xanderle</title>
    <description>The latest articles on DEV Community by xanderle (@xanderle).</description>
    <link>https://dev.to/xanderle</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F203307%2F51050dc4-fc39-4a02-8c7c-e938e9e43ed1.png</url>
      <title>DEV Community: xanderle</title>
      <link>https://dev.to/xanderle</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/xanderle"/>
    <language>en</language>
    <item>
      <title>Using an iPad for Dev</title>
      <dc:creator>xanderle</dc:creator>
      <pubDate>Sun, 03 Oct 2021 07:44:29 +0000</pubDate>
      <link>https://dev.to/xanderle/using-an-ipad-for-dev-119e</link>
      <guid>https://dev.to/xanderle/using-an-ipad-for-dev-119e</guid>
      <description>&lt;p&gt;Anyone that says you can use an iPad for software development actually mean “I can SSH into a remote server and kinda do stuff”. Admittedly there are some apps like Scriptable and Pythonista 3 that allow you to execute code locally on device, but they lack some of the freedom you have executing code on an actual computer.&lt;/p&gt;

&lt;p&gt;I recently acquired an iPad Pro and, like a normal person, the first thing I did was set it up for software development.&lt;/p&gt;

&lt;h2&gt;
  
  
  But why?
&lt;/h2&gt;

&lt;p&gt;An iPad is probably the best tablet experience you can get - but it comes with the downfall of a terrible experience for software dev. With the latest iPads advertising their keyboard and mouse support, and their external monitor capabilities it feels like they’re pushing into thin client territory and I want to try maximise this devices utilisation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;Using an iPad comfortably for software development work requires a rather niche set of conditions to work.&lt;br&gt;
Firstly, you have to be comfortable using just terminal for development (tmux + nvim users I’m looking at you) and secondly you need a desktop/server you can SSH into. If you don’t own a pc and you want to get into software dev… don’t buy an iPad first.&lt;/p&gt;

&lt;h2&gt;
  
  
  But my precious IDE?
&lt;/h2&gt;

&lt;p&gt;But how do I do all the fancy things my IDE does in terminal? I need them! Well with the changes that have come through in Neovim 0.5, you can now use Neovim as a fully fledged IDE. By using tree-sitter, nvim-compe, nvim-dap you can get all the nice features of IDE’s such as autocomplete, definition and reference jumping, and most importantly the ability to debug. There’s a plethora of tutorials on how to do that so I want touch on it here. &lt;/p&gt;

&lt;p&gt;Now just have a nice text editor isn’t enough, that’s your whole terminal window gone! So by adding tmux into the mix we almost have a tiling manager (as long as its a terminal application).&lt;/p&gt;

&lt;h2&gt;
  
  
  The iPad Setup
&lt;/h2&gt;

&lt;p&gt;Now for this to work, you need a terminal emulator app. The best terminal app I’ve found is blink shell. It supports multiple simultaneous connections, setting up hosts, split view and most importantly Mosh. &lt;/p&gt;

&lt;h3&gt;
  
  
  What’s Mosh?
&lt;/h3&gt;

&lt;p&gt;Mosh is a mobile shell, with an emphasis on mobile. It uses UDP instead of TCP (like SSH does), so you aren’t plagued by things like your SSH session time outs because you’ve switched wifi networks or to 4G, or even put your iPad to sleep. All in all it means that Mosh is the superior choice for your mobile shell needs. Given that you’re coding on an iPad, the ability to put the device to sleep then wake it up and resume is a killer feature. &lt;/p&gt;

&lt;h2&gt;
  
  
   Setup
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Install openssh-server, neovim and tmux on your desktop. (This will depend entirely on your distro)&lt;/li&gt;
&lt;li&gt;Launch blink, type config and hit enter&lt;/li&gt;
&lt;li&gt;Change the default username to yours&lt;/li&gt;
&lt;li&gt;Go keys =&amp;gt; + =&amp;gt; create new =&amp;gt; and enter in a name and click save&lt;/li&gt;
&lt;li&gt;Go back to the main menu and go hosts =&amp;gt; + =&amp;gt; and fill out host, host name, user and key.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ssh-copy-id key_name_here yourusername@ipaddress&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;mosh host_here&lt;/code&gt; and hey presto you’re in!&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Now what?
&lt;/h2&gt;

&lt;p&gt;Well you have a full blown terminal to a powerful remote server… what more could you want?&lt;/p&gt;

&lt;p&gt;Did you say port forwarding? Because that’s here!&lt;/p&gt;

&lt;p&gt;Blink shell supports port forwarding which means you can run a remote web server and access on your iPad! It follows normal ssh syntax so &lt;br&gt;
&lt;code&gt;ssh -L 8080:localhost:8080 yourhost&lt;/code&gt; will forward 8080 on your iPad to the remote server’s 8080 port!&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;The iPad is such a wonderful tool in terms of its productivity and creativity potential however, its never really been a software developers go to device. It still technically isn’t, but it makes for a fabulous thin client for those committed enough for on-the-go development and with the new iPad Minis released, a very portable one at that.&lt;/p&gt;

&lt;p&gt;You can also plug the iPad into a monitor or Airplay your terminal to a TV if you really wanted to.&lt;/p&gt;

</description>
      <category>ipad</category>
      <category>devjournal</category>
    </item>
    <item>
      <title>Installing Arch Linux on Mac Hypervisor</title>
      <dc:creator>xanderle</dc:creator>
      <pubDate>Sat, 08 Feb 2020 09:24:11 +0000</pubDate>
      <link>https://dev.to/xanderle/installing-arch-linux-on-mac-hypervisor-2c7c</link>
      <guid>https://dev.to/xanderle/installing-arch-linux-on-mac-hypervisor-2c7c</guid>
      <description>&lt;h2&gt;
  
  
  Situation
&lt;/h2&gt;

&lt;p&gt;So you love your shiny Apple build quality computers, but you also love telling people "I use Arch btw".&lt;/p&gt;

&lt;p&gt;Solution: Install Arch Linux via xhyve and then remote into it via NoMachine.&lt;/p&gt;

&lt;p&gt;THIS IS A GENERAL GUIDE ASSUMING A LEVEL OF DIFFICULTY BECAUSE THIS IS OVERKILL.&lt;/p&gt;

&lt;h2&gt;
  
  
  Steps:
&lt;/h2&gt;

&lt;p&gt;Prerequisites:  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You're going to need Homebrew (go google that I'm not telling you)&lt;/li&gt;
&lt;li&gt;Arch Linux ISO
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;brew install xhyve
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Make a directory you're going to do this in
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir Arch
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Wacky work around for making the ISO useable for you
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dd if=/dev/zero of=/tmp/tmp.iso bs=$[4*1024] count=1                                               

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



&lt;ul&gt;
&lt;li&gt;Write the ISO into this tmp.iso
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dd if=/Your/Download/Path/archlinux-2020.02.01-x86_64.iso bs=$[4*1024] skip=1 &amp;gt;&amp;gt; tmp.iso
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Mount the tmp.iso you just made
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;hdiutil attach /tmp/tmp.iso
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Now you need two files, vmlinuz and archiso.img so you are going to copy them into your Arch dir you made earlier. (Your ARCH_202002 might be different)
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd Arch
cp /Volumes/ARCH_202002/arch/boot/x86_64/vmlinuz .
cp /Volumes/ARCH_202002/arch/boot/x86_64/archiso.img .

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



&lt;ul&gt;
&lt;li&gt;Create a HD for the guest operating system. Adjust from 50G to whatever you want.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkfile -n 50G Arch.img
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Generate a UUID
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;uuidgen
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Now paste into a start.sh file this script. &lt;br&gt;
Remember to &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;replace  with the output of uuidgen.&lt;/li&gt;
&lt;li&gt;set the path to the ARCH iso in IMG_CD&lt;/li&gt;
&lt;li&gt;Set archisolabel=&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;(also chmod +x it)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;KERNEL="vmlinuz"
INITRD="archiso.img"
CMDLINE="earlyprintk=serial console=ttyS0 root=&amp;lt;UUID&amp;gt; archisobasedir=arch archisolabel=ARCH_202002 rw loglevel=3 quiet"

MEM="-m 4G" #RAM
SMP="-c 2" #NUMBEROFCORES
NET="-s 2:0,virtio-net"
IMG_CD="-s 3,ahci-cd,/THE/PATH/TO/archlinux-2020.02.01-x86_64.iso"
IMG_HDD="-s 4,virtio-blk,Arch.img"
PCI_DEV="-s 0:0,hostbridge -s 31,lpc"
LPC_DEV="-l com1,stdio"
ACPI="-A"
UUID="-U &amp;lt;UUID&amp;gt;"

xhyve $ACPI $MEM $SMP $PCI_DEV $LPC_DEV $NET $IMG_CD $IMG_HDD $UUID -f kexec,$KERNEL,$INITRD,"$CMDLINE"


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



&lt;p&gt;Run the script with sudo (you need it for networking) and go through your normal install procedure using the hard drive is located at /dev/vda&lt;br&gt;
create a /boot /dev/vda1 of type vfat (type W95 FAT b) and your / in /dev/vda2&lt;/p&gt;

&lt;p&gt;add the virtio_blk to /etc/mkinitcpio.conf&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;MODULES=(virtio_blk)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Right before you quit you are going to want to copy two files off.&lt;/p&gt;

&lt;p&gt;Now get an SSH server going so you can SCP two files off.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;scp root@192.168.64.5:/mnt/boot/initramfs-linux.img .
scp root@192.168.64.5:/mnt/boot/vmlinuz-linux .
scp root@192.168.64.5:/mnt/boot/grub/grub.cfg .
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Armed with these new files make a new script called run.sh (or edit the old one)&lt;/p&gt;

&lt;p&gt;Look into the grub.cfg file to find any extra cmdline arguments you might need.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;KERNEL="vmlinuz-linux"
INITRD="initramfs-linux.img"
CMDLINE="earlyprintk=serial console=ttyS0 root=&amp;lt;UUID&amp;gt; archisobasedir=arch archisolabel=ARCH_202002 rw loglevel=3 quiet"

MEM="-m 4G"
SMP="-c 2"
NET="-s 2:0,virtio-net"
IMG_HDD="-s 4,virtio-blk,Arch.img"
PCI_DEV="-s 0:0,hostbridge -s 31,lpc"
LPC_DEV="-l com1,stdio"
ACPI="-A"
UUID="-U &amp;lt;UUID&amp;gt;

# shellcheck disable=SC2086
xhyve $ACPI $MEM $SMP $PCI_DEV $LPC_DEV $NET $IMG_CD $IMG_HDD $UUID -f kexec,$KERNEL,$INITRD,"$CMDLINE"
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;As some final steps, install NoMachine, i3-gaps, Nerd Fonts (Fira Code variant obviously) and use NoMachine to RDP into your shiny new VM!&lt;/p&gt;

</description>
      <category>archlinux</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
