<?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>Forem: Rodrigo Medina</title>
    <description>The latest articles on Forem by Rodrigo Medina (@roeeyn).</description>
    <link>https://forem.com/roeeyn</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%2F50358%2F92ea330a-a32c-4e01-8bd3-1b354fc41cd0.jpg</url>
      <title>Forem: Rodrigo Medina</title>
      <link>https://forem.com/roeeyn</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/roeeyn"/>
    <language>en</language>
    <item>
      <title>Pyenv and Virtualenvs Quick-start</title>
      <dc:creator>Rodrigo Medina</dc:creator>
      <pubDate>Sat, 29 Oct 2022 00:13:35 +0000</pubDate>
      <link>https://forem.com/roeeyn/pyenv-and-virtualenvs-quick-start-5785</link>
      <guid>https://forem.com/roeeyn/pyenv-and-virtualenvs-quick-start-5785</guid>
      <description>&lt;h6&gt;
  
  
  Image obtained from DALL-E: &lt;em&gt;epic virtual pythons yellow and blue with a cyberpunk style&lt;/em&gt;
&lt;/h6&gt;

&lt;p&gt;Whenever I get a new computer, I need to get through the python versions management, so this is the guide with the most common commands I need to execute to get up and running.&lt;/p&gt;

&lt;p&gt;For this, I will use &lt;a href="https://github.com/pyenv/pyenv"&gt;pyenv&lt;/a&gt; and the &lt;a href="https://github.com/pyenv/pyenv-virtualenv"&gt;pyenv-virtualenv&lt;/a&gt; tools.&lt;/p&gt;

&lt;h2&gt;
  
  
  Initial help
&lt;/h2&gt;

&lt;p&gt;This should be the most common first step for most of the tools we use.&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="c"&gt;# Get the available commands for pyenv&lt;/span&gt;
pyenv &lt;span class="nt"&gt;--help&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Get The Installed Python Versions
&lt;/h2&gt;

&lt;p&gt;This command will show us which versions we have already installed in our system. In the beginning, it should be only &lt;code&gt;system&lt;/code&gt;, which is the default installation that comes with the macOS.&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="c"&gt;## List all the python versions available to pyenv&lt;/span&gt;
pyenv versions
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Install A New Version
&lt;/h2&gt;

&lt;p&gt;First, we should run the &lt;code&gt;--help&lt;/code&gt; command, to get the available subcommands available in the &lt;code&gt;install&lt;/code&gt; option.&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="c"&gt;# Generic help &amp;amp; usage&lt;/span&gt;
pyenv &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;--help&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, we need to decide which version we want to install. For that, we may want to first see all the available versions. To achieve this, we need to execute:&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="c"&gt;# List all available versions&lt;/span&gt;
pyenv &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;--list&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Finally, we need to execute the installation command with the version we want. As an example, I will install the &lt;code&gt;3.9.14&lt;/code&gt; version.&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="c"&gt;# Install selected version&lt;/span&gt;
pyenv &lt;span class="nb"&gt;install &lt;/span&gt;3.9.14
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To verify our installation, we may execute &lt;code&gt;pyenv versions&lt;/code&gt; again, and the recent installation should appear there.&lt;/p&gt;

&lt;h2&gt;
  
  
  Use The Recently Installed Python Version
&lt;/h2&gt;

&lt;p&gt;To use the recently installed as the &lt;code&gt;global&lt;/code&gt;, or default version, we need to execute:&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="c"&gt;# Sets the global Python version&lt;/span&gt;
pyenv global 3.9.14
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Create a Virtual Environment
&lt;/h2&gt;

&lt;p&gt;The best practice for python projects, is to use a virtualenv per project, so we can have isolated dependencies between them. To create a new virtualenv we need to execute:&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="c"&gt;# Create a new virtual env with the global python version&lt;/span&gt;
&lt;span class="c"&gt;# pyenv virtualenv YOUR_VIRTUAL_ENV_NAME&lt;/span&gt;
&lt;span class="c"&gt;# e.g.&lt;/span&gt;
pyenv virtualenv python-graphql-client
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  List All the Virtual Environments
&lt;/h2&gt;

&lt;p&gt;A good way to verify that a virtual env has been created successfully is to list all the available virtual environments. To achieve this, we execute:&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="c"&gt;# Show available virtualenvs&lt;/span&gt;
pyenv virtualenvs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Activate The Virtual Environment
&lt;/h2&gt;

&lt;p&gt;To activate, and start using your virtual environment, you need to execute:&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="c"&gt;# Activate a virtualenv&lt;/span&gt;
&lt;span class="c"&gt;# pyenv activate YOUR_VIRTUAL_ENV_NAME&lt;/span&gt;
&lt;span class="c"&gt;# e.g.&lt;/span&gt;
pyenv activate python-graphql-client
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Deactivate The Virtual Environment
&lt;/h2&gt;

&lt;p&gt;Once you're done using your virtual environment, you may want to deactivate it. To achieve this, you may run:&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="c"&gt;# The deactivation must be sourced&lt;/span&gt;
&lt;span class="nb"&gt;source &lt;/span&gt;deactivate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Extra
&lt;/h2&gt;

&lt;p&gt;If you want to avoid activating and deactivating manually, you can use &lt;a href="https://github.com/Yelp/aactivator"&gt;aactivator&lt;/a&gt;, which will activate and deactivate automatically based on the project you are placed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusions
&lt;/h2&gt;

&lt;p&gt;This is the basic stuff that works for me. If you find it useful, consider giving a like. Happy hacking!&lt;/p&gt;

</description>
      <category>pyenv</category>
      <category>virtualenv</category>
      <category>python</category>
      <category>quickstart</category>
    </item>
    <item>
      <title>How To Setup Your CTFd Platform With HTTPS And SSL</title>
      <dc:creator>Rodrigo Medina</dc:creator>
      <pubDate>Fri, 26 Nov 2021 05:28:22 +0000</pubDate>
      <link>https://forem.com/roeeyn/how-to-setup-your-ctfd-platform-with-https-and-ssl-3fda</link>
      <guid>https://forem.com/roeeyn/how-to-setup-your-ctfd-platform-with-https-and-ssl-3fda</guid>
      <description>&lt;p&gt;If you want to organize and host a CTF event, one of the best and easiest options available for managing this is &lt;a href="https://github.com/CTFd/CTFd" rel="noopener noreferrer"&gt;CTFd&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This open-source platform lets you manage users, challenges, and their categories in a very easy way, so the only thing we need to do is to clone the spin up a server, clone the repo, run the docker-compose, and set up the TLS certificate.&lt;/p&gt;

