<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:media="http://search.yahoo.com/mrss/"><channel><title><![CDATA[Jacob Stoner]]></title><description><![CDATA[Some Notes]]></description><link>https://blog.jacobstoner.com/</link><image><url>https://blog.jacobstoner.com/favicon.png</url><title>Jacob Stoner</title><link>https://blog.jacobstoner.com/</link></image><generator>Ghost 5.14</generator><lastBuildDate>Tue, 04 Nov 2025 10:02:39 GMT</lastBuildDate><atom:link href="https://blog.jacobstoner.com/rss/" rel="self" type="application/rss+xml"/><ttl>60</ttl><item><title><![CDATA[Use a laptop as a 2nd display on Linux using FreeRDP]]></title><description><![CDATA[<p>Dual monitors using a laptop as a second display. This guide assumes that you are using a Debian based distro (X11 only). Both devices must be connected to the same network.</p><p>1. &#xA0;<strong>Define an output to be a used as a dummy monitor</strong><br><br>a. &#xA0;The simple method: select</p>]]></description><link>https://blog.jacobstoner.com/use-a-laptop-or-tablet-as-a-2nd-display-on-linux-with-a-dummy-monitor-and-rdp/</link><guid isPermaLink="false">639b7faa159ecf00acfd59e7</guid><dc:creator><![CDATA[Jacob Stoner]]></dc:creator><pubDate>Thu, 15 Dec 2022 22:47:58 GMT</pubDate><media:content url="https://blog.jacobstoner.com/content/images/2022/12/HwZdh1SzRyKWB7RdMAnk-Q.jpg" medium="image"/><content:encoded><![CDATA[<img src="https://blog.jacobstoner.com/content/images/2022/12/HwZdh1SzRyKWB7RdMAnk-Q.jpg" alt="Use a laptop as a 2nd display on Linux using FreeRDP"><p>Dual monitors using a laptop as a second display. This guide assumes that you are using a Debian based distro (X11 only). Both devices must be connected to the same network.</p><p>1. &#xA0;<strong>Define an output to be a used as a dummy monitor</strong><br><br>a. &#xA0;The simple method: select an unused existing graphics port</p><pre><code># find an unused output
find -L /sys/class/drm -maxdepth 1 -type d -name &apos;card0-*&apos; -exec sh -c &apos;if [ $(cat $0/status) = &quot;disconnected&quot; ]; then echo $0; fi&apos; {} \;|cut -c22-|sort
#on my system DP-1 is available
OUTPUT=DP-1
DIR=/sys/kernel/debug/dri/0/$OUTPUT</code></pre><p>b. &#xA0;The other way: use the evdi kernel module to add an output<br><em>In case you can&apos;t use an existing graphics port</em></p><pre><code># typically the evdi module must be installed first
sudo apt install -y evdi-dkms

# load the module, requesting a dummy device
sudo modprobe evdi initial_device_count=1

# find the new output
DIR=$(sudo find /sys/kernel/debug/dri/1/ -maxdepth 1 -name &apos;DVI*&apos;|head -1)</code></pre><p>2. &#xA0;<strong>Force activate the output</strong></p><pre><code># override EDID (pretend to be a 1080P monitor with lots of resolution options)
EDID_BASE64=AP///////wAebdVZ+KEJAAQXAQNoNR546jMxpFdRoCYQUFSna4CzAIGAlQBxT6nAgQCBwJBAAjqAGHE4LUBYLEUACSUhAAAeAAAA/QA4Sx5TDwAKICAgICAgAAAA/AAyNEVOMzMKICAgICAgAAAA/wAzMDRORFBISksyODgKAJ8=
sudo bash -c &quot;base64 -d &lt;&lt;&lt;$EDID_BASE64 &gt; $DIR/edid_override&quot;

# force output on
sudo sh -c &quot;echo on &gt; $DIR/force&quot;

# add an additional resolution to the dummy display (optional)
# check the xrandr output name, it may be different than the kernel name
xrandr|grep &apos; connected&apos;
OUTPUT=DP-1
RES=&quot;1920 1200&quot;
MODELINE=$(cvt $RES|awk &apos;/Modeline/{print substr($0,10)}&apos;)
MODE=$(sed &apos;s/^&quot;\([^&quot;]\+\).*/\1/&apos; &lt;&lt;&lt;$MODELINE)
sh -c &quot;xrandr --newmode $MODELINE&quot;
xrandr --addmode $OUTPUT $MODE

