<?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: Loknath Dhar</title>
    <description>The latest articles on DEV Community by Loknath Dhar (@dhar01).</description>
    <link>https://dev.to/dhar01</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%2F358924%2Fdc24009b-464b-435f-aa73-7c2fcc456a89.jpg</url>
      <title>DEV Community: Loknath Dhar</title>
      <link>https://dev.to/dhar01</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dhar01"/>
    <language>en</language>
    <item>
      <title>SSL with Apache Solr</title>
      <dc:creator>Loknath Dhar</dc:creator>
      <pubDate>Wed, 24 Aug 2022 09:27:00 +0000</pubDate>
      <link>https://dev.to/dhar01/ssl-with-apache-solr-4gfh</link>
      <guid>https://dev.to/dhar01/ssl-with-apache-solr-4gfh</guid>
      <description>&lt;h1&gt;
  
  
  Setting up SSL
&lt;/h1&gt;

&lt;p&gt;As I am highly dependent on official documentation, I found that Apache Solr maintain an awesome documentation from which I learned a lot. Setting up SSL can be found &lt;a href="https://solr.apache.org/guide/solr/latest/deployment-guide/enabling-ssl.html"&gt;here&lt;/a&gt;. I am writing this for easier step by step setup.&lt;/p&gt;

&lt;p&gt;Happy Searching!&lt;/p&gt;

&lt;h1&gt;
  
  
  Generate certificate &amp;amp; key
&lt;/h1&gt;

&lt;p&gt;From the official documentation, you can generate a self-signed certificate to test your setup. But for the trusted authority, generate a certificate and convert it to &lt;code&gt;.pfx&lt;/code&gt; format, which is type &lt;code&gt;PKCS12&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;And before starting Solr, we need to configure zookeeper.&lt;/p&gt;

&lt;h1&gt;
  
  
  Configure Zookeeper
&lt;/h1&gt;

&lt;p&gt;We must configure Solr cluster properties in Zookeeper so that Solr nodes know to communicate via SSL. After creating, setting up and starting Zookeeper, we need to setup &lt;code&gt;urlScheme&lt;/code&gt; cluster-wide property to &lt;code&gt;https&lt;/code&gt; before any Solr nodes start up.&lt;/p&gt;

&lt;p&gt;For &lt;em&gt;Unix&lt;/em&gt;, go to &lt;code&gt;$solr_home&lt;/code&gt; and run,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;server/scripts/cloud-scripts/zkcli.sh &lt;span class="nt"&gt;-zkhost&lt;/span&gt; server1:2181,server2:2181,server3:2181 &lt;span class="nt"&gt;-cmd&lt;/span&gt; clusterprop &lt;span class="nt"&gt;-name&lt;/span&gt; urlScheme &lt;span class="nt"&gt;-val&lt;/span&gt; https
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For existing collections, we can update cluster properties by using the Collections API (&lt;em&gt;CLUSTERPROP&lt;/em&gt;):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;http://IP:8983/solr/admin/collections?action&lt;span class="o"&gt;=&lt;/span&gt;CLUSTERPROP&amp;amp;name&lt;span class="o"&gt;=&lt;/span&gt;urlScheme&amp;amp;val&lt;span class="o"&gt;=&lt;/span&gt;https
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command only needs to be run on one node of the cluster, the change will apply to all nodes.&lt;/p&gt;

&lt;h1&gt;
  
  
  Configure Solr
&lt;/h1&gt;

&lt;p&gt;At this point, I think we all have set up zookeeper properly, have certificates and key at hand and didn't start Solr. Now, let's set up system properties of Solr in &lt;code&gt;$solr_home/bin/solr.in.sh&lt;/code&gt; or, &lt;code&gt;/etc/default/solr.in.sh&lt;/code&gt;:&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="nv"&gt;SOLR_SSL_ENABLED&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nb"&gt;true
&lt;/span&gt;&lt;span class="nv"&gt;SOLR_SSL_KEY_STORE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/etc/solr-ssl.keystore.p12    &lt;span class="c"&gt;# define your store path&lt;/span&gt;
&lt;span class="nv"&gt;SOLR_SSL_KEY_STORE_PASSWORD&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;secret    &lt;span class="c"&gt;# use your store password&lt;/span&gt;
&lt;span class="nv"&gt;SOLR_SSL_TRUST_STORE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/etc/solr-ssl.keystore.p12    &lt;span class="c"&gt;# define your store path&lt;/span&gt;
&lt;span class="nv"&gt;SOLR_SSL_TRUST_STORE_PASSWORD&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;secret    &lt;span class="c"&gt;# use your store password&lt;/span&gt;
&lt;span class="nv"&gt;SOLR_SSL_NEED_CLIENT_AUTH&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nb"&gt;false
&lt;/span&gt;&lt;span class="nv"&gt;SOLR_SSL_WANT_CLIENT_AUTH&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nb"&gt;false
&lt;/span&gt;&lt;span class="nv"&gt;SOLR_SSL_CHECK_PEER_NAME&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nb"&gt;true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, start Solr and it's working.&lt;/p&gt;

