<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Tips-and-Tricks on stuartleeks.com</title>
    <link>https://stuartleeks.com/tags/tips-and-tricks/</link>
    <description>Recent content in Tips-and-Tricks on stuartleeks.com</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Thu, 27 May 2021 13:42:16 +0100</lastBuildDate>
    <atom:link href="https://stuartleeks.com/tags/tips-and-tricks/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Fun with WSL, GitHub CLI and Windows Notifications</title>
      <link>https://stuartleeks.com/posts/wsl-github-cli-windows-notifications-part-2/</link>
      <pubDate>Thu, 27 May 2021 13:42:16 +0100</pubDate>
      <guid>https://stuartleeks.com/posts/wsl-github-cli-windows-notifications-part-2/</guid>
      <description>&lt;h2 id=&#34;introduction&#34;&gt;Introduction&lt;/h2&gt;&#xA;&lt;p&gt;In the &lt;a href=&#34;https://stuartleeks.com/posts/wsl-github-cli-windows-notifications-part-1/&#34;&gt;last post&lt;/a&gt; we saw how to create a drop-in replacement for &lt;code&gt;notify-send&lt;/code&gt;. This allowed us to take a script that used &lt;code&gt;notify-send&lt;/code&gt; and run it without modification. In this post, we&amp;rsquo;ll take a look at how we can update that script to take better advantage of Windows notifications.&lt;/p&gt;&#xA;&lt;p&gt;At the end of that post, the notification was fairly generic as shown below:&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;./notification-previous.png&#34; alt=&#34;Notification with WSL Distro as category and &amp;ldquo;Run finished&amp;rdquo; as text&#34;&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Fun with WSL, GitHub CLI and Windows Notifications</title>
      <link>https://stuartleeks.com/posts/wsl-github-cli-windows-notifications-part-1/</link>
      <pubDate>Thu, 27 May 2021 07:10:16 +0100</pubDate>
      <guid>https://stuartleeks.com/posts/wsl-github-cli-windows-notifications-part-1/</guid>
      <description>&lt;h2 id=&#34;introduction&#34;&gt;Introduction&lt;/h2&gt;&#xA;&lt;p&gt;I&amp;rsquo;ve been making use of the &lt;a href=&#34;https://cli.github.com/&#34;&gt;GitHub CLI&lt;/a&gt; and finding it a productive way to work with GitHub. Recently, &lt;a href=&#34;https://blog.gripdev.xyz/&#34;&gt;Lawrence Gripper&lt;/a&gt; shared with me a handy alias that he had set up:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;alias ghrun&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;gh run list | grep \$(git branch --show-current) | cut -d&lt;/span&gt;$&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;\t&amp;#39; -f 8 | xargs gh run watch &amp;amp;&amp;amp; notify-send &amp;#39;Run finished&amp;#39;&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This &lt;code&gt;ghrun&lt;/code&gt; alias finds the latest GitHub actions workflow for the current branch and starts a &lt;code&gt;gh run watch&lt;/code&gt; for it. This shows the progress through the steps of a workflow:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Forwarding copy to clipboard from dev container to Windows Host</title>
      <link>https://stuartleeks.com/posts/vscode-devcontainer-clipboard-forwarding/</link>
      <pubDate>Wed, 17 Feb 2021 19:11:12 +0000</pubDate>
      <guid>https://stuartleeks.com/posts/vscode-devcontainer-clipboard-forwarding/</guid>
      <description>&lt;h2 id=&#34;background&#34;&gt;Background&lt;/h2&gt;&#xA;&lt;p&gt;I&amp;rsquo;ve mentioned &lt;a href=&#34;https://stuartleeks.com/posts/vscode-devcontainers/&#34;&gt;VS Code dev containers&lt;/a&gt; on this blog before and like &lt;a href=&#34;https://stuartleeks.com/posts/vscode-devcontainers-wsl/&#34;&gt;using them from WSL&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;I&amp;rsquo;m also a fan of &lt;a href=&#34;https://github.com/lawrencegripper/azbrowse&#34;&gt;azbrowse&lt;/a&gt; for working with Azure resources from the terminal, and lately have found myself running azbrowse from within a dev container for various reasons.&lt;/p&gt;&#xA;&lt;p&gt;There are several features in azbrowse that copy data to the clipboard, and when run from WSL it detects that and copies to the Windows clipboard, which is convenient. When run from a dev container, the experience isn&amp;rsquo;t so good (a polite way of saying that it doesn&amp;rsquo;t work).&lt;/p&gt;</description>
    </item>
    <item>
      <title>Forwarding SSH Agent requests from WSL to Windows</title>
      <link>https://stuartleeks.com/posts/wsl-ssh-key-forward-to-windows/</link>
      <pubDate>Fri, 03 Jul 2020 15:11:12 +0000</pubDate>
      <guid>https://stuartleeks.com/posts/wsl-ssh-key-forward-to-windows/</guid>
      <description>&lt;h2 id=&#34;background&#34;&gt;Background&lt;/h2&gt;&#xA;&lt;p&gt;As I mentioned in my &lt;a href=&#34;https://stuartleeks.com/posts/git-for-windows-ssh-key-passphrases/&#34;&gt;previous post&lt;/a&gt;, I switched to using SSH key auth for GitHub and Azure DevOps Repos a long time ago and found it a positive experience. At first I was a bit lazy and didn&amp;rsquo;t use passphrases on my keys, and just kept a copy of my keys in the &lt;code&gt;.ssh&lt;/code&gt; folder in my User folder in Windows and another copy in &lt;code&gt;~/.ssh&lt;/code&gt; in WSL.&lt;/p&gt;&#xA;&lt;p&gt;For day-to-day working this worked okay, but I finally got round to adding passphrases to my keys a while back and was less happy with the setup at that point. My previously suppressed niggles around having the keys in multiple places re-surfaced once I had to add handle passphrases in multiple systems on the same machine!&lt;/p&gt;</description>
    </item>
    <item>
      <title>Fun with Git for Windows, SSH Keys and Passphrases</title>
      <link>https://stuartleeks.com/posts/git-for-windows-ssh-key-passphrases/</link>
      <pubDate>Tue, 30 Jun 2020 14:18:36 +0000</pubDate>
      <guid>https://stuartleeks.com/posts/git-for-windows-ssh-key-passphrases/</guid>
      <description>&lt;p&gt;Disclaimer: this post is one to file under &amp;ldquo;things I&amp;rsquo;m blogging in the hope that I find the answer more quickly next time&amp;rdquo;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;background&#34;&gt;Background&lt;/h2&gt;&#xA;&lt;p&gt;I switched to using SSH key auth for GitHub and Azure DevOps Repos a long time ago and never looked back. For a while I was using SSH keys without passphrases but got round to adding passphrases a while back. I set up the Windows OpenSSH Authentication Agent - the service defaults to Disabled so I set it as Automatic start and nudged it to Running. (For more information, see the &lt;a href=&#34;https://docs.microsoft.com/en-us/windows-server/administration/openssh/openssh_install_firstuse&#34;&gt;docs on installing Windows OpenSSH&lt;/a&gt;)&lt;/p&gt;</description>
    </item>
    <item>
      <title>Working With Multiple Kubernetes Contexts</title>
      <link>https://stuartleeks.com/posts/working-with-multiple-kubernetes-contexts/</link>
      <pubDate>Fri, 24 Jan 2020 20:24:13 +0000</pubDate>
      <guid>https://stuartleeks.com/posts/working-with-multiple-kubernetes-contexts/</guid>
      <description>&lt;p&gt;If you&amp;rsquo;re working with Kubernetes then there&amp;rsquo;s a pretty good chance that you&amp;rsquo;ve been working with &lt;code&gt;kubectl&lt;/code&gt;!&lt;/p&gt;&#xA;&lt;p&gt;There&amp;rsquo;s also a pretty good chance that you end up working with more than one cluster context. So, how do you manage multiple contexts?&lt;/p&gt;&#xA;&lt;h2 id=&#34;kubeconfig&#34;&gt;KUBECONFIG&lt;/h2&gt;&#xA;&lt;p&gt;One way that you might have encountered is obtaining a &lt;code&gt;kubeconfig&lt;/code&gt; file that contains the details of how to connect to a cluster. &lt;code&gt;kubectl&lt;/code&gt; allows you to pass a &lt;code&gt;--kubeconfig&lt;/code&gt; option to commands to specify which &lt;code&gt;kubeconfig&lt;/code&gt; should be used to connect to a cluster to execute the command. E.g. &lt;code&gt;kubectl get pods --kubeconfig=/path/to/kubeconfig&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Working With Git Rebase in Visual Studio Code</title>
      <link>https://stuartleeks.com/posts/working-with-git-rebase-in-visual-studio-code/</link>
      <pubDate>Thu, 23 Jan 2020 08:15:27 +0000</pubDate>
      <guid>https://stuartleeks.com/posts/working-with-git-rebase-in-visual-studio-code/</guid>
      <description>&lt;p&gt;Following the &lt;a href=&#34;https://stuartleeks.com/posts/setting-visual-studio-code-as-your-git-editor/&#34;&gt;git theme&lt;/a&gt; for mini-posts, I thought I&amp;rsquo;d give &lt;code&gt;git rebase&lt;/code&gt; a mention this time.&lt;/p&gt;&#xA;&lt;p&gt;When I first started working with git I found a way to pretend that it was a source control system like any other that I&amp;rsquo;d used. Eventually, I was working on a pull request for an OSS project and a maintainer asked me to rebase my changes. Now, I&amp;rsquo;d heard of rebase at that point but I hadn&amp;rsquo;t used it, so I was a bit daunted. So this post has a few tips that I wish I&amp;rsquo;d known at that point. By way of encouragement, I&amp;rsquo;ll add that getting familiar with git rebase is a huge part of the reason that I love git and has improved my developer workflow.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Setting Visual Studio Code As Your Git Editor</title>
      <link>https://stuartleeks.com/posts/setting-visual-studio-code-as-your-git-editor/</link>
      <pubDate>Wed, 22 Jan 2020 07:17:34 +0000</pubDate>
      <guid>https://stuartleeks.com/posts/setting-visual-studio-code-as-your-git-editor/</guid>
      <description>&lt;p&gt;My &lt;a href=&#34;https://stuartleeks.com/posts/working-with-pull-requests-in-azure-devops/&#34;&gt;last post&lt;/a&gt; seemed to go down quite well, so I&amp;rsquo;m going to try a few mini-posts with a &lt;a href=&#34;https://stuartleeks.com/tags/tips-and-tricks&#34;&gt;&amp;rsquo;tips-and-tricks&amp;rsquo;&lt;/a&gt; theme. This works well for me as I&amp;rsquo;d started making some notes about productivity tips I use as part of my prep for an internal no-prep presentation ;-)&lt;/p&gt;&#xA;&lt;p&gt;This one is a really small tip that is covered in the &lt;a href=&#34;https://code.visualstudio.com/Docs/editor/versioncontrol#_vs-code-as-git-editor&#34;&gt;Visual Studio Code docs&lt;/a&gt;, but lots of people using Visual Studio Code seem to have missed it so I&amp;rsquo;m going to mention it here: you can set Visual Studio Code to be your git editor. To do this run:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Working With Pull Requests in Azure DevOps</title>
      <link>https://stuartleeks.com/posts/working-with-pull-requests-in-azure-devops/</link>
      <pubDate>Fri, 17 Jan 2020 13:16:36 +0000</pubDate>
      <guid>https://stuartleeks.com/posts/working-with-pull-requests-in-azure-devops/</guid>
      <description>&lt;p&gt;I like working at the terminal. No judgement if you don&amp;rsquo;t, but for me the terminal feels like a comfortable and productive place :-)&lt;/p&gt;&#xA;&lt;p&gt;I also like to find ways to gradually improve my experience with the terminal, and a while back I mentioned to &lt;a href=&#34;https://blog.gripdev.xyz/&#34;&gt;Lawrence&lt;/a&gt; that I&amp;rsquo;d created some git aliases to help me easily check out pull requests on github. He immediately replied pointing me to &lt;a href=&#34;https://github.com/ldez/prm&#34;&gt;github.com/ldez/prm (Pull Request Manager)&lt;/a&gt; which is an awesome tool for checking out pull requests locally and working with them.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
