<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: David Lun</title>
    <description>The latest articles on DEV Community by David Lun (@mc0de).</description>
    <link>https://dev.to/mc0de</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F227566%2Fa330ff46-c168-42d2-af4a-6f3d1fc5870e.jpg</url>
      <title>DEV Community: David Lun</title>
      <link>https://dev.to/mc0de</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mc0de"/>
    <language>en</language>
    <item>
      <title>How to configure 1Password SSH Key and automatically sign your commits on GitHub?</title>
      <dc:creator>David Lun</dc:creator>
      <pubDate>Mon, 26 Jun 2023 19:06:08 +0000</pubDate>
      <link>https://dev.to/mc0de/how-to-configure-1password-ssh-key-and-automatically-sign-your-commits-on-github-4f7b</link>
      <guid>https://dev.to/mc0de/how-to-configure-1password-ssh-key-and-automatically-sign-your-commits-on-github-4f7b</guid>
      <description>&lt;ul&gt;
&lt;li&gt;&lt;p&gt;First generate ssh key using &lt;a href="https://1password.com/"&gt;1Password&lt;/a&gt; and save it in Vault. Optionally you can add your existing keys manually.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;On 1Password &lt;code&gt;Settings -&amp;gt; Developer&lt;/code&gt; check &lt;code&gt;Use the SSH agent&lt;/code&gt; box.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create &lt;code&gt;allowed-signers&lt;/code&gt; file, Sublime Merge complains if it can't find this file and shows all commits as invalid.&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; /home/&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;whoami&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;/config/git/
&lt;span class="nb"&gt;touch&lt;/span&gt; /home/&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;whoami&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;/config/git/allowed-signers
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Update your local git configuration &lt;code&gt;~/.gitconfig&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ini"&gt;&lt;code&gt;&lt;span class="nn"&gt;[gpg]&lt;/span&gt;
    &lt;span class="py"&gt;format&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;ssh&lt;/span&gt;
&lt;span class="nn"&gt;[gpg "ssh"]&lt;/span&gt;
    &lt;span class="py"&gt;program&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;/opt/1Password/op-ssh-sign&lt;/span&gt;
    &lt;span class="py"&gt;allowedSignersFile&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;/home/user/config/git/allowed-signers&lt;/span&gt;
&lt;span class="nn"&gt;[commit]&lt;/span&gt;
    &lt;span class="py"&gt;gpgsign&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;true&lt;/span&gt;
&lt;span class="nn"&gt;[user]&lt;/span&gt;
    &lt;span class="py"&gt;signingKey&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;ssh-ed25519 pubkey&lt;/span&gt;
    &lt;span class="py"&gt;name&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;Your name&lt;/span&gt;
    &lt;span class="py"&gt;email&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;email@example.org&lt;/span&gt;
&lt;span class="nn"&gt;[init]&lt;/span&gt;
    &lt;span class="py"&gt;defaultBranch&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;main&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Update local SSH configuration to use 1Password's SSH agent for all hosts &lt;code&gt;~/.ssh/config&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Host *
        IdentityAgent ~/.1password/agent.sock
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Finally Add your public key to your GitHub account &lt;code&gt;Settings -&amp;gt; SSH and GPG keys -&amp;gt; Signing keys&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;1Password will pop-up to authorize the use of your private key and if you generated your private key in the app it is never saved on the computer.&lt;/p&gt;

</description>
      <category>ssh</category>
      <category>1password</category>
      <category>git</category>
      <category>github</category>
    </item>
    <item>
      <title>How to get Laravel model table statically</title>
      <dc:creator>David Lun</dc:creator>
      <pubDate>Thu, 20 Apr 2023 17:37:13 +0000</pubDate>
      <link>https://dev.to/mc0de/how-to-get-laravel-model-table-statically-2895</link>
      <guid>https://dev.to/mc0de/how-to-get-laravel-model-table-statically-2895</guid>
      <description>&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="kn"&gt;namespace&lt;/span&gt; &lt;span class="nn"&gt;App\Models\Traits&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;trait&lt;/span&gt; &lt;span class="nc"&gt;CanGetTableNameStatically&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;table&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;with&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;static&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;getTable&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>laravel</category>
    </item>
  </channel>
</rss>
