<?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: Janak  bista</title>
    <description>The latest articles on Forem by Janak  bista (@janakbist).</description>
    <link>https://forem.com/janakbist</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%2F922770%2Feb108ef3-d95a-4871-b44b-f0c56a8e92c6.jpg</url>
      <title>Forem: Janak  bista</title>
      <link>https://forem.com/janakbist</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/janakbist"/>
    <language>en</language>
    <item>
      <title>Building a Linux Server From Scratch</title>
      <dc:creator>Janak  bista</dc:creator>
      <pubDate>Mon, 13 Apr 2026 20:27:59 +0000</pubDate>
      <link>https://forem.com/janakbist/building-a-linux-server-from-scratch-1jj3</link>
      <guid>https://forem.com/janakbist/building-a-linux-server-from-scratch-1jj3</guid>
      <description>&lt;p&gt;Setting up a Linux server from scratch is one of the most valuable skills in system administration, DevOps, and cybersecurity. It helps you understand how servers actually work under the hood instead of relying on managed services.&lt;/p&gt;

&lt;p&gt;In this guide, I’ll walk through how to build a basic Linux server, configure it, and make it ready for real-world use.&lt;/p&gt;

&lt;p&gt;Why Build Your Own Linux Server?&lt;/p&gt;

&lt;p&gt;A self-built Linux server helps you:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Understand system internals (users, permissions, services)&lt;/li&gt;
&lt;li&gt;Host applications (web apps, APIs, databases)&lt;/li&gt;
&lt;li&gt;Practice DevOps skills&lt;/li&gt;
&lt;li&gt;Prepare for cybersecurity labs&lt;/li&gt;
&lt;li&gt;Gain full control over your environment&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Step 1: Choose Your Linux Distribution&lt;/p&gt;

&lt;p&gt;For servers, the most common choices are:&lt;/p&gt;

&lt;p&gt;Ubuntu Server (beginner-friendly)&lt;br&gt;
Debian (stable and lightweight)&lt;br&gt;
CentOS / Rocky Linux (enterprise-style systems)&lt;/p&gt;

&lt;p&gt;In this guide, we will install Ubuntu Server.&lt;/p&gt;

&lt;p&gt;Step 2: Install Linux Server&lt;/p&gt;

&lt;p&gt;Get Ubuntu Server from:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://ubuntu.com/download/server" rel="noopener noreferrer"&gt;Download ISO:&lt;/a&gt;Install:&lt;/p&gt;

&lt;p&gt;Use VirtualBox, VMware, or physical machine&lt;br&gt;
Select:&lt;br&gt;
Minimal installation&lt;br&gt;
OpenSSH server (IMPORTANT)&lt;/p&gt;

&lt;p&gt;Step 3: Configure Network&lt;/p&gt;

&lt;p&gt;Check IP address:&lt;br&gt;
&lt;/p&gt;

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

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

&lt;/div&gt;



&lt;p&gt;Test internet:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ping google.com

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

&lt;/div&gt;



&lt;p&gt;Update system:&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;sudo &lt;/span&gt;apt update &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;p&gt;Step 4: Secure Your Server&lt;br&gt;
Create a new user:&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;sudo &lt;/span&gt;adduser user1

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

&lt;/div&gt;



&lt;p&gt;Give sudo access:&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;sudo &lt;/span&gt;usermod &lt;span class="nt"&gt;-aG&lt;/span&gt; &lt;span class="nb"&gt;sudo &lt;/span&gt;user1

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

&lt;/div&gt;



&lt;p&gt;Enable SSH access&lt;/p&gt;

&lt;p&gt;Install SSH (if not installed):&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;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;openssh-server &lt;span class="nt"&gt;-y&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;Check SSH status:&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;sudo &lt;/span&gt;systemctl status ssh

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

&lt;/div&gt;



&lt;p&gt;Change SSH port (basic security step)&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;sudo &lt;/span&gt;nano /etc/ssh/sshd_config

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

&lt;/div&gt;



&lt;p&gt;Change:&lt;/p&gt;

&lt;p&gt;Port 22 → Port 2222&lt;/p&gt;

&lt;p&gt;Restart SSH:&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;sudo &lt;/span&gt;systemctl restart ssh

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

&lt;/div&gt;



&lt;p&gt;Step 5: Configure Firewall (UFW)&lt;/p&gt;