# Use the standard display configuration utility to configure the dummy display.
# Match the resolution of your device and position the display.
</code></pre><p><em>If the display fails to activate or 1920x1080 doesn&apos;t show up, then reboot and select a different output in step one.</em><br><br>3. &#xA0;<strong>Serve the dummy monitor with FreeRDP</strong></p><pre><code>sudo apt install -y freerdp2-shadow-x11
freerdp-shadow-cli -auth -may-interact /monitors:1</code></pre><p>4. &#xA0;<strong>Connect FreeRDP client</strong></p><pre><code>sudo apt install -y freerdp2-x11
xfreerdp /v:YOUR_HOST_IP /cert-ignore /floatbar:sticky:off,show:always -gfx /rfx /f</code></pre><p><strong>Notes:</strong><br>freerdp-shadow-cli is somewhat buggy in this setup, even the development version, but the settings here work well.<br>-may-interact is required for the cursor to show up on the client. &#xA0;Alternately the local cursor can be used on each device.<br>Disabling GFX is required for reliable operation, but we still have rfx<br>GFX works in the development version of the client, but no cursor<br>aFreeRDP works on android, but no cursor<br>wfreerdp works on windows, but no cursor<br>Does not work reliably with other RDP clients<br>In my testing, VNC is not a suitable replacement for FreeRDP in this setup--it&apos;s too slow.<br>Thank you to all of the FreeRDP developers for this awesome software.</p><p><strong>Discussion:</strong><br><a href="https://news.ycombinator.com/item?id=34010970">https://news.ycombinator.com/item?id=34010970</a></p>]]></content:encoded></item><item><title><![CDATA[Wayland RDP Server with audio using Microsoft's WSLg stack]]></title><description><![CDATA[<p>I spent some time playing with the Microsoft&apos;s modified Weston/PulseAudio/FreeRDP stack. &#xA0;This is what Windows is using to display GUI Linux apps under WSL. &#xA0;I primarily use Linux and I use Linux remote desktops quite a bit. &#xA0;I use xrdp, freerdp, x11vnc, vinagre,</p>]]></description><link>https://blog.jacobstoner.com/wayweston-rdp/</link><guid isPermaLink="false">63975e87159ecf00acfd5866</guid><dc:creator><![CDATA[Jacob Stoner]]></dc:creator><pubDate>Mon, 12 Dec 2022 17:58:38 GMT</pubDate><content:encoded><![CDATA[<p>I spent some time playing with the Microsoft&apos;s modified Weston/PulseAudio/FreeRDP stack. &#xA0;This is what Windows is using to display GUI Linux apps under WSL. &#xA0;I primarily use Linux and I use Linux remote desktops quite a bit. &#xA0;I use xrdp, freerdp, x11vnc, vinagre, guacamole for different things. &#xA0;I&apos;ve tried GNOME&apos;s built in RDP server and freerdp2-shadow-x11. &#xA0;They all work well enough. &#xA0;xrdp is best so far, but it&apos;s a PITA to set up and the stack is kind of heavy. &#xA0;I know it&apos;s possible to get audio and H264 video working with xrdp, but I have not tried it yet. &#xA0;I am curious about a Wayland RDP server. I installed Weston (the reference Wayland compositor) on Debian and was shocked at how easy it was to get an RDP server up and running. &#xA0;Weston pulls in few dependencies, it&apos;s quite small, and has an RDP backend baked in that works quite well out of the box. &#xA0;Just run &quot;weston --backend=rdp-backend.so&quot;. &#xA0;Depending on the version, it may be necessary to generate a key file, which is easy. &#xA0;There is no authentication, it just fires up an RDP server logged in as the current user. &#xA0;This is perfect for me since I&apos;m using wireguard for network level authentication. &#xA0;It supports the RemoteFX codec, but not the progressive codec, and no H264 codec, no sound. &#xA0;Not bad.</p><p>It annoys me to say so, but Windows has the best remote desktop, MS designed RDP after all. &#xA0;It&apos;s awesome that MS is integrating Linux these days, and I was curious how WSL works. &#xA0;It turns out they are using RDP. &#xA0;They designed a new extension called rail that send each window individually, to make it seamless. &#xA0;They have forks of Weston, PulseAudio, and FreeRDP up on github, with all of their modifications to the Linux side of the RDP stack. &#xA0;Interesting...</p><p>After poking around in my free time last week, I got them up and running on a minimal Debian bullseye install. &#xA0;Microsoft compiles minimal binaries, without some of the goodies that I want, so after trying those I decided to compile from source. &#xA0;Their stack is designed to be run on the same host, so they aren&apos;t worried about network latency at all. &#xA0;I had to make some small tweaks to get it working well with FreeRDP. &#xA0;Audio is uncompressed PCM (no easy fix, afaik). Audio didn&apos;t play well with the FreeRDP pulse client plugin (easy fix). &#xA0;RemoteFX is hard-coded to disabled (easy fix).</p><p>Firefox works great. &#xA0;I can stream youtube videos in 1080p with audio on the same network and can&apos;t even tell it&apos;s remote.</p><p>Here is my shell script that sets it up:<br><a href="https://jacobstoner.com/msweston.sh">https://jacobstoner.com/msweston.sh</a></p><p>Run it as root on Debian bullseye. &#xA0;It downloads, tweaks, compiles, and installs Microsoft&apos;s forks of weston, pulseaudio, and FreeRDP and sets them up to run as root on boot. &#xA0;You could also just use it as a guide, line-by-line, that&apos;s probably a good idea anyway.</p><p>MS uses a supervisor process that sets everything up, keeps it connected, and restarts things as needed. &#xA0;That won&apos;t work for us since we aren&apos;t connecting to Windows. During testing Weston stopped accepting clients a couple times when trying unsupported client options and it was necessary to killall -9 weston. &#xA0;This is just for testing, it is not meant as a production environtment, espeically because it&apos;s running as root; but you could totally build a production worthy terminal server around these tools.</p><p>To connect using freerdp, I&apos;ve had the best results with this command:<br>xfreerdp /v:10.0.1.135 /cert-ignore /size:1024x768 /f /floatbar:sticky:off,show:always /sound:latency:200 -gfx /rfx</p><p>The thing that bothers me the most is the inability to resize the client desktop size after connection. &#xA0;Of everything that I have tested, that only works with xrdp and Windows. &#xA0;It would also be nice if the audio stream was compressed and if progressive or H264 video encoding was supported. &#xA0;It would be cool to get rail support in the freerdp client, that would open up some interesting options for virtualizing apps. &#xA0;Hopefully the MS patches get merged upstream and more community work can be done on this.</p>]]></content:encoded></item><item><title><![CDATA[zswap: improve memory performance on Linux]]></title><description><![CDATA[<p>Zwap is a Linux kernel module that will attempt to compress memory pages and keep them in ram before swapping to disk. &#xA0;This is helpful on low memory systems and will result in a noticeable performance improvement in most cases. &#xA0;It is required that a swap device exists.</p>]]></description><link>https://blog.jacobstoner.com/zswap-improve-memory-performance-on-linux/</link><guid isPermaLink="false">621a633f0f665a0de138ab14</guid><dc:creator><![CDATA[Jacob Stoner]]></dc:creator><pubDate>Sat, 26 Feb 2022 18:27:36 GMT</pubDate><media:content url="https://blog.jacobstoner.com/content/images/2022/02/Random-Access_Memory_Board_Device-1.jpg" medium="image"/><content:encoded><![CDATA[<img src="https://blog.jacobstoner.com/content/images/2022/02/Random-Access_Memory_Board_Device-1.jpg" alt="zswap: improve memory performance on Linux"><p>Zwap is a Linux kernel module that will attempt to compress memory pages and keep them in ram before swapping to disk. &#xA0;This is helpful on low memory systems and will result in a noticeable performance improvement in most cases. &#xA0;It is required that a swap device exists. &#xA0;Here are some commands to enable it on Linux. &#xA0;Tested on Debian and Ubuntu.</p><p><code>sudo perl -pi -e &apos;s/^(GRUB_CMDLINE_LINUX_DEFAULT.*)&quot;$/$1 zswap.enabled=1 zswap.compressor=lz4 zswap.zpool=z3fold zswap.max_pool_percent=25&quot;/&apos; /etc/default/grub</code><br><code>sudo update-grub</code><br><code>sudo echo -e &apos;lz4\nlz4_compress\nz3fold&apos; &gt;&gt; /etc/initramfs-tools/modules</code><br><code>sudo update-initramfs -u</code><br><code>sudo reboot</code></p><p>This will update grub to instruct linux to load the required modules, set sensible parameters, and add the modules to initramfs so they are able to be loaded early in the boot process.</p><h3 id="explanation-of-parameters">Explanation of parameters:</h3><p><br><strong>zswap.enabled=1</strong> #enable zswap<br><strong>zswap.compressor=lz4</strong> #use lz4 compression, the best balance of speed and performance<br><strong>zswap.zpool=z3fold</strong> #the z3fold allocator stores up to three compressed pages per physical page, allowing for a higher compression ratio<br><strong>zswap.max_pool_percent</strong>=25 #max percent of ram that may be used for compressed pages. &#xA0;Default is 20, I like to bump it up just a little. &#xA0;Be careful not to go too high or there won&apos;t be any memory left for cache and it will hurt performance instead of helping it.</p><p>This is especially helpful on low end systems with &lt;= 4GB RAM. &#xA0;It also works well those t2.nano instances and other low memory VPS instances.</p><h3 id="here-are-some-commands-to-check-if-it-is-working">Here are some commands to check if it is working:<br></h3><p><code>cat /sys/module/zswap/parameters/enabled</code><br>should return Y<br><br>examine all debug parameters for the module<br><code>sudo grep -R . /sys/kernel/debug/zswap/</code></p><p>view current compression ratio<br><code>sudo bash -c &apos;echo &quot;scale=2; &quot; $(&lt;/sys/kernel/debug/zswap/stored_pages) &quot; * 4096 /&quot; $(&lt;/sys/kernel/debug/zswap/pool_total_size) | bc&apos;</code></p><p></p><p></p>]]></content:encoded></item><item><title><![CDATA[XFINITY Hotspots]]></title><description><![CDATA[<p>Connect to XFINITY hotspots from Android and Linux without an app.</p><p><strong>Android 11</strong><br>EAP method: TTLS<br>Identity: your-username<br>Password: your-password<br>CA certificate: Use system certificates<br>Online certificate status: Don&apos;t validate<br>Domain: secure.aaa.wifi.comcast.com<br>Phase 2 authentication: PAP</p><p><strong>The others require a certificate</strong><br>Get the certificate</p>]]></description><link>https://blog.jacobstoner.com/xfinity-hotspots/</link><guid isPermaLink="false">621160c20f665a0de138aaab</guid><dc:creator><![CDATA[Jacob Stoner]]></dc:creator><pubDate>Sat, 19 Feb 2022 21:39:53 GMT</pubDate><media:content url="https://blog.jacobstoner.com/content/images/2022/02/wifi-hotspot-on-mobile-phone-46067664_s-e1584299781333.webp" medium="image"/><content:encoded><![CDATA[<img src="https://blog.jacobstoner.com/content/images/2022/02/wifi-hotspot-on-mobile-phone-46067664_s-e1584299781333.webp" alt="XFINITY Hotspots"><p>Connect to XFINITY hotspots from Android and Linux without an app.</p><p><strong>Android 11</strong><br>EAP method: TTLS<br>Identity: your-username<br>Password: your-password<br>CA certificate: Use system certificates<br>Online certificate status: Don&apos;t validate<br>Domain: secure.aaa.wifi.comcast.com<br>Phase 2 authentication: PAP</p><p><strong>The others require a certificate</strong><br>Get the certificate from FireFox:<br>/usr/share/ca-certificates/mozilla/COMODO_RSA_Certification_Authority.crt<br><a href="https://jacobstoner.com/COMODO_RSA_Certification_Authority.crt">Or download it here</a></p><p><strong>Android 10</strong><br>EAP method: TTLS<br>Phase 2 authentication: PAP<br>Identity: your-username<br>Password: your-password<br>CA certificate: (install and use cert file)</p><p><strong>Linux (network manager)</strong><br>Security WPA &amp; WPA2 Enterprise<br>Authentication: Tunneled TLS<br>CA certificate: (use file)<br>Inner authentication: PAP<br>username: your-username<br>password: your-password</p><p><strong>Linux (wpa_supplicant)</strong><br>network={<br>ssid=&quot;XFINITY&quot;<br>scan_ssid=1<br>key_mgmt=WPA-EAP<br>eap=TTLS<br>phase2=&quot;auth=PAP&quot;<br>ca_cert=&quot;/root/COMODO_RSA_Certification_Authority.crt&quot;<br>identity=&quot;your-username&quot;<br>password=&quot;your-password&quot;<br>}</p>]]></content:encoded></item></channel></rss>