&lt;p&gt;General requirements:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;[ ] VPS/server/droplet (I'm using &lt;a href="https://www.digitalocean.com/" rel="noopener noreferrer"&gt;digital ocean&lt;/a&gt; but any server works)&lt;/li&gt;
&lt;li&gt;[ ] A domain (I'm using a domain bought and configured in Google domains, but if you can modify the A registries, you're good to go)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  1. Spin up your server
&lt;/h2&gt;

&lt;p&gt;For this, I'm going to use &lt;a href="https://www.digitalocean.com/" rel="noopener noreferrer"&gt;Digital Ocean&lt;/a&gt;, but this can be done in practically any cloud provider.&lt;br&gt;
I created a droplet (VPS) with the following features:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Fdmrgfufa4%2Fimage%2Fupload%2Fv1637902940%2Farticles%2Fctfd%2520with%2520https%2F1.1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Fdmrgfufa4%2Fimage%2Fupload%2Fv1637902940%2Farticles%2Fctfd%2520with%2520https%2F1.1.png" alt="Sample digital ocean server"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Fdmrgfufa4%2Fimage%2Fupload%2Fv1637902940%2Farticles%2Fctfd%2520with%2520https%2F1.2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Fdmrgfufa4%2Fimage%2Fupload%2Fv1637902940%2Farticles%2Fctfd%2520with%2520https%2F1.2.png" alt="Sample digital ocean server"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Fdmrgfufa4%2Fimage%2Fupload%2Fv1637902942%2Farticles%2Fctfd%2520with%2520https%2F1.3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Fdmrgfufa4%2Fimage%2Fupload%2Fv1637902942%2Farticles%2Fctfd%2520with%2520https%2F1.3.png" alt="Sample digital ocean server"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Fdmrgfufa4%2Fimage%2Fupload%2Fv1637902941%2Farticles%2Fctfd%2520with%2520https%2F1.4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Fdmrgfufa4%2Fimage%2Fupload%2Fv1637902941%2Farticles%2Fctfd%2520with%2520https%2F1.4.png" alt="Sample digital ocean server"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After connection to the new server (&lt;code&gt;ssh root@YOUR_IP&lt;/code&gt;), the requirements are the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;[ ] git&lt;/li&gt;
&lt;li&gt;[ ] docker&lt;/li&gt;
&lt;li&gt;[ ] docker-compose&lt;/li&gt;
&lt;li&gt;[ ] some editor (I will use vim)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To install this, I first updated the packages with:&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;sudo &lt;/span&gt;apt update &lt;span class="nt"&gt;-y&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;sudo &lt;/span&gt;apt upgrade &lt;span class="nt"&gt;-y&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  1.1 [OPTIONAL] Installing tmux and nice terminal
&lt;/h3&gt;

&lt;p&gt;I like to have tmux and some preconfigured vim, so I use &lt;a href="https://github.com/roeeyn/dotfiles/blob/master/script/bootstrap_remote_server.sh" rel="noopener noreferrer"&gt;this script&lt;/a&gt; which configures this for me.&lt;/p&gt;

&lt;p&gt;You can have it by executing:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

&lt;span class="c"&gt;# Install zsh&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;zsh

&lt;span class="c"&gt;# Execute bootstrap script&lt;/span&gt;
curl &lt;span class="nt"&gt;-L&lt;/span&gt; https://raw.githubusercontent.com/roeeyn/dotfiles/master/script/bootstrap_remote_server.sh | sh


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;After this, you need to log out and log in again to start with zsh.&lt;/p&gt;

&lt;h3&gt;
  
  
  1.2 Install Docker
&lt;/h3&gt;

&lt;p&gt;Then executed the official commands from &lt;a href="https://docs.docker.com/engine/install/ubuntu/#install-using-the-repository" rel="noopener noreferrer"&gt;Docker documentation&lt;/a&gt;:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

&lt;span class="c"&gt;# Docker requirements&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;ca-certificates curl gnupg lsb-release

&lt;span class="c"&gt;# Docker GPG key&lt;/span&gt;
curl &lt;span class="nt"&gt;-fsSL&lt;/span&gt; https://download.docker.com/linux/ubuntu/gpg | &lt;span class="nb"&gt;sudo &lt;/span&gt;gpg &lt;span class="nt"&gt;--dearmor&lt;/span&gt; &lt;span class="nt"&gt;-o&lt;/span&gt; /usr/share/keyrings/docker-archive-keyring.gpg

&lt;span class="c"&gt;# Docker setup of the stable repository&lt;/span&gt;
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="s2"&gt;"deb [arch=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;dpkg &lt;span class="nt"&gt;--print-architecture&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt; signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;&lt;span class="s2"&gt;
  &lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;lsb_release &lt;span class="nt"&gt;-cs&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt; stable"&lt;/span&gt; | &lt;span class="nb"&gt;sudo tee&lt;/span&gt; /etc/apt/sources.list.d/docker.list &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; /dev/nul

&lt;span class="c"&gt;# Docker installation&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt update &lt;span class="nt"&gt;-y&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;docker-ce docker-ce-cli containerd.io


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  1.3 Install Docker Compose
&lt;/h3&gt;

&lt;p&gt;Following the official docker-compose &lt;a href="https://docs.docker.com/compose/install/" rel="noopener noreferrer"&gt;documentation&lt;/a&gt;, we can install this with:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

&lt;span class="c"&gt;# Get the docker-compose binary&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;curl &lt;span class="nt"&gt;-L&lt;/span&gt; &lt;span class="s2"&gt;"https://github.com/docker/compose/releases/download/1.29.2/docker-compose-&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;uname&lt;/span&gt; &lt;span class="nt"&gt;-s&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;-&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;uname&lt;/span&gt; &lt;span class="nt"&gt;-m&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="nt"&gt;-o&lt;/span&gt; /usr/local/bin/docker-compose

&lt;span class="c"&gt;# Make it executable&lt;/span&gt;
&lt;span class="nb"&gt;sudo chmod&lt;/span&gt; +x /usr/local/bin/docker-compose


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
  
  
  2. Clone the CTFd repository
&lt;/h2&gt;

&lt;p&gt;We need to clone the CTFd repository, which contains all the files that we need to set up our platform.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

git clone https://github.com/CTFd/CTFd.git


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
  
  
  3. Initialize the Platform
&lt;/h2&gt;

&lt;p&gt;After cloning the repo, we can access the CTFd directory with &lt;code&gt;cd CTFd&lt;/code&gt; and there we can see all the platform files.&lt;/p&gt;

&lt;p&gt;To initialize the platform we can execute:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

&lt;span class="c"&gt;# If you would like to see the logs (recommended)&lt;/span&gt;
docker-compose up

&lt;span class="c"&gt;# If you just trust that everything is going well (no logs)&lt;/span&gt;
docker-compose up &lt;span class="nt"&gt;-d&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;This will pull all the docker images and create all the needed containers. After finishing the startup process, the landing page of &lt;strong&gt;the platform should be available in the public ip&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Fdmrgfufa4%2Fimage%2Fupload%2Fv1637902940%2Farticles%2Fctfd%2520with%2520https%2F3.1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Fdmrgfufa4%2Fimage%2Fupload%2Fv1637902940%2Farticles%2Fctfd%2520with%2520https%2F3.1.png" alt="Proof of working IP"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here you will need to set up the information about your CTF.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Fdmrgfufa4%2Fimage%2Fupload%2Fv1637902942%2Farticles%2Fctfd%2520with%2520https%2F3.2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Fdmrgfufa4%2Fimage%2Fupload%2Fv1637902942%2Farticles%2Fctfd%2520with%2520https%2F3.2.png" alt="Proof of working IP"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Add the IP to your DNS
&lt;/h2&gt;

&lt;p&gt;When you already have your platform up and running, you need to register it to your domain. For this, I'm using &lt;a href="https://domains.google.com/" rel="noopener noreferrer"&gt;Google domains&lt;/a&gt;, and you need to add an A register to the domain. In my case, it looks like the following:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Fdmrgfufa4%2Fimage%2Fupload%2Fv1637902941%2Farticles%2Fctfd%2520with%2520https%2F4.1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Fdmrgfufa4%2Fimage%2Fupload%2Fv1637902941%2Farticles%2Fctfd%2520with%2520https%2F4.1.png" alt="Google Domains demo"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If everything went well, at this point you should already be having the platform at your domain (with NO certificate or https yet).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Fdmrgfufa4%2Fimage%2Fupload%2Fv1637902941%2Farticles%2Fctfd%2520with%2520https%2F4.2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Fdmrgfufa4%2Fimage%2Fupload%2Fv1637902941%2Farticles%2Fctfd%2520with%2520https%2F4.2.png" alt="Proof of working domain"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Add a Certificate with Certbot (Let's Encrypt)
&lt;/h2&gt;