&lt;p&gt;If you use curl, see the official documentation section on how to use curl in case of SSL.&lt;/p&gt;

</description>
      <category>apache</category>
      <category>solr</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Setting up SolrCloud for Production</title>
      <dc:creator>Loknath Dhar</dc:creator>
      <pubDate>Thu, 28 Jul 2022 11:30:00 +0000</pubDate>
      <link>https://dev.to/dhar01/setting-up-solrcloud-for-production-5bed</link>
      <guid>https://dev.to/dhar01/setting-up-solrcloud-for-production-5bed</guid>
      <description>&lt;p&gt;I wasn't familiar with SolrCloud when I started working with this. When I started to learn it and worked directly with it - I did so many mistakes. Even setting up SolrCloud for production was a hassle for me (&lt;em&gt;I'm a slow learner&lt;/em&gt;). But overtime, I got a hang of it and I think writing an up-to-date guide to set up SolrCloud on production server is a good idea.&lt;/p&gt;

&lt;p&gt;The official documentation is amazing enough and you should read it. &lt;strong&gt;This post is very straight forward&lt;/strong&gt;. If you want any explanation and want to &lt;em&gt;know/learn&lt;/em&gt; more, please consult official documentation.&lt;/p&gt;

&lt;p&gt;Let's get started.&lt;/p&gt;

