<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Windows on Techformist</title>
    <link>https://techformist.com/tags/windows/</link>
    <description>Recent content in Windows on Techformist</description>
    <image>
      <url>https://techformist.com/logo.svg</url>
      <link>https://techformist.com/logo.svg</link>
    </image>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <lastBuildDate>Fri, 29 May 2020 06:30:00 +0000</lastBuildDate><atom:link href="https://techformist.com/tags/windows/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Setup Development Workspace in WSL2</title>
      <link>https://techformist.com/setup-dev-workspace-wsl2/</link>
      <pubDate>Fri, 29 May 2020 06:30:00 +0000</pubDate>
      
      <guid>https://techformist.com/setup-dev-workspace-wsl2/</guid>
      <description>&lt;p&gt;WSL2 was released yesterday along with Windows10 May 2020 update (v2004). WSL2 enables to work with Linux kernels within Windows, and it brings some crazy possibilities for those of us who refuse to dual boot or switch over completely to Linux.&lt;/p&gt;
&lt;p&gt;I am assuming that you already have installed Windows v2004 through the normal Windows update channel, or through the &lt;a href=&#34;https://support.microsoft.com/en-us/help/3159635/windows-10-update-assistant&#34;&gt;update assistant&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Once you are on Windows10 2004, here&amp;rsquo;s how you can setup a cool WSL2 development environment.&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>WSL2 was released yesterday along with Windows10 May 2020 update (v2004). WSL2 enables to work with Linux kernels within Windows, and it brings some crazy possibilities for those of us who refuse to dual boot or switch over completely to Linux.</p>
<p>I am assuming that you already have installed Windows v2004 through the normal Windows update channel, or through the <a href="https://support.microsoft.com/en-us/help/3159635/windows-10-update-assistant">update assistant</a>.</p>
<p>Once you are on Windows10 2004, here&rsquo;s how you can setup a cool WSL2 development environment.</p>
<h2 id="installation">Installation</h2>
<h3 id="wsl2">WSL2</h3>
<p>If you don&rsquo;t have WSL yet, install it from <code>Start</code> &gt; <code>Turn Windows Features On or Off</code>. Check <code>Windows Subsystem for Linux</code>. This should install WSL2. If you had WSL1 in previous Windows versions, the option will remain checked and you don&rsquo;t have to do anything else.</p>
<p><img loading="lazy" src="/2020/wsl-features-windows.jpg" type="" alt="wsl-features-windows"  /></p>
<p>Install <a href="https://www.microsoft.com/en-us/search?q=debian">Debian</a> or Ubuntu from Microsoft Store.</p>
<p>If Debian/Ubuntu/other flavours were already installed on your computer (in WSL1), you would have to upgrade the kernel. Do that by following instructions on this <a href="https://docs.microsoft.com/en-us/windows/wsl/wsl2-kernel">page</a>. Future upgrades may not need this manual step.</p>
<p>Verify whether you are running the right version of the kernel -</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-cmd" data-lang="cmd"><span class="line"><span class="cl">wsl -l -v
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">  NAME      STATE           VERSION
</span></span><span class="line"><span class="cl">* Debian    Running         2
</span></span></code></pre></div><p>Version 1 will imply that you are still running WSL1, else you should be all set with WSL2.</p>
<h3 id="terminal">Terminal</h3>
<p><a href="https://www.microsoft.com/en-us/p/windows-terminal/9n0dx20hk701?rtc=1">Install Windows Terminal</a> from Microsoft Store if you don&rsquo;t already have it. While this is optional, the app makes for a delightful terminal experience.</p>
<p>Of course, you can always continue to use <a href="https://cmder.net/">Cmder</a>, or any other emulator.</p>
<p>Once Terminal is installed, open Terminal &gt; Click on the dropdown in Toolbar &gt; Open <code>Settings</code>. You add instructions to open command prompt, Powershell or WSL in the settings file. You can also change themes, colors or fonts for Terminal window.</p>
<p>Add an entry for Debian under <code>Profiles</code>-</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="p">{</span>
</span></span><span class="line"><span class="cl">    <span class="nt">&#34;acrylicOpacity&#34;</span><span class="p">:</span> <span class="mf">0.5</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">    <span class="nt">&#34;closeOnExit&#34;</span><span class="p">:</span> <span class="kc">true</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">    <span class="nt">&#34;colorScheme&#34;</span><span class="p">:</span> <span class="s2">&#34;One Quarter Dark&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">    <span class="nt">&#34;commandline&#34;</span><span class="p">:</span> <span class="s2">&#34;wsl.exe -d Debian&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">    <span class="nt">&#34;cursorColor&#34;</span><span class="p">:</span> <span class="s2">&#34;#FFFFFF&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">    <span class="nt">&#34;cursorShape&#34;</span><span class="p">:</span> <span class="s2">&#34;bar&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">    <span class="nt">&#34;fontFace&#34;</span><span class="p">:</span> <span class="s2">&#34;Consolas&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">    <span class="nt">&#34;fontSize&#34;</span><span class="p">:</span> <span class="mi">16</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">    <span class="nt">&#34;guid&#34;</span><span class="p">:</span> <span class="s2">&#34;{58ad8b0c-3ef8-5f4d-bc6f-13e4c00f2530}&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">    <span class="nt">&#34;historySize&#34;</span><span class="p">:</span> <span class="mi">9001</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">    <span class="nt">&#34;icon&#34;</span><span class="p">:</span> <span class="s2">&#34;ms-appx:///ProfileIcons/{9acb9455-ca41-5af7-950f-6bca1bc9722f}.png&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">    <span class="nt">&#34;name&#34;</span><span class="p">:</span> <span class="s2">&#34;Debian&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">    <span class="nt">&#34;padding&#34;</span><span class="p">:</span> <span class="s2">&#34;0, 0, 0, 0&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">    <span class="nt">&#34;snapOnInput&#34;</span><span class="p">:</span> <span class="kc">true</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">    <span class="nt">&#34;useAcrylic&#34;</span><span class="p">:</span> <span class="kc">false</span>
</span></span><span class="line"><span class="cl"><span class="p">}</span><span class="err">,</span>
</span></span></code></pre></div><p>Note the change in <code>colorScheme</code> - you may use any color scheme that is already part of the settings.</p>
<p>The settings file I use is at <a href="https://gist.githubusercontent.com/prashanth1k/576c1c309c9aad7a8907d06137d219e9/raw/86331481c1d331a06c18c1d98d36c1a143709e44/terminal-settings.json">this Gist</a>.</p>
<p>You are now all set to access WSL2 from your terminal. Just click on the dropdown and select <code>Debian</code> profile to open WSL2.</p>
<h2 id="initial-setup">Initial Setup</h2>
<p>I love to work with <a href="https://fishshell.com/">Fish shell</a> since it has beautiful defaults that includes useful functions like auto complete, and an easy-to-use customiser (among others).</p>
<p>Install Fish.</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-cmd" data-lang="cmd"><span class="line"><span class="cl"><span class="k">echo</span> &#39;deb http://download.opensuse.org/repositories/shells:/fish:/release:/3/Debian_10/ /&#39; <span class="p">|</span> sudo tee /etc/apt/sources.list.d/shells:fish:release:3.list
</span></span><span class="line"><span class="cl">sudo wget -nv https://download.opensuse.org/repositories/shells:fish:release:3/Debian_10/Release.key -O <span class="s2">&#34;/etc/apt/trusted.gpg.d/shells:fish:release:3.asc&#34;</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">apt-get update
</span></span><span class="line"><span class="cl">apt-get install fish
</span></span></code></pre></div><p>See <a href="https://software.opensuse.org/download.html?project=shells%3Afish%3Arelease%3A3&amp;package=fish">this page for more detailed instructions</a>.</p>
<h3 id="optional-change-root-password">Optional: Change root password</h3>
<p>If you have setup a non-root user (which you normally do during install) and already logged in as that user, or did not setup root password yet, you an do that now.</p>
<p>First, login to Windows command prompt and set default WSL user.</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-cmd" data-lang="cmd"><span class="line"><span class="cl">debian config --default-user root
</span></span></code></pre></div><p>.. or in case of Ubuntu..</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-cmd" data-lang="cmd"><span class="line"><span class="cl">ubuntu.exe config --default-user root
</span></span></code></pre></div><p>Open a new terminal to login as root. Change password.</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-cmd" data-lang="cmd"><span class="line"><span class="cl">passwd
</span></span></code></pre></div><p>Reset default user to your user id.</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-cmd" data-lang="cmd"><span class="line"><span class="cl">debian config --default-user <span class="p">&lt;</span>your_userid&gt;
</span></span></code></pre></div><p>Exit from current terminal that is logged in as root and open a new window to just be yourself.</p>
<h3 id="configure-fish-shell">Configure fish shell</h3>
<p>Change default shell to fish.</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-cmd" data-lang="cmd"><span class="line"><span class="cl">chsh -s `which fish`
</span></span></code></pre></div><p>Install <a href="https://github.com/oh-my-fish/oh-my-fish">oh my fish</a> to make your shell beautiful.</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-cmd" data-lang="cmd"><span class="line"><span class="cl">curl -L https://get.oh-my.fish <span class="p">|</span> fish
</span></span></code></pre></div><p>Now you can install themes or add new functions to fish.</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">omf list <span class="c1"># list themes &amp; plugins installed</span>
</span></span><span class="line"><span class="cl">omf theme <span class="c1"># list themes</span>
</span></span><span class="line"><span class="cl">omf install clearance <span class="c1"># install clearance theme</span>
</span></span><span class="line"><span class="cl">omf theme default <span class="c1"># change back to default theme</span>
</span></span></code></pre></div><p><img loading="lazy" src="/2020/windows-terminal-wsl2.jpg" type="" alt="windows-terminal-wsl2"  /></p>
<h2 id="setup-your-favourite-programs">Setup Your Favourite Programs</h2>
<h3 id="nvm--node">NVM / Node</h3>
<p>We will not install Node directly, but use NVM.</p>
<p>First install NVM..</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-cmd" data-lang="cmd"><span class="line"><span class="cl">curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh <span class="p">|</span> bash
</span></span></code></pre></div><p>You have to do an additional step for Fish shell since it not directly supported.</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-cmd" data-lang="cmd"><span class="line"><span class="cl">omf install bass
</span></span><span class="line"><span class="cl">vi ~/.config/fish/functions/nvm.fish
</span></span></code></pre></div><p>Add the following content to file -</p>
<pre tabindex="0"><code>function nvm
    bass source ~/.nvm/nvm.sh --no-use &#39;;&#39; nvm $argv