&lt;p&gt;For adding a certificate we need to execute some more steps.&lt;/p&gt;

&lt;h3&gt;
  
  
  5.1 Generate a certificate
&lt;/h3&gt;

&lt;p&gt;Before creating the certbot certificate, make sure to &lt;strong&gt;stop all the containers from the previous steps&lt;/strong&gt;.&lt;br&gt;
If you ran your containers from previous steps in &lt;em&gt;normal&lt;/em&gt; mode (no &lt;code&gt;-d&lt;/code&gt; after &lt;code&gt;docker-compose&lt;/code&gt;), you can only press Ctrl-C in the running process.&lt;br&gt;
If you ran your containers from previous steps in detached moded (with the &lt;code&gt;-d&lt;/code&gt; flag after &lt;code&gt;docker-compose&lt;/code&gt;) you should execute &lt;code&gt;docker-compose down&lt;/code&gt; inside the &lt;code&gt;CTFd&lt;/code&gt; directory.&lt;/p&gt;

&lt;p&gt;The easiest way to generate a certificate is with the certbot docker image. Following the &lt;a href="https://eff-certbot.readthedocs.io/en/stable/install.html#running-with-docker" rel="noopener noreferrer"&gt;official documentation&lt;/a&gt;, this can be done with the following:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

docker run &lt;span class="nt"&gt;-it&lt;/span&gt; &lt;span class="nt"&gt;--rm&lt;/span&gt; &lt;span class="nt"&gt;--name&lt;/span&gt; certbot &lt;span class="se"&gt;\&lt;/span&gt;
          &lt;span class="nt"&gt;-v&lt;/span&gt; &lt;span class="s2"&gt;"/etc/letsencrypt:/etc/letsencrypt"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
          &lt;span class="nt"&gt;-v&lt;/span&gt; &lt;span class="s2"&gt;"/var/lib/letsencrypt:/var/lib/letsencrypt"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
          certbot/certbot certonly


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;We should select the &lt;code&gt;Spin up a temporary server&lt;/code&gt; option, enter your email, accept the agreements, and enter the domain we're planning to use.&lt;br&gt;
This is similar to what you should see:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

➜  ~ docker run -it --rm --name certbot \
            -v "/etc/letsencrypt:/etc/letsencrypt" \
            -v "/var/lib/letsencrypt:/var/lib/letsencrypt" \
            -p 80:80 -p 443:443 certbot/certbot certonly

Saving debug log to /var/log/letsencrypt/letsencrypt.log

How would you like to authenticate with the ACME CA?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: Spin up a temporary webserver (standalone)
2: Place files in webroot directory (webroot)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 1
Enter email address (used for urgent renewal and security notices)
 (Enter 'c' to cancel): rodrigo.medina.neri@gmail.com

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Please read the Terms of Service at
https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf. You must
agree in order to register with the ACME server. Do you agree?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: Y

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Would you be willing, once your first certificate is successfully issued, to
share your email address with the Electronic Frontier Foundation, a founding
partner of the Let's Encrypt project and the non-profit organization that
develops Certbot? We'd like to send you email about our work encrypting the web,
EFF news, campaigns, and ways to support digital freedom.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: Y
Account registered.
Please enter the domain name(s) you would like on your certificate (comma and/or
space separated) (Enter 'c' to cancel): examplectf.manguitoblue.io
Requesting a certificate for examplectf.manguitoblue.io

Successfully received certificate.
Certificate is saved at: /etc/letsencrypt/live/examplectf.manguitoblue.io/fullchain.pem
Key is saved at:         /etc/letsencrypt/live/examplectf.manguitoblue.io/privkey.pem
This certificate expires on 2022-02-24.
These files will be updated when the certificate renews.

