<?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: abdennour</title>
    <description>The latest articles on DEV Community by abdennour (@abdennour).</description>
    <link>https://dev.to/abdennour</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%2F619317%2Fcf381e6a-9370-42ab-910d-287a27b8b812.png</url>
      <title>DEV Community: abdennour</title>
      <link>https://dev.to/abdennour</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/abdennour"/>
    <language>en</language>
    <item>
      <title>yq for helm post-render instead of kustomize</title>
      <dc:creator>abdennour</dc:creator>
      <pubDate>Mon, 21 Nov 2022 23:02:06 +0000</pubDate>
      <link>https://dev.to/abdennour/yq-for-helm-post-render-instead-of-kustomize-4mdc</link>
      <guid>https://dev.to/abdennour/yq-for-helm-post-render-instead-of-kustomize-4mdc</guid>
      <description>&lt;p&gt;Spending several hours to get all resources patched with &lt;code&gt;.metadata.labels&lt;/code&gt; using kustomize as &lt;a href="https://helm.sh/docs/topics/advanced/#post-rendering" rel="noopener noreferrer"&gt;helm post-render&lt;/a&gt; tool; Sometimes, the command kustomize removed an old subcommand (build)..sometimes, the command kustomize requires external plugins...etc&lt;/p&gt;

&lt;p&gt;At the end, things works simply with a single &lt;code&gt;yq&lt;/code&gt; command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;yq &lt;span class="s1"&gt;'. *= load("patch.yaml")'&lt;/span&gt; all.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Shipping that single command inside &lt;code&gt;postrender&lt;/code&gt; script, then use it with helm: &lt;code&gt;helm template -g ./my-chart --post-renderer ./postrender&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;yq is a portable CLI with 0 dependencies. That's why i like it against kustomize in this use case.&lt;/p&gt;

&lt;p&gt;Find full example in this &lt;a href="https://github.com/abdennour/example-helm-postrender-with-yq" rel="noopener noreferrer"&gt;github repo&lt;/a&gt; &lt;/p&gt;

</description>
      <category>documentation</category>
    </item>
    <item>
      <title>Reduce size of /var/log/journal</title>
      <dc:creator>abdennour</dc:creator>
      <pubDate>Tue, 17 May 2022 03:14:30 +0000</pubDate>
      <link>https://dev.to/abdennour/reduce-size-of-varlogjournal-16i0</link>
      <guid>https://dev.to/abdennour/reduce-size-of-varlogjournal-16i0</guid>
      <description>&lt;p&gt;&lt;code&gt;$ journalctl --disk-usage&lt;/code&gt;&lt;br&gt;
Journals take up 3.8G on disk.&lt;br&gt;
You can control the size of this directory using this parameter in your /etc/systemd/journald.conf:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;SystemMaxUse=50M&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;You can force a log rotation:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ sudo systemctl kill --kill-who=main --signal=SIGUSR2 systemd-journald.service&lt;br&gt;
&lt;/code&gt;NOTE: You might need to restart the logging service to force a log rotation, if the above signaling method does not do it. You can restart the service like so:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;sudo systemctl restart systemd-journald.service&lt;/code&gt;&lt;/p&gt;

</description>
      <category>linux</category>
      <category>journalctl</category>
    </item>
    <item>
      <title> Mount my Passport WD driver on MacOS Big Sur with NTFS read write</title>
      <dc:creator>abdennour</dc:creator>
      <pubDate>Sat, 24 Jul 2021 15:57:04 +0000</pubDate>
      <link>https://dev.to/abdennour/mount-my-passport-wd-driver-on-macos-big-sur-with-ntfs-read-write-pc4</link>
      <guid>https://dev.to/abdennour/mount-my-passport-wd-driver-on-macos-big-sur-with-ntfs-read-write-pc4</guid>
      <description>&lt;p&gt;After upgrading my MacOS to big sure, i realized that some features did not work intuitively as previously. This includes my HD driver (MPassport).&lt;br&gt;
Files are formatted with NTFS, and the Boss MacOS does not want to allow write. &lt;/p&gt;
&lt;h1&gt;
  
  
  Paid Solutions
&lt;/h1&gt;

&lt;p&gt;There is iBoysoft NTFS for Mac and others.&lt;br&gt;
But i solved the issue with simple script&lt;/p&gt;
&lt;h1&gt;
  
  
  Free Solution
&lt;/h1&gt;