end
</code></pre><p>Finally, install node.</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-cmd" data-lang="cmd"><span class="line"><span class="cl">nvm install 14.3
</span></span></code></pre></div><p>Set default node version in nvm to always use the latest version.</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-cmd" data-lang="cmd"><span class="line"><span class="cl">nvm alias default node
</span></span></code></pre></div><p>Node is now ready to do great things!</p>
<h3 id="vs-code">VS Code</h3>
<p>Install <a href="https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-wsl">Remote WSL extension</a>.</p>
<p>Hit <code>Ctrl + Shift + p</code> &gt; enter <code>New Window using Distro</code>. Select the Linux distro that you are setting up.</p>
<p>VSCode will automatically download and configure server to work within the distro, and open a new window specific to the distro.</p>
<p>You can now use VSCode to work with files within the Linux folders. You will see the default Fish shell when you open a new terminal within VSCode.</p>
<h3 id="docker">Docker</h3>
<p>Docker runs 8-10x faster in WSL2 - there is simply no reason to postpone using Docker in Windows anymore :)</p>
<p>Install <a href="https://www.docker.com/products/docker-desktop">Docker for Desktop</a>.</p>
<p>New installations do not require any additional steps. If you had an older version, <a href="https://docs.docker.com/docker-for-windows/wsl/">follow instructions here</a> to set everything up.</p>
<h2 id="code-away">Code Away</h2>
<p>Start working your magic in Linux in Windows!</p>
]]></content:encoded>
    </item>
    
    <item>
      <title>Install Scoop for Command-line Nirvana</title>
      <link>https://techformist.com/2019/05/06/install-scoop-for-command-line-nirvana/</link>
      <pubDate>Mon, 06 May 2019 10:04:00 +0000</pubDate>
      
      <guid>https://techformist.com/2019/05/06/install-scoop-for-command-line-nirvana/</guid>
      <description>&lt;p&gt;Command line in Windows.&lt;/p&gt;