&lt;p&gt;(&lt;em&gt;I'm writing this guide with the experience of Linux servers&lt;/em&gt;)&lt;/p&gt;

&lt;p&gt;To easily go to the installation directory, I put these on &lt;code&gt;.bashrc&lt;/code&gt;:&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="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;solr_home&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/opt/solr
&lt;span class="nv"&gt;PATH&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/opt/solr/bin:&lt;span class="nv"&gt;$PATH&lt;/span&gt;

&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;zookeeper_home&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/opt/zookeeper
&lt;span class="nv"&gt;PATH&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/opt/zookeeper/bin:&lt;span class="nv"&gt;$PATH&lt;/span&gt;

&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; &lt;span class="nv"&gt;$zookeeper_home&lt;/span&gt;    &lt;span class="c"&gt;# will take to /opt/zookeeper&lt;/span&gt;
&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; &lt;span class="nv"&gt;$solr_home&lt;/span&gt;    &lt;span class="c"&gt;# will take to /opt/solr&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Note that, this &lt;code&gt;solr_home&lt;/code&gt; and &lt;code&gt;SOLR_HOME&lt;/code&gt; variable isn't same.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Zookeeper
&lt;/h2&gt;

&lt;p&gt;To bring the SolrCloud into production, we need external zookeeper (&lt;em&gt;not the embedded one&lt;/em&gt;) server to manage our configuration and coordination centrally. We're going to work with 3 servers. We will install zookeeper and Apache Solr into all servers with same configuration.&lt;/p&gt;

&lt;p&gt;First, let's configure our &lt;a href="https://zookeeper.apache.org/"&gt;Apache Zookeeper&lt;/a&gt;. Install desired Java version according to the official documentation. At the time of writing, the latest Zookeeper and Solr - both needs Java 11.&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="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;openjdk-11-jdk

&lt;span class="c"&gt;# check java version&lt;/span&gt;
&lt;span class="nv"&gt;$ &lt;/span&gt;java &lt;span class="nt"&gt;-version&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Download the latest stable version from the official website. Notice that we don't want the source (&lt;em&gt;src&lt;/em&gt;) bundle, we need the binary (&lt;em&gt;bin&lt;/em&gt;) version.&lt;/p&gt;

&lt;h3&gt;
  
  
  Installation and configuration
&lt;/h3&gt;

&lt;p&gt;It's not recommended to work with them while on root. But I'm going to work as a root user. My installation directory will be under &lt;code&gt;/opt&lt;/code&gt;.&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="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;tar&lt;/span&gt; &lt;span class="nt"&gt;-xvf&lt;/span&gt; zookeeper-&lt;span class="k"&gt;*&lt;/span&gt;.tar.gz &lt;span class="nt"&gt;-C&lt;/span&gt; /opt

&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;ln&lt;/span&gt; &lt;span class="nt"&gt;-s&lt;/span&gt; /opt/zookeeper-&lt;span class="k"&gt;*&lt;/span&gt; /opt/zookeeper
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We need to create a configuration file for zookeeper under &lt;code&gt;$zookeepr_home/conf/&lt;/code&gt;. The file name will be &lt;code&gt;zoo.cfg&lt;/code&gt;:&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="nv"&gt;tickTime&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;2000
&lt;span class="nv"&gt;dataDir&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/var/lib/zookeeper/data
&lt;span class="nv"&gt;dataLogDir&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/var/lib/zookeeper/logs

&lt;span class="nv"&gt;clientPort&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;2181
4lw.commands.whitelist&lt;span class="o"&gt;=&lt;/span&gt;mntr,conf,ruok

&lt;span class="nv"&gt;initLimit&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;5
&lt;span class="nv"&gt;syncLimit&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;2

&lt;span class="c"&gt;# put IP addresses or host on the place of Server1, Server2, Server3&lt;/span&gt;
server.1&lt;span class="o"&gt;=&lt;/span&gt;Server1:2888:3888
server.2&lt;span class="o"&gt;=&lt;/span&gt;Server2:2888:3888
server.3&lt;span class="o"&gt;=&lt;/span&gt;Server3:2888:3888

autopurge.snapRetainCount&lt;span class="o"&gt;=&lt;/span&gt;3
autopurge.purgeInterval&lt;span class="o"&gt;=&lt;/span&gt;1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We will create a zookeeper environment file in the same place of &lt;code&gt;zoo.cfg&lt;/code&gt;, which is under &lt;code&gt;$zookeeper_home/conf&lt;/code&gt;. The file name will be &lt;code&gt;zookeeper-env.sh&lt;/code&gt;:&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="nv"&gt;JAVA_HOME&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"/usr/lib/jvm/java-1.11.0-openjdk-amd64"&lt;/span&gt;
&lt;span class="nv"&gt;ZOO_LOG_DIR&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"/var/lib/zookeeper/logs"&lt;/span&gt;
&lt;span class="nv"&gt;ZOO_LOG4J_PROP&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"INFO,ROLLINGFILE"&lt;/span&gt;

&lt;span class="c"&gt;# increaseing the file size limit to 50MiB&lt;/span&gt;
&lt;span class="nv"&gt;JVMFLAGS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$JVMFLAGS&lt;/span&gt;&lt;span class="s2"&gt; -Djute.maxbuffer=50000000"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create directories defined on the configuration:&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="nb"&gt;mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; /var/lib/zookeeper/data
&lt;span class="nb"&gt;mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; /var/lib/zookeeper/logs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create a &lt;code&gt;myid&lt;/code&gt; text file under &lt;code&gt;/var/lib/zookeeper/data&lt;/code&gt;directory. Put the server id in that file with a single line. In case of server 2, the file will contain: &lt;code&gt;2&lt;/code&gt;&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="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"2"&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt;/var/lib/zookeeper/data/myid
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now you can start zookeeper whenever you want but it need to be started before Solr.&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="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; &lt;span class="nv"&gt;$zookeeper_home&lt;/span&gt;
&lt;span class="nv"&gt;$ &lt;/span&gt;bin/zkServer.sh start
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Apache SolrCloud
&lt;/h2&gt;

&lt;p&gt;Download latest Solr (&lt;em&gt;bin version&lt;/em&gt;) on the server, move file to the &lt;code&gt;/opt&lt;/code&gt; and extract it.&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="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;tar &lt;/span&gt;xzf solr-&lt;span class="k"&gt;*&lt;/span&gt;.tgz solr-&lt;span class="k"&gt;*&lt;/span&gt;/bin/install_solr_service.sh &lt;span class="nt"&gt;--strip-components&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Install it under &lt;code&gt;/opt&lt;/code&gt;.&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="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;bash ./install_solr_service.sh solr-&lt;span class="k"&gt;*&lt;/span&gt;.tgz
&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;ln&lt;/span&gt; &lt;span class="nt"&gt;-s&lt;/span&gt; solr-&lt;span class="k"&gt;*&lt;/span&gt;/ solr
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Edit &lt;code&gt;bin/solr.in.sh&lt;/code&gt; for some configuration. We can also set this system wide by creating a file under &lt;code&gt;/etc/default&lt;/code&gt;.&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;#writing include file&lt;/span&gt;

&lt;span class="nv"&gt;SOLR_PID_DIR&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/var/solr
&lt;span class="nv"&gt;SOLR_HOME&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/var/solr/data

&lt;span class="c"&gt;#LOG SETTINGS&lt;/span&gt;

&lt;span class="nv"&gt;LOG4J_PROPS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/var/solr/log4j2.xml
&lt;span class="nv"&gt;SOLR_LOGS_DIR&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/var/solr/logs

&lt;span class="nv"&gt;SOLR_HEAP&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"1g"&lt;/span&gt;

&lt;span class="nv"&gt;SOLR_JAVA_HOME&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"/usr/lib/jvm/java-1.11.0-openjdk-amd64"&lt;/span&gt;
&lt;span class="nv"&gt;ZK_HOST&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"zk-server1:2181,zk-server2:2181,zk-server3:2181"&lt;/span&gt;
&lt;span class="nv"&gt;SOLR_LOG_LEVEL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;INFO

&lt;span class="c"&gt;# Data backup location for replication environment&lt;/span&gt;
&lt;span class="nv"&gt;SOLR_OPTS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$SOLR_OPTS&lt;/span&gt;&lt;span class="s2"&gt; -Dsolr.allowPaths=/mnt/solr_backup"&lt;/span&gt;

&lt;span class="c"&gt;# for soft commits&lt;/span&gt;
&lt;span class="nv"&gt;SOLR_OPTS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$SOLR_OPTS&lt;/span&gt;&lt;span class="s2"&gt; -Dsolr.autoSoftCommit.maxTime=10000"&lt;/span&gt;
&lt;span class="nv"&gt;SOLR_HOST&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"zk-server-ip"&lt;/span&gt; &lt;span class="c"&gt;# current server IP address&lt;/span&gt;

&lt;span class="nv"&gt;SOLR_JAVA_MEM&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"-Xms2g -Xmx2g"&lt;/span&gt;
&lt;span class="nv"&gt;ZK_CLIENT_TIMEOUT&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"30000"&lt;/span&gt;
&lt;span class="nv"&gt;SOLR_PORT&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;8983

&lt;span class="c"&gt;# To make available on the public internet&lt;/span&gt;
&lt;span class="nv"&gt;SOLR_JETTY_HOST&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"0.0.0.0"&lt;/span&gt;

&lt;span class="c"&gt;# set this up in case if you set up authentication. &lt;/span&gt;
&lt;span class="c"&gt;# By setting this, the script will run without error&lt;/span&gt;
&lt;span class="nv"&gt;SOLR_AUTH_TYPE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"basic"&lt;/span&gt;
&lt;span class="nv"&gt;SOLR_AUTHENTICATION_OPTS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"-Dbasicauth=username:password"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create directories defined in the configuration:&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="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; /var/solr/data
&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; /var/solr/logs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And it's done.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;You have to configure all servers like this.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Start SolrCloud by using the script:&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="nv"&gt;$ &lt;/span&gt;bin/solr start &lt;span class="nt"&gt;-c&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; 8983 &lt;span class="nt"&gt;-s&lt;/span&gt; /var/solr/data &lt;span class="nt"&gt;-z&lt;/span&gt; zk1:2181,zk2:2181,zk3:2181 &lt;span class="nt"&gt;-force&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To get help:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;bin/solr start &lt;span class="nt"&gt;-help&lt;/span&gt;
bin/solr restart &lt;span class="nt"&gt;-help&lt;/span&gt; &lt;span class="c"&gt;# you got the point how to get help&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I hope you are able to get the SolrCloud running without any errors.&lt;/p&gt;

&lt;p&gt;Use &lt;code&gt;bin/solr&lt;/code&gt; script to interact with Solr and Zookeeper. To know more, use official documentation.&lt;/p&gt;

&lt;p&gt;To create a collection:&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="nv"&gt;$ &lt;/span&gt;bin/solr create_collection &lt;span class="nt"&gt;-c&lt;/span&gt; col_name &lt;span class="nt"&gt;-d&lt;/span&gt; _default &lt;span class="nt"&gt;-shards&lt;/span&gt; 1 &lt;span class="nt"&gt;-replicationFactor&lt;/span&gt; 3 &lt;span class="nt"&gt;-p&lt;/span&gt; 8983 &lt;span class="nt"&gt;-V&lt;/span&gt; &lt;span class="nt"&gt;-force&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To delete a collection:&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="nv"&gt;$ &lt;/span&gt;bin/solr delete &lt;span class="nt"&gt;-c&lt;/span&gt; col_name &lt;span class="nt"&gt;-deleteConfig&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; 8983 &lt;span class="nt"&gt;-V&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's all. I will try to update this post from time to time. I'm also planning to include some useful commands later.&lt;/p&gt;

&lt;p&gt;Hope, things are working.&lt;/p&gt;

&lt;p&gt;Happy searching!&lt;/p&gt;

</description>
      <category>solr</category>
      <category>apache</category>
      <category>administration</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Setting up Codeblocks with Freeglut on Linux</title>
      <dc:creator>Loknath Dhar</dc:creator>
      <pubDate>Sat, 06 Feb 2021 05:17:19 +0000</pubDate>
      <link>https://dev.to/dhar01/setting-up-codeblocks-with-freeglut-in-linux-9if</link>
      <guid>https://dev.to/dhar01/setting-up-codeblocks-with-freeglut-in-linux-9if</guid>
      <description>&lt;p&gt;In my Computer Graphics class, the teacher asked us to setup Codeblocks for the glut. She gave us an amazing tutorial on how to setup Codeblocks on windows but didn't provide any suggestion to set up on Linux. After some researching on google, I was able to setup Codeblocks with &lt;strong&gt;Freeglut&lt;/strong&gt; (&lt;em&gt;which is an alternative to Glut and available on Linux&lt;/em&gt;). This is a kind of writeup (&lt;em&gt;or tutorial&lt;/em&gt;) on how I was able to setup Codeblocks with Freeglut.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;This setup is tested and working on Pop os, as of writing, should be working with Ubuntu/Debian with the latest Codeblocks. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Also, I linked to the posts from where I collected these and setting up Codeblocks to work properly. &lt;/p&gt;

&lt;h1&gt;
  
  
  Installation Part
&lt;/h1&gt;

&lt;p&gt;To work with all of these, of course, we have to install all the necessary files.&lt;/p&gt;

&lt;p&gt;For Freeglut:&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 g++ freeglut3 freeglut3-dev

sudo apt install libxmu-dev libxi-dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For Codeblocks:&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 codeblocks
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For &lt;a href="https://en.wikibooks.org/wiki/OpenGL_Programming/Installation/Linux" rel="noopener noreferrer"&gt;OpenGL&lt;/a&gt;:&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 build-essential libgl1-mesa-dev

sudo apt install libglew-dev libsdl2-dev libsdl2-image-dev libglm-dev libfreetype6-dev  # some libraries
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check OpenGL installation:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;glxinfo | grep OpenGL
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Setup Part
&lt;/h1&gt;

&lt;p&gt;Open Codeblocks, go to &lt;code&gt;settings &amp;gt; Global Variables&lt;/code&gt;.&lt;br&gt;
Click &lt;code&gt;new&lt;/code&gt;, it should look like this:&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fmbr16y8x8ejw824ka5ox.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fmbr16y8x8ejw824ka5ox.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;type &lt;code&gt;freeglut&lt;/code&gt;, press ok and setup the rest like this:&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F1hez3gb1srizxze6bqbl.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F1hez3gb1srizxze6bqbl.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now close the Codeblocks.&lt;/p&gt;

&lt;p&gt;Resting part is collected from &lt;a href="http://forums.codeblocks.org/index.php?topic=17291.0" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Go to &lt;code&gt;/usr/share/codeblocks/templates&lt;/code&gt;, create the file &lt;code&gt;freeglut.cbp&lt;/code&gt; and put the following code there:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?xml version="1.0" encoding="UTF-8" standalone="yes" ?&amp;gt;
&amp;lt;CodeBlocks_project_file&amp;gt;
    &amp;lt;FileVersion major="1" minor="4" /&amp;gt;
    &amp;lt;Project&amp;gt;
        &amp;lt;Option title="freeglut" /&amp;gt;
        &amp;lt;Option pch_mode="0" /&amp;gt;
        &amp;lt;Option compiler="gcc" /&amp;gt;
        &amp;lt;Build&amp;gt;
            &amp;lt;Target title="default"&amp;gt;
                &amp;lt;Option output="freeglut.exe" /&amp;gt;
                &amp;lt;Option type="0" /&amp;gt;
                &amp;lt;Option compiler="gcc" /&amp;gt;
                &amp;lt;Option includeInTargetAll="1" /&amp;gt;
            &amp;lt;/Target&amp;gt;
        &amp;lt;/Build&amp;gt;
        &amp;lt;Compiler&amp;gt;
            &amp;lt;Add directory="$(#freeglut.include)" /&amp;gt;
        &amp;lt;/Compiler&amp;gt;
        &amp;lt;Linker&amp;gt;
            &amp;lt;Add library="freeglut" /&amp;gt;
            &amp;lt;Add library="glu32" /&amp;gt;
            &amp;lt;Add library="opengl32" /&amp;gt;
            &amp;lt;Add library="winmm" /&amp;gt;
            &amp;lt;Add library="gdi32" /&amp;gt;
            &amp;lt;Add library="user32" /&amp;gt;
            &amp;lt;Add library="kernel32" /&amp;gt;
            &amp;lt;Add directory="$(#freeglut.lib)" /&amp;gt;
        &amp;lt;/Linker&amp;gt;
        &amp;lt;Unit filename="main.cpp"&amp;gt;
            &amp;lt;Option compilerVar="CPP" /&amp;gt;
            &amp;lt;Option target="default" /&amp;gt;
        &amp;lt;/Unit&amp;gt;
    &amp;lt;/Project&amp;gt;
&amp;lt;/CodeBlocks_project_file&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save it.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create a directory named &lt;strong&gt;freeglut&lt;/strong&gt; on &lt;code&gt;/usr/share/codeblocks/templates/wizard/&lt;/code&gt;. You will find another directory named &lt;strong&gt;glut&lt;/strong&gt; there. Copy all the contents and paste it on the newly created &lt;strong&gt;freeglut&lt;/strong&gt; directory.&lt;/li&gt;
&lt;li&gt;Now go to the created &lt;strong&gt;freeglut&lt;/strong&gt; directory, edit the &lt;code&gt;wizard.script&lt;/code&gt; file and paste the following:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;////////////////////////////////////////////////////////////////////////////////
//
// FreeGLUT project wizard
//
////////////////////////////////////////////////////////////////////////////////

// globals
FreeGlutPathDefault    &amp;lt;- _T("$(#freeglut)");
FreeGlutPathDefaultInc &amp;lt;- _T("$(#freeglut.include)");
FreeGlutPathDefaultLib &amp;lt;- _T("$(#freeglut.lib)");
FreeGlutPath &amp;lt;- _T("");

function BeginWizard()
{
    local intro_msg = _T("Welcome to the new FreeGLUT project wizard!\n\n" +
                         "This wizard will guide you to create a new project\n" +
                         "using the FreeGLUT OpenGL extensions.\n\n" +
                         "When you 're ready to proceed, please click \"Next\"...");

    local glutpath_descr = _T("Please select the location of FreeGLUT on your computer.\n" +
                              "This is the top-level folder where FreeGLUT was installed (unpacked).\n" +
                              "To help you, this folder must contain the subfolders\n" +
                              "\"include\" and \"lib\".");

    Wizard.AddInfoPage(_T("GlutIntro"), intro_msg);
    Wizard.AddProjectPathPage();
    if (PLATFORM == PLATFORM_MAC)
    {
        FreeGlutPathDefault="/System/Library/Frameworks/FreeGLUT.framework";
    }
    else
        Wizard.AddGenericSelectPathPage(_T("FreeGlutPath"), glutpath_descr, _T("Please select FreeGLUT's location:"), FreeGlutPathDefault);
    Wizard.AddCompilerPage(_T(""), _T("*"), true, true);
}

////////////////////////////////////////////////////////////////////////////////
// GLUT's path page
////////////////////////////////////////////////////////////////////////////////

function OnLeave_GlutPath(fwd)
{
    if (fwd)
    {
        local dir         = Wizard.GetTextControlValue(_T("txtFolder")); // txtFolder is the text control in GenericSelectPathPage
        local dir_nomacro = VerifyDirectory(dir);

        if (dir_nomacro.IsEmpty())
            return false;

        // verify include dependencies
        local dir_nomacro_inc = GetCompilerIncludeDir(dir, FreeGlutPathDefault, FreeGlutPathDefaultInc);
        if (dir_nomacro_inc.IsEmpty())
            return false;
        if (!VerifyFile(dir_nomacro_inc + wxFILE_SEP_PATH + _T("GL"), _T("freeglut.h"), _T("FreeGLUT's include"))) return false;

        // verify library dependencies
        local dir_nomacro_lib = GetCompilerLibDir(dir, FreeGlutPathDefault, FreeGlutPathDefaultLib);
        if (dir_nomacro_lib.IsEmpty())
            return false;

        if (PLATFORM == PLATFORM_MSW)
        {
            if (!VerifyLibFile(dir_nomacro_lib, _T("freeglut"), _T("FreeGLUT's"))) return false;
        }
        else
        {
            if (!VerifyLibFile(dir_nomacro_lib, _T("freeglut"), _T("FreeGLUT's"))) return false;
        }


        FreeGlutPath = dir; // Remember the original selection.

        local is_macro = _T("");

        // try to resolve the include directory as macro
        is_macro = GetCompilerIncludeMacro(dir, FreeGlutPathDefault, FreeGlutPathDefaultInc);
        if (is_macro.IsEmpty())
        {
            // not possible -&amp;gt; use the real inc path we had computed instead
            FreeGlutPathDefaultInc = dir_nomacro_inc;
        }

        // try to resolve the library directory as macro
        is_macro = GetCompilerLibMacro(dir, FreeGlutPathDefault, FreeGlutPathDefaultLib);
        if (is_macro.IsEmpty())
        {
            // not possible -&amp;gt; use the real lib path we had computed instead
            FreeGlutPathDefaultLib = dir_nomacro_lib;
        }
    }
    return true;
}

// return the files this project contains
function GetFilesDir()
{
    return _T("glut/files");
}

// setup the already created project
function SetupProject(project)
{
    // set project options
    if (PLATFORM != PLATFORM_MAC)
    {
        project.AddIncludeDir(FreeGlutPathDefaultInc);
        project.AddLibDir(FreeGlutPathDefaultLib);
    }

    // add link libraries
    if (PLATFORM == PLATFORM_MSW)
    {
        project.AddLinkLib(_T("freeglut"));
        project.AddLinkLib(_T("opengl32"));
        project.AddLinkLib(_T("glu32"));
        project.AddLinkLib(_T("winmm"));
        project.AddLinkLib(_T("gdi32"));
    }
    else if (PLATFORM == PLATFORM_MAC)
    {
        project.AddLinkerOption(_T("-framework GLUT"));
        project.AddLinkerOption(_T("-framework OpenGL"));

        project.AddLinkerOption(_T("-framework Cocoa")); // GLUT dependency
    }
    else
    {
        project.AddLinkLib(_T("glut"));
        project.AddLinkLib(_T("GL"));
        project.AddLinkLib(_T("GLU"));
        project.AddLinkLib(_T("Xxf86vm"));
    }

    // enable compiler warnings (project-wide)
    WarningsOn(project, Wizard.GetCompilerID());

    // Debug
    local target = project.GetBuildTarget(Wizard.GetDebugName());
    if (!IsNull(target))
    {
        target.SetTargetType(ttConsoleOnly); // ttConsoleOnly: console for debugging
        target.SetOutputFilename(Wizard.GetDebugOutputDir() + Wizard.GetProjectName() + DOT_EXT_EXECUTABLE);
        target.SetWorkingDir(FreeGlutPath + _T("/bin"));
        // enable generation of debugging symbols for target
        DebugSymbolsOn(target, Wizard.GetCompilerID());
    }

    // Release
    target = project.GetBuildTarget(Wizard.GetReleaseName());
    if (!IsNull(target))
    {
        target.SetTargetType(ttExecutable); // ttExecutable: no console
        target.SetOutputFilename(Wizard.GetReleaseOutputDir() + Wizard.GetProjectName() + DOT_EXT_EXECUTABLE);
        target.SetWorkingDir(FreeGlutPath + _T("/bin"));
        // enable optimizations for target
        OptimizationsOn(target, Wizard.GetCompilerID());
    }

    return true;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save it.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Now on &lt;code&gt;/usr/share/codeblocks/templates/wizard&lt;/code&gt; directory, there is a script named &lt;code&gt;config.script&lt;/code&gt; and add the following line at the end of the file:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;RegisterWizard(wizProject,     _T("freeglut"),     _T("FreeGLUT project"),      _T("2D/3D Graphics"));
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Now go to this &lt;a href="http://freeglut.sourceforge.net/index.php#download" rel="noopener noreferrer"&gt;link&lt;/a&gt;, this is the Freeglut project's source files, download the latest stable:&lt;/li&gt;
&lt;/ul&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ffjj0vpb4it4h7m019qff.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ffjj0vpb4it4h7m019qff.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Extract it.&lt;/li&gt;
&lt;li&gt;Copy the contents of the extracted folder and paste it on the &lt;code&gt;/usr/share/codeblocks/templates/wizard/freeglut&lt;/code&gt; directory. At the time of writing, it looks like this:&lt;/li&gt;
&lt;/ul&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fu4a6p1e0vtvdp1w2nf8x.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fu4a6p1e0vtvdp1w2nf8x.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Codeblocks Setup Part
&lt;/h1&gt;

&lt;p&gt;If everything goes well/correctly, Codeblocks should be open without warning/showing any errors.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open Codeblocks. Go to &lt;code&gt;File &amp;gt; New &amp;gt; Projects&lt;/code&gt; and this dialog should be showing with &lt;strong&gt;Freeglut&lt;/strong&gt; Project:&lt;/li&gt;
&lt;/ul&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fy2pa24rn1u9tm72uqup5.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fy2pa24rn1u9tm72uqup5.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Give a name of the project as you see fit:&lt;/li&gt;
&lt;/ul&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fpsjcznzq2vlrvzjtyzxi.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fpsjcznzq2vlrvzjtyzxi.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Then, specify the location where the Freeglut is:&lt;/li&gt;
&lt;/ul&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ffenew0dfdnd90hqurosi.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ffenew0dfdnd90hqurosi.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Leave the next dialog as it is (&lt;em&gt;don't change anything&lt;/em&gt;):&lt;/li&gt;
&lt;/ul&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F8t821ivowtp62b2u03e9.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F8t821ivowtp62b2u03e9.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;At this moment your Codeblocks should be ready for the Freeglut projects.&lt;/p&gt;

&lt;h1&gt;
  
  
  Final Part
&lt;/h1&gt;

&lt;p&gt;Just checking if things are working or not.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Go to sources, there should be a &lt;code&gt;main.cpp&lt;/code&gt; file for test running:&lt;/li&gt;
&lt;/ul&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F87yljltqn34dxjsahem4.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F87yljltqn34dxjsahem4.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Build and Run!&lt;/li&gt;
&lt;/ul&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fi46ookx1e592pxvirdo8.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fi46ookx1e592pxvirdo8.png" alt="Alt Text"&gt;&lt;/a&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fpxpufqfqax0g9kicouog.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fpxpufqfqax0g9kicouog.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That's it.&lt;/p&gt;

&lt;p&gt;Okay, that's all. Hope, everything works fine.&lt;br&gt;
See ya later!&lt;/p&gt;

</description>
      <category>linux</category>
      <category>codeblocks</category>
      <category>freeglut</category>
      <category>opengl</category>
    </item>
    <item>
      <title>Walkthrough: Shodan.io [TryHackMe]</title>
      <dc:creator>Loknath Dhar</dc:creator>
      <pubDate>Thu, 08 Oct 2020 08:08:44 +0000</pubDate>
      <link>https://dev.to/dhar01/walkthrough-shodan-io-5ep3</link>
      <guid>https://dev.to/dhar01/walkthrough-shodan-io-5ep3</guid>
      <description>&lt;p&gt;&lt;a href="https://www.shodan.io"&gt;Shodan.io&lt;/a&gt; is a search engine for the internet of things. There is a room about &lt;strong&gt;Shodan&lt;/strong&gt; in Tryhackme and this walk-through is about that.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Due to the nature of Shodan and its scanning services, the answer is changing all the time. So keep trying.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h1&gt;
  
  
  Task 01
&lt;/h1&gt;

&lt;p&gt;An &lt;strong&gt;autonomous system number (ASN)&lt;/strong&gt; is a global identifier of a range of IP addresses. Basically, large companies like Google, Microsoft have their own ASN for all of the IP addresses they own.&lt;/p&gt;

&lt;p&gt;To find out ASN, first, we can search their IP address: &lt;code&gt;ping google.com&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;We can put the IP address into an ASN lookup tool such as &lt;a href="https://www.ultratools.com/tools/asnInfo"&gt;ultralools/asninfo&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;[It is mentioned by David Paine (&lt;em&gt;see on the comment&lt;/em&gt;) that the above link isn't working. You should check another which he suggested: &lt;a href="https://dnschecker.org/asn-whois-lookup.php"&gt;DNSchecker&lt;/a&gt;]&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--l9XPLEOu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/4jngi66z558q2i76zd3t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--l9XPLEOu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/4jngi66z558q2i76zd3t.png" alt="Alt Text" width="485" height="228"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Though, we can put the company name here to find the ASN, using the IP address seems the easiest one to me.&lt;/p&gt;

&lt;p&gt;On shodan, we can search using the ASN filter. The filter is: &lt;code&gt;ASN:[number]&lt;/code&gt;&lt;br&gt;
here, the number is marked on the picture.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--BQ5wzHny--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/5qg8beqhf25a6510s9l6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--BQ5wzHny--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/5qg8beqhf25a6510s9l6.png" alt="Alt Text" width="800" height="71"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Task 02
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;What is Google's ASN number?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Ans:&lt;/strong&gt; You know it now. ;)&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;When it was allocated?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Ans:&lt;/strong&gt; Again, look at the details.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Where are most of the machines on this ASN number, physically in the world?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Ans:&lt;/strong&gt; United States.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ODa9dyxr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/fwd7xp39mrvo1jbsgkgt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ODa9dyxr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/fwd7xp39mrvo1jbsgkgt.png" alt="Alt Text" width="390" height="317"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What is Google's top service across all their devices on this ASN?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Ans:&lt;/strong&gt; SSH.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--brIKZGDP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/c0r7034nvq93t516esvh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--brIKZGDP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/c0r7034nvq93t516esvh.png" alt="Alt Text" width="390" height="214"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What SSH product does Google use?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Ans:&lt;/strong&gt; OpenSSH.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What is Google's most used Google product, according to this search? Ignore the word "Google".&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Ans:&lt;/strong&gt; Cloud.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--F1WQgVLx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/lrduuaygeaz1nqhlndox.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--F1WQgVLx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/lrduuaygeaz1nqhlndox.png" alt="Alt Text" width="379" height="167"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Task 03
&lt;/h1&gt;

&lt;p&gt;Here is a list of filters for shodan:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;product: &lt;em&gt;product Name&lt;/em&gt; (&lt;em&gt;ex: MySQL&lt;/em&gt;)&lt;/li&gt;
&lt;li&gt;city&lt;/li&gt;
&lt;li&gt;country&lt;/li&gt;
&lt;li&gt;Geo (&lt;em&gt;co-ordinates&lt;/em&gt;)&lt;/li&gt;
&lt;li&gt;Hostname&lt;/li&gt;
&lt;li&gt;net (&lt;em&gt;based on IP/CIDR&lt;/em&gt;)&lt;/li&gt;
&lt;li&gt;os (&lt;em&gt;find operating systems&lt;/em&gt;)&lt;/li&gt;
&lt;li&gt;port&lt;/li&gt;
&lt;li&gt;before/after (&lt;em&gt;time-frames&lt;/em&gt;)&lt;/li&gt;
&lt;/ol&gt;

&lt;h1&gt;
  
  
  Task 04
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;What is the top operating system for MYSQL servers in Google's ASN?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Ans:&lt;/strong&gt; 5.6.40–84.0-log&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7ClxTe9z--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/ap2tjmgdh1x96jvnkpb5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7ClxTe9z--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/ap2tjmgdh1x96jvnkpb5.png" alt="Alt Text" width="392" height="200"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What is the 2nd most popular country for MYSQL servers in Google's ASN?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Ans:&lt;/strong&gt; Netherlands.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--88tCwb3X--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/650481abl2bgxyezm8rd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--88tCwb3X--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/650481abl2bgxyezm8rd.png" alt="Alt Text" width="417" height="335"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Under Google's ASN, which is more popular for Nginx, Hypertext Transfer Protocol, or Hypertext Transfer Protocol(s)?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Ans:&lt;/strong&gt; HyperText Transfer Protocol.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--X5tpjhjE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/jtug7t9z1no4pix77kn1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--X5tpjhjE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/jtug7t9z1no4pix77kn1.png" alt="Alt Text" width="800" height="68"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--piTYq1En--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/o6j201ibjz951m0chi29.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--piTYq1En--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/o6j201ibjz951m0chi29.png" alt="Alt Text" width="403" height="187"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Port 80&lt;/strong&gt; stands for HTTP; &lt;strong&gt;port 443&lt;/strong&gt; stands for HTTPs.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Under Google's ASN, what is the most popular city?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Ans:&lt;/strong&gt; Mountain View. (&lt;em&gt;Answer changes tiem to time&lt;/em&gt;)&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Under Google's ASN in Los Angeles, what is the top operating system according to Shodan?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Ans:&lt;/strong&gt; PAN-OS.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Atpoo-VX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/j43u23s4yqvqav8r7o6f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Atpoo-VX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/j43u23s4yqvqav8r7o6f.png" alt="Alt Text" width="800" height="70"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--TTIvb5Hj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/zev21xqc1e3qag8ea0au.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--TTIvb5Hj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/zev21xqc1e3qag8ea0au.png" alt="Alt Text" width="392" height="209"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Using the top Webcam search from the explore page, does Google's ASN have any webcams? Yay / nay.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Ans:&lt;/strong&gt; Nay.&lt;/p&gt;

&lt;h1&gt;
  
  
  Task 05
&lt;/h1&gt;

&lt;p&gt;Shodan has a limit on the free user account. It has an API, use it for more searches.&lt;/p&gt;

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