<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
 <title type="text">duh.se: TIL</title>
 <link rel="self" href="https://duh.se/feeds/til.atom.xml" />
 <link href="https://duh.se/til/index.html" />
 <id>urn:https-duh-se:-til-index-html</id>
 <updated>2026-05-28T03:24:00Z</updated>
<entry>
 <title type="text">vim: save to macOS clipboard</title>
 <link rel="alternate" href="https://duh.se/2026/05/28/vim-save-to-macos-clipboard/" />
 <id>tag:duh.se,2026-05-28:/2026/05/28/vim-save-to-macos-clipboard/</id>
 <published>2026-05-28T03:24:00Z</published>
 <updated>2026-05-28T03:24:00Z</updated>
 <author><name>Johan Eckerström</name></author>
 <content type="html">&lt;div class=&quot;language-vim highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;w&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;!&lt;/span&gt;pbcopy
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
</content>
</entry>
<entry>
 <title type="text">Hide kernel processes in top with LIBPROC_HIDE_KERNEL</title>
 <link rel="alternate" href="https://duh.se/2025/03/26/libproc-hide-kernel-top/" />
 <id>tag:duh.se,2025-03-26:/2025/03/26/libproc-hide-kernel-top/</id>
 <published>2025-03-26T11:00:00Z</published>
 <updated>2025-03-26T11:00:00Z</updated>
 <author><name>Johan Eckerström</name></author>
 <content type="html">&lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;LIBPROC_HIDE_KERNEL&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;1 top
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;blockquote&gt;
  &lt;p&gt;Although the question has aged a bit, there is an interesting new
approach: Since version 4 of the &lt;strong&gt;procps&lt;/strong&gt; package, you can set
the environment variable &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;LIBPROC_HIDE_KERNEL&lt;/code&gt;. If set, &lt;strong&gt;ps(1)&lt;/strong&gt;
and &lt;strong&gt;top(1)&lt;/strong&gt; will display user space processes, only.&lt;/p&gt;
&lt;/blockquote&gt;
</content>
</entry>
<entry>
 <title type="text">macOS: set the default app for a file type with duti</title>
 <link rel="alternate" href="https://duh.se/2025/03/08/macos-default-app-with-duti/" />
 <id>tag:duh.se,2025-03-08:/2025/03/08/macos-default-app-with-duti/</id>
 <published>2025-03-08T11:00:00Z</published>
 <updated>2025-03-08T11:00:00Z</updated>
 <author><name>Johan Eckerström</name></author>
 <content type="html">&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;duti&lt;/code&gt; takes a bundle identifier and binds it to a file extension (or
UTI). Combine it with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;osascript&lt;/code&gt; to look up the bundle id of the app
you actually have installed.&lt;/p&gt;

&lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;brew &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;duti

&lt;span class=&quot;c&quot;&gt;# Figure out the bundle id of the app you want.&lt;/span&gt;
osascript &lt;span class=&quot;nt&quot;&gt;-e&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;id of app &quot;Zed&quot;&#39;&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# Bind .yml files to that app, for all roles (viewer + editor).&lt;/span&gt;
duti &lt;span class=&quot;nt&quot;&gt;-s&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;osascript &lt;span class=&quot;nt&quot;&gt;-e&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;id of app &quot;Zed&quot;&#39;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; .yml all
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
</content>
</entry>
</feed>