&lt;p&gt;You love it when there are Powershell, Cmder and friends. And, you hate it when you cannot install simple programs quickly.&lt;/p&gt;
&lt;p&gt;Well, hate may be a strong word - but you get the gist.&lt;/p&gt;
&lt;p&gt;I have tried chocolatey and have a like-dislike relationship with that program. I have also experimented with VMs and anything that exposes more of the command line. None of the programs stuck in my day-to-day flow. For a few projects, I dedicatedly use WSL - but could not quite switch over everywhere.&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>Command line in Windows.</p>
<p>You love it when there are Powershell, Cmder and friends. And, you hate it when you cannot install simple programs quickly.</p>
<p>Well, hate may be a strong word - but you get the gist.</p>
<p>I have tried chocolatey and have a like-dislike relationship with that program. I have also experimented with VMs and anything that exposes more of the command line. None of the programs stuck in my day-to-day flow. For a few projects, I dedicatedly use WSL - but could not quite switch over everywhere.</p>
<p>In the meantime, I now use <a href="https://github.com/lukesampson/scoop">Scoop</a>. Scoop is different.</p>
<ul>
<li>Install Scoop</li>
<li>Install developer apps/configurations (e.g. curl)</li>
<li>Use apps</li>
</ul>
<p>I faced installation issues to begin with - but none that could stand the test of a good Google search.</p>
<p>Here&rsquo;s what you do -</p>
<ol>
<li>
<p>Open Powershell in Windows 10. Execute the following command to bypass the execution policy for the session.</p>
<p>Set-ExecutionPolicy Bypass -Scope Process</p>
</li>
<li>
<p>Set directory for Scoop and install it.</p>
</li>
</ol>
<pre tabindex="0"><code>   $env:SCOOP=&#39;e:\scoop&#39;
       [environment]::setEnvironmentVariable(&#39;SCOOP&#39;,$env:SCOOP,&#39;User&#39;)
   iex (new-object net.webclient).downloadstring(&#39;https://get.scoop.sh&#39;)
</code></pre><ol start="3">
<li>Install apps using <code>scoop install curl</code> or install apps globally. You can set directory for global apps using Powershell admin</li>
</ol>
<pre tabindex="0"><code>   $env:SCOOP_GLOBAL=&#39;c:\apps&#39;
       [environment]::setEnvironmentVariable(&#39;SCOOP_GLOBAL&#39;,$env:SCOOP_GLOBAL,&#39;Machine&#39;)
   scoop install -g curl
</code></pre><p>Now, just hit commands in Powershell to install local/global apps.</p>
]]></content:encoded>
    </item>
    
    <item>
      <title>Can a clipboard editor save the day?</title>
      <link>https://techformist.com/ditto-clipboard-editor/</link>
      <pubDate>Tue, 30 Apr 2019 06:30:00 +0000</pubDate>
      
      <guid>https://techformist.com/ditto-clipboard-editor/</guid>
      <description>&lt;p&gt;A clipboard editor of all the things? How can it be useful in this day and age?&lt;/p&gt;
&lt;p&gt;I have tried to automate some of the most common things that I do on a regular basis. There are a bunch of tools that I use to do just that - these save keystrokes (AutoHotkey), automate regular tasks (e.g. take a screenshot, optimize size and upload to imgur), or connect my one useless social media account to the other (IFTTT).&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>A clipboard editor of all the things? How can it be useful in this day and age?</p>
<p>I have tried to automate some of the most common things that I do on a regular basis. There are a bunch of tools that I use to do just that - these save keystrokes (AutoHotkey), automate regular tasks (e.g. take a screenshot, optimize size and upload to imgur), or connect my one useless social media account to the other (IFTTT).</p>
<ul>
<li><a href="https://www.autohotkey.com/">AutoHotkey</a></li>
<li><a href="https://ifttt.com/">IFTTT</a></li>
<li><a href="https://getsharex.com/">ShareX</a></li>
</ul>
<p>But for all my life, I could never think that I would need a clipboard editor. Sure, an editor can provide powerful functions to remember the last one million strings I had copied, but what&rsquo;s the point?</p>
<p>I will just copy the thing again if at all I lose it. How can I lose something that I copied a second ago anyway?</p>
<p>Without answering all those smart questions, I installed me-self <a href="https://ditto-cp.sourceforge.io/">Ditto</a>. Ditto promises to hold the text or image content you copied a while back. That&rsquo;s all there is to it - no more.</p>
<p>And, it turned out that&rsquo;s what was missing in my life.</p>
<p>Searching for and re-copying content that I had copied 25 seconds back can shave whole minutes in your super productive day.</p>
<p><img loading="lazy" src="/misc/ditto-clipboard.jpg" type="" alt=""  /></p>
<p>I can now -</p>
<ul>
<li>Press <code>Ctrl + Shift + `</code> to access clipboard</li>
<li>Do a <code>Ctrl + 1</code> to <code>Ctrl + 0</code> to quickly recopy the last 10 strings / images</li>
<li>Start typing in after pressing the shortcut key to quickly filter whatever stuff you had copied to clipboard</li>
<li>Hit enter or click to copy the content again</li>
</ul>
<p>Ditto also has this feature to sync between computers over network (which I don&rsquo;t use). Since the application maintains your clipboard entries in a SQLite DB, you can also put the DB on a shared drive if you want to live dangerously in your LAN.</p>
<p>Ditto is free and open source (GPLv3 if you care for such a thing), very light on resources, and very very quick to use. Try it by all means, but be warned - you will get addicted.</p>
<p><a href="https://ditto-cp.sourceforge.io/">Download Ditto</a>.</p>
]]></content:encoded>
    </item>
    
    <item>
      <title>Spin up your own local GraphQL server within 15 min</title>
      <link>https://techformist.com/spin-up-your-own-local-graphql-server-within-15-min/</link>
      <pubDate>Thu, 21 Feb 2019 15:30:00 +0000</pubDate>
      
      <guid>https://techformist.com/spin-up-your-own-local-graphql-server-within-15-min/</guid>
      <description>&lt;p&gt;Create your own GraphQL APIs in 15 min flat using Postgres database and a bit of help from PostGraphile. No GraphQL server configuration needed.&lt;/p&gt;
&lt;p&gt;No frontend beginner developer ever said - &amp;ldquo;I want to play around with servers to understand their internals byheart before I venture forth with my beautiful Vue application&amp;rdquo;.&lt;/p&gt;
&lt;p&gt;If you are building on REST APIs, you have public services like &lt;a href=&#34;https://jsonplaceholder.typicode.com/&#34;&gt;JSONPlaceholder&lt;/a&gt;. These services provide quick access to much loved sample APIs for to-do, posts, users etc.&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>Create your own GraphQL APIs in 15 min flat using Postgres database and a bit of help from PostGraphile. No GraphQL server configuration needed.</p>
<p>No frontend beginner developer ever said - &ldquo;I want to play around with servers to understand their internals byheart before I venture forth with my beautiful Vue application&rdquo;.</p>
<p>If you are building on REST APIs, you have public services like <a href="https://jsonplaceholder.typicode.com/">JSONPlaceholder</a>. These services provide quick access to much loved sample APIs for to-do, posts, users etc.</p>
<p>There are not a lot of choices if you are building on GraphQL. There have been efforts towards providing such an API in the past but none last long. The solution - create them locally.</p>
<p>Local GraphQL can be cumbersome.</p>
<p>When you start, one may be left wondering on Express + GraphQL + a bit of configuration + write more than few lines of code to get started to serve any new API. There are tools like <a href="https://github.com/marmelab/json-graphql-server">json-graphql-server</a> that claim to speed up this process. However, they are not kept up to date, and seemingly are not meant for Windows(?).</p>
<p>So, I did the next logical thing that was easy and quick. Create an environment of your own using <a href="https://www.postgresql.org/">PostgreSQL</a> and <a href="https://www.graphile.org/postgraphile/">PostGraphile</a>.</p>
<h3 id="initial-setup">Initial Setup</h3>
<ol>
<li>
<p><a href="https://www.postgresql.org/download/">Download and install PostgreSQL</a>.<br>
Alternatively use <a href="https://laragon.org/download/">Laragon with Postgres</a> - it is a really good control centre for local development.</p>
</li>
<li>
<p>Open pgAdmin - the DB admin application for Postgres. Use an existing database or create a new one. Right click on Schema &gt; Tables and click on &lsquo;New Table&rsquo;. I will assume that you will use a database called &rsquo;test&rsquo;. Create a table called &rsquo;todo&rsquo;.
<img loading="lazy" src="/misc/postgres-create-table.png" type="" alt=""  /></p>
</li>
<li>
<p>Create few columns
<img loading="lazy" src="/misc/pgadmin-create-table-columns.png" type="" alt=""  /></p>
</li>
<li>
<p>Start your very own GraphQL server. The server uses port 5000 by default, but we will change it to 5050 for the heck of it (also because 5000 is used by a few other front-end apps)</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-cmd" data-lang="cmd"><span class="line"><span class="cl">npx postgraphile -c test --watch -p 5050
</span></span></code></pre></div><p><img loading="lazy" src="/misc/postgraphile-server-start.png" type="" alt=""  /></p>
</li>
</ol>
<h3 id="start-playing-around">Start playing around</h3>
<p>Go to [http://localhost:5050/graphiql]. Copy/paste the GraphQL statements to perform different operations.</p>
<h5 id="query-data">Query data</h5>
<p>Query for data. Of course you will not find anything at this time.</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-graphql" data-lang="graphql"><span class="line"><span class="cl"><span class="p">{</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">  </span><span class="py">allTodos</span><span class="w"> </span><span class="p">{</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="py">nodes</span><span class="w"> </span><span class="p">{</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">      </span><span class="py">id</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">      </span><span class="py">title</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">      </span><span class="py">done</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="p">}</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">  </span><span class="p">}</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="p">}</span><span class="w">
</span></span></span></code></pre></div><p>The output will be -</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-graphql" data-lang="graphql"><span class="line"><span class="cl"><span class="p">{</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">  </span><span class="s">&#34;data&#34;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="s">&#34;allTodos&#34;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">      </span><span class="s">&#34;nodes&#34;</span><span class="p">:</span><span class="w"> </span><span class="p">[]</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="p">}</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">  </span><span class="p">}</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="p">}</span><span class="w">
</span></span></span></code></pre></div><p><img loading="lazy" src="/misc/graphiql-graphql-server-simple.png" type="" alt=""  /></p>
<h5 id="insert-data">Insert data</h5>
<p>Insert &rsquo;to-do&rsquo; data in your database.</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-graphql" data-lang="graphql"><span class="line"><span class="cl"><span class="kd">mutation</span><span class="w"> </span><span class="p">{</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">  </span><span class="nc">createTodo</span><span class="p">(</span><span class="kd">input</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="nc">todo</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="nc">title</span><span class="p">:</span><span class="w"> </span><span class="s">&#34;Create GraphQL server&#34;</span><span class="p">,</span><span class="w"> </span><span class="nc">done</span><span class="p">:</span><span class="w"> </span><span class="nc">true</span><span class="w"> </span><span class="p">}</span><span class="w"> </span><span class="p">})</span><span class="w"> </span><span class="p">{</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="nc">todo</span><span class="w"> </span><span class="p">{</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">      </span><span class="py">id</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">      </span><span class="py">title</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">      </span><span class="py">done</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="p">}</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">  </span><span class="p">}</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="p">}</span><span class="w">
</span></span></span></code></pre></div><p>This statement will create a single to-do, query back <code>id</code>, <code>title</code>, &amp; <code>done</code> fields, and display them at the right hand side of the screen.</p>
<p><img loading="lazy" src="/misc/graphiql-graphql-mutation.png" type="" alt=""  /></p>
<p>Output -</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-graphql" data-lang="graphql"><span class="line"><span class="cl"><span class="p">{</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">  </span><span class="s">&#34;data&#34;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="s">&#34;createTodo&#34;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">      </span><span class="s">&#34;todo&#34;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">        </span><span class="s">&#34;id&#34;</span><span class="p">:</span><span class="w"> </span><span class="nc">10</span><span class="p">,</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">        </span><span class="s">&#34;title&#34;</span><span class="p">:</span><span class="w"> </span><span class="s">&#34;Create GraphQL server&#34;</span><span class="p">,</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">        </span><span class="s">&#34;done&#34;</span><span class="p">:</span><span class="w"> </span><span class="nc">true</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">      </span><span class="p">}</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="p">}</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">  </span><span class="p">}</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="p">}</span><span class="w">
</span></span></span></code></pre></div><p>You can repeat the <code>query</code> operation and find that it can display data too!</p>
<h3 id="configure-additional-apis">Configure additional APIs</h3>
<p>By now you have a full-fledged server that is serving to-dos. You can add filters, do magic on inserts/updates using functions, and eventually find that the world is the limit.</p>
<p>But, what about additional APIs? Similar to to-dos, you can start creating entities and find them available to your GraphQL without any additional effort. That is the magic of PostGraphile.</p>
<h3 id="why-use-this-setup-for-local-graphql-environment">Why use this setup for local GraphQL environment?</h3>
<ul>
<li>Quicker setup. Type in a few commands + configure DB table - and you are done</li>
<li>Minimal effort to setup new APIs - you are not limited to standard APIs but can go all wild</li>
<li>You can take this to your production environment too. I have used Postgraphile for projects and it rocks!</li>
<li>PostGraphile uses your friendly, neighbourhood Javascript. So we are right at home</li>
</ul>
<h3 id="comments">Comments..?</h3>
<p>What do you say about this folks? Super..? Stupid? Somewhere in between?
Or, simply &ldquo;what am I doing on this planet when people like this exist&rdquo;..?</p>
]]></content:encoded>
    </item>
    
    <item>
      <title>Optimize Images for Web</title>
      <link>https://techformist.com/optimize-images-for-web/</link>
      <pubDate>Mon, 18 Feb 2019 15:30:00 +0000</pubDate>
      
      <guid>https://techformist.com/optimize-images-for-web/</guid>
      <description>&lt;p&gt;I had been a big user of SmushIt! Wordpress plugin in its heyday. After slowing down my sites too often, I switched to offline solutions.&lt;/p&gt;
&lt;p&gt;None of the tools I used have been as easy to use as &lt;a href=&#34;https://nikkhokkho.sourceforge.io/static.php?page=FileOptimizer&#34;&gt;FileOptimizer&lt;/a&gt;. Also: find this handy &lt;a href=&#34;https://sourceforge.net/projects/nikkhokkho/files/FileOptimizer/&#34;&gt;download link&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img loading=&#34;lazy&#34; src=&#34;https://techformist.com/misc/file-optimizer-image-optimization-for-web-windows.jpg&#34; type=&#34;&#34; alt=&#34;&#34;  /&gt;&lt;/p&gt;
&lt;p&gt;FileOptimizer is a free, open-source tool to optimize files. It is in fact a wrapper for a bunch of open source tools that work great individually, but absolutely rock as a collection.&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>I had been a big user of SmushIt! Wordpress plugin in its heyday. After slowing down my sites too often, I switched to offline solutions.</p>
<p>None of the tools I used have been as easy to use as <a href="https://nikkhokkho.sourceforge.io/static.php?page=FileOptimizer">FileOptimizer</a>. Also: find this handy <a href="https://sourceforge.net/projects/nikkhokkho/files/FileOptimizer/">download link</a>.</p>
<p><img loading="lazy" src="/misc/file-optimizer-image-optimization-for-web-windows.jpg" type="" alt=""  /></p>
<p>FileOptimizer is a free, open-source tool to optimize files. It is in fact a wrapper for a bunch of open source tools that work great individually, but absolutely rock as a collection.</p>
<p>While FileOptimizer site does not look all shiny, I can vouch for it after about ~5 years of usage (as if that matters - go figure).</p>
<p>I primarily use it for JPG and PNG images that are intended for consumption over web. It can do lossy compression of image files individually or in batch.</p>
<p>Ordinarily, I combine FileOptimizer with <a href="https://getsharex.com/">ShareX</a> - a great, under-appreciated screenshot taking tool. Configure ShareX to allow editing of images after taking a screenshot and later, run FileOptimizer to compress edited images.</p>
<p>Now, just using the default shortcut keys I can take screenshot, manipulate image, and optimize it in one go.</p>
]]></content:encoded>
    </item>
    
    <item>
      <title>The Right WSL Setup for using Node</title>
      <link>https://techformist.com/the-right-wsl-setup-for-using-node/</link>
      <pubDate>Sat, 29 Dec 2018 16:31:00 +0000</pubDate>
      
      <guid>https://techformist.com/the-right-wsl-setup-for-using-node/</guid>
      <description>&lt;p&gt;A few node packages have been causing me pain lately. Who knew that my Windows 10 addiction can get me into trouble with node?&lt;/p&gt;
&lt;p&gt;There are, of course, multiple ways to solve the node problem on Windows.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Do not use the offending package :).
If there is no support for Windows, your great program does not get written using the specific package. Hell, yeah.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Use NVM to juggle between node versions and check whether the problem goes away.
I did something similar when using strapi-js. I could not get it to work on Node 10 or 11.&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>A few node packages have been causing me pain lately. Who knew that my Windows 10 addiction can get me into trouble with node?</p>
<p>There are, of course, multiple ways to solve the node problem on Windows.</p>
<ol>
<li>
<p>Do not use the offending package :).
If there is no support for Windows, your great program does not get written using the specific package. Hell, yeah.</p>
</li>
<li>
<p>Use NVM to juggle between node versions and check whether the problem goes away.
I did something similar when using strapi-js. I could not get it to work on Node 10 or 11.</p>
</li>
<li>
<p>Try using Git Bash or something similar.</p>
</li>
<li>
<p>Or, hop on to the train to Linux - Windows Subsystem for Linux to be specific</p>
</li>
</ol>
<p>I live life on the edge - so, Linux.</p>
<h2 id="enable-wsl--install-linux-within-windows">Enable WSL &amp; Install Linux within Windows</h2>
<p>First, go ahead and enable WSL.</p>
<ol>
<li>Go to Control Panel\Programs\Programs and Features</li>
<li>Select &ldquo;Turn Windows features on or off&rdquo; on the left navigation link</li>
<li>Check &ldquo;Windows Subsystem for Linux&rdquo; to install</li>
</ol>
<p>Next, you have to choose a Linux distribution to install. You can do that quite easily by going to Start Menu &gt; Microsoft Store &gt; Search for &ldquo;Linux&rdquo;.</p>
<p>Select a Linux distribution and click &lsquo;Get&rsquo; to install.</p>
<p>Alas, it was not that simple for me. Windows Store was stuck in a loop and refused to install any app. Multiple rounds of reset, clearing cache etc did not help. Therefore I did the next best thing - left that problem for another day, and followed an alternative.</p>
<ol>
<li>Download the Debian distribution for WSL from <a href="https://docs.microsoft.com/en-us/windows/wsl/install-manual">Microsoft Site</a>.</li>
<li>Click on the file to run the Debian installation. Provide a user id/password for Linux when prompted</li>
</ol>
<h2 id="configure-linux-in-windows">Configure Linux in Windows</h2>
<p>Once the Linux installation is complete, it is time to configure the app.</p>
<h3 id="the-shell">The Shell</h3>
<p>Click on Start &gt; Debian GNU/Linux to start the Debian shell. You can use the default command shell by playing around with the command prompt options.</p>
<p><img loading="lazy" src="/misc/console-bash-wsl.jpg" type="" alt="console-bash-wsl.jpg"  /></p>
<p>Alternatively, use the following line to start bash in <a href="http://cmder.net/">Cmder</a> (or in your favorite emulator).</p>
<pre tabindex="0"><code>%windir%\system32\bash.exe ~ -cur_console:p
</code></pre><p><img loading="lazy" src="/misc/cmder-wsl-debian.jpg" type="" alt="cmder-wsl-debian.jpg"  /></p>
<h3 id="update-packages">Update Packages</h3>
<p>In the bash prompt, update package versions.</p>
<pre tabindex="0"><code>sudo apt update
</code></pre><p>You will have a problem in using wget and other such utilities with https protocol. An example of error below.</p>
<pre tabindex="0"><code>ERROR: The certificate of ‘curl.haxx.se’ is not trusted.
</code></pre><p>Run the below command to install trusted certificate providers.</p>
<pre tabindex="0"><code>sudo apt-get install ca-certificates
</code></pre><h3 id="install-curl">Install curl</h3>
<p>You can find the latest version of curl by going to [https://curl.haxx.se/download/] and use wget to get latest version and build locally. I am lazy and used apt to get an older version.</p>
<pre tabindex="0"><code>sudo apt install curl
</code></pre><h3 id="install-node">Install node</h3>
<p>Get latest node.</p>
<pre tabindex="0"><code>curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
</code></pre><p>And, install node.</p>
<pre tabindex="0"><code>sudo apt install nodejs
</code></pre><h3 id="finis">Finis</h3>
<p>Code away to Javascript glory.</p>
]]></content:encoded>
    </item>
    
    <item>
      <title>Test SMTP from Windows Command Line</title>
      <link>https://techformist.com/test-smtp-from-windows-command-line/</link>
      <pubDate>Fri, 09 Nov 2018 05:20:00 +0000</pubDate>
      
      <guid>https://techformist.com/test-smtp-from-windows-command-line/</guid>
      <description>&lt;p&gt;The first thing you want to do when you setup SMTP server is to test it. (yep, I consider myself smart).&lt;/p&gt;
&lt;p&gt;When the SMTP server setup was &amp;lsquo;once in a blue moon&amp;rsquo; process, I could afford to just set up the client through the local Outlook or any other mail client, through Gmail and such.&lt;/p&gt;
&lt;p&gt;The task became a chore if you had to setup SMTP on all new applications, and had to be repeated twice every month. The fact that not all SMTP servers are the same and cannot be tamed by me in one go - just adds to the fun.&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>The first thing you want to do when you setup SMTP server is to test it. (yep, I consider myself smart).</p>
<p>When the SMTP server setup was &lsquo;once in a blue moon&rsquo; process, I could afford to just set up the client through the local Outlook or any other mail client, through Gmail and such.</p>
<p>The task became a chore if you had to setup SMTP on all new applications, and had to be repeated twice every month. The fact that not all SMTP servers are the same and cannot be tamed by me in one go - just adds to the fun.</p>
<p>Instead of writing my own program for the initial testing, I just use the below Powershell script in Windows 10.</p>
<pre tabindex="0"><code>$EmailFrom = &#34;noreply@newdomain.com&#34;
$EmailTo = &#34;toemail@mail.com&#34;
$Subject = &#34;hello&#34;
$Body = &#34;Just saying hello to the world.&#34;
$SMTPServer = &#34;newdomain.com&#34;
$SMTPClient = New-Object Net.Mail.SmtpClient($SmtpServer, 25)
$SMTPClient.EnableSsl = $false
$SMTPClient.Credentials = New-Object System.Net.NetworkCredential(&#34;noreply@newdomain.com&#34;, &#34;!uncrackablepass!&#34;);
$SMTPClient.Send($EmailFrom, $EmailTo, $Subject, $Body)
</code></pre><p>Create a script file and run that for max effect. Or, simply copy /paste the code in the Powershell prompt to test your SMTP server.</p>
<p>Hope you did read that this was applicable to Powershell? It does not work in CMD or the &rsquo;normal&rsquo; command prompt in Windows.</p>
]]></content:encoded>
    </item>
    
    <item>
      <title>Fish - Super Shell for Windows</title>
      <link>https://techformist.com/fish-super-shell-for-windows/</link>
      <pubDate>Mon, 05 Nov 2018 03:57:00 +0000</pubDate>
      
      <guid>https://techformist.com/fish-super-shell-for-windows/</guid>
      <description>&lt;p&gt;I have been a Powershell user since it was released in Windows 10. But, I had been switching between Powershell and Linux Bash - just so I can.&lt;/p&gt;
&lt;p&gt;Fish changed the world for me.&lt;/p&gt;
&lt;p&gt;It is unbelievable that I did not quite know Fish until late of Y2018. One of the positives of seeing a lot of developer videos is learning how other developers work.&lt;/p&gt;
&lt;p&gt;In one of those videos, the shell had some crazy colors and auto-completing like nobody&amp;rsquo;s business. I attributed that to Mac at that time, but some lazy browsing led me to the &lt;a href=&#34;https://fishshell.com/&#34;&gt;Fish shell&lt;/a&gt;.&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>I have been a Powershell user since it was released in Windows 10. But, I had been switching between Powershell and Linux Bash - just so I can.</p>
<p>Fish changed the world for me.</p>
<p>It is unbelievable that I did not quite know Fish until late of Y2018. One of the positives of seeing a lot of developer videos is learning how other developers work.</p>
<p>In one of those videos, the shell had some crazy colors and auto-completing like nobody&rsquo;s business. I attributed that to Mac at that time, but some lazy browsing led me to the <a href="https://fishshell.com/">Fish shell</a>.</p>
<p>
    <img loading="lazy" src="/misc/fish%20shell%20windows%20commander.jpg" alt="fish shell windows commander.jpg"  /></p>
<p>And, what a shell that is.
(I totally understand if you are freaked out by my freaking out on a shell. That is so 90&rsquo;s).</p>
<ol>
<li>
<p>I love the autocomplete / auto-suggestions. This is <strong>so helpful</strong> and you will be left wondering how you could live without one</p>
</li>
<li>
<p>See above * (infinity)</p>
</li>
</ol>
<h2 id="setup-on-windows">Setup on Windows</h2>
<p>If you are a Windows user like me - you may need to do a few things to get Fish working.</p>
<p>In WSL:</p>
<pre tabindex="0"><code>   sudo apt install fish
</code></pre><p>Type &lsquo;fish&rsquo; to enter Fish shell and try out. If you like what you find, you can replace the default shell by -</p>
<pre tabindex="0"><code>   $ chsh -s /usr/bin/fish
</code></pre><p>If you get a &ldquo;PAM: Authentication failure&rdquo; with the above command, verify that the correct path exists in &lsquo;/etc/shells&rsquo;.</p>
<pre tabindex="0"><code>   $ which fish      &#39; -- find path of install, typically /usr/bin/fish
   $ cat /etc/shells &#39; -- verify whether usr/bin/fish is listed as shell
</code></pre><p>Your default WSL shell should now be Fish. If you are working on an emulator (like Commander), you should run wsl.exe instead of bash.exe.</p>
<p>
    <img loading="lazy" src="/misc/fish%20configure%20wsl.jpg" alt="fish configure wsl.jpg"  /></p>
<p>I would have said &rsquo;enjoy fishing&rsquo; at this time, but will not do that since I am a vegetarian.</p>
]]></content:encoded>
    </item>
    
    <item>
      <title>Command Line Tools for Windows</title>
      <link>https://techformist.com/command-line-tools-for-windows/</link>
      <pubDate>Sat, 03 Nov 2018 02:57:00 +0000</pubDate>
      
      <guid>https://techformist.com/command-line-tools-for-windows/</guid>
      <description>&lt;p&gt;The humble &amp;lsquo;cmd&amp;rsquo; in Windows is good enough, but who ever can be satisfied with stuff that is &amp;lsquo;good enough&amp;rsquo;?&lt;/p&gt;
&lt;p&gt;tl;dr: Use &lt;a href=&#34;http://cmder.net/&#34;&gt;cmder&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I am a Windows guy through and through, but had been an active user of Linux on my main desktop and servers. While servers are largely managed through SSH or even CPANEL today, I switched to Windows only after experiencing multiple issues with boot loaders. It also helped that most of the programs I used were on Windows - thanks to my day job.&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>The humble &lsquo;cmd&rsquo; in Windows is good enough, but who ever can be satisfied with stuff that is &lsquo;good enough&rsquo;?</p>
<p>tl;dr: Use <a href="http://cmder.net/">cmder</a></p>
<p>I am a Windows guy through and through, but had been an active user of Linux on my main desktop and servers. While servers are largely managed through SSH or even CPANEL today, I switched to Windows only after experiencing multiple issues with boot loaders. It also helped that most of the programs I used were on Windows - thanks to my day job.</p>
<p>I did not use a lot of command line with most of the development happening on a browser in the last four years. But as I started looking at other platforms for my hobby projects, command line became more and more embedded in my daily work. It was only then that I started missing less, touch, magic through pipes, split, and friends.</p>
<p>I had tried multiple tools in the past, and revisited them to check which tool best satisfies my use case.</p>
<ol>
<li>
<p><a href="http://gnuwin32.sourceforge.net/packages/coreutils.htm">GNU utils</a>
A bunch of utilities that bring Linux commands to Windows. These were my go to tools till recently. Not really maintained (i.e., no updates) but I have not seen any problems.</p>
</li>
<li>
<p><a href="https://docs.microsoft.com/en-us/windows/wsl/install-win10">Linux subsystem</a>
Install your favorite Linux distribution within Windows. Good interoperability, no boot issues - I loved the concept. The only downside is that it takes up a lot of space for an additional operating system.</p>
</li>
<li>
<p>Virtual machines
Create a virtual machine with a Linux operating system. Or, just download the ready made VMs from the Internet. I did not quite make this mainstream - inter interoperability is bit of a problem. I also cannot spare a lot of space - yes, even in 2018.</p>
</li>
<li>
<p><a href="http://www.cygwin.com/">Cygwin</a>
Cygwin provides a way to run a large no. of Linux tools within Windows. The tools use POSIX API offered by Cygwin. I am surprised why I did not use Cygwin as much as I should have.</p>
</li>
</ol>
<p>While all of the tools and methods are great, none suited my work style. The intelligent thing for me to do was to change my work style, but I am not that intelligent.</p>
<p>Fast forward to 2018 and there were two big changes -</p>
<ol>
<li>
<p>VS Code offers an integrated terminal that proved really amazing and brought back my love for command line tools. That took off a barrier in streamlining my workflow.</p>
</li>
<li>
<p>Powershell changed the way I used command line in Windows. Even cmd underwent changes (Ctrl+V at last)</p>
</li>
</ol>
<p>These changed my life.</p>
<p>And then, I stumbled upon <a href="http://cmder.net/">Cmder</a>.

    <img loading="lazy" src="/misc/cmder%20screenshot.jpg" alt="cmder screenshot.jpg"  /></p>
<ol>
<li>A cool command line tool (it is an emulator, uses ConEmu in the background)</li>
<li>Access to bash commands using the full install option</li>
<li>Has a ton of utilities and personalisation options</li>
<li>Tabbed command windows</li>
</ol>
<p>Cmder is my new best friend until I find the next shiny thing.</p>
]]></content:encoded>
    </item>
    
    <item>
      <title>NPM Install mysql errors in Windows</title>
      <link>https://techformist.com/npm-install-mysql-errors-in-windows/</link>
      <pubDate>Tue, 30 Oct 2018 07:17:00 +0000</pubDate>
      
      <guid>https://techformist.com/npm-install-mysql-errors-in-windows/</guid>
      <description>&lt;p&gt;Have you used npm install to get mysql package?&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;npm i --save mysql
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;It is quite common to see the below error on Windows:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;c:\dev\proj\js\adonis\hwblog2&amp;gt;npm i --save mysql
adonis-fullstack-app@4.1.0 c:\dev\proj\js\adonis\hwblog2
`-- sqlstring@2.3.1  extraneous

npm ERR! Windows_NT 10.0.17134
npm ERR! argv &amp;#34;C:\\dev\\js\\nodejs\\node.exe&amp;#34; &amp;#34;C:\\Users\\itsme\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js&amp;#34; &amp;#34;i&amp;#34; &amp;#34;--save&amp;#34; &amp;#34;mysql&amp;#34;
npm ERR! node v10.11.0
npm ERR! npm  v3.9.5
npm ERR! path c:\dev\proj\js\adonis\hwblog2\node_modules\.staging\bignumber.js-1aa9aeba
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall rename

npm ERR! Error: EPERM: operation not permitted, rename &amp;#39;c:\dev\proj\js\adonis\hwblog2\node_modules\.staging\bignumber.js-1aa9aeba&amp;#39; -&amp;gt; &amp;#39;c:\dev\proj\js\adonis\hwblog2\node_modules\bignumber.js&amp;#39;
npm ERR!     at destStatted (C:\Users\itsme\AppData\Roaming\npm\node_modules\npm\lib\install\action\finalize.js:25:7)
npm ERR!     at FSReqWrap.oncomplete (fs.js:154:21)
npm ERR!
npm ERR! Error: EPERM: operation not permitted, rename &amp;#39;c:\dev\proj\js\adonis\hwblog2\node_modules\.staging\bignumber.js-1aa9aeba&amp;#39; -&amp;gt; &amp;#39;c:\dev\proj\js\adonis\hwblog2\node_modules\bignumber.js&amp;#39;
npm ERR!  { Error: EPERM: operation not permitted, rename &amp;#39;c:\dev\proj\js\adonis\hwblog2\node_modules\.staging\bignumber.js-1aa9aeba&amp;#39; -&amp;gt; &amp;#39;c:\dev\proj\js\adonis\hwblog2\node_modules\bignumber.js&amp;#39;
npm ERR!     at destStatted (C:\Users\itsme\AppData\Roaming\npm\node_modules\npm\lib\install\action\finalize.js:25:7)
npm ERR!     at FSReqWrap.oncomplete (fs.js:154:21)
npm ERR!
npm ERR! Error: EPERM: operation not permitted, rename &amp;#39;c:\dev\proj\js\adonis\hwblog2\node_modules\.staging\bignumber.js-1aa9aeba&amp;#39; -&amp;gt; &amp;#39;c:\dev\proj\js\adonis\hwblog2\node_modules\bignumber.js&amp;#39; parent: &amp;#39;adonis-fullstack-app&amp;#39; }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! Please include the following file with any support request:
npm ERR!     c:\dev\proj\js\adonis\hwblog2\npm-debug.log
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The above error is caused when trying to install mysql package for AdonisJS app, but the error itself is universal on Windows 10.&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>Have you used npm install to get mysql package?</p>
<pre tabindex="0"><code>npm i --save mysql
</code></pre><p>It is quite common to see the below error on Windows:</p>
<pre tabindex="0"><code>c:\dev\proj\js\adonis\hwblog2&gt;npm i --save mysql
adonis-fullstack-app@4.1.0 c:\dev\proj\js\adonis\hwblog2
`-- sqlstring@2.3.1  extraneous

npm ERR! Windows_NT 10.0.17134
npm ERR! argv &#34;C:\\dev\\js\\nodejs\\node.exe&#34; &#34;C:\\Users\\itsme\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js&#34; &#34;i&#34; &#34;--save&#34; &#34;mysql&#34;
npm ERR! node v10.11.0
npm ERR! npm  v3.9.5
npm ERR! path c:\dev\proj\js\adonis\hwblog2\node_modules\.staging\bignumber.js-1aa9aeba
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall rename

npm ERR! Error: EPERM: operation not permitted, rename &#39;c:\dev\proj\js\adonis\hwblog2\node_modules\.staging\bignumber.js-1aa9aeba&#39; -&gt; &#39;c:\dev\proj\js\adonis\hwblog2\node_modules\bignumber.js&#39;
npm ERR!     at destStatted (C:\Users\itsme\AppData\Roaming\npm\node_modules\npm\lib\install\action\finalize.js:25:7)
npm ERR!     at FSReqWrap.oncomplete (fs.js:154:21)
npm ERR!
npm ERR! Error: EPERM: operation not permitted, rename &#39;c:\dev\proj\js\adonis\hwblog2\node_modules\.staging\bignumber.js-1aa9aeba&#39; -&gt; &#39;c:\dev\proj\js\adonis\hwblog2\node_modules\bignumber.js&#39;
npm ERR!  { Error: EPERM: operation not permitted, rename &#39;c:\dev\proj\js\adonis\hwblog2\node_modules\.staging\bignumber.js-1aa9aeba&#39; -&gt; &#39;c:\dev\proj\js\adonis\hwblog2\node_modules\bignumber.js&#39;
npm ERR!     at destStatted (C:\Users\itsme\AppData\Roaming\npm\node_modules\npm\lib\install\action\finalize.js:25:7)
npm ERR!     at FSReqWrap.oncomplete (fs.js:154:21)
npm ERR!
npm ERR! Error: EPERM: operation not permitted, rename &#39;c:\dev\proj\js\adonis\hwblog2\node_modules\.staging\bignumber.js-1aa9aeba&#39; -&gt; &#39;c:\dev\proj\js\adonis\hwblog2\node_modules\bignumber.js&#39; parent: &#39;adonis-fullstack-app&#39; }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! Please include the following file with any support request:
npm ERR!     c:\dev\proj\js\adonis\hwblog2\npm-debug.log
</code></pre><p>The above error is caused when trying to install mysql package for AdonisJS app, but the error itself is universal on Windows 10.</p>
<p>The error is caused by <strong>bignumber.js</strong>. You will see the same error when trying to install bignumber.js.</p>
<p>You can fix the error quite easily -</p>
<ol>
<li>Go to Start &gt; Settings &gt; Update &amp; Security &gt; Windows Security &gt; Virus &amp; threat protection &gt; Virus &amp; threat protection settings (or Manage Settings).</li>
<li>Change <code>Real-time protection</code> to <code>Off</code>.</li>
<li>Change <code>Cloud-delivered protection</code> to <code>Off</code>.</li>
</ol>
<p>Restart command prompt.</p>
<pre tabindex="0"><code>npm cache clean
npm i --save mysql
</code></pre><p>Works like a charm.</p>
<p>Don&rsquo;t forget to turn the protection back after the npm install.</p>
]]></content:encoded>
    </item>
    
    <item>
      <title>Backup - Your Life Depends on It</title>
      <link>https://techformist.com/backup-your-life-depends-on-it/</link>
      <pubDate>Wed, 24 Oct 2018 09:04:00 +0000</pubDate>
      
      <guid>https://techformist.com/backup-your-life-depends-on-it/</guid>
      <description>&lt;p&gt;Backing up has been historically a pain.&lt;/p&gt;
&lt;p&gt;Most of the times I lacked the resources - either I don&amp;rsquo;t have the hardware or could not quite setup everything seamlessly.&lt;/p&gt;
&lt;h3 id=&#34;previous-setup&#34;&gt;Previous Setup&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;https://sourceforge.net/projects/synchronicity/&#34;&gt;Create Synchronicity&lt;/a&gt;
Light-weight, backup and synchronise.
I include any folder that needs to be backed up to CS. Schedule the program to run every fortnight or so.&lt;/p&gt;
&lt;p&gt;The files are backed up an attached hard-drive, some folders go to OneDrive, Dropbox, Box, or Google Drive folders.&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>Backing up has been historically a pain.</p>
<p>Most of the times I lacked the resources - either I don&rsquo;t have the hardware or could not quite setup everything seamlessly.</p>
<h3 id="previous-setup">Previous Setup</h3>
<ol>
<li>
<p><a href="https://sourceforge.net/projects/synchronicity/">Create Synchronicity</a>
Light-weight, backup and synchronise.
I include any folder that needs to be backed up to CS. Schedule the program to run every fortnight or so.</p>
<p>The files are backed up an attached hard-drive, some folders go to OneDrive, Dropbox, Box, or Google Drive folders.</p>
</li>
<li>
<p><a href="https://tools.stefankueng.com/CryptSync.html">CryptSync</a>
Light-weight program to synchronize two folders - while encrypting one of them.
This was useful to backup sensitive data to OneDrive and its cousins.</p>
</li>
<li>
<p><a href="https://www.backup-utility.com/download.html">AOMEI Backupper</a>
Create system backups in an attached hard-drive.</p>
</li>
</ol>
<h3 id="problem">Problem</h3>
<p>The setup looks ok - on paper. I was not delighted since -</p>
<ol>
<li>I had multiple backups running for some folders - it was messy, and I could (did) not spend enough time to untangle the wires</li>
<li>Encryption is great, but not quite friendly. I had to download, decrypt (learnt to store passwords in LastPass after I lost the password once), and only then reach to the data</li>
<li>I also had folders in the cloud backup providers that were directly updated</li>
<li>Light weight or otherwise - the convoluted structure is not a good arrangement</li>
</ol>
<h3 id="solution">Solution</h3>
<p>Move to <a href="https://www.duplicati.com/">Duplicati</a>.</p>
<ol>
<li>One platform to backup to NAS, FTP or to OneDrive and friends</li>
<li>Built-in encryption</li>
<li>One (browser) window to rule them all (well almost, exceptions apply)</li>
</ol>
<p>I still use AOMEI Backupper (am still amazed each time I type the name) for scheduled system backups.</p>
<p>My hard-drive misbehaved a couple of times in the last six months, and I did not see myself reaching out to AOMEI System Backup for help. As of now, I have scheduled reminders in Google Calendar to remind me to create (or test) a recovery drive twice an year.</p>
<p>I have learnt to live with this arrangement until I invest in better software (queued up task to purchase either Acronis Backup and Recovery, AOMEI Backupper Pro, or Ashampoo Backup Pro).</p>
<p>Caution: Duplicati is still running Beta on v2.0.</p>
]]></content:encoded>
    </item>
    
    <item>
      <title>Invaluable Presentation Tools for a Developer</title>
      <link>https://techformist.com/invaluable-presentation-tools-for-a-developer/</link>
      <pubDate>Sun, 21 Oct 2018 04:36:00 +0000</pubDate>
      
      <guid>https://techformist.com/invaluable-presentation-tools-for-a-developer/</guid>
      <description>&lt;p&gt;I am a developer (or an imposter who thinks he is a developer).&lt;/p&gt;
&lt;p&gt;A developer has to figure out solutions to problems, and sometimes carry the rest of the humanity along for the ride.&lt;/p&gt;
&lt;p&gt;I am unique in that - rest of the developers do that 99.99xxx99% of the time, and I fill in the gap.&lt;/p&gt;
&lt;p&gt;For that communication to be effective with my fellow humans: I prefer to structure the information, use any means within my reach and in general, not be known as a snob.&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>I am a developer (or an imposter who thinks he is a developer).</p>
<p>A developer has to figure out solutions to problems, and sometimes carry the rest of the humanity along for the ride.</p>
<p>I am unique in that - rest of the developers do that 99.99xxx99% of the time, and I fill in the gap.</p>
<p>For that communication to be effective with my fellow humans: I prefer to structure the information, use any means within my reach and in general, not be known as a snob.</p>
<p>I need presentation tools to do all those preferences to happen in the real world.</p>
<p>Here are my favourite tools to present my invaluable ideas to the world. I work on a PC using Windows 10 - so, feel free to banish this site if you are a Mac&rsquo;er. Most of the tools are free - thank you all, you are awesome.</p>
<h1 id="helpers">Helpers</h1>
<p>Helpers come first since these are omni present and are useful regardless of the medium of presentation (well, almost).</p>
<ol>
<li>
<p><a href="https://getsharex.com/">ShareX</a></p>
<p>Using ShareX for a million years now, never let me down. I was a fan of <a href="http://www.donationcoder.com/software/mouser/popular-apps/screenshot-captor">Screenshot Captor</a> before but I have moved on.<br>
ShareX can automate post screenshot flow - e.g. open Greenshot Editor to resize screenshot, upload the screenshot to a target host, copy the image or shortcut to clipboard, and take the dog out for a walk in the mean time.</p>
</li>
<li>
<p><a href="https://www.inputdirector.com/">InputDirector</a>
I don&rsquo;t have a multi-monitor setup. But I do have an extra laptop. When I am doing presentations, or referring to too many materials at one go - InputDirector stands by for the rescue.</p>
<p>I can seamlessly transition from my desktop to my laptop and back - all using a single keyboard and mouse combination.</p>
</li>
<li>
<p><a href="https://www.yworks.com/products/yed">yeED</a>
Write UMLs, simple flows, and stuff.</p>
</li>
<li>
<p><a href="https://pencil.evolus.vn/">Pencil</a>
Create prototypes, mockups and simple diagrams.</p>
</li>
<li>
<p><a href="https://www.glassbrick.org/">GlassBrick</a>
Zoom in, zoom out, and be done.
You never knew you wanted this program until you have started using it.</p>
</li>
<li>
<p><a href="https://office.live.com/start/PowerPoint.aspx">PowerPoint</a>
I use Powerpoint (an offline version) - there that&rsquo;s out in the open.\</p>
</li>
</ol>
<h1 id="screencast">Screencast</h1>
<ol>
<li>
<p><a href="https://www.techsmith.com/video-editor.html">Camtasia</a>
I have tried many screencasting software - but Camtasia works best for developers. Period.
Record, edit sound in Audacity - and you are done.</p>
</li>
<li>
<p><a href="https://www.vb-audio.com/Voicemeeter/">Voicemeeter</a></p>
<p>Do some sound processing magic in real-time - do live streaming, record, or just about anything else.</p>
<p>Having a weak voice ain&rsquo;t keeping us from speaking. Even the strongest of alphas will have doubts about who&rsquo;s on the other side when you use Voicemeeter. All hail computers.</p>
<p>Combine this with <a href="https://www.vb-audio.com/Cable/index.htm">VB-Cable virtual audio device</a>.</p>
</li>
<li>
<p><a href="https://epic-pen.com/">Epic-pen</a>
Highlight certain areas of the screen during a presentation.</p>
</li>
<li>
<p><a href="https://www.cockos.com/licecap/">LiceCAP</a></p>
<p>If you are not doing anything bombastic, you should consider GIFs rather than a video. LiceCAP is good enough software to record GIFs fast.</p>
</li>
</ol>
<h1 id="podcast">Podcast</h1>
<p>I am not into podcasts and only did test runs so far. This will be my resort when there are zombies around and I cannot communicate through books, blog posts or videos.</p>
<p>I am ready with the below tools when it is time.</p>
<ol>
<li>
<p><a href="https://www.audacityteam.org/">Audacity</a>
Greatest sound recorder, processor ever.</p>
</li>
<li>
<p>Voicemeeter
Yes, again.</p>
</li>
</ol>
<h1 id="writing">Writing</h1>
<p>Many of you will feel disappointed that I present through writing. But I can&rsquo;t help it if I am a terrific author.</p>
<h2 id="blogs">Blogs</h2>
<ol>
<li>
<p>Wordpress Post / Page Editor</p>
<p>I tried a lot of software including the <a href="https://apps.wordpress.com/desktop/">Wordpress offline editor</a>, but none of them provide the same seamless experience as the inbuilt editor.</p>
<p>Don&rsquo;t use Gutenberg though - that has to be killed by fire as of Y2018.</p>
</li>
<li>
<p>Markdown editors on <a href="https://www.netlifycms.org/">Netlify CMS</a> and <a href="https://www.siteleaf.com/">Siteleaf</a></p>
<p>If you are getting started or in a hurry to write posts (who isn&rsquo;t?) - these work fine. Choose one depending on your preference.</p>
</li>
<li>
<p>Offline markdown editing on <a href="https://code.visualstudio.com/">VS Code</a></p>
<p>I can put all my stupid preferences in VS Code, write and commit to Git. For e.g. I can Emmet something like typing a <code>{:target=&quot;_blank&quot;}</code> after links in Jekyll markdown files.</p>
<p>I could do something similar using <a href="https://www.phraseexpress.com/">PhraseExpress</a> in all applications, but there is only so much productivity to improve on an yearly basis.</p>
</li>
</ol>
<h2 id="books">Books</h2>
<ol>
<li>
<p><a href="https://pandoc.org/">Pandoc</a></p>
<p>You can write what you want but you are not getting anywhere without providing that in a thousand formats. Pandoc has you covered.</p>
</li>
<li>
<p><a href="https://typora.io">Typora</a></p>
<p>Write markdown, see magical rendering as you type, apply themes, and save/export in popular formats.</p>
<p>Have a look at my <a href="https://techformist.com/create-ebook-from-multiple-markdown-files/">book writing process flow</a></p>
</li>
<li>
<p>Did I mention VS Code for markdown?</p>
<p>I think I am in love with that tool.</p>
</li>
</ol>
<p>Well, that&rsquo;s about my tool-set; get back to work.</p>
]]></content:encoded>
    </item>
    
  </channel>
</rss>