&lt;p&gt;Enable firewall:&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;sudo &lt;/span&gt;ufw &lt;span class="nb"&gt;enable&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;Allow SSH:&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;sudo &lt;/span&gt;ufw allow 2222/tcp

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

&lt;/div&gt;



&lt;p&gt;Check status:&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;sudo &lt;/span&gt;ufw status

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

&lt;/div&gt;



&lt;p&gt;Step 6: Install a Web Server (Optional but Common)&lt;br&gt;
Install Nginx:&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;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;nginx &lt;span class="nt"&gt;-y&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;Start service:&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;sudo &lt;/span&gt;systemctl start nginx

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

&lt;/div&gt;



&lt;p&gt;Enable on boot:&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;sudo &lt;/span&gt;systemctl &lt;span class="nb"&gt;enable &lt;/span&gt;nginx

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

&lt;/div&gt;



&lt;p&gt;Test:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://your-server-ip" rel="noopener noreferrer"&gt;http://your-server-ip&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Step 7: Install Database (Optional)&lt;br&gt;
MySQL:&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;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;mysql-server &lt;span class="nt"&gt;-y&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;Secure installation:&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;sudo &lt;/span&gt;mysql_secure_installation

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

&lt;/div&gt;



&lt;p&gt;Step 8: Install Developer Tools&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;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;git curl wget unzip &lt;span class="nt"&gt;-y&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;Step 9: Monitor Server&lt;/p&gt;

&lt;p&gt;Check system usage:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;Disk usage:&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;df&lt;/span&gt; &lt;span class="nt"&gt;-h&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;Memory usage:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;free &lt;span class="nt"&gt;-h&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;Step 10: Final Test&lt;/p&gt;

&lt;p&gt;Try accessing your server:&lt;/p&gt;

&lt;p&gt;SSH login:&lt;br&gt;
ssh user1@your-server-ip -p 2222&lt;br&gt;
Open browser:&lt;br&gt;
&lt;a href="http://your-server-ip" rel="noopener noreferrer"&gt;http://your-server-ip&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🚀 What You have:&lt;/p&gt;

&lt;p&gt;A secure Linux server&lt;br&gt;
SSH access configured&lt;br&gt;
Firewall protection&lt;br&gt;
Optional web server and database&lt;br&gt;
Basic monitoring tools&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>devops</category>
      <category>linux</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Sherlock for Digital Forensics &amp; Reconnaissance (OSINT Guide)</title>
      <dc:creator>Janak  bista</dc:creator>
      <pubDate>Mon, 13 Apr 2026 20:16:19 +0000</pubDate>
      <link>https://forem.com/janakbist/sherlock-for-digital-forensics-reconnaissance-osint-guide-4285</link>
      <guid>https://forem.com/janakbist/sherlock-for-digital-forensics-reconnaissance-osint-guide-4285</guid>
      <description>&lt;p&gt;In cybersecurity one of the first steps in an investigation is Open Source Intelligence (OSINT) gathering. OSINT helps analysts understand a target’s digital footprint using publicly available information.&lt;/p&gt;

&lt;p&gt;One of the most powerful OSINT tools for username reconnaissance is Sherlock.&lt;/p&gt;

&lt;p&gt;🔍 What is Sherlock?&lt;/p&gt;

&lt;p&gt;Sherlock is a Python-based OSINT tool that allows you to search for a username across hundreds of social media platforms.&lt;/p&gt;

&lt;p&gt;It helps investigators:&lt;/p&gt;

&lt;p&gt;Identify where a username exists online&lt;br&gt;
Map digital footprints across platforms&lt;br&gt;
Support forensic investigations and threat intelligence&lt;br&gt;
Perform ethical reconnaissance in cybersecurity labs&lt;/p&gt;

&lt;p&gt;⚙️ Installation&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Clone the repository
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/sherlock-project/sherlock.git

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

&lt;/div&gt;


&lt;ol&gt;
&lt;li&gt;Navigate into the directory
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;sherlock

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

&lt;/div&gt;


&lt;ol&gt;
&lt;li&gt;Install dependencies
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip3 &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-r&lt;/span&gt; requirements.txt

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

&lt;/div&gt;


&lt;p&gt;🚀 Basic Usage&lt;br&gt;
🔎 Search a username across platforms&lt;br&gt;
&lt;/p&gt;

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

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

&lt;/div&gt;