&lt;p&gt;Plugin your HD drive, then check its volume name under /Volumes&lt;/p&gt;

&lt;p&gt;let's say your volume origin name (ls -l /Volumes) is MPassport.&lt;/p&gt;

&lt;p&gt;retrieve the disk name&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;disk_name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;diskutil list | &lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-i&lt;/span&gt; passport | &lt;span class="nb"&gt;awk&lt;/span&gt; &lt;span class="s1"&gt;'{print $6}'&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;then:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;origin_name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;MPassport
&lt;span class="nb"&gt;sudo &lt;/span&gt;umount /Volumes/&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;origin_name&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;
&lt;span class="nb"&gt;sudo mkdir&lt;/span&gt; /Volumes/&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;disk_name&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;mount &lt;span class="nt"&gt;-t&lt;/span&gt; ntfs &lt;span class="nt"&gt;-o&lt;/span&gt; rw,auto,nobrowse /dev/&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;disk_name&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt; /Volumes/&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;disk_name&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;
open /Volumes/&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;disk_name&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Happy read/write !&lt;/p&gt;

&lt;p&gt;More details &lt;a href="https://gist.github.com/CharlesThierry/7305166b208d6f6cdd37962761d5ac23"&gt;https://gist.github.com/CharlesThierry/7305166b208d6f6cdd37962761d5ac23&lt;/a&gt;&lt;/p&gt;

</description>
      <category>costeffective</category>
      <category>free</category>
      <category>ntfs</category>
      <category>macos</category>
    </item>
    <item>
      <title>Populate env vars from .env file with Shell</title>
      <dc:creator>abdennour</dc:creator>
      <pubDate>Sun, 18 Jul 2021 08:05:37 +0000</pubDate>
      <link>https://dev.to/abdennour/populate-env-vars-from-env-file-with-shell-2338</link>
      <guid>https://dev.to/abdennour/populate-env-vars-from-env-file-with-shell-2338</guid>
      <description>&lt;p&gt;This should work&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;export&lt;/span&gt; &lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;cat&lt;/span&gt; .env | xargs&lt;span class="si"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But not all time namely if it includes some comments and you are running it with sh (not bash)&lt;/p&gt;

&lt;p&gt;Then, mitigate this issue by using instead:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;export&lt;/span&gt; &lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;cat&lt;/span&gt; .env | &lt;span class="nb"&gt;sed&lt;/span&gt; &lt;span class="s1"&gt;'s@#.*@@'&lt;/span&gt;| &lt;span class="nb"&gt;tr&lt;/span&gt; &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s1"&gt;''&lt;/span&gt; | xargs&lt;span class="si"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>SSH over HTTP Proxy</title>
      <dc:creator>abdennour</dc:creator>
      <pubDate>Sun, 25 Apr 2021 16:37:40 +0000</pubDate>
      <link>https://dev.to/abdennour/ssh-over-http-proxy-41c2</link>
      <guid>https://dev.to/abdennour/ssh-over-http-proxy-41c2</guid>
      <description>&lt;h2&gt;
  
  
  story
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;nc -X connect&lt;/code&gt; is the popular way to communicate with SSH over proxy. However, it's broken when your client is MacOS.&lt;/p&gt;

&lt;h2&gt;
  
  
  solution
&lt;/h2&gt;

&lt;p&gt;Install corkscrew&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;brew &lt;span class="nb"&gt;install &lt;/span&gt;corkscrew
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;SSH now:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh &lt;span class="nt"&gt;-4&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-o&lt;/span&gt; &lt;span class="s2"&gt;"ProxyCommand corkscrew ip.http.proxy port-http-proxy %h %p"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  user@ip-machine-in-other-network
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;.i.e: in following example my HTTP_PROXY is &lt;code&gt;192.168.1.15:3128&lt;/code&gt;. And i want to login into &lt;code&gt;10.11.6.23&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh &lt;span class="nt"&gt;-4&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-o&lt;/span&gt; &lt;span class="s2"&gt;"ProxyCommand corkscrew 192.168.1.15 3128 %h %p"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  user@10.11.6.23
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note  : &lt;code&gt;-4&lt;/code&gt; is to force ipv4 over other options (ipv6)&lt;/p&gt;

</description>
      <category>squid</category>
      <category>httpproxy</category>
      <category>nowindows</category>
      <category>macos</category>
    </item>
  </channel>
</rss>
