<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Nitin Reddy</title>
    <description>The latest articles on DEV Community by Nitin Reddy (@nitinkatkam).</description>
    <link>https://dev.to/nitinkatkam</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%2F242551%2F1b01ca53-3b07-40a6-8545-d0acec23708b.jpg</url>
      <title>DEV Community: Nitin Reddy</title>
      <link>https://dev.to/nitinkatkam</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/nitinkatkam"/>
    <language>en</language>
    <item>
      <title>Ruby: IRB tab-autocomplete</title>
      <dc:creator>Nitin Reddy</dc:creator>
      <pubDate>Fri, 19 Feb 2021 06:34:46 +0000</pubDate>
      <link>https://dev.to/nitinkatkam/ruby-irb-tab-autocomplete-4m11</link>
      <guid>https://dev.to/nitinkatkam/ruby-irb-tab-autocomplete-4m11</guid>
      <description>&lt;p&gt;Ruby's IRB is a pretty good environment to quickly test a snippet of code. And when you want to test a snippet of code, you do not necessarily know all of the methods and properties for the objects you are working with. If only there were a tab code-complete feature in IRB.&lt;/p&gt;

&lt;p&gt;...which has been available in IRB since too-long-ago-to-remember.&lt;/p&gt;

&lt;p&gt;What you neeed to do is run this one-line require and then you get autocomplete:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;require 'irb/completion'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For instance, type&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;'red'.cap
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and then press Tab. Auto-complete! :-)&lt;/p&gt;

</description>
      <category>ruby</category>
    </item>
    <item>
      <title>HTTP 418 - I'm a Tea Pot</title>
      <dc:creator>Nitin Reddy</dc:creator>
      <pubDate>Fri, 01 Jan 2021 17:25:25 +0000</pubDate>
      <link>https://dev.to/nitinkatkam/http-418-i-m-a-tea-pot-3i73</link>
      <guid>https://dev.to/nitinkatkam/http-418-i-m-a-tea-pot-3i73</guid>
      <description>&lt;p&gt;We have an &lt;a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/418"&gt;HTTP response code 418&lt;/a&gt; for tea pots. Why would a tea pot be listening on TCP port 80? 🤔 &lt;/p&gt;

</description>
      <category>http</category>
    </item>
    <item>
      <title>Workaround for "rails g scaffold" hangs</title>
      <dc:creator>Nitin Reddy</dc:creator>
      <pubDate>Sat, 26 Dec 2020 17:35:46 +0000</pubDate>
      <link>https://dev.to/nitinkatkam/workaround-for-rails-g-scaffold-hangs-1n49</link>
      <guid>https://dev.to/nitinkatkam/workaround-for-rails-g-scaffold-hangs-1n49</guid>
      <description>&lt;p&gt;If you are running a "rails g scaffold ..." and have the command hanging with no visible sign of activity, Spring is likely playing havoc.&lt;/p&gt;

&lt;p&gt;Rails Spring is a preloader for the Rails framework. If you execute a "spring stop" and re-run the scaffold command, it should work. However, having to stop Spring after every command is going to get aggravating so there's an environment variable you can set - DISABLE_SPRING.&lt;/p&gt;

&lt;p&gt;Run "spring stop" (if it is already running) and then define the DISABLE_SPRING variable like this on a bash prompt:&lt;br&gt;
export DISABLE_SPRING=true&lt;/p&gt;

</description>
      <category>rails</category>
    </item>
    <item>
      <title>GitHub "main" branch</title>
      <dc:creator>Nitin Reddy</dc:creator>
      <pubDate>Sun, 25 Oct 2020 16:48:16 +0000</pubDate>
      <link>https://dev.to/nitinkatkam/github-main-branch-5089</link>
      <guid>https://dev.to/nitinkatkam/github-main-branch-5089</guid>
      <description>&lt;p&gt;If you have created a new GitHub repository recently, you may have noticed that the default branch name is "main" instead of "master". To change the default branch from "main" back to "master" (after creating the "master" branch), and navigate to the Settings &amp;gt; Branches page.&lt;/p&gt;

