<?xml version='1.0' encoding='utf-8' ?>

<rss version='2.0' xmlns:lj='http://www.livejournal.org/rss/lj/1.0/' xmlns:atom10='http://www.w3.org/2005/Atom'>
<channel>
  <title>Postcards from Semaphore</title>
  <link>https://gdt.dreamwidth.org/</link>
  <description>Postcards from Semaphore - Dreamwidth Studios</description>
  <lastBuildDate>Wed, 13 Jan 2021 11:09:10 GMT</lastBuildDate>
  <generator>LiveJournal / Dreamwidth Studios</generator>
  <lj:journal>gdt</lj:journal>
  <lj:journaltype>personal</lj:journaltype>
  <image>
    <url>https://v2.dreamwidth.org/12224960/2733095</url>
    <title>Postcards from Semaphore</title>
    <link>https://gdt.dreamwidth.org/</link>
    <width>100</width>
    <height>100</height>
  </image>

<item>
  <guid isPermaLink='true'>https://gdt.dreamwidth.org/60970.html</guid>
  <pubDate>Wed, 13 Jan 2021 11:09:10 GMT</pubDate>
  <title>Compiling and installing software for the uBITX v6 QRP amateur radio transciever</title>
  <link>https://gdt.dreamwidth.org/60970.html</link>
  <description>&lt;p&gt;The uBITX uses an Arduino internally. This article describes how to update its software.&lt;/p&gt;

&lt;h3&gt;Required hardware&lt;/h3&gt;

&lt;p&gt;The connector on the back is a Mini-B USB connector, so you&apos;ll need a &amp;quot;Mini-B to A&amp;quot; USB cable. This is not the same cable as used with older Android smartphones. The Mini-B connector was used with a lot of cameras a decade ago.&lt;/p&gt;

&lt;p&gt;You&apos;ll also need a computer. I use a laptop with Fedora Linux installed.&lt;/p&gt;

&lt;h3&gt;Required software for software development&lt;/h3&gt;

&lt;p&gt;In Fedora all the required software is installed with &lt;b&gt;sudo dnf install arduino git&lt;/b&gt;.  Add yourself to the users and lock groups with &lt;b&gt;sudo usermod -a -G users,lock $USER&lt;/b&gt; (on Debian-style systems use &lt;b&gt;sudo usermod -a -G dialout,lock $USER&lt;/b&gt;). You&apos;ll need to log out and log in again for that to have an effect (if you want to see which groups you are already in, then use the &lt;b&gt;id&lt;/b&gt; command).&lt;/p&gt;

&lt;p&gt;Run &lt;b&gt;arduino&lt;/b&gt; as your ordinary non-root user to create the directories used by the Arduino IDE. You can quit the IDE once it starts.&lt;/p&gt;

&lt;h3&gt;Obtain the uBITX software&lt;/h3&gt;

&lt;blockquote&gt;
&lt;pre&gt;
$ cd ~/Arduino
$ git clone https://github.com/afarhan/ubitxv6.git ubitx_v6.1_code
&lt;/pre&gt;
&lt;/blockquote&gt;

&lt;h3&gt;Connect the uBITX to your computer&lt;/h3&gt;

&lt;p&gt;Plug in the USB cable and turn on the radio. Running &lt;b&gt;dmesg&lt;/b&gt; will show the Arduino appearing as a &quot;USB serial&quot; device:&lt;/p&gt;

&lt;blockquote&gt;
&lt;pre&gt;
usb 1-1: new full-speed USB device number 6 using xhci_hcd
usb 1-1: New USB device found, idVendor=1a86, idProduct=7523, bcdDevice= 2.64
usb 1-1: New USB device strings: Mfr=0, Product=2, SerialNumber=0
usb 1-1: Product: USB Serial
usbcore: registered new interface driver ch341
usbserial: USB Serial support registered for ch341-uart
ch341 1-1:1.0: ch341-uart converter detected
usb 1-1: ch341-uart converter now attached to ttyUSB1
&lt;/pre&gt;
&lt;/blockquote&gt;

&lt;p&gt;If you want more information about the USB device then use:&lt;/p&gt;