NEXT STEPS:
- The certificate will need to be renewed before it expires. Certbot can automatically renew the certificate in the background, but you may need to take steps to enable that functionality. See https://certbot.org/renewal-setup for instructions.
We were unable to subscribe you the EFF mailing list because your e-mail address appears to be invalid. You can try again later by visiting https://act.eff.org.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
If you like Certbot, please consider supporting our work by:
 * Donating to ISRG / Let's Encrypt:   https://letsencrypt.org/donate
 * Donating to EFF:                    https://eff.org/donate-le
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  5.2 Copy Your Recently Created Certificates
&lt;/h3&gt;

&lt;p&gt;Your certificates should now be in &lt;code&gt;/etc/letsencrypt/live/YOUR_DOMAIN/&lt;/code&gt;. In my case, it is &lt;code&gt;/etc/letsencrypt/live/examplectf.manguitoblue.io/&lt;/code&gt;.&lt;br&gt;
Let's copy &lt;code&gt;fullchain.pem&lt;/code&gt; and &lt;code&gt;privkey.pem&lt;/code&gt; into the CTFd folder, so we can use this inside our nginx container. For this, you can execute:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

&lt;span class="c"&gt;# Inside your CTFd repo directory&lt;/span&gt;
&lt;span class="nb"&gt;cp&lt;/span&gt; /etc/letsencrypt/live/YOUR_DOMAIN/fullchain.pem ./conf/nginx/fullchain.pem
&lt;span class="nb"&gt;cp&lt;/span&gt; /etc/letsencrypt/live/YOUR_DOMAIN/privkey.pem ./conf/nginx/privkey.pem


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  5.3 Modify Your docker-compose Configuration
&lt;/h3&gt;

&lt;p&gt;After copying the certificates to the CTFd files, you need to add them to the nginx container volume, so they can be used inside the container. For this, you need to update the volumes section of the nginx service inside the &lt;code&gt;docker-compose.yml&lt;/code&gt; with the following:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;

&lt;span class="nn"&gt;...&lt;/span&gt;
&lt;span class="na"&gt;volumes&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;./conf/nginx/http.conf:/etc/nginx/nginx.conf&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;./conf/nginx/fullchain.pem:/certificates/fullchain.pem:ro&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;./conf/nginx/privkey.pem:/certificates/privkey.pem:ro&lt;/span&gt;
&lt;span class="nn"&gt;...&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Also, you need to add the https port to the mapping, this is done by adding the following line in the file:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;

&lt;span class="nn"&gt;...&lt;/span&gt;
&lt;span class="na"&gt;ports&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;80:80&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;443:443&lt;/span&gt;
&lt;span class="nn"&gt;...&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;At the end the complete &lt;code&gt;docker-compose.yml&lt;/code&gt; should look something like this:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;

&lt;span class="na"&gt;version&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;2'&lt;/span&gt;

&lt;span class="na"&gt;services&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;ctfd&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;build&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;.&lt;/span&gt;
    &lt;span class="na"&gt;user&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;root&lt;/span&gt;
    &lt;span class="na"&gt;restart&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;always&lt;/span&gt;
    &lt;span class="na"&gt;ports&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;8000:8000"&lt;/span&gt;
    &lt;span class="na"&gt;environment&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;UPLOAD_FOLDER=/var/uploads&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;DATABASE_URL=mysql+pymysql://ctfd:ctfd@db/ctfd&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;REDIS_URL=redis://cache:6379&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;WORKERS=1&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;LOG_FOLDER=/var/log/CTFd&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;ACCESS_LOG=-&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;ERROR_LOG=-&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;REVERSE_PROXY=true&lt;/span&gt;
    &lt;span class="na"&gt;volumes&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;.data/CTFd/logs:/var/log/CTFd&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;.data/CTFd/uploads:/var/uploads&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;.:/opt/CTFd:ro&lt;/span&gt;
    &lt;span class="na"&gt;depends_on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;db&lt;/span&gt;
    &lt;span class="na"&gt;networks&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;default&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;internal&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;

  &lt;span class="na"&gt;nginx&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;nginx:1.17&lt;/span&gt;
    &lt;span class="na"&gt;restart&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;always&lt;/span&gt;
    &lt;span class="na"&gt;volumes&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;./conf/nginx/http.conf:/etc/nginx/nginx.conf&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;./conf/nginx/fullchain.pem:/certificates/fullchain.pem:ro&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;./conf/nginx/privkey.pem:/certificates/privkey.pem:ro&lt;/span&gt;
    &lt;span class="na"&gt;ports&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;80:80&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;443:443&lt;/span&gt;
    &lt;span class="na"&gt;depends_on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;ctfd&lt;/span&gt;

  &lt;span class="na"&gt;db&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;mariadb:10.4.12&lt;/span&gt;
    &lt;span class="na"&gt;restart&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;always&lt;/span&gt;
    &lt;span class="na"&gt;environment&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;MYSQL_ROOT_PASSWORD=ctfd&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;MYSQL_USER=ctfd&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;MYSQL_PASSWORD=ctfd&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;MYSQL_DATABASE=ctfd&lt;/span&gt;
    &lt;span class="na"&gt;volumes&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;.data/mysql:/var/lib/mysql&lt;/span&gt;
    &lt;span class="na"&gt;networks&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;internal&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="c1"&gt;# This command is required to set important mariadb defaults&lt;/span&gt;
    &lt;span class="na"&gt;command&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;mysqld&lt;/span&gt;&lt;span class="pi"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;--character-set-server=utf8mb4&lt;/span&gt;&lt;span class="pi"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;--collation-server=utf8mb4_unicode_ci&lt;/span&gt;&lt;span class="pi"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;--wait_timeout=28800&lt;/span&gt;&lt;span class="pi"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;--log-warnings=0&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;

  &lt;span class="na"&gt;cache&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;redis:4&lt;/span&gt;
    &lt;span class="na"&gt;restart&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;always&lt;/span&gt;
    &lt;span class="na"&gt;volumes&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;.data/redis:/data&lt;/span&gt;
    &lt;span class="na"&gt;networks&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;internal&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;

&lt;span class="na"&gt;networks&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;default&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;internal&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;internal&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  5.4 Modify Your Nginx Configuration
&lt;/h3&gt;

&lt;p&gt;Finally, we need to specify in the &lt;code&gt;conf/nginx/http.conf&lt;/code&gt; that we want to use the certificates and the SSL, and also, redirect any traffic from http to https. For this, we need to do the following:&lt;/p&gt;
&lt;h4&gt;
  
  
  5.4.1 Add the http redirect
&lt;/h4&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight nginx"&gt;&lt;code&gt;

