<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Blog</title>
    <description></description>
    <link>https://blog.vlasov.me/</link>
    <atom:link href="https://blog.vlasov.me/feed.xml" rel="self" type="application/rss+xml" />
    <pubDate>Sun, 11 Oct 2026 14:40:25 +0000</pubDate>
    <lastBuildDate>Sun, 11 Oct 2026 14:40:25 +0000</lastBuildDate>
    <generator>Jekyll v4.4.1</generator>
    
      <item>
        <title>How to remove all YouTube Shorts from watch history</title>
        <description>&lt;p&gt;Unlike any other solution out there that simply hide the shorts, this one will actually remove shorts from watch history since beginning of time.&lt;/p&gt;

&lt;p&gt;By the nature of ever changing YouTube, this solution is likely to break whenever YouTube changes. Check the comments in case someone already posted a fix.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;WARNING&lt;/strong&gt;: I do not take responsibility if something happens to your account, as Google may not like such activity.
If you have a billion of shorts watched, removing all may take several hours.
So it’s good to take a break once in a while. It is safe to close the page or the browser at any moment and continue later.
Also, watch your RAM consumption, loading too much of the watch history may gradually eat all the RAM.&lt;/p&gt;

&lt;p&gt;Go to &lt;a href=&quot;https://www.youtube.com/feed/history&quot;&gt;youtube.com/feed/history&lt;/a&gt;, then open browser console (usually &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;F12&lt;/code&gt;) and put:&lt;/p&gt;