&lt;p&gt;💾 Save results to a file&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python3 sherlock username123 &lt;span class="nt"&gt;--output&lt;/span&gt; results.txt

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

&lt;/div&gt;



&lt;p&gt;📁 Save results in JSON format (useful for analysis)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python3 sherlock username123 &lt;span class="nt"&gt;--output&lt;/span&gt; results.json &lt;span class="nt"&gt;--json&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>cybersecurity</category>
      <category>python</category>
      <category>tooling</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>How Koin works</title>
      <dc:creator>Janak  bista</dc:creator>
      <pubDate>Mon, 26 Sep 2022 04:41:27 +0000</pubDate>
      <link>https://forem.com/janakbist/how-koin-works-4ahj</link>
      <guid>https://forem.com/janakbist/how-koin-works-4ahj</guid>
      <description>&lt;p&gt;Koin woks on simple domain specific language(DSL) model, a computer languages ​​created for specific application domain.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--mkUs30XW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2nxe5l4jhjr9avijjrua.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--mkUs30XW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2nxe5l4jhjr9avijjrua.png" alt="Image description" width="880" height="738"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In koin we have to create a module first .In this module all the dependent objects are there, then we have to load one or more modules in to koin in application class by calling start koin method. Then we can inject object wherever we want.&lt;/p&gt;

&lt;p&gt;Here are the key term&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;get(): It is used inside constructors to resolve needed instances.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;factory : It is used to indicate a new instance must be created &lt;br&gt;
each time it is injected.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;single :It indicates that a unique instance will be created at &lt;br&gt;
the beginning and shared on every future injection.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;name : It is used to name definition . This is required when we want to have multiple instances of the same class with different types&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>Interceptors</title>
      <dc:creator>Janak  bista</dc:creator>
      <pubDate>Thu, 22 Sep 2022 04:54:51 +0000</pubDate>
      <link>https://forem.com/janakbist/interceptors-3407</link>
      <guid>https://forem.com/janakbist/interceptors-3407</guid>
      <description>&lt;p&gt;Interceptors are the powerful mechanism that can monitor, rewrite, and retry API call.&lt;/p&gt;

&lt;p&gt;We need to add a logger for each network call ,but by using interceptor we can add a logger once and it will work for each network calls.&lt;/p&gt;