&lt;blockquote&gt;
&lt;pre&gt;
$ lsusb -d 1a86:7523
Bus 001 Device 006: ID 1a86:7523 QinHeng Electronics CH340 serial converter
&lt;/pre&gt;
&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src=&quot;https://www.dreamwidth.org/tools/commentcount?user=gdt&amp;ditemid=60970&quot; width=&quot;30&quot; height=&quot;12&quot; alt=&quot;comment count unavailable&quot; style=&quot;vertical-align: middle;&quot;/&gt; comments</description>
  <comments>https://gdt.dreamwidth.org/60970.html</comments>
  <category>linux</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>https://gdt.dreamwidth.org/60842.html</guid>
  <pubDate>Fri, 13 Nov 2020 12:07:40 GMT</pubDate>
  <title>Blocking a USB device</title>
  <link>https://gdt.dreamwidth.org/60842.html</link>
  <description>&lt;p&gt;udev can be used to block a USB device (or even an entire class of devices, such as USB storage). Add a file /etc/udev/rules.d/99-local-blacklist.rules containing:&lt;/p&gt;

&lt;blockquote&gt;
&lt;pre&gt;
SUBSYSTEM==&quot;usb&quot;, ATTRS{idVendor}==&quot;0123&quot;, ATTRS{idProduct}==&quot;4567&quot;, ATTR{authorized}=&quot;0&quot;
&lt;/pre&gt;
&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src=&quot;https://www.dreamwidth.org/tools/commentcount?user=gdt&amp;ditemid=60842&quot; width=&quot;30&quot; height=&quot;12&quot; alt=&quot;comment count unavailable&quot; style=&quot;vertical-align: middle;&quot;/&gt; comments</description>
  <comments>https://gdt.dreamwidth.org/60842.html</comments>
  <category>linux</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>https://gdt.dreamwidth.org/60309.html</guid>
  <pubDate>Thu, 21 Mar 2019 12:26:22 GMT</pubDate>
  <title>Jupyter notebook and R</title>
  <link>https://gdt.dreamwidth.org/60309.html</link>
  <description>&lt;p&gt;This has become substantially simpler in Fedora 29:&lt;/p&gt;

&lt;pre&gt;
sudo dnf install notebook R-IRKernel R-IRdisplay
&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src=&quot;https://www.dreamwidth.org/tools/commentcount?user=gdt&amp;ditemid=60309&quot; width=&quot;30&quot; height=&quot;12&quot; alt=&quot;comment count unavailable&quot; style=&quot;vertical-align: middle;&quot;/&gt; comments</description>
  <comments>https://gdt.dreamwidth.org/60309.html</comments>
  <category>linux</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>https://gdt.dreamwidth.org/59786.html</guid>
  <pubDate>Thu, 07 Mar 2019 14:06:00 GMT</pubDate>
  <title>wpa_supplicant update trades off interoperation for security</title>
  <link>https://gdt.dreamwidth.org/59786.html</link>
  <description>&lt;p&gt;In case you want to choose a different security compromise, the update has a nice summary:&lt;/p&gt;
&lt;pre&gt;wpasupplicant (2:2.6-19) unstable; urgency=medium

  With this release, wpasupplicant no longer respects the system
  default minimum TLS version, defaulting to TLSv1.0, not TLSv1.2. If
  you&amp;apos;re sure you will never connect to EAP networks requiring anything less
  than 1.2, add this to your wpasupplicant configuration:

    tls_disable_tlsv1_0=1
    tls_disable_tlsv1_1=1

  wpasupplicant also defaults to a security level 1, instead of the system
  default 2. Should you need to change that, change this setting in your
  wpasupplicant configuration:

    openssl_ciphers=DEFAULT@SECLEVEL=2

  Unlike wpasupplicant, hostapd still respects system defaults.

 -- Andrej Shadura &amp;lt;&amp;hellip;@debian.org&amp;gt;  Sat, 15 Dec 2018 14:22:18 +0100&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src=&quot;https://www.dreamwidth.org/tools/commentcount?user=gdt&amp;ditemid=59786&quot; width=&quot;30&quot; height=&quot;12&quot; alt=&quot;comment count unavailable&quot; style=&quot;vertical-align: middle;&quot;/&gt; comments</description>
  <comments>https://gdt.dreamwidth.org/59786.html</comments>
  <category>linux</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>https://gdt.dreamwidth.org/59462.html</guid>
  <pubDate>Tue, 05 Mar 2019 01:30:25 GMT</pubDate>
  <title>Finding git credentials in libsecret</title>
  <link>https://gdt.dreamwidth.org/59462.html</link>
  <description>&lt;p&gt;To find passwords in libsecret you need to know what attributes to search for. These are often set by some shim but not documented. The attributes tend to vary by shim.&lt;/p&gt;

