<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>cli on Aldrin Jenson</title>
    <link>/tags/cli/</link>
    <description>Aldrin Jenson (cli)</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <lastBuildDate>Mon, 02 Sep 2024 12:00:00 -0400</lastBuildDate>
    
    <atom:link href="/tags/cli/index.xml" rel="self" type="application/rss+xml" />
    
    
    <item>
      <title>Clone any website locally with HTTrack</title>
      <link>/til/clone-any-website-to-local-using-httrack/</link>
      <pubDate>Mon, 02 Sep 2024 12:00:00 -0400</pubDate>
      
      <guid>/til/clone-any-website-to-local-using-httrack/</guid>
      <description>&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;brew install httrack
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;httrack &amp;lt;website_url&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Source: &lt;a href=&#34;https://hackzism.blogspot.com/2020/06/clone-websites-using-httrack.html&#34;&gt;https://hackzism.blogspot.com/2020/06/clone-websites-using-httrack.html&lt;/a&gt;&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Drag and drop files from the macOS terminal</title>
      <link>/til/adding-drag-drop-from-terminal-in-mac-os/</link>
      <pubDate>Wed, 20 Mar 2024 12:00:00 -0400</pubDate>
      
      <guid>/til/adding-drag-drop-from-terminal-in-mac-os/</guid>
      <description>&lt;p&gt;Use this cool tool:&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://github.com/Wevah/dragterm&#34;&gt;https://github.com/Wevah/dragterm&lt;/a&gt;&lt;/p&gt;
&lt;h3 id=&#34;steps-to-install&#34;&gt;Steps to install:&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;git clone the above repo&lt;/li&gt;
&lt;li&gt;cd dragterm&lt;/li&gt;
&lt;li&gt;&lt;code&gt;brew install cocoapods&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;g++ DTDraggingSourceView.m main.m -framework Cocoa -o drag&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Add the folder to PATH&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;code&gt;export PATH=&amp;quot;&amp;lt;your drag term folder path&amp;gt;:$PATH&amp;quot;&lt;/code&gt;&lt;/p&gt;
&lt;h3 id=&#34;usage&#34;&gt;Usage:&lt;/h3&gt;
&lt;p&gt;&lt;code&gt;drag &amp;lt;filename&amp;gt;&lt;/code&gt;&lt;/p&gt;
&lt;h3 id=&#34;bonus&#34;&gt;Bonus&lt;/h3&gt;
&lt;p&gt;If you are using &lt;code&gt;ranger&lt;/code&gt; or some other CLI based file manager, you can easily add support to dragging from terminal using &lt;code&gt;dragterm&lt;/code&gt; with a key-map as follows:&lt;/p&gt;
&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;map &amp;lt;C-d&amp;gt; shell drag %p
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Paste the above to &lt;code&gt;.config/ranger/rc.conf&lt;/code&gt; to map ctrl+d to drag a file from ranger&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Compressing images from the CLI</title>
      <link>/til/compressing-images-from-the-cli/</link>
      <pubDate>Fri, 01 Mar 2024 12:00:00 -0400</pubDate>
      
      <guid>/til/compressing-images-from-the-cli/</guid>
      <description>&lt;h3 id=&#34;steps&#34;&gt;Steps&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Move all your image files to a folder&lt;/li&gt;
&lt;li&gt;calculate it&amp;rsquo;s folder size using &lt;code&gt;du&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;create a copy of the folder.&lt;/li&gt;
&lt;li&gt;install imagemagick&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;code&gt;brew install imagemagick&lt;/code&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;in this folder, perform the following actions:&lt;/li&gt;
&lt;/ul&gt;
&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;mkdir compressed
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;for&lt;/span&gt; i in *; &lt;span style=&#34;color:#66d9ef&#34;&gt;do&lt;/span&gt; convert $i -resize 40% compressed/$i; &lt;span style=&#34;color:#66d9ef&#34;&gt;done&lt;/span&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The above will compress all images by making the size 40% of the initial size and will move it to a folder called &lt;code&gt;compressed&lt;/code&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Check folder structure again using &lt;code&gt;du&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;if it&amp;rsquo;s still too much, repeat again but this time reduce quality to even lower&lt;/li&gt;
&lt;/ul&gt;
</description>
    </item>
    
  </channel>
</rss>