&lt;span class="k"&gt;server&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kn"&gt;listen&lt;/span&gt; &lt;span class="mi"&gt;80&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kn"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;301&lt;/span&gt; &lt;span class="s"&gt;https://&lt;/span&gt;&lt;span class="nv"&gt;$host$request_uri&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h4&gt;
  
  
  5.4.2 Define the SSL certificates
&lt;/h4&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight nginx"&gt;&lt;code&gt;

&lt;span class="k"&gt;server&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kn"&gt;listen&lt;/span&gt; &lt;span class="mi"&gt;443&lt;/span&gt; &lt;span class="s"&gt;ssl&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="kn"&gt;ssl_certificate&lt;/span&gt; &lt;span class="n"&gt;/certificates/fullchain.pem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kn"&gt;ssl_certificate_key&lt;/span&gt; &lt;span class="n"&gt;/certificates/privkey.pem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kn"&gt;ssl_protocols&lt;/span&gt; &lt;span class="s"&gt;TLSv1&lt;/span&gt; &lt;span class="s"&gt;TLSv1.1&lt;/span&gt; &lt;span class="s"&gt;TLSv1.2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kn"&gt;ssl_ciphers&lt;/span&gt; &lt;span class="s"&gt;HIGH:!aNULL:!MD5&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kn"&gt;...&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;In the end, the complete &lt;code&gt;conf/nginx/http.conf&lt;/code&gt; file should look something like this:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight nginx"&gt;&lt;code&gt;

&lt;span class="k"&gt;worker_processes&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;events&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

  &lt;span class="kn"&gt;worker_connections&lt;/span&gt; &lt;span class="mi"&gt;1024&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;http&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

  &lt;span class="c1"&gt;# Configuration containing list of application servers&lt;/span&gt;
  &lt;span class="kn"&gt;upstream&lt;/span&gt; &lt;span class="s"&gt;app_servers&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

    &lt;span class="kn"&gt;server&lt;/span&gt; &lt;span class="nf"&gt;ctfd&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;8000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="kn"&gt;server&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kn"&gt;listen&lt;/span&gt; &lt;span class="mi"&gt;80&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kn"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;301&lt;/span&gt; &lt;span class="s"&gt;https://&lt;/span&gt;&lt;span class="nv"&gt;$host$request_uri&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="kn"&gt;server&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

    &lt;span class="kn"&gt;listen&lt;/span&gt; &lt;span class="mi"&gt;443&lt;/span&gt; &lt;span class="s"&gt;ssl&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="kn"&gt;ssl_certificate&lt;/span&gt; &lt;span class="n"&gt;/certificates/fullchain.pem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kn"&gt;ssl_certificate_key&lt;/span&gt; &lt;span class="n"&gt;/certificates/privkey.pem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kn"&gt;ssl_protocols&lt;/span&gt; &lt;span class="s"&gt;TLSv1&lt;/span&gt; &lt;span class="s"&gt;TLSv1.1&lt;/span&gt; &lt;span class="s"&gt;TLSv1.2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kn"&gt;ssl_ciphers&lt;/span&gt; &lt;span class="s"&gt;HIGH:!aNULL:!MD5&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="kn"&gt;client_max_body_size&lt;/span&gt; &lt;span class="mi"&gt;4G&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="c1"&gt;# Handle Server Sent Events for Notifications&lt;/span&gt;
    &lt;span class="kn"&gt;location&lt;/span&gt; &lt;span class="n"&gt;/events&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

      &lt;span class="kn"&gt;proxy_pass&lt;/span&gt; &lt;span class="s"&gt;http://app_servers&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="kn"&gt;proxy_set_header&lt;/span&gt; &lt;span class="s"&gt;Connection&lt;/span&gt; &lt;span class="s"&gt;''&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="kn"&gt;proxy_http_version&lt;/span&gt; &lt;span class="mf"&gt;1.1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="kn"&gt;chunked_transfer_encoding&lt;/span&gt; &lt;span class="no"&gt;off&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="kn"&gt;proxy_buffering&lt;/span&gt; &lt;span class="no"&gt;off&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="kn"&gt;proxy_cache&lt;/span&gt; &lt;span class="no"&gt;off&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="kn"&gt;proxy_redirect&lt;/span&gt; &lt;span class="no"&gt;off&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="kn"&gt;proxy_set_header&lt;/span&gt; &lt;span class="s"&gt;Host&lt;/span&gt; &lt;span class="nv"&gt;$host&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="kn"&gt;proxy_set_header&lt;/span&gt; &lt;span class="s"&gt;X-Real-IP&lt;/span&gt; &lt;span class="nv"&gt;$remote_addr&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="kn"&gt;proxy_set_header&lt;/span&gt; &lt;span class="s"&gt;X-Forwarded-For&lt;/span&gt; &lt;span class="nv"&gt;$proxy_add_x_forwarded_for&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="kn"&gt;proxy_set_header&lt;/span&gt; &lt;span class="s"&gt;X-Forwarded-Host&lt;/span&gt; &lt;span class="nv"&gt;$server_name&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="c1"&gt;# Proxy connections to the application servers&lt;/span&gt;
    &lt;span class="kn"&gt;location&lt;/span&gt; &lt;span class="n"&gt;/&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

      &lt;span class="kn"&gt;proxy_pass&lt;/span&gt; &lt;span class="s"&gt;http://app_servers&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="kn"&gt;proxy_redirect&lt;/span&gt; &lt;span class="no"&gt;off&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="kn"&gt;proxy_set_header&lt;/span&gt; &lt;span class="s"&gt;Host&lt;/span&gt; &lt;span class="nv"&gt;$host&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="kn"&gt;proxy_set_header&lt;/span&gt; &lt;span class="s"&gt;X-Real-IP&lt;/span&gt; &lt;span class="nv"&gt;$remote_addr&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="kn"&gt;proxy_set_header&lt;/span&gt; &lt;span class="s"&gt;X-Forwarded-For&lt;/span&gt; &lt;span class="nv"&gt;$proxy_add_x_forwarded_for&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="kn"&gt;proxy_set_header&lt;/span&gt; &lt;span class="s"&gt;X-Forwarded-Host&lt;/span&gt; &lt;span class="nv"&gt;$server_name&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
  
  
  6. Restart docker-compose containers
&lt;/h2&gt;

&lt;p&gt;As we needed to stop all the containers to create the certificate, we need to start them again. This time (and if the previous steps worked well) we may run it in detached mode, so they can be living there even when we log out from the remote server. For this, we can execute:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