&lt;p&gt;Another use-case is caching the response of network calls to build an offline-first app.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Interceptors are of two types :&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Interceptors added between the Application Code (our written code) and the OkHttp Core Library are referred to as application interceptors. These are the interceptors that we add with addInterceptor().&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Interceptors on the network: These are interceptors placed between the OkHttp Core Library and the server. These can be added to OkHttpClient by using the addNetworkInterceptor command ().&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Here’s a simple interceptor that logs the outgoing request and the incoming response.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class LoggingInterceptor implements Interceptor {
  @Override public Response intercept(Interceptor.Chain chain) throws IOException {
    Request request = chain.request();

    long t1 = System.nanoTime();
    logger.info(String.format("Sending request %s on %s%n%s",
        request.url(), chain.connection(), request.headers()));

    Response response = chain.proceed(request);

    long t2 = System.nanoTime();
    logger.info(String.format("Received response for %s in %.1fms%n%s",
        response.request().url(), (t2 - t1) / 1e6d, response.headers()));

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

&lt;/div&gt;



&lt;p&gt;**&lt;br&gt;
We can add interceptor while building the OkHttpRequest object as follows :**&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;fun gfgHttpClient(): OkHttpClient {
    val builder = OkHttpClient().newBuilder()
        .addInterceptor(/*our interceptor*/)
    return builder.build()
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Keeping the response in the cache&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If we want to cache the API call response so that when we call the API again, the response will come from Cache. If we have an API call from Client to Server and the Cache-Control header is enabled on the server, OkHttp Core will respect that header and cache the response that was sent from the server for a certain amount of time. &lt;/p&gt;

</description>
    </item>
    <item>
      <title>Work Manager Android</title>
      <dc:creator>Janak  bista</dc:creator>
      <pubDate>Sat, 17 Sep 2022 04:07:13 +0000</pubDate>
      <link>https://forem.com/janakbist/work-manager-android-4i52</link>
      <guid>https://forem.com/janakbist/work-manager-android-4i52</guid>
      <description>&lt;p&gt;Work manager handles the scheduled tasks that can run even if app exits or device restart.&lt;/p&gt;

&lt;p&gt;In simple we can say ,Run background jobs using work manager.&lt;/p&gt;

&lt;p&gt;For example : sync data from server.&lt;/p&gt;

&lt;p&gt;Explanation :&lt;/p&gt;

&lt;p&gt;suppose, we have  a news app and every 2 hours we goes to server and check whether there is new updated news or not. If there any lets notify the users that new updated news .This is done with the help of work manager. &lt;/p&gt;

</description>
    </item>
    <item>
      <title>Scoped Function in Kotlin</title>
      <dc:creator>Janak  bista</dc:creator>
      <pubDate>Sat, 17 Sep 2022 03:53:38 +0000</pubDate>
      <link>https://forem.com/janakbist/scoped-function-in-kotlin-3fp7</link>
      <guid>https://forem.com/janakbist/scoped-function-in-kotlin-3fp7</guid>
      <description>&lt;p&gt;There are five scope functions in kotlin : let, run ,with ,also &amp;amp; apply.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;let: It takes object it is invoked upon as the parameter &amp;amp; return the result of the lambda expression.let is used for checking nullable property.
&lt;code&gt;Syntax : var name : String? = "Hello"
name?.let{println(it)}&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For Example :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;fun PerformOperation() {
val name:String = "Ram"
val person = Person.let {
return "Name: ${it.name}"
}
print(person)

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

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;Output : Ram&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;2.also :&lt;br&gt;
 It does some additional processing on object it was involked &lt;br&gt;
 unlike let object. but returns original object instead of new &lt;br&gt;
 return data.&lt;/p&gt;

&lt;p&gt;3.run :&lt;br&gt;
 It is similar to let function .It returns the last statement .It does not contain 'it' keyword. &lt;/p&gt;

&lt;p&gt;4.with :&lt;br&gt;
 It is just like run operator .It refers context of the object.&lt;/p&gt;

</description>
      <category>let</category>
      <category>run</category>
      <category>also</category>
      <category>apply</category>
    </item>
    <item>
      <title>Kotlin Flows On android</title>
      <dc:creator>Janak  bista</dc:creator>
      <pubDate>Sat, 17 Sep 2022 03:44:20 +0000</pubDate>
      <link>https://forem.com/janakbist/kotlin-flows-on-android-4l3f</link>
      <guid>https://forem.com/janakbist/kotlin-flows-on-android-4l3f</guid>
      <description>&lt;p&gt;In &lt;a href="https://dev.tourl"&gt;Coroutines&lt;/a&gt;, a Flow is a type that can emit multiple values sequentially as opposed to suspend functions that return only a single value.&lt;/p&gt;

&lt;p&gt;For Example : we can use Flow  to receive live updates from database.&lt;/p&gt;

&lt;p&gt;Flows are built on top of coroutines and can produce multiple values.&lt;/p&gt;

&lt;p&gt;A flow is conceptually a stream of data that can be computed asynchronously. The emitted values must be of the same type. For example, a &lt;code&gt;Flow&amp;lt;Int&amp;gt;&lt;/code&gt; is a flow that emits integer values.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Extension Function</title>
      <dc:creator>Janak  bista</dc:creator>
      <pubDate>Thu, 15 Sep 2022 14:50:52 +0000</pubDate>
      <link>https://forem.com/janakbist/extension-function-249m</link>
      <guid>https://forem.com/janakbist/extension-function-249m</guid>
      <description>&lt;p&gt;Kotlin gives the programmer the ability to add more functionality to the existing classes, without inheriting them.&lt;/p&gt;

&lt;p&gt;This is achieved through a feature known as extensions.&lt;/p&gt;

&lt;p&gt;When a function is added to an existing class it is known as Extension Function.&lt;/p&gt;

&lt;p&gt;To add an extension function to a class, define a new function appended to the class name.&lt;/p&gt;

&lt;p&gt;For Example :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;fun main() {
 val list = mutableListOf(1,2,3,4)
 list.swap(0,2)
 print(list)
}
fun MutableList&amp;lt;Int&amp;gt;.swap(index1: Int, index2: Int) {
    val tmp = this[index1] // 'this' corresponds to the list
    this[index1] = this[index2]
    this[index2] = tmp

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

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;Output : [3,2,1,4]&lt;/code&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Kotlin Flows On android</title>
      <dc:creator>Janak  bista</dc:creator>
      <pubDate>Thu, 15 Sep 2022 14:42:15 +0000</pubDate>
      <link>https://forem.com/janakbist/kotlin-flows-on-android-2cj8</link>
      <guid>https://forem.com/janakbist/kotlin-flows-on-android-2cj8</guid>
      <description>&lt;p&gt;In &lt;a href="https://dev.to/janakbist/coroutines-3m4l"&gt;Coroutines&lt;/a&gt;, a Flow is a type that can emit multiple values sequentially as opposed to suspend functions that return only a single value.&lt;/p&gt;

&lt;p&gt;For Example : we can use Flow  to receive live updates from database.&lt;/p&gt;

&lt;p&gt;Flows are built on top of coroutines and can produce multiple values.&lt;/p&gt;

&lt;p&gt;A flow is conceptually a stream of data that can be computed asynchronously. The emitted values must be of the same type. For example, a &lt;code&gt;Flow&amp;lt;Int&amp;gt;&lt;/code&gt; is a flow that emits integer values.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Coroutines</title>
      <dc:creator>Janak  bista</dc:creator>
      <pubDate>Tue, 13 Sep 2022 14:30:43 +0000</pubDate>
      <link>https://forem.com/janakbist/coroutines-3m4l</link>
      <guid>https://forem.com/janakbist/coroutines-3m4l</guid>
      <description>&lt;p&gt;A coroutine is a concurrency design pattern that we can use on Android to simplify code that executes asynchronously. Coroutines were added to Kotlin in version 1.3 and are based on established concepts from other languages.&lt;/p&gt;

&lt;p&gt;On Android, coroutines help to manage long-running tasks that might otherwise block the main thread and cause your app to become unresponsive. Over 50% of professional developers who use coroutines have reported seeing increased productivity.&lt;/p&gt;

&lt;p&gt;Features : Lightweight , fewer leakage ,jetpack Integration.&lt;/p&gt;

&lt;p&gt;Based on the Guide to app architecture, the examples in this topic make a network request and return the result to the main thread, where the app can then display the result to the user.&lt;/p&gt;

&lt;p&gt;Specifically, the ViewModel Architecture component calls the repository layer on the main thread to trigger the network request. This guide iterates through various solutions that use coroutines keep the main thread unblocked.&lt;/p&gt;

&lt;p&gt;ViewModel includes a set of KTX extensions that work directly with coroutines. &lt;/p&gt;

</description>
    </item>
    <item>
      <title>Hilt Dependency Injection</title>
      <dc:creator>Janak  bista</dc:creator>
      <pubDate>Tue, 13 Sep 2022 14:23:32 +0000</pubDate>
      <link>https://forem.com/janakbist/hilt-dependency-injection-45f7</link>
      <guid>https://forem.com/janakbist/hilt-dependency-injection-45f7</guid>
      <description>&lt;p&gt;Hilt is a dependency injection library for Android that reduces the boilerplate of doing manual dependency injection. &lt;/p&gt;

&lt;p&gt;Doing manual dependency injection requires to construct every class and its dependencies by hand, and to use containers to reuse and manage dependencies.&lt;/p&gt;

&lt;p&gt;Hilt provides a standard way to use DI in your application by providing containers for every Android class in your project and managing their lifecycles automatically. &lt;/p&gt;

&lt;p&gt;&lt;code&gt;var a = "string"&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Hilt is built on top of the popular DI library Dagger to benefit from the compile-time correctness, runtime performance, scalability, and Android Studio support that Dagger provides. For more information, see Hilt and Dagger.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>1.RecyclerView in kotlin</title>
      <dc:creator>Janak  bista</dc:creator>
      <pubDate>Thu, 08 Sep 2022 15:30:36 +0000</pubDate>
      <link>https://forem.com/janakbist/1recyclerview-in-kotlin-3ijh</link>
      <guid>https://forem.com/janakbist/1recyclerview-in-kotlin-3ijh</guid>
      <description>&lt;p&gt;1.First we have to add dependency in build.gradle of app or module Folder .&lt;/p&gt;

&lt;p&gt;dependencies {&lt;br&gt;
implementation 'androidx.recyclerview:recyclerview:1.2.0'&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;2.Then we have to use RecyclerView Widget from androidx.widget.recyclerview.&lt;/p&gt;

&lt;p&gt;3.Create RecyclerView items .&lt;br&gt;
4.Make Adapter class to inflate Recycler items.&lt;br&gt;
5.Then set Adapter on the required screen.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