&lt;div class=&quot;language-js 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;async&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;while &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;window&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;innerHeight&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;window&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;scrollY&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;documentElement&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;scrollHeight&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;days&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;Array&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;querySelectorAll&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;#contents &amp;gt; .ytd-reel-shelf-renderer&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;));&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kd&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;days&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;kd&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;day&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;days&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;];&lt;/span&gt;
      &lt;span class=&quot;nx&quot;&gt;day&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;scrollIntoView&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;behavior&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;smooth&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;block&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;start&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;

      &lt;span class=&quot;kd&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;rightArrowButton&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;day&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;querySelector&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;#right-arrow &amp;gt; ytd-button-renderer&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
      &lt;span class=&quot;k&quot;&gt;while &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;rightArrowButton&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;checkVisibility&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;())&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;nx&quot;&gt;rightArrowButton&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;click&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;await&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Promise&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;resolve&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;setTimeout&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;resolve&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;));&lt;/span&gt;
      &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

      &lt;span class=&quot;kd&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;videos&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;Array&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;day&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;querySelectorAll&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;ytd-reel-item-renderer&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;));&lt;/span&gt;
      &lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kd&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;j&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;j&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;videos&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;nx&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;`day &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;days&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; | video &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;j&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;videos&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

        &lt;span class=&quot;k&quot;&gt;while &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kc&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
          &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;menuButton&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;videos&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;].&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;querySelector&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;#button[aria-label=&quot;Action menu&quot;]&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
          &lt;span class=&quot;k&quot;&gt;if &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;menuButton&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;nx&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;waiting for menu...&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
            &lt;span class=&quot;k&quot;&gt;await&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Promise&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;resolve&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;setTimeout&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;resolve&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1000&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;));&lt;/span&gt;
          &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;k&quot;&gt;break&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
          &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

        &lt;span class=&quot;k&quot;&gt;if &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;menuButton&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;checkVisibility&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;())&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
          &lt;span class=&quot;k&quot;&gt;continue&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
        &lt;span class=&quot;nx&quot;&gt;menuButton&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;click&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;await&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Promise&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;resolve&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;setTimeout&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;resolve&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;));&lt;/span&gt;

        &lt;span class=&quot;kd&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;removeButton&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;Array&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;querySelectorAll&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;.style-scope.ytd-menu-service-item-renderer&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)).&lt;/span&gt;
          &lt;span class=&quot;nf&quot;&gt;find&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;el&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;el&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;textContent&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;===&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;Remove from watch history&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;if &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;removeButton&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;checkVisibility&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;())&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
          &lt;span class=&quot;nx&quot;&gt;removeButton&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;click&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;await&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Promise&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;resolve&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;setTimeout&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;resolve&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;));&lt;/span&gt;
      &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
      &lt;span class=&quot;nx&quot;&gt;day&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;remove&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

    &lt;span class=&quot;nb&quot;&gt;window&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;scrollTo&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;documentElement&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;scrollHeight&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;await&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Promise&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;resolve&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;setTimeout&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;resolve&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;5000&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;));&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;done&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;})();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This will go through every visible short on the page, click the three dots menu and then click “Remove from watch history”.
After processing all visible shorts, it will scroll the page for more. Once it reaches the end of the history, it will just stop.&lt;/p&gt;

</description>
        <pubDate>Sun, 05 May 2024 00:00:00 +0000</pubDate>
        <link>https://blog.vlasov.me/2024/05/how-to-remove-all-youtube-shorts-from-watch-history.html</link>
        <guid isPermaLink="true">https://blog.vlasov.me/2024/05/how-to-remove-all-youtube-shorts-from-watch-history.html</guid>
        
        
      </item>
    
      <item>
        <title>How to install Intune in Debian 12</title>
        <description>&lt;p&gt;&lt;strong&gt;See &lt;a href=&quot;#2026-update&quot;&gt;2026 UPDATE&lt;/a&gt;.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I wish I didn’t have to use this abomination of a software from Microslop, but no luck. After spending countless hours (and even more in 2026) I had to document this, at least for my own sake.&lt;/p&gt;

&lt;h2 id=&quot;common-misconceptions&quot;&gt;Common misconceptions&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;There is no need to install &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;openjdk-11-jdk&lt;/code&gt; (see &lt;a href=&quot;#2026-update&quot;&gt;2026 UPDATE&lt;/a&gt;). It is not available in Debian 12 but can be installed from unstabe. Don’t do it, it’s not worth the risk of mixing stable with unstable. Instead you can use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;msopenjdk-11&lt;/code&gt; package from Microslop’s repository (see below) and create a dummy &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;openjdk-11-jre&lt;/code&gt; to satisfy the dependency.&lt;/li&gt;
  &lt;li&gt;There is no need to install Edge browser, unless you need it for some other reason. Intune does not require it.&lt;/li&gt;
  &lt;li&gt;There is no need to fake &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/os-release&lt;/code&gt; file during enrolment (see below), but it is still needed for compliance check.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;general-steps&quot;&gt;General steps&lt;/h2&gt;

&lt;ol&gt;
  &lt;li&gt;Create and install a dummy &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;openjdk-11-jre&lt;/code&gt; package (see &lt;a href=&quot;#2026-update&quot;&gt;2026 UPDATE&lt;/a&gt;).&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo apt install msopenjdk-11&lt;/code&gt; (comes from Microslop’s repository, which you added at the previous step).&lt;/li&gt;
  &lt;li&gt;Symlink &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;openjdk-11-jdk&lt;/code&gt; to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;msopenjdk-11&lt;/code&gt;:
    &lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo ln -s \
  /usr/lib/jvm/msopenjdk-11-amd64 \
  /usr/lib/jvm/java-11-openjdk-amd64
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo update-alternatives --config java&lt;/code&gt; and select the one that points to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;msopenjdk-11&lt;/code&gt;.&lt;/li&gt;
  &lt;li&gt;Follow &lt;a href=&quot;https://learn.microsoft.com/en-us/mem/intune/user-help/microsoft-intune-app-linux&quot;&gt;Ubuntu 22.04 instructions&lt;/a&gt; to install Intune.&lt;/li&gt;
  &lt;li&gt;Finally run &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;intune-portal&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
  &lt;li&gt;When running Intune for the first time and clicking “Sign up” it will open a separate second window to enter your corporate email. If this new window is blank, see troubleshooting section below.&lt;/li&gt;
  &lt;li&gt;After entering your email, it should open yet another third window (yes, 3 windows total!) to enter your corporate password. If it did not open another window, see troubleshooting section below.&lt;/li&gt;
  &lt;li&gt;After authenticating, you should see the last screen with the “Register” button. If you instead see “Get the app” button, see troubleshooting section below.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;troubleshooting&quot;&gt;Troubleshooting&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;When clicking “Sign up”, the new window is blank. The content is there but for some reason it fails to render. One workaround is to blindly navigate to the input field. Click the window in the top left corner and press &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Tab&lt;/code&gt;, it should jump to the input field, then type in your corporate email and press &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Enter&lt;/code&gt;. It should open a new window for entering password, which will have its content visible. Another workaround is to run a separate X server with software renderer:
    &lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo apt install xserver-xephyr
Xephyr -ac -br -noreset -screen 1280x1024 :1 &amp;amp;
# optionaly, run some window manager to be able to change window geometry:
# DISPLAY=:1 openbox &amp;amp;
DISPLAY=:1 intune
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;After entering email there is no separate third window to enter password, instead it asks for password in the same second window. Possible reasons:
    &lt;ul&gt;
      &lt;li&gt;No symlink to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;msopenjdk-11&lt;/code&gt;.&lt;/li&gt;
      &lt;li&gt;Intune fails to create a keyring to store the tokens. See &lt;a href=&quot;#keyring-troubleshooting&quot;&gt;Keyring Troubleshooting&lt;/a&gt;.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;You authenticated but it shows “Get the app” button. After clicking the button nothing happens. See the previous step.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;You get error “[1001]”. This can mean anything (classic Microslop) but most likely it one of the following:
    &lt;ul&gt;
      &lt;li&gt;Too many attempts to enrol, the procedure might be temporarily blocked. Try again later.&lt;/li&gt;
      &lt;li&gt;Still something is wrong with the keyring. See &lt;a href=&quot;#keyring-troubleshooting&quot;&gt;Keyring Troubleshooting&lt;/a&gt;.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;If device compliance check asks you to to downgrade to a supported distribution, grab &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/os-release&lt;/code&gt; from Ubuntu 22.04 installation (you may use &lt;a href=&quot;https://raw.githubusercontent.com/chef/os_release/main/ubuntu_2204&quot;&gt;this&lt;/a&gt; one) and keep it updated. Outdated version in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;os-release&lt;/code&gt; may fail the compliance check.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;keyring-troubleshooting&quot;&gt;Keyring Troubleshooting&lt;/h3&gt;

&lt;p&gt;This chapter is also 2026 updated.&lt;/p&gt;

&lt;p&gt;To be totally safe, we will create a new keyring setup. You will have to figure out yourself how to merge it later with the old one, or check if someone already commented on it.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Install &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;seahorse&lt;/code&gt; (unless already installed):
    &lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo apt install seahorse
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;Move your old keyring setup somewhere else, e.g. rename it to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;keyrings~&lt;/code&gt;:
    &lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mv -v ~/.local/share/keyrings{,~}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;Restart &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;gnome-keyring-daemon&lt;/code&gt; (this will also recreate the keyring directory in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;~/.local/share/keyrings&lt;/code&gt;):
    &lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;systemctl --user restart gnome-keyring-daemon.service
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Re-login, to avoid any running application to try access a not-yet-ready keyring.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Start &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;seahorse&lt;/code&gt;. In the UI click the plus button “+”, then select “Password keyring”, name it “Default”, optionally set the password (previously blank password was fine but I’m 100% sure anymore, check if someone already commented on it), finally click “Create”. Right click the “Default” keyring in the side bar and select “Set as default”.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;Now start &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;intune-portal&lt;/code&gt; and try to enroll again.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2 id=&quot;2026-update&quot;&gt;2026 UPDATE&lt;/h2&gt;

&lt;p&gt;Pretty much the old guide still applies with one correction: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;intune-portal&lt;/code&gt; now has a hard dependency on &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;openjdk-11-jre&lt;/code&gt; package. Workaround is to create a dummy package:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Install &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;equivs&lt;/code&gt;:
    &lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo apt install equivs
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;Create package description template:
    &lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mkdir dummy-openjdk-11-jre
cd dummy-openjdk-11-jre
equivs-control openjdk-11-jre
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;Edit &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;openjdk-11-jre&lt;/code&gt; file and replace all the content with following:
    &lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Package: openjdk-11-jre
Version: 11.999
Provides: openjdk-11-jre
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;Create a .deb package:
    &lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;equivs-build openjdk-11-jre
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;Install the newly created package:
    &lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo dpkg -i ./openjdk-11-jre_11.999_all.deb
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now you can install &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;intune-portal&lt;/code&gt; normally.&lt;/p&gt;
</description>
        <pubDate>Tue, 26 Mar 2024 00:00:00 +0000</pubDate>
        <link>https://blog.vlasov.me/2024/03/how-to-install-intune-in-debian-12.html</link>
        <guid isPermaLink="true">https://blog.vlasov.me/2024/03/how-to-install-intune-in-debian-12.html</guid>
        
        
      </item>
    
      <item>
        <title>Merge Git repositories, preserving chronological order of commits</title>
        <description>&lt;p&gt;Sometimes you want to split a huge monorepo into multiple smaller repositories,
like if you were migrating from Subversion. What if you want to do the opposite?
I did.&lt;/p&gt;

&lt;p&gt;I had a set of tiny git repositories that describe how to build Debian packages
in OpenSuse Build Service. The repositories had similar directory structure
and even the commits in each repository were alike. Eventually I thought that
merging all repositories into a single monorepo would be more efficient.&lt;/p&gt;

&lt;p&gt;I started searching if somebody had already achieved something like this. I
found few attempts but they all differ in a way how
the history is preserved.&lt;/p&gt;

&lt;p&gt;Basically all the solutions I found merge repositories with
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--allow-unrelated-histories&lt;/code&gt; option. It allows merging branches that don’t share
common ancestor commits. But in result the history of each repository is trapped
inside merge commits. Here is how it would look for two repositories:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;     A  B  C  D       W  X  Y  Z
     •--•--•--•   +   •--•--•--•

                  |
                  v
     A  B  C  D       W  X  Y  Z
     •--•--•--•   +   •--•--•--•
    /                /
•--•-------------•--•-------------•
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Which is inconvenient if you still want to reorder or squash some consequent
commits across multiple repositories. This is how I wanted the commits,
ordered chronologically:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;A  W  B  C  X  Y  Z  D
•--•--•--•--•--•--•--•
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Here is the approach I went with:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;First we clone all repositories somewhere locally.&lt;/li&gt;
&lt;/ul&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;&lt;span class=&quot;nb&quot;&gt;mkdir&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; ~/merge-attempt/repos
&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; ~/merge-attempt/repos
git clone git@githost:user/repo1
...
git clone git@githost:user/repo9
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;Then we do &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;git format-patch&lt;/code&gt; inside each repository to extract entire history
into a set of patch files. These files will be named like
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;0000-commit-message.patch&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;0001-another-commit.patch&lt;/code&gt; and so on. That makes
them appear in chronological order, but that not very useful if you try to
iterate over the patches from all repositories at once. The obvious way would be
to rename the files to include commit date and time in their filenames.&lt;/li&gt;
&lt;/ul&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;&lt;span class=&quot;nb&quot;&gt;cd &lt;/span&gt;repos
&lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;R &lt;span class=&quot;k&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do
  &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;pushd&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$R&lt;/span&gt;
  git format-patch &lt;span class=&quot;nt&quot;&gt;--root&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--src-prefix&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;a/&lt;span class=&quot;nv&quot;&gt;$R&lt;/span&gt;/ &lt;span class=&quot;nt&quot;&gt;--dst-prefix&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;b/&lt;span class=&quot;nv&quot;&gt;$R&lt;/span&gt;/
  &lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;P &lt;span class=&quot;k&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;.patch&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do
    &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;^Date: &apos;&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$P&lt;/span&gt; | &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
      &lt;span class=&quot;nb&quot;&gt;sed&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;s/^Date: \(.*\)/\1/&apos;&lt;/span&gt; | &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
      &lt;span class=&quot;nb&quot;&gt;date&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-Iseconds&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-f&lt;/span&gt; - | &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
      &lt;span class=&quot;nb&quot;&gt;sed&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;s/[:+]/-/g&apos;&lt;/span&gt; | &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
      xargs &lt;span class=&quot;nt&quot;&gt;-I&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;{}&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;mv&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$P&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{}&lt;/span&gt;.patch
  &lt;span class=&quot;k&quot;&gt;done
  &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;mv&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;.patch ../..
  &lt;span class=&quot;nb&quot;&gt;popd
&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;done&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Here &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--src-prefix&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--dst-prefix&lt;/code&gt; arguments allow us to preconfigure the
patches, so when applied, the files would be created in subdirectories named
according to original repository.&lt;/p&gt;

&lt;p&gt;We should get something like this:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;2018-09-23T23-42-02-03-00.patch
2018-12-10T13-51-56-02-00.patch
2019-04-16T20-05-20-03-00.patch
2019-04-16T20-25-31-03-00.patch
2019-04-16T20-35-56-03-00.patch
2019-04-16T20-38-16-03-00.patch
2019-04-16T20-49-06-03-00.patch
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;Having all the patches ready, we need to create a new repository and apply
them.&lt;/li&gt;
&lt;/ul&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;&lt;span class=&quot;nb&quot;&gt;mkdir&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; ~/merge-attempt/monorepo
&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; ~/merge-attempt/monorepo
git init &lt;span class=&quot;nb&quot;&gt;.&lt;/span&gt;
git am ../&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;.patch
git filter-branch &lt;span class=&quot;nt&quot;&gt;--env-filter&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;export GIT_COMMITTER_DATE=&quot;$GIT_AUTHOR_DATE&quot;&apos;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And that would be it.&lt;/p&gt;
</description>
        <pubDate>Wed, 22 May 2019 00:00:00 +0000</pubDate>
        <link>https://blog.vlasov.me/2019/05/merge-git-repositories.html</link>
        <guid isPermaLink="true">https://blog.vlasov.me/2019/05/merge-git-repositories.html</guid>
        
        
      </item>
    
      <item>
        <title>How to disable Power Button in Openbox and Debian 8 Jessie</title>
        <description>&lt;p&gt;This is something that was bothering me for quite a while. Rarely but I happened to press accidentally
the power button and shut down my computer, loosing all unsaved work. These few times I tried to search
for solution, it never worked. After another undesired power off I decided to sit down and fix it.&lt;/p&gt;

&lt;p&gt;Why I never managed to get it working properly is due to the combination of systemd and Openbox.
Both are capable to set what the special buttons like power or sleep do. So fixing it in the either
one kept the button misbehaving. And the trick was to configure it in both places.&lt;/p&gt;

&lt;p&gt;Let’s first disable the button in Openbox. Edit &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;~/.config/openbox/rc.xml&lt;/code&gt; and find the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;XF86PowerOff&lt;/code&gt; piece
and comment it out by wrapping it between &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;&amp;lt;!--&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--&amp;gt;&lt;/code&gt;:&lt;/p&gt;

&lt;div class=&quot;language-xml 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;c&quot;&gt;&amp;lt;!--
&amp;lt;keybind key=&quot;XF86PowerOff&quot;&amp;gt;
  &amp;lt;action name=&quot;Execute&quot;&amp;gt;
    &amp;lt;command&amp;gt;systemctl poweroff&amp;lt;/command&amp;gt;
  &amp;lt;/action&amp;gt;
&amp;lt;/keybind&amp;gt;
--&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Reload the Openbox config file:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ openbox --reconfigure
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Time for the systemd part. Open &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/systemd/logind.conf&lt;/code&gt; and find the line with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;HandlePowerKey&lt;/code&gt; in it.
By default the value for the power button handler is &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;poweroff&lt;/code&gt;. Remove the preceding &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;#&lt;/code&gt; symbol and
change the value to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ignore&lt;/code&gt;:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;HandlePowerKey=ignore
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Lastly, restart logind:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ sudo systemctl restart systemd-logind
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And we’re done. Now the power button is harmless. Of course it will continue working to power on the computer
or wake it up from the sleep.&lt;/p&gt;

&lt;p&gt;P.S. In case something doesn’t work, check the logs ( &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-f&lt;/code&gt; for real time update):&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ sudo journalctl -f
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
</description>
        <pubDate>Sun, 09 Oct 2016 00:00:00 +0000</pubDate>
        <link>https://blog.vlasov.me/2016/10/how-to-disable-power-button-in-openbox-and-debian-8-jessie.html</link>
        <guid isPermaLink="true">https://blog.vlasov.me/2016/10/how-to-disable-power-button-in-openbox-and-debian-8-jessie.html</guid>
        
        
      </item>
    
      <item>
        <title>How to remove all SoundCloud likes at once</title>
        <description>&lt;p&gt;How so there is no way to track which tracks I listened? There are various “SoundCloud History” browser extensions,
but every other streaming service has that (I know only YouTube) out of the box.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;UPDATE Nov 2016&lt;/strong&gt;: It took only few years of whining to get &lt;a href=&quot;https://soundcloud.com/you/history&quot;&gt;Listening history&lt;/a&gt;. Good job SoundCloud!&lt;/p&gt;

&lt;p&gt;So my workaround is to use the Like button. I basically like every track in my stream I listened. And to keep it clean and tidy once in a while I remove all the likes to start fresh. Yet even removing all the likes at once is not possible. I just love the tech support &lt;a href=&quot;https://www.soundcloudcommunity.com/soundcloud/topics/how-to-unlike-multiple-things-at-once&quot;&gt;answer&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;You can’t do that. Hope that helps.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Helps a lot!&lt;/p&gt;

&lt;p&gt;Go to &lt;a href=&quot;https://soundcloud.com/you/likes&quot;&gt;soundcloud.com/you/likes&lt;/a&gt;, then open browser console (usually &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;F12&lt;/code&gt;) and put:&lt;/p&gt;

&lt;div class=&quot;language-js 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;async&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;while &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kc&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;a&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;Array&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;querySelectorAll&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;.sc-button-like[title=&apos;Unlike&apos;]&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;));&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;if &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;length&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
            &lt;span class=&quot;k&quot;&gt;break&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;nx&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;forEach&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;button&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;button&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;click&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;());&lt;/span&gt;
        &lt;span class=&quot;c1&quot;&gt;// wait 2 seconds before more tracks get loaded:&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;await&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Promise&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;resolve&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;setTimeout&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;resolve&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;2000&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;));&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;})();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;What it does is that it goes through every Unlike button and clicks it. It may take a while if you have many likes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;WARNING&lt;/strong&gt;: Snap, SoundCloud decided to disable my Liking abilities for who knows how long:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;We’ve noticed a high volume of liking coming from your account and we would like to ask that you slow down.
If your account is performing many more actions when compared to most others, it loses the human touch.
Remember that there is a fine line between promoting yourself and bombarding other users with notifications.
We want our community to remain a genuine, positive place for members to interact, so remember to stick to our Community Guidelines.
You can continue liking again in 5 hours. The more you hit these limits, the longer the block will last.&lt;/p&gt;
&lt;/blockquote&gt;
</description>
        <pubDate>Fri, 30 Sep 2016 00:00:00 +0000</pubDate>
        <link>https://blog.vlasov.me/2016/09/how-to-remove-all-soundcloud-likes.html</link>
        <guid isPermaLink="true">https://blog.vlasov.me/2016/09/how-to-remove-all-soundcloud-likes.html</guid>
        
        
      </item>
    
      <item>
        <title>How to pair a Low Energy (LE) Bluetooth device in dual boot with Windows &amp; Linux</title>
        <description>&lt;p&gt;Those who dualboot know the pain of re-pairing your keyboard or mouse everytime you boot to a different OS. In this tutorial I will show how to pair a LE Bluetooth mouse in both Windows 8 and Debian simultaneously.&lt;/p&gt;

&lt;p&gt;First pair the device in Debian, then reboot in Windows and pair the device there too. Yes, this will reset the paring in Debian, just carry on. Now we need to access the pairing keys in Windows. Download &lt;a href=&quot;http://live.sysinternals.com/psexec.exe&quot;&gt;psexec.exe&lt;/a&gt; and open a command prompt with Administrator rights.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&amp;gt; cd Downloads
&amp;gt; psexec.exe -s -i regedit /e C:\BTKeys.reg HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\BTHPORT\Parameters\Keys
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The keys should be now exported to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;C:\BTKeys.reg&lt;/code&gt;. You should get something like:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\BTHPORT\Parameters\Keys\7512a3185b2c\84abd4a25ee1]
&quot;LTK&quot;=hex:6c,54,ee,80,40,47,6c,cb,fc,8e,f3,f1,c6,b2,04,9e
&quot;KeyLength&quot;=dword:00000000
&quot;ERand&quot;=hex(b):1e,12,aa,37,39,cc,af,34
&quot;EDIV&quot;=dword:00003549
&quot;CSRK&quot;=hex:38,d7,aa,c1,42,06,31,25,12,b8,5a,6d,c3,90,98,f2
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;7512a3185b2c&lt;/code&gt; is the MAC address of the Bluetooth adapter, which can also be written in standard format as &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;75:12:A3:18:5B:2C&lt;/code&gt;. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;84abd4a25ee1&lt;/code&gt; is the mouse address that was assigned during the pairing. We will need those numbers in the next steps.&lt;/p&gt;

&lt;p&gt;Now boot again to Debian. The mouse wont paired automatically, because it is now assigned to a different address and with different keys. Let’s fix it.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ cd /var/lib/bluetooth/75:12:A3:18:5B:2C/
$ ls
cache 84:AB:D4:A2:5F:E1 settings
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;If you look closely, the mouse address is not the same as in Windows. In my case only the fifth group is different. We need the device addresses to match, so rename the file.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ mv 84:AB:D4:A2:{5F,5E}:E1
$ cd 84:AB:D4:A2:5E:E1/
$ ls
attributes gatt info
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now open the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;info&lt;/code&gt; file for editing and update the keys values. The relation between Windows and Bluez keys format is as follows:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;LTK&lt;/code&gt; goes into &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Key&lt;/code&gt; of the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;LongTermKey&lt;/code&gt; group. Change to uppercase and remove the commas.&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;KeyLength&lt;/code&gt; goes into &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;EncSize&lt;/code&gt;. In my case I had to replace the original value &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;12&lt;/code&gt; with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;0&lt;/code&gt;.&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ERand&lt;/code&gt; goes into &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Rand&lt;/code&gt;. This is the tricky part. First you need to write down the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ERand&lt;/code&gt; value in reverse, so it becomes &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;34afcc3937aa121e&lt;/code&gt;. Then convert it to decimal to get &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;3796477557015712286&lt;/code&gt;.&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;EDIV&lt;/code&gt; goes to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;EDiv&lt;/code&gt;. Convert from HEX to decimal normally, no reverse this time.&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;CSRK&lt;/code&gt; goes to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Key&lt;/code&gt; of the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;LocalSignatureKey&lt;/code&gt; group. Uppercased and no commas.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;At the end you should get this.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;[LocalSignatureKey]
Key=38D7AAC14206312512B85A6DC39098F2

[LongTermKey]
Key=6C54EE8040476CCBFC8EF3F1C6B2049E
Authenticated=0
EncSize=0
EDiv=13641
Rand=3796477557015712286
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Save the changes and reboot. From now on Debian and Windows will connect the mouse automatically. Awesome!&lt;/p&gt;

&lt;p&gt;P.S. Mygod was nice to turn the instructions into a &lt;a href=&quot;https://gist.github.com/Mygod/f390aabf53cf1406fc71166a47236ebf&quot;&gt;Python script&lt;/a&gt;, try it out.&lt;/p&gt;
</description>
        <pubDate>Thu, 18 Sep 2014 00:00:00 +0000</pubDate>
        <link>https://blog.vlasov.me/2014/09/how-to-pair-low-energy-le-bluetooth.html</link>
        <guid isPermaLink="true">https://blog.vlasov.me/2014/09/how-to-pair-low-energy-le-bluetooth.html</guid>
        
        
      </item>
    
      <item>
        <title>Expanding wildcards with qmake</title>
        <description>&lt;p&gt;I was always wondering why doing something like this never worked&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;SOURCES += *.cpp
SOURCES -= excluded.cpp
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;excluded.cpp&lt;/code&gt; always stayed in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;SOURCES&lt;/code&gt;. The thing is that when you add a new value to the list, it’s just a string.
Thus using wildcard in files names is nothing more but an asteriks character.
And therefore using &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-=&lt;/code&gt; operator will only remove exact strings.
But today I found another &lt;a href=&quot;https://wiki.qt.io/Undocumented_QMake#Replace_functions&quot;&gt;undocumented function&lt;/a&gt; I’ve been looking for years!&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;$$files(glob)&lt;/code&gt; — Returns a list of files which match the specified glob pattern.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So now I can do&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;SOURCES += $$files(*.cpp)
SOURCES -= excluded.cpp
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;and it actually works.&lt;/p&gt;
</description>
        <pubDate>Tue, 26 Mar 2013 00:00:00 +0000</pubDate>
        <link>https://blog.vlasov.me/2013/03/expanding-wildcards-with-qmake.html</link>
        <guid isPermaLink="true">https://blog.vlasov.me/2013/03/expanding-wildcards-with-qmake.html</guid>
        
        <category>qmake</category>
        
        <category>qt</category>
        
        
      </item>
    
      <item>
        <title>Shortcut to show folders first in Nautilus</title>
        <description>&lt;p&gt;I really miss a menu shortcut in Nautilus to toggle “Show folders before files” option. Going to preferences every time is too much hassle.&lt;/p&gt;

&lt;p&gt;But there is other way to toggle it using dconf or gconftool. For Ubuntu 12.04 or newer I suggest using dconf, install it if you don’t have it yet.&lt;/p&gt;

&lt;p&gt;Create a script with the following content:&lt;/p&gt;

&lt;div class=&quot;language-bash 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;c&quot;&gt;#!/bin/bash&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# Version: Sun Sep 8 2013&lt;/span&gt;

&lt;span class=&quot;nv&quot;&gt;OLD_VALUE&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;LSB_RELEASE&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;lsb_release &lt;span class=&quot;nt&quot;&gt;-sr&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$LSB_RELEASE&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&amp;lt;&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;12.04&apos;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;then
    &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;OLD_VALUE&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;gconftool &lt;span class=&quot;nt&quot;&gt;--get&lt;/span&gt; /apps/nautilus/preferences/sort_directories_first&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;else
    &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;OLD_VALUE&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;dconf &lt;span class=&quot;nb&quot;&gt;read&lt;/span&gt; /org/gnome/nautilus/preferences/sort-directories-first&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;fi

&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;NEW_VALUE&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos;false&apos;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$OLD_VALUE&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;false&apos;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;then
    &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;NEW_VALUE&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos;true&apos;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;fi

if&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$LSB_RELEASE&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&amp;lt;&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;12.04&apos;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;then
    &lt;/span&gt;gconftool &lt;span class=&quot;nt&quot;&gt;--type&lt;/span&gt; Boolean &lt;span class=&quot;nt&quot;&gt;--set&lt;/span&gt; /apps/nautilus/preferences/sort_directories_first &lt;span class=&quot;nv&quot;&gt;$NEW_VALUE&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;else
    &lt;/span&gt;dconf write /org/gnome/nautilus/preferences/sort-directories-first &lt;span class=&quot;nv&quot;&gt;$NEW_VALUE&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;fi&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;del&gt;If you have older Ubuntu, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;dconf&lt;/code&gt; maybe not available. Uncomment &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;gconftool&lt;/code&gt; lines and comment &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;dconf&lt;/code&gt; ones.&lt;/del&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;UPDATE 2013:&lt;/strong&gt; the new version of the script works across all versions of Ubuntu.&lt;/p&gt;

&lt;p&gt;Save the script somewhere, I prefer to keep mine in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;~/.bin&lt;/code&gt;. Also give it execute permissions.&lt;/p&gt;

&lt;p&gt;The next step may vary depending on Gnome version, I will describe it as it’s in Ubuntu 12.04. Go to keyboard shortcut setting and add  a new custom shortcut. The command field set to path to the script we just created, in my case it’s &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;~/.bin/nautilus-folders-first.sh&lt;/code&gt;. You may also try to set full path if relative doesn’t work. Right click on the shortcut and set an actual hotkey combination. Choose something that doesn’t interferer with any other application, the shortcut is going to be system global. Ctrl+Alt+[some key] is good choice, I prefer Ctrl+Alt+F.&lt;/p&gt;

&lt;p&gt;Now open Nautilus and browse  where you have both files and folders, test the shortcut. If it doesn’t work, try the script in terminal and see if there are any errors.&lt;/p&gt;
</description>
        <pubDate>Sat, 24 Nov 2012 00:00:00 +0000</pubDate>
        <link>https://blog.vlasov.me/2012/11/shortcut-to-show-folders-first-in.html</link>
        <guid isPermaLink="true">https://blog.vlasov.me/2012/11/shortcut-to-show-folders-first-in.html</guid>
        
        <category>Gnome</category>
        
        <category>Nautilus</category>
        
        <category>Ubuntu</category>
        
        
      </item>
    
      <item>
        <title>Using Focusrite Scarlett 18i6 in Linux</title>
        <description>&lt;p&gt;With the current 1.0.25 ALSA release you need to do &lt;a href=&quot;http://lists.linuxaudio.org/pipermail/linux-audio-user/2012-April/084702.html&quot;&gt;some hacking&lt;/a&gt; to get Scarlett working. But the hack is as simple as it can be.&lt;/p&gt;

&lt;p&gt;Download the tarball &lt;a href=&quot;ftp://ftp.alsa-project.org/pub/driver/alsa-driver-1.0.25.tar.bz2&quot;&gt;ftp://ftp.alsa-project.org/pub/driver/alsa-driver-1.0.25.tar.bz2&lt;/a&gt; and comment  the call to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;snd_usb_create_mixer()&lt;/code&gt; on the line 517 in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;alsa-kernel/usb/card.c&lt;/code&gt; so it would look like:&lt;/p&gt;

&lt;div class=&quot;language-c 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;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;err&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;cm&quot;&gt;/* create normal USB audio interfaces */&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;snd_usb_create_streams&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;chip&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ifnum&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;cm&quot;&gt;/*||
        snd_usb_create_mixer(chip, ifnum, ignore_ctl_error) &amp;lt; 0*/&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;goto&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;__error&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Build and install:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ ./configue
$ make
$ sudo make install
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Considering a bad practice to use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo make install&lt;/code&gt;, in our case you don’t need to worry. Just reboot and select Scarlett as a default device in Sound Settings. Voila!&lt;/p&gt;

&lt;p&gt;To restore Scarlett after reconnecting it from the USB port use:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ sudo alsa force-reload
$ alsactl restore 0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
</description>
        <pubDate>Sat, 08 Sep 2012 00:00:00 +0000</pubDate>
        <link>https://blog.vlasov.me/2012/09/using-focusrite-scarlett-18i6-in-linux.html</link>
        <guid isPermaLink="true">https://blog.vlasov.me/2012/09/using-focusrite-scarlett-18i6-in-linux.html</guid>
        
        <category>alsa</category>
        
        <category>sound</category>
        
        <category>Ubuntu</category>
        
        
      </item>
    
      <item>
        <title>Bash auto-completion trick</title>
        <description>&lt;p&gt;zhs has a nice feature. If a program supports &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--help&lt;/code&gt; then zsh can do  auto-completion of its arguments. The trick is that zsh silently runs  the program with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--help&lt;/code&gt; argument, parses the output and use it for  auto-completion. I wish bash could do that. Well, not exactly but it  can. Bash has auto-completions too using templates. But if you want to  add auto-completion to your program you would need to write a  new template and either put it to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/bash_completion.d/&lt;/code&gt; or source in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.bashrc&lt;/code&gt;  or &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.profile&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;But you don’t have to do any of it if you can re-use bash templates as is.  For example the template for configure scripts does almost the same what zsh does for all programs. It simply parses the output from &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;./configure --help&lt;/code&gt;. Unfortunately it works only for arguments that prefixed with double dash. Better than nothing anyways.&lt;/p&gt;
</description>
        <pubDate>Tue, 31 Jul 2012 00:00:00 +0000</pubDate>
        <link>https://blog.vlasov.me/2012/07/bash-auto-completion-trick.html</link>
        <guid isPermaLink="true">https://blog.vlasov.me/2012/07/bash-auto-completion-trick.html</guid>
        
        <category>bash</category>
        
        <category>cli</category>
        
        <category>zsh</category>
        
        
      </item>
    
  </channel>
</rss>