&lt;span class="c"&gt;# Inside the CTFd repo directory&lt;/span&gt;
docker-compose up &lt;span class="nt"&gt;-d&lt;/span&gt;

&lt;span class="c"&gt;# If you want to be extra cautious you can run:&lt;/span&gt;
&lt;span class="c"&gt;# docker-compose up --force-recreate -d&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;If everything went well, you may now see that the page has a valid certificate.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Fdmrgfufa4%2Fimage%2Fupload%2Fv1637902941%2Farticles%2Fctfd%2520with%2520https%2F5.1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Fdmrgfufa4%2Fimage%2Fupload%2Fv1637902941%2Farticles%2Fctfd%2520with%2520https%2F5.1.png" alt="Proof of working certificate"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Wrap up
&lt;/h2&gt;

&lt;p&gt;Even if they seem to be lots of steps, they aren't as hard as they seem in the beginning. CTFd and certbot are great projects very well maintained and you shouldn't have any issues while using them.&lt;/p&gt;

&lt;p&gt;If this guide helped you, please consider giving it a like.&lt;br&gt;
Good luck in your CTF, and happy hacking!&lt;/p&gt;

</description>
      <category>ctf</category>
      <category>ctfd</category>
      <category>https</category>
    </item>
    <item>
      <title>Export from Org to Markdown in Spacemacs</title>
      <dc:creator>Rodrigo Medina</dc:creator>
      <pubDate>Sat, 10 Oct 2020 22:26:40 +0000</pubDate>
      <link>https://forem.com/roeeyn/export-from-org-to-markdown-in-spacemacs-1dab</link>
      <guid>https://forem.com/roeeyn/export-from-org-to-markdown-in-spacemacs-1dab</guid>
      <description>&lt;p&gt;Org-mode is one of the coolest features in Emacs and this case Spacemacs. It can be used to write documentation, personal notes, and also schedule your events in an awesome agenda.&lt;/p&gt;

&lt;p&gt;In my case, I use Org files to write and export tutorials from one single file to three platforms, which are &lt;a href="https://medium.com/@roeeyn" rel="noopener noreferrer"&gt;Medium&lt;/a&gt;,&lt;a href="https://dev.to/roeeyn"&gt;Dev.to&lt;/a&gt;, and &lt;a href="https://roeeyn.github.io/roeeyn_blog/" rel="noopener noreferrer"&gt;my blog&lt;/a&gt;, using Spacemacs as my main editor. &lt;/p&gt;

&lt;p&gt;To be able to export to a Markdown from an Org file, you need to do the following:&lt;/p&gt;

&lt;h1&gt;
  
  
  1. Make sure you have the markdown layer installed
&lt;/h1&gt;

&lt;p&gt;Having the &lt;a href="https://develop.spacemacs.org/layers/+lang/markdown/README.html#live-preview" rel="noopener noreferrer"&gt;markdown layer&lt;/a&gt; installed will give you a better experience when editing markdown files.&lt;/p&gt;

&lt;h1&gt;
  
  
  2. Add the md export backend into Spacemacs
&lt;/h1&gt;

&lt;p&gt;You need to add the &lt;code&gt;md&lt;/code&gt; value into the export backends variable. The easiest way for me to do this is the following:&lt;/p&gt;

&lt;p&gt;Inside Spacemacs type:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;M-x customize-option 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;and then type &lt;code&gt;org-export-backends&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;It will bring a customization buffer in which you can move with the arrow keys, and select the &lt;code&gt;md&lt;/code&gt; checkbox to enable it, and then press Enter in the &lt;code&gt;Appy and save&lt;/code&gt; button.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Fdmrgfufa4%2Fimage%2Fupload%2Fv1602368202%2Farticles%2Fexport%2520from%2520org%2520to%2520markdown%2520in%2520spacemacs%2Fstep1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Fdmrgfufa4%2Fimage%2Fupload%2Fv1602368202%2Farticles%2Fexport%2520from%2520org%2520to%2520markdown%2520in%2520spacemacs%2Fstep1.png" title="Modifying export backends" alt="Modifying export backends"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  3. Verify the exportation
&lt;/h1&gt;

&lt;p&gt;After applying and saving the new export backend, you can do a new export doing the following:&lt;/p&gt;

&lt;p&gt;With an org file buffer open, type:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;, e e 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Fdmrgfufa4%2Fimage%2Fupload%2Fv1602368203%2Farticles%2Fexport%2520from%2520org%2520to%2520markdown%2520in%2520spacemacs%2Fstep2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Fdmrgfufa4%2Fimage%2Fupload%2Fv1602368203%2Farticles%2Fexport%2520from%2520org%2520to%2520markdown%2520in%2520spacemacs%2Fstep2.png" title="Exporting menu" alt="Exporting menu"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This will open the export menu, and now we will see the new markdown option available. If you want to create a markdown file from your org file, inside the previous menu type:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;m m 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;and this will create a new markdown file from your org file.&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusions
&lt;/h1&gt;

&lt;p&gt;From now on, whenever you want to export an org file to a markdown file, you will only need to follow step 3.&lt;/p&gt;

&lt;p&gt;If you find this useful, please consider giving it a like.&lt;br&gt;
Happy hacking!&lt;/p&gt;

</description>
      <category>spacemacs</category>
      <category>org</category>
      <category>export</category>
      <category>markdown</category>
    </item>
    <item>
      <title>How to Install Spacemacs in MacOS Catalina</title>
      <dc:creator>Rodrigo Medina</dc:creator>
      <pubDate>Sat, 10 Oct 2020 21:36:21 +0000</pubDate>
      <link>https://forem.com/roeeyn/how-to-install-spacemacs-in-macos-catalina-4ebf</link>
      <guid>https://forem.com/roeeyn/how-to-install-spacemacs-in-macos-catalina-4ebf</guid>
      <description>&lt;p&gt;I am a fan of Spacemacs, and whenever I have to install it on a new computer, I have to go to the documentation and scroll for a while. This is why I created this quick guide with all the steps I usually follow.&lt;/p&gt;

&lt;h1&gt;
  
  
  1. Install Emacs
&lt;/h1&gt;

&lt;p&gt;As Spacemacs is based in emacs, we need to install it first. As we're using macOS, the recommended way of doing this is using the brew cask:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;brew cask install emacs 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h1&gt;
  
  
  2. Install Source Code Pro font
&lt;/h1&gt;