&lt;p&gt;For git&apos;s libsecret shim the attributes are: protocol, server, user.&lt;/p&gt;

&lt;p&gt;A worked example, the account gdt on git.example.org:&lt;/p&gt;

&lt;pre&gt;
$ secret-tool search --all &apos;protocol&apos; &apos;https&apos; &apos;server&apos; &apos;git.example.org&apos; &apos;user&apos; &apos;gdt&apos;
[/org/freedesktop/secrets/collection/login/123]
label = Git: https://git.example.org/
secret = CvKxlezMsSDuR7piMBTzREJ7l8WL1T
created = 2019-02-01 10:20:34
modified = 2019-02-01 10:20:34
schema = org.gnome.keyring.NetworkPassword
attribute.protocol = https
attribute.server = git.example.org
attribute.user = gdt
&lt;/pre&gt;

&lt;p&gt;Note that the &quot;label&quot; is mere documentation, it&apos;s the &quot;attribute&quot; entries which matter.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src=&quot;https://www.dreamwidth.org/tools/commentcount?user=gdt&amp;ditemid=59462&quot; width=&quot;30&quot; height=&quot;12&quot; alt=&quot;comment count unavailable&quot; style=&quot;vertical-align: middle;&quot;/&gt; comments</description>
  <comments>https://gdt.dreamwidth.org/59462.html</comments>
  <category>linux</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>https://gdt.dreamwidth.org/58164.html</guid>
  <pubDate>Sun, 29 Jul 2018 13:24:39 GMT</pubDate>
  <title>MacbookPro8,2 boots with very bright screen</title>
  <link>https://gdt.dreamwidth.org/58164.html</link>
  <description>&lt;p&gt;The screen brightness is held in a EFI variable.&lt;/p&gt;
&lt;blockquote&gt;&lt;pre&gt;hexdump /sys/firmware/efi/efivars/backlight-level-7c436110-ab2a-4bbb-a880-fe41995c9f82 
0000000 0007 0000 0101&lt;/pre&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src=&quot;https://www.dreamwidth.org/tools/commentcount?user=gdt&amp;ditemid=58164&quot; width=&quot;30&quot; height=&quot;12&quot; alt=&quot;comment count unavailable&quot; style=&quot;vertical-align: middle;&quot;/&gt; comments</description>
  <comments>https://gdt.dreamwidth.org/58164.html</comments>
  <category>linux</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>https://gdt.dreamwidth.org/57606.html</guid>
  <pubDate>Fri, 13 Apr 2018 06:43:40 GMT</pubDate>
  <title>Installing NetCDF for R in Fedora</title>
  <link>https://gdt.dreamwidth.org/57606.html</link>
  <description>&lt;pre&gt;
$ &lt;b&gt;sudo install netcdf-devel&lt;/b&gt;
$ &lt;b&gt;R --no-restore --no-save&lt;/b&gt;
&amp;gt; &lt;b&gt;install.packages(&apos;ncdf4&apos;)&lt;/b&gt;
&amp;gt; &lt;b&gt;q()&lt;/b&gt;
&lt;/pre&gt;

&lt;p&gt;There&apos;s a good summary of using NetCDF &lt;a href=&quot;http://geog.uoregon.edu/bartlein/courses/geog490/week04-netCDF.html&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src=&quot;https://www.dreamwidth.org/tools/commentcount?user=gdt&amp;ditemid=57606&quot; width=&quot;30&quot; height=&quot;12&quot; alt=&quot;comment count unavailable&quot; style=&quot;vertical-align: middle;&quot;/&gt; comments</description>
  <comments>https://gdt.dreamwidth.org/57606.html</comments>
  <category>linux</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>https://gdt.dreamwidth.org/57406.html</guid>
  <pubDate>Wed, 11 Apr 2018 12:44:12 GMT</pubDate>
  <title>Jupyter notebook for Fedora 27</title>
  <link>https://gdt.dreamwidth.org/57406.html</link>
  <description>&lt;h2&gt;Jupyter with Python&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;https://fedoralovespython.org/&quot;&gt;Fedora loves Python has the good oil:&lt;/a&gt;&lt;/p&gt;