&lt;p&gt;The master-slave terminology has been removed from most software (MongoDB recently renamed the "rs.slaveOk" command to "rs.secondaryOk") and GitHub is doing its part in promoting equality.&lt;/p&gt;

</description>
      <category>github</category>
    </item>
    <item>
      <title>Creating Certificates with certie</title>
      <dc:creator>Nitin Reddy</dc:creator>
      <pubDate>Sun, 23 Aug 2020 19:27:09 +0000</pubDate>
      <link>https://dev.to/nitinkatkam/creating-certificates-with-certie-2ngi</link>
      <guid>https://dev.to/nitinkatkam/creating-certificates-with-certie-2ngi</guid>
      <description>&lt;p&gt;To setup TLS/SSL for web servers, X.509 client authentication, or even for database servers, you need to have certificate files. The quickest way to generate them, assuming you are on MacOS/Linux, is with certie.&lt;/p&gt;

&lt;p&gt;Installing certie is simple:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo gem install certie
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Following the installation, generating the certificates is as simple as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;certie dev.mymachine.local
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This creates a root certificate and a server certificate in PEM format within the current directory.&lt;/p&gt;

&lt;p&gt;You may want to change the subject prefix by editing the ".certie_subjprefix" file in your home directory. Note that if you change the subject prefix, you would need to start over (delete the contents of the current directory, or create a new directory).&lt;/p&gt;

&lt;h3&gt;
  
  
  Dependencies
&lt;/h3&gt;

&lt;p&gt;If you were unable to successfully execute "gem install certie" above, you likely need to install Ruby and OpenSSL dependencies.&lt;/p&gt;

&lt;p&gt;If you are on RedHat, you may need to install build tools and Ruby:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo yum groupinstall -y "Development Tools"
sudo yum install -y ruby-devel openssl-devel
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For Ubuntu/Debian, the dependencies are installed with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt install -y ruby-dev libssl-dev build-essential
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>certificate</category>
      <category>ssl</category>
    </item>
    <item>
      <title>Building a Desktop GUI App with Ruby</title>
      <dc:creator>Nitin Reddy</dc:creator>
      <pubDate>Sat, 15 Aug 2020 07:15:19 +0000</pubDate>
      <link>https://dev.to/nitinkatkam/building-a-desktop-gui-app-with-ruby-3b0m</link>
      <guid>https://dev.to/nitinkatkam/building-a-desktop-gui-app-with-ruby-3b0m</guid>
      <description>&lt;p&gt;It's 2020 and just about every other blog post on software development captures experiences in web development. Desktop development is as uncommon as spotting an orangutan on a beach. In this blog post, we are going to briefly look at how we can build a desktop user interface using Ruby and the GTK3 library. Also, this post assumes that you are using Mac OS.&lt;/p&gt;

&lt;p&gt;To get started, you would need to install the following dependencies. GTK3 is available as a brew package and so is the Glade user interface designer. We will use the gtk3 gem for Ruby.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;brew install gtk+3
brew install glade
gem install gtk3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you did any kind of programming with Windows Forms, AWT, Swing, native iOS, or native Android, then you have used a GUI library that introduces you to the basics of building desktop user interfaces - they involve adding controls/widgets into layout containers that fit into a top-level window/frame.&lt;/p&gt;

&lt;p&gt;Within the UI heirarchy, Window is a top-level container. You can set properties such as the size, position, and border of windows and can add child widgets to it. The following code creates a new Window object, sets the size property, and adds a delete event handler.&lt;br&gt;
&lt;/p&gt;

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

window = Gtk::Window.new("My Window")
window.set_size_request(300,200)
window.signal_connect "delete-event" do |e|
  Gtk.main_quit
