<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Henrique Graca on Medium]]></title>
        <description><![CDATA[Stories by Henrique Graca on Medium]]></description>
        <link>https://medium.com/@hjgraca?source=rss-29194cdedab1------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*GnYKFUZTLohffx3dvomrkg.png</url>
            <title>Stories by Henrique Graca on Medium</title>
            <link>https://medium.com/@hjgraca?source=rss-29194cdedab1------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 16 Nov 2026 04:23:37 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@hjgraca/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com" rel="hub"/>
        <item>
            <title><![CDATA[Style your Windows terminal and use WSL and PowerShell like a pro]]></title>
            <link>https://medium.com/@hjgraca/style-your-windows-terminal-and-wsl2-like-a-pro-9a2e1ad4c9d0?source=rss-29194cdedab1------2</link>
            <guid isPermaLink="false">https://medium.com/p/9a2e1ad4c9d0</guid>
            <category><![CDATA[terminal-windows]]></category>
            <category><![CDATA[zsh]]></category>
            <category><![CDATA[wsl]]></category>
            <category><![CDATA[oh-my-zsh]]></category>
            <category><![CDATA[powershell]]></category>
            <dc:creator><![CDATA[Henrique Graca]]></dc:creator>
            <pubDate>Thu, 14 Nov 2019 11:12:11 GMT</pubDate>
            <atom:updated>2021-06-29T10:29:53.408Z</atom:updated>
            <content:encoded><![CDATA[<p>With zsh and powerline10k you can have a terminal that will make your unix friends jealous 😀</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3zKJWYBLG3G9IJsonITdpg.png" /><figcaption>Finished look of the terminal</figcaption></figure><h3>Some assumptions</h3><ul><li>Have <strong>WSL </strong>installed. If not you can follow the <a href="https://docs.microsoft.com/en-us/windows/wsl/install-win10"><strong>official docs</strong></a><strong> </strong>(I am using Ubuntu 18.04). Once you finished installing you need to setup for the first time, follow tutorial <a href="https://docs.microsoft.com/en-us/windows/wsl/initialize-distro">here</a></li><li>(optional) Have <strong>WSL 2</strong> installed following the <a href="https://docs.microsoft.com/en-us/windows/wsl/wsl2-install"><strong>official docs</strong></a><strong> (</strong>WSL 2 is only available in Windows 10 builds 18917 or higher)</li><li>Have the new <strong>Windows Terminal</strong> (preview) installed. You can get it from the <a href="https://www.microsoft.com/en-us/p/windows-terminal-preview/9n0dx20hk701"><strong>Windows Store</strong></a></li></ul><h3>Getting Started</h3><p>Without any styling you should have something very similar to this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jQr-2NhKrP0KxLm_noAUfg.png" /><figcaption>Default Windows Terminal screen</figcaption></figure><p>The first thing I recommend it to go into the settings and change the default profile to Ubuntu. After you click settings your json editor will popup with the profiles.json file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*quihVzthNVVRvsIjkQbMJg.png" /></figure><p>Next you are going to add two new schemes to the file and change the default values from the PowerShell and Ubuntu profiles. The end result will be:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1f22af25c7d72c9bc516513590d5842c/href">https://medium.com/media/1f22af25c7d72c9bc516513590d5842c/href</a></iframe><p>Great after we saved the file we should see something different</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ROBh9exlXIhDZOKJUJf-ag.png" /><figcaption>Ubuntu</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6d1TZiH5cpyxYRfq_wEReQ.png" /><figcaption>PowerShell</figcaption></figure><p>Looks better but not there yet. You must have noticed the font faces in the profiles, those do not exist in windows by default so we need to install them.</p><h3>Fonts</h3><p><strong>Install Powerline fonts in Windows<br></strong>To have a correctly working theme, you needed to download and install some needed fonts.</p><p>Open Powershell command prompt:</p><pre>git clone <a href="https://github.com/powerline/fonts.git">https://github.com/powerline/fonts.git</a> --depth=1</pre><pre>cd fonts</pre><pre>.\install.ps1</pre><pre># this will take a while to install all fonts. you can delete the folder after.</pre><p>Next go to <a href="https://www.nerdfonts.com/"><strong>Nerd Fonts</strong></a> and download and install the font you like. In this tutorial I downloaded the <a href="https://github.com/ryanoasis/nerd-fonts/releases/download/v2.0.0/Mononoki.zip"><strong>mononoki </strong></a>font. These are custom fonts and icons for your terminal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8nx5Eoaexv-CRNngxGQxPA.png" /><figcaption><strong>Unzip the file</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qdpZgR2BPT4i_yDByBJ8rA.png" /><figcaption><strong>And install the font</strong></figcaption></figure><h3>PowerShell</h3><p>Let´s start by styling PowerShell (scroll down if you want to see WSL). You will need to have <a href="https://git-scm.com/downloads"><strong>installed Git for Windows</strong></a><strong>.</strong></p><p>Follow <a href="https://github.com/JanDeDobbeleer/oh-my-posh?WT.mc_id=-blog-scottha#installation"><strong>these directions</strong></a>, this will install Posh-Git and Oh-My-Posh.</p><p>Install posh-git and oh-my-posh:</p><pre># You could have the following to allow for scripts execution <br># Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser</pre><pre>Install-Module posh-git -Scope CurrentUser<br>Install-Module oh-my-posh -Scope CurrentUser</pre><p>Enable the prompt:</p><pre># Start the default settings (might not work so optional)<br>Set-Prompt</pre><pre># To enable the engine edit your PowerShell profile, run<br>notepad $PROFILE</pre><pre># and append the following lines to the profile file you just opened (or created in case the file was not there already):</pre><pre>Import-Module posh-git<br>Import-Module oh-my-posh<br>Set-PoshPrompt Paradox</pre><p>Once you are done this is what your PowerShell will look like. You can get other themes <a href="https://github.com/JanDeDobbeleer/oh-my-posh?WT.mc_id=-blog-scottha#themes">here</a>. And as you can see all icons are there including the git icons 😎</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*owAPKY34QVh51dcD7Xt1Aw.png" /></figure><h3>WSL</h3><p>Now that we have PowerShell styled lets take care of Ubuntu.</p><p>1. First install zsh</p><pre>sudo apt-get install zsh curl git</pre><p>2. Install <a href="https://github.com/robbyrussell/oh-my-zsh">oh-my-zsh</a>.</p><pre># When prompted to set zsh as your default shell say Yes</pre><pre>sh -c &quot;$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)&quot;</pre><p>If all went well, your Ubuntu terminal shell should look like this. Just your username in the prompt.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xjbxiWHptMBu9nA8dNk7pA.png" /></figure><p>Now we are ready to add some themes. I will be using <a href="https://github.com/romkatv/powerlevel10k"><strong>Powerlevel10k</strong></a><strong>. </strong>And because we have <strong>oh my zsh</strong> installed we just need to run the following scripts</p><pre>git clone --depth=1 https://github.com/romkatv/powerlevel10k.git $ZSH_CUSTOM/themes/powerlevel10k</pre><p>Set ZSH_THEME=powerlevel10k/powerlevel10k in your ~/.zshrc. To do that run vim ~/.zshrcand replace the <strong>ZSH_THEME</strong> value. Save and exit Vim 😂</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QU3CuE6A40f0dUWbAcHMdw.png" /></figure><p>Now restart the Windows Terminal and you should see the Powerlevel10k configuration wizard</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m6DMoVhPLZzHVuJZ9tEqJw.png" /></figure><p>If all the fonts were installed correctly you should see a diamond (like above) a lock and a debian logo. Follow the wizard until the end and then apply your changes to the ~/.zshrc file</p><p>Depending on the style you chose you should have a good looking terminal like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V826s1-NRtU6dfhwz1tQYg.png" /></figure><p>That’s it you now have a very good looking PowerShell and WSL terminal that will make your unix friends jealous 😍</p><h3>Extras for WSL</h3><p><strong>Plugins</strong></p><p>zsh and Powerlevel10k have an enormous amount of plugins and extensions that you can add to your shell.</p><p><strong>Add Auto Suggestions (</strong><a href="https://github.com/zsh-users/zsh-autosuggestions"><strong>repo</strong></a><strong>)</strong></p><ol><li>Clone this repository into $ZSH_CUSTOM/plugins (by default ~/.oh-my-zsh/custom/plugins)</li></ol><pre>git clone <a href="https://github.com/zsh-users/zsh-autosuggestions">https://github.com/zsh-users/zsh-autosuggestions</a> ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions</pre><p>2. Add the plugin to the list of plugins for Oh My Zsh to load (inside ~/.zshrc): (you will probably have git already)</p><pre>plugins=(zsh-autosuggestions)</pre><pre># and bellow add: to fix the suggestion style</pre><pre>ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE=&quot;fg=244&quot;</pre><p>3. Start a new terminal session. And now you have auto suggestions.</p><p><strong>Kubectl plugin (</strong><a href="https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/kubectl"><strong>repo</strong></a><strong>)</strong></p><p>For those like me that have to deal with Kubernetes this is an amazing plugin, because it gives you autocomplete and many aliases for you to have to type less. What do you have to do?! Very easy just open ~/.zshrc and edit the plugins line and add kubectl. Save and exit Vim</p><pre>plugins=(git zsh-autosuggestions <strong>kubectl</strong>)</pre><p>Restart the terminal session</p><p><strong>Styling the prompt with Powerlevel10k</strong></p><p>We can add many things to the prompt, like aws or azure login user information, Kubernetes cluster and namespace information, nodejs version and so on. To do so we need to edit the Powerlevel10k configuration file <strong>~/.p10k.zsh</strong>:</p><pre>vim  ~/.p10k.zsh</pre><p>Change the POWERLEVEL9K_LEFT_PROMPT_ELEMENTS to change the left hand side of the prompt.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fv0O_ieJfia8IKZBfUh0kw.png" /></figure><p>Change the POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS to change the right hand side of the prompt. This is where most of the elements are.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Gvefes9EzZWiTlfFw60WZQ.png" /></figure><p>For example to add the Kubernetes cluster and namespace information I just enable the <strong>kubecontext </strong>element. And for the battery information the <strong>battery </strong>element</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yWP-hVtYoY4nJFkyITW0kg.png" /><figcaption>In pink the Kubernetes cluster(aks9533) and namepsace (demo).</figcaption></figure><p>And that’s it, totally customizable and good looking terminal. To learn more have a look at the <a href="https://github.com/Powerlevel9k/powerlevel9k/wiki/Stylizing-Your-Prompt">style your prompt guide</a> of Powerlevel9k (original project) to know what to change.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9a2e1ad4c9d0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using WSL2 + Visual Studio Code for Jekyll blogging on Windows 10]]></title>
            <link>https://medium.com/@hjgraca/using-wsl2-visual-studio-code-for-jekyll-blogging-on-windows-10-99489deb4650?source=rss-29194cdedab1------2</link>
            <guid isPermaLink="false">https://medium.com/p/99489deb4650</guid>
            <category><![CDATA[visual-studio-code]]></category>
            <category><![CDATA[windows-10]]></category>
            <category><![CDATA[jekyll]]></category>
            <category><![CDATA[wsl-2]]></category>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[Henrique Graca]]></dc:creator>
            <pubDate>Thu, 05 Sep 2019 16:11:56 GMT</pubDate>
            <atom:updated>2019-09-05T16:11:56.962Z</atom:updated>
            <content:encoded><![CDATA[<p>If you are like me and have your blog hosted on GitHub pages you are using Jekyll as your blog generation engine. Turns out that Jekyll does not support Windows so you have to do some hacking in order to make it work on Windows. In this post I will show you how to take advantage of <a href="https://docs.microsoft.com/en-us/windows/wsl/wsl2-about"><strong>WSL2</strong></a><strong> </strong>and Ubuntu 18.04 to install Jekyll and locally run your blog.</p><h3>What is Windows Subsystem for Linux 2?</h3><p>The Windows Subsystem for Linux (WSL) is a new Windows 10 feature that enables you to run native Linux command-line tools directly on Windows.</p><p>WSL 2 is a new version of the architecture that powers the Windows Subsystem for Linux to run ELF64 Linux binaries on Windows. This new architecture changes how these Linux binaries interact with Windows and your computer’s hardware, but still provides the same user experience as in WSL 1 (the current widely available version). Individual Linux distros can be run either as a WSL 1 distro, or as a WSL 2 distro, can be upgraded or downgraded at any time, and you can run WSL 1 and WSL 2 distros side by side. WSL 2 uses an entirely new architecture that uses a real Linux kernel.</p><p>How to install WSL2 is documented <a href="https://docs.microsoft.com/en-us/windows/wsl/wsl2-install">here</a></p><h3>Visual Studio Remote WSL</h3><p>If you have VS Code already installed you will need to install the Remote WSL extension so that you are able to run linux commands and applications against your mounted Windows folder where your Jekyll blog is.</p><p>Extension is <a href="https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-wsl">here</a></p><p>After the extension is installed you will see a small icon on the bottom left of VS Code</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/65/1*9WQv38Ec3lCDPtacVpF22A.png" /><figcaption>VS Code Remote icon</figcaption></figure><p>What I usually do is open the folder that as the blog before starting the remote session. Once I have the folder open in VS Code I click on the Remote WSL icon and are presented with the following options:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Dfah7F6wfj7jOkYNovh9_A.png" /><figcaption>Remote WSL options</figcaption></figure><p>You will then choose <strong>Remote-WSL: Reopen Folder in WSL</strong> (if you had the folder opened). Once everything is finished the icon will change to:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/247/1*7woqt-9S1PTtl-NQRygCfA.png" /><figcaption>Session established</figcaption></figure><p>Now open the terminal window and you will see that the context is your Ubuntu machine and the folder is a mount to your Jekyll blog folder</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/922/1*Oru1mLVcQqsScP8u5JqbSA.png" /></figure><h3>Installing Jekyll in WSL Ubuntu 18.04</h3><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2b91f776ab98684418bf01cd67d4ade3/href">https://medium.com/media/2b91f776ab98684418bf01cd67d4ade3/href</a></iframe><p>And now you can run your blog locally in Windows 10 with the power of WSL2 and Linux without having to hack your way installing Jekyll on Windows.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=99489deb4650" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>