&lt;pre&gt;$ &lt;b&gt;sudo dnf install notebook&lt;/b&gt;
$ &lt;b&gt;jupyter notebook&lt;/b&gt;&lt;/pre&gt;
&lt;h2&gt;Jupyter with R&lt;/h2&gt;
&lt;p&gt;Firstly, install Jupyter with Python, as above.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://irkernel.github.io/installation/&quot;&gt;IRkernel&lt;/a&gt; has the good oil. I&apos;ve modified their advice to install RPM packages where they are available:&lt;/p&gt;
&lt;pre&gt;$ &lt;b&gt;sudo dnf install czmq-devel libcurl-devel openssl-devel&lt;/b&gt;
$ &lt;b&gt;sudo dnf install R-crayon R-pbdZMQ R-repr&lt;/b&gt;
$ &lt;b&gt;R --no-restore --no-save&lt;/b&gt;
&amp;gt; &lt;b&gt;install.packages(&apos;devtools&apos;)&lt;/b&gt;
&amp;gt; &lt;b&gt;devtools::install_github(paste0(&apos;IRkernel/&apos;, c(&apos;IRdisplay&apos;, &apos;IRkernel&apos;)))&lt;/b&gt;
&amp;gt; &lt;b&gt;IRkernel::installspec()&lt;/b&gt;
&amp;gt; &lt;b&gt;q()&lt;/b&gt;
&lt;/pre&gt;
&lt;p&gt;If you want to do a system-wide installation then run R as root, proceed as above, but the last step is:
&lt;pre&gt;
&amp;gt; &lt;b&gt;IRkernel::installspec(user = FALSE)&lt;/b&gt;
&lt;/pre&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src=&quot;https://www.dreamwidth.org/tools/commentcount?user=gdt&amp;ditemid=57406&quot; width=&quot;30&quot; height=&quot;12&quot; alt=&quot;comment count unavailable&quot; style=&quot;vertical-align: middle;&quot;/&gt; comments</description>
  <comments>https://gdt.dreamwidth.org/57406.html</comments>
  <category>linux</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>https://gdt.dreamwidth.org/57197.html</guid>
  <pubDate>Fri, 16 Mar 2018 03:37:38 GMT</pubDate>
  <title>Checking Meltdown and Spectre fixes, and not thinking about usage</title>
  <link>https://gdt.dreamwidth.org/57197.html</link>
  <description>&lt;p&gt;The Linux kernel has fixes for Meltdown, Spectre v1 and Spectre v2. Check the status with:&lt;/p&gt;

&lt;blockquote&gt;&lt;pre&gt;
$ &lt;b&gt;cat /sys/devices/system/cpu/vulnerabilities/meltdown&lt;/b&gt;
Mitigation: PTI
$ &lt;b&gt;cat /sys/devices/system/cpu/vulnerabilities/spectre_v1&lt;/b&gt;
Mitigation: __user pointer sanitization
$ &lt;b&gt;cat /sys/devices/system/cpu/vulnerabilities/spectre_v2&lt;/b&gt;
Mitigation: Full generic retpoline&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;You&apos;d think that would be enough. But Linux has fucked it up. Here&apos;s the output from a Raspberry Pi 3 running 4.9.80. That ARM CPU doesn&apos;t have instruction speculation and this isn&apos;t vulnerable to Meltdown or Spectre-style bugs.&lt;/p&gt;