end
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Typically, you would use a layout manager within a window to help with the placement of widgets. Grid layout is pretty simple - all you would need to do is specify the column and row within which you want to place a widget, for instance a label. The code for this appears below.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;grid = Gtk::Grid.new
label = Gtk::Label.new("Name")
grid.attach label, 0, 0, 1, 1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's do something useful by displaying IP addresses within the label:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;require 'socket'
ips = Socket.ip_address_list
label.text = ips.map { |iter| iter.ip_address }.join ("\n")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Looks simple so far? We then put the grid into the window and display it on-screen.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;window.add grid
window.show_all
Gtk.main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You now have a perfectly good way to see the IP addresses of the host you are running this code on. GTK includes lots of widgets from Entry (text boxes) to Notebooks (tabbed panels), which you can see on the &lt;a href="https://developer.gnome.org/gtk3/stable/ch03.html"&gt;widget gallery&lt;/a&gt; at:&lt;br&gt;
&lt;a href="https://developer.gnome.org/gtk3/stable/ch03.html"&gt;https://developer.gnome.org/gtk3/stable/ch03.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can experiment with the code above by adding buttons:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;button = Gtk::Button.new(:label =&amp;gt; "Click Me")
button.signal_connect "clicked" do |e|
  puts "Hello"  # Displayed on the text console that you run the script from
end
grid.attach button, 0, 1, 1, 1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As the user interface gets more complex, you may want to use the Glade UI designer instead of hand-coding the interface.&lt;/p&gt;

</description>
      <category>ruby</category>
    </item>
    <item>
      <title>Directories within root after upgrading to MacOS Catalina (10.15)</title>
      <dc:creator>Nitin Reddy</dc:creator>
      <pubDate>Sun, 20 Oct 2019 19:16:34 +0000</pubDate>
      <link>https://dev.to/nitinkatkam/directories-within-root-after-upgrading-to-macos-catalina-10-15-2opj</link>
      <guid>https://dev.to/nitinkatkam/directories-within-root-after-upgrading-to-macos-catalina-10-15-2opj</guid>
      <description>&lt;p&gt;After upgrading to MacOS Catalina, you would no longer be able to create directories in the root directory. On attempting to create a directory, you would see a “Read-only file system” error:&lt;/p&gt;

&lt;p&gt;Nitins-MacBook-Pro:/ nitin$ sudo mkdir -p /data/db&lt;br&gt;
  Password:&lt;br&gt;
  mkdir: /data/db: Read-only file system&lt;br&gt;
  Nitins-MacBook-Pro:/ nitin$ &lt;/p&gt;

&lt;p&gt;Upon upgrading, directories existing within the root directory are moved to the path “/Users/Shared/Relocated Items/Security“ and a shortcut on the desktop named “Relocated Items” is created.&lt;/p&gt;

&lt;p&gt;Also see: "Dedicated system volume" at &lt;a href="https://www.apple.com/macos/catalina/features/"&gt;https://www.apple.com/macos/catalina/features/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>catalina</category>
    </item>
    <item>
      <title>MacOS Catalina defaults to zsh</title>
      <dc:creator>Nitin Reddy</dc:creator>
      <pubDate>Fri, 11 Oct 2019 15:24:18 +0000</pubDate>
      <link>https://dev.to/nitinkatkam/macos-catalina-defaults-to-zsh-5dc8</link>
      <guid>https://dev.to/nitinkatkam/macos-catalina-defaults-to-zsh-5dc8</guid>
      <description>&lt;p&gt;If you are on MacOS, you have probably noticed that MacOS now has zsh as the default shell instead of bash. If you haven't, you are doing a great job of ignoring the motd on opening the terminal :-)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;The default interactive shell is now zsh.
To update your account to use zsh, please run `chsh -s /bin/zsh`.
For more details, please visit https://support.apple.com/kb/HT208050.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;MacOS had bash as the default shell for the Terminal since Panther (OS X 10.3). However, when bash v.4 was released under the GPL v3 license (previous versions of bash were released under the GPL v2 license), Apple decided to switch to zsh. bash is still available on Mojave (OS X 10.14) and Catalina (OS X 10.15) so your bash scripts would still run.&lt;/p&gt;

&lt;p&gt;As a developer, the most obvious change is that for changes to the shell environment, you have to edit the .zshrc file instead of the .bashrc file and the .zprofile file instead of .bash_profile. The command history is in .zsh_history instead of .bash_history. &lt;/p&gt;

</description>
      <category>macos</category>
    </item>
  </channel>
</rss>