&lt;p&gt;This is the font suggested for the editor, and we can do it by using the &lt;code&gt;cask/fonts&lt;/code&gt; tap from homebrew&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;brew tap homebrew/cask-fonts 
brew cask install font-source-code-pro
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h1&gt;
  
  
  3. Clone the Spacemacs Project
&lt;/h1&gt;

&lt;p&gt;Clone the Spacemacs project, it doesn't matter where, we're going to delete it at the end (after copying it).&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git clone https://github.com/syl20bnr/spacemacs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h1&gt;
  
  
  4. Checkout develop branch
&lt;/h1&gt;

&lt;p&gt;As the &lt;code&gt;main&lt;/code&gt; or &lt;code&gt;master&lt;/code&gt; branch is a little outdated, I always use the &lt;code&gt;develop&lt;/code&gt; branch for a better experience.&lt;/p&gt;

&lt;p&gt;So let's get into the folder&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd spacemacs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;And then change the branch that we're going to copy&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git checkout develop 
# Just to make sure everything is updated
git pull origin develop
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h1&gt;
  
  
  5. Copy spacemacs
&lt;/h1&gt;

&lt;p&gt;We need to copy the Spacemacs folder into the &lt;code&gt;~/.emacs.d&lt;/code&gt;. For this, we need to get outside the Spacemacs folder and execute&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cp -a spacemacs ~/.emacs.d
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h1&gt;
  
  
  6. Giving permissions
&lt;/h1&gt;

&lt;p&gt;As MacOS Catalina has new security features, we need to give *&lt;strong&gt;&lt;em&gt;Full Disk Access&lt;/em&gt;&lt;/strong&gt;* to the &lt;code&gt;/usr/bin/ruby&lt;/code&gt; script which is the one that launches Spacemacs.&lt;/p&gt;

&lt;p&gt;For this, go to &lt;code&gt;System Preferences&lt;/code&gt;, and then into &lt;code&gt;Security and Privacy&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Fdmrgfufa4%2Fimage%2Fupload%2Fv1602356666%2Farticles%2FInstall%2520Spacemacs%2520in%2520MacOS%2520Catalina%2Fstep1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Fdmrgfufa4%2Fimage%2Fupload%2Fv1602356666%2Farticles%2FInstall%2520Spacemacs%2520in%2520MacOS%2520Catalina%2Fstep1.png" title="MacOS Security and Privacy" alt="MacOS Security and Privacy"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then, go into &lt;code&gt;Privacy -&amp;gt; Full Disk Access&lt;/code&gt;, and then unlock the lock to enable changes. After that, go and click the add button.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Fdmrgfufa4%2Fimage%2Fupload%2Fv1602356667%2Farticles%2FInstall%2520Spacemacs%2520in%2520MacOS%2520Catalina%2Fstep2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Fdmrgfufa4%2Fimage%2Fupload%2Fv1602356667%2Farticles%2FInstall%2520Spacemacs%2520in%2520MacOS%2520Catalina%2Fstep2.png" title="Full Disk Access" alt="Full Disk Access"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then you need to search for the &lt;code&gt;/usr/bin/ruby&lt;/code&gt; script. The easiest way to do this is with the KeyBoard shortcut&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SHIFT + CMD + G  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Which will open a search window and then there we can type &lt;code&gt;/usr/bin/ruby&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Fdmrgfufa4%2Fimage%2Fupload%2Fv1602356843%2Farticles%2FInstall%2520Spacemacs%2520in%2520MacOS%2520Catalina%2Fstep3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Fdmrgfufa4%2Fimage%2Fupload%2Fv1602356843%2Farticles%2FInstall%2520Spacemacs%2520in%2520MacOS%2520Catalina%2Fstep3.png" title="Full Disk Access" alt="Full Disk Access"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We can click accept and lock again to prevent further changes.&lt;/p&gt;

&lt;h1&gt;
  
  
  7. Verify the access
&lt;/h1&gt;

&lt;p&gt;If you open Spacemacs and the hit&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SPC f f 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;you should be able to go now to the desktop and any folder you want.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Fdmrgfufa4%2Fimage%2Fupload%2Fv1602357529%2Farticles%2FInstall%2520Spacemacs%2520in%2520MacOS%2520Catalina%2Fstep4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Fdmrgfufa4%2Fimage%2Fupload%2Fv1602357529%2Farticles%2FInstall%2520Spacemacs%2520in%2520MacOS%2520Catalina%2Fstep4.png" title="Working File access Spacemacs" alt="Working File access Spacemacs"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If this is useful for you, please consider giving it a like.&lt;br&gt;
Happy hacking!&lt;/p&gt;

</description>
      <category>spacemacs</category>
      <category>macos</category>
    </item>
    <item>
      <title>Basic Security For Your Brand New Server</title>
      <dc:creator>Rodrigo Medina</dc:creator>
      <pubDate>Tue, 06 Oct 2020 04:39:36 +0000</pubDate>
      <link>https://forem.com/roeeyn/basic-security-for-your-brand-new-server-2dn</link>
      <guid>https://forem.com/roeeyn/basic-security-for-your-brand-new-server-2dn</guid>
      <description>&lt;p&gt;Whenever I get a brand new server for whatever reason, I always forget what to do as I only have in mind the project that this server will use. This is why I created a basic security checklist for me, to set up the basic stuff.&lt;/p&gt;

&lt;p&gt;Note: Most of the times I work with Debian based servers, so this checklist will assume that.&lt;/p&gt;

&lt;h1&gt;
  
  
  1. Update and Upgrade
&lt;/h1&gt;

&lt;p&gt;As you're receiving the server for the first time, it may not be necessary to update, but it is always recommended. Also, you may want to upgrade and remove the unused packages.&lt;/p&gt;

&lt;p&gt;For this, you can throw a oneliner:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;apt update -y &amp;amp;&amp;amp; apt upgrade -y &amp;amp;&amp;amp; apt dist-upgrade -y &amp;amp;&amp;amp; apt autoremove -y
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h1&gt;
  
  
  2. Change the root password
&lt;/h1&gt;

&lt;p&gt;Most of the time the first interaction will be through &lt;code&gt;ssh&lt;/code&gt;, using the default root password. This is mostly insecure as the server will be publicly available and some bored guy will have enough time to brute force the password.&lt;/p&gt;

&lt;p&gt;Run this command to change the password (logged as root):&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;passwd 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;I will suggest to logout with &lt;code&gt;exit&lt;/code&gt; and then login again to verify that everything is ok, but it is optional.&lt;/p&gt;