&lt;blockquote&gt;&lt;pre&gt;
$ &lt;b&gt;ls /sys/devices/system/cpu/vulnerabilities&lt;/b&gt;
ls: cannot access &apos;/sys/devices/system/cpu/vulnerabilities&apos;: No such file or directory&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;That&apos;s right. We can&apos;t tell if the CPU is immune to the issue or if the Linux kernel is too old to have a fix for the issue. A program wanting to check this is going to have to carry around a table of CPU architectures and Linux versions. Which is likely going to be wrong, because who&apos;s going to know the data a fix for Spectre made it into a MIPS build. Classic. All Linux needed to do was to create /sys/devices/system/cpu/vulnerabilities for all architectures. Sigh.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src=&quot;https://www.dreamwidth.org/tools/commentcount?user=gdt&amp;ditemid=57197&quot; width=&quot;30&quot; height=&quot;12&quot; alt=&quot;comment count unavailable&quot; style=&quot;vertical-align: middle;&quot;/&gt; comments</description>
  <comments>https://gdt.dreamwidth.org/57197.html</comments>
  <category>linux</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>https://gdt.dreamwidth.org/56637.html</guid>
  <pubDate>Mon, 28 Aug 2017 11:06:51 GMT</pubDate>
  <title>Finding Google DNS cluster</title>
  <link>https://gdt.dreamwidth.org/56637.html</link>
  <description>&lt;p&gt;From NANOG list:&lt;/p&gt;
&lt;blockquote&gt;&lt;pre&gt;
dig o-o.myaddr.l.google.com -t txt +short @8.8.8.8
&lt;/pre&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src=&quot;https://www.dreamwidth.org/tools/commentcount?user=gdt&amp;ditemid=56637&quot; width=&quot;30&quot; height=&quot;12&quot; alt=&quot;comment count unavailable&quot; style=&quot;vertical-align: middle;&quot;/&gt; comments</description>
  <comments>https://gdt.dreamwidth.org/56637.html</comments>
  <category>linux</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>https://gdt.dreamwidth.org/56109.html</guid>
  <pubDate>Fri, 31 Mar 2017 23:08:55 GMT</pubDate>
  <title>dd</title>
  <link>https://gdt.dreamwidth.org/56109.html</link>
  <description>The reason for using &lt;strong&gt;dd&lt;/strong&gt; to write to USB flash sticks is historical.&lt;br /&gt;&lt;br /&gt;On some other UNIX-like operating systems only &amp;quot;raw&amp;quot; block devices present the partition table, boot sector and unpartitioned space. Specifically, whereas Linux presents a &lt;tt&gt;/dev/sda&lt;/tt&gt; block device containing all the bytes of a disk, in those other operating systems the equivalent would be a &lt;tt&gt;/dev/rsda&lt;/tt&gt; raw block device.&lt;br /&gt;&lt;br /&gt;In those other UNIX-like operating systems you must write to raw block devices in multiples of the sector size of the device. &lt;strong&gt;dd&lt;/strong&gt; can do this, &lt;strong&gt;cp&lt;/strong&gt; and &lt;strong&gt;cat&lt;/strong&gt; cannot. How you discover a device&apos;s sector size was left as an exercise for the reader, it is traditionally 0.5KB, more recently 4KB, and three orders of magnitude larger again for flash devices.&lt;br /&gt;&lt;br /&gt;Linux doesn&apos;t have raw devices, so using &lt;strong&gt;dd&lt;/strong&gt; isn&apos;t needed to write an image to a disk. You can &lt;tt&gt;wget -O /dev/sd𝐱 &amp;hellip;&lt;/tt&gt; a Fedora .iso file directly onto the USB flash drive.&lt;br /&gt;&lt;br /&gt;Note that some devices perform better when handed data is particular block sizes. Most USB sticks perform best if handed data in 4MB chunks. &lt;strong&gt;dd&lt;/strong&gt; is useful if you want that optimisation: &lt;tt&gt;wget -O - &amp;hellip; | dd of=/dev/sd𝐱 bs=4M status=progress&lt;/tt&gt;. Note that if you do not set the &lt;tt&gt;bs&lt;/tt&gt; blocksize then the default of 0.5KB is going to make writing a USB flash stick very slow.&lt;br /&gt;&lt;br /&gt;&lt;img src=&quot;https://www.dreamwidth.org/tools/commentcount?user=gdt&amp;ditemid=56109&quot; width=&quot;30&quot; height=&quot;12&quot; alt=&quot;comment count unavailable&quot; style=&quot;vertical-align: middle;&quot;/&gt; comments</description>
  <comments>https://gdt.dreamwidth.org/56109.html</comments>
  <category>linux</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
</channel>
</rss>