&lt;h1&gt;
  
  
  3. Add another user
&lt;/h1&gt;

&lt;p&gt;Having your main user to be root is not the best of the ways to handle operations. I recommend adding another user that will carry all the usual operations that do not require root access. This will prevent that if the server is compromised, at least they will not have root access.&lt;/p&gt;

&lt;p&gt;To create a new user, run this command:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# I will use pedrito, but you can use whatever username you want
adduser pedrito 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h1&gt;
  
  
  4. Reconfigure SSH Server
&lt;/h1&gt;

&lt;p&gt;It is a good idea to regenerate the ssh keys, even if they are new. This can be done by reconfiguring the &lt;code&gt;open-ssh&lt;/code&gt; server.&lt;/p&gt;

&lt;p&gt;For reconfiguring the ssh server run:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Reconfigure
dpkg-reconfigure openssh-server
# Restart the server
systemctl restart ssh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h1&gt;
  
  
  5. Disable password authentication in sshd_config
&lt;/h1&gt;

&lt;p&gt;Having password authentication is a bad idea because as I said before, attackers will have time to brute-force passwords and we don't want that. That's why we will disable the password auth for ssh and will make available only the pub keys.&lt;/p&gt;

&lt;p&gt;For disabling password auth:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo vim /etc/ssh/sshd_config
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Inside the file we need to change the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  PubkeyAuthentication yes&lt;/li&gt;
&lt;li&gt;  PasswordAuthentication no&lt;/li&gt;
&lt;li&gt;  ChallengeResponseAuthentication no&lt;/li&gt;
&lt;li&gt;  UsePAM no&lt;/li&gt;
&lt;li&gt;  PermitRootLogin no&lt;/li&gt;
&lt;li&gt;  PasswordAuthentication no&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Then, we need to copy our ssh pubkey in the &lt;code&gt;authorized_keys&lt;/code&gt; file.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# inside local machine
cat ~/.ssh/id_rsa.pub | pbcopy

# inside server
mkdir -p /home/pedrito/.ssh
vim authorized_keys
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Inside the &lt;code&gt;authorized_keys&lt;/code&gt; file, you should paste whatever you copy from the &lt;code&gt;id_rsa.pub&lt;/code&gt; JUST AS IT IS.&lt;/p&gt;

&lt;p&gt;Then, you should change the ownership of the &lt;code&gt;.ssh&lt;/code&gt; directory, to the normal user.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;chown -R pedrito:pedrito /home/pedrito/.ssh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Before restarting the system, you may want to give your user some privileges, this can be done with &lt;code&gt;visudo&lt;/code&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;visudo 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;And inside the file:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pedrito  ALL=(ALL) NOPASSWD:ALL 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Finally, restart the ssh service executing:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;systemctl restart ssh 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h1&gt;
  
  
  6. Validate
&lt;/h1&gt;

&lt;p&gt;Validate that you can log in with your ssh keys, by doing:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ssh pedrito@ipaddress 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;This time it will log in automatically because we have the ssh keys. If we try on another computer, it shouldn't let us log in. Also, the only user available for login should be &lt;code&gt;pedrito&lt;/code&gt;, i.e. if we try to login as &lt;code&gt;root&lt;/code&gt; it should throw another error and not proceed.&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusions
&lt;/h1&gt;

&lt;p&gt;This is the basic stuff that works for me. If you find it useful consider giving a like. Happy hacking!&lt;/p&gt;

</description>
      <category>security</category>
      <category>servers</category>
      <category>ubuntu</category>
    </item>
    <item>
      <title>How to Get Ics Files From External Shared Calendars</title>
      <dc:creator>Rodrigo Medina</dc:creator>
      <pubDate>Sat, 29 Aug 2020 02:35:03 +0000</pubDate>
      <link>https://forem.com/roeeyn/how-to-get-ics-files-from-external-shared-calendars-2n2b</link>
      <guid>https://forem.com/roeeyn/how-to-get-ics-files-from-external-shared-calendars-2n2b</guid>
      <description>&lt;p&gt;There can be some scenarios where you require to have all your shared calendars in a &lt;code&gt;.ics&lt;/code&gt; file. In my case, it was the need to have the MLH calendar, that the staff shared to us, shared with my agenda in Spacemacs.&lt;/p&gt;

&lt;p&gt;For doing this, I had to follow the next steps.&lt;/p&gt;

&lt;h1&gt;
  
  
  Get the link
&lt;/h1&gt;

&lt;p&gt;Inside the configuration of the shared calendar, you have to get the &lt;strong&gt;calendar public URL&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--sMQ6TPgV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/dmrgfufa4/image/upload/v1598665559/articles/ics%2520from%2520google%2520calendar/pic1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--sMQ6TPgV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/dmrgfufa4/image/upload/v1598665559/articles/ics%2520from%2520google%2520calendar/pic1.png" alt="img" title="Image of where to get the calendar public URL"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Get the Calendar Id
&lt;/h1&gt;

&lt;p&gt;Now you have to get &lt;code&gt;src&lt;/code&gt; part from the url, for example, if the original url was&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;https://calendar.google.com/calendar/embed?src=en-gb.christian%23holiday%40group.v.calendar.google.com&amp;amp;ctz=Europe%2FParis

en-gb.christian%23holiday%40group.v.calendar.google.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h1&gt;
  
  
  Join the Calendar Id with the Calendar feed
&lt;/h1&gt;

&lt;p&gt;The calendar feed usual structure is the following:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;https://calendar.google.com/calendar/ical/**********/public/basic.ics
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;You need to replace the &lt;code&gt;*&lt;/code&gt; with the url you got in the step 2. In this case, it will end as the following.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;https://calendar.google.com/calendar/ical/en-gb.christian%23holiday%40group.v.calendar.google.com/public/basic.ics
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h1&gt;
  
  
  Download the ics file
&lt;/h1&gt;

&lt;p&gt;Now that you have the file URL, you can download it using &lt;code&gt;wget&lt;/code&gt;.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;wget -O my_cal.ics https://calendar.google.com/calendar/ical/en-gb.christian%23holiday%40group.v.calendar.google.com/public/basic.ics
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;This information was hard to find for me, and if you find it useful, leave a like please. The original answer that provided this solution is found &lt;a href="https://support.google.com/calendar/thread/7353749?msgid=17912822"&gt;here&lt;/a&gt; .&lt;/p&gt;

</description>
      <category>calendar</category>
      <category>google</category>
      <category>ics</category>
    </item>
  </channel>
</rss>
