<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Rownok Bosunia on Medium]]></title>
        <description><![CDATA[Stories by Rownok Bosunia on Medium]]></description>
        <link>https://medium.com/@rondevs?source=rss-25133f1d8ab7------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*_Yvr5VkbWFxWtdaIlP1xlg.png</url>
            <title>Stories by Rownok Bosunia on Medium</title>
            <link>https://medium.com/@rondevs?source=rss-25133f1d8ab7------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 22:40:09 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rondevs/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[A 3-Hour npm Breach Put Millions of JavaScript Projects at Risk: Inside the Axios RAT Attack]]></title>
            <link>https://rondevs.medium.com/a-3-hour-npm-breach-put-millions-of-javascript-projects-at-risk-inside-the-axios-rat-attack-993c2705a040?source=rss-25133f1d8ab7------2</link>
            <guid isPermaLink="false">https://medium.com/p/993c2705a040</guid>
            <category><![CDATA[devsecops]]></category>
            <category><![CDATA[supply-chain-security]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[npm]]></category>
            <dc:creator><![CDATA[Rownok Bosunia]]></dc:creator>
            <pubDate>Wed, 01 Apr 2026 13:44:34 GMT</pubDate>
            <atom:updated>2026-04-01T13:44:34.464Z</atom:updated>
            <content:encoded><![CDATA[<h4>A technical breakdown of the March 31, 2026 Axios npm compromise, including malicious versions, RAT indicators, C2 traffic hunting, Git history validation, and incident response steps.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1jp5_84R_KOfAmW4oNjFBg.png" /><figcaption>Cybersecurity Alert: Axios Supply Chain Attack</figcaption></figure><h3><strong>Overview:</strong></h3><p>On <strong>March 31, 2026</strong>, attackers briefly compromised Axios on npm and published malicious versions (1.14.1 and 0.30.4) that silently executed a <strong>cross-platform Remote Access Trojan (RAT)</strong> through a postinstall hook.</p><p>Any fresh npm install during that window may have exposed:</p><ul><li>developer machines</li><li>CI/CD runners</li><li>Docker builds</li><li>cloud deployment systems</li></ul><p>This post explains what happened, how to check if your environment was affected, and what steps to take next.</p><p>It took less than <strong>three hours</strong> for one of the most trusted JavaScript packages to become a malware delivery mechanism.</p><p>During that short window, a simple npm install may have silently executed a <strong>cross-platform RAT</strong>.</p><p>The package was <strong>Axios</strong>.</p><p>If you work in JavaScript, Node.js, DevOps, or application security, this incident is worth paying close attention to.</p><p>With millions of projects relying on Axios, this was not just another package issue. It was a serious software supply chain compromise with real-world implications for developer environments and CI infrastructure.</p><p>What makes it especially concerning is that the malicious code ran <strong>during installation</strong>, before the application was even started.</p><h3>What Happened</h3><p>Attackers gained access to an official npm maintainer account and published two malicious versions:</p><ul><li>axios@1.14.1</li><li>axios@0.30.4</li></ul><p>These versions pulled in a malicious dependency:</p><ul><li>plain-crypto-js@4.2.1</li></ul><p>The payload was triggered through a postinstall hook, which means it ran automatically as soon as the package was installed:</p><pre>npm install</pre><p>No runtime execution was needed.</p><p>That means any fresh install during the exposure window could have affected:</p><ul><li>local development machines</li><li>GitHub Actions workflows</li><li>Jenkins and GitLab runners</li><li>Docker image pipelines</li><li>deployment agents</li></ul><p>This is exactly why supply chain attacks are so dangerous. They take advantage of trust.</p><h3>Why This Matters</h3><p>This was not a typo-squatting package.</p><p>This was a compromise of a trusted dependency.</p><p>The attackers did not need to break your application.</p><p>They targeted the software supply chain itself.</p><p>That changes the risk completely.</p><p>A compromised developer laptop or CI runner can expose:</p><ul><li>cloud credentials</li><li>GitHub tokens</li><li>SSH keys</li><li>deployment secrets</li><li>wallet keys in Web3 projects</li></ul><p>In many cases, the package is only the entry point.</p><p>The real target is the environment around it.</p><h3>How to Check If Your System Was Affected</h3><h3>Check Installed Axios Version</h3><pre>npm list axios<br>npm list -g axios</pre><p>Look for:</p><ul><li>1.14.1</li><li>0.30.4</li></ul><h3>Check Lockfiles</h3><p>Even if node_modules is clean now, lockfiles may still contain evidence.</p><pre>grep -E &#39;axios.*1\.14\.1|axios.*0\.30\.4&#39; package-lock.json<br>grep &#39;plain-crypto-js&#39; package-lock.json</pre><p>Also check:</p><ul><li>yarn.lock</li><li>pnpm-lock.yaml</li></ul><h3>Review Git History</h3><p>This is one of the most overlooked steps.</p><pre>git log --all -- package-lock.json<br>git diff HEAD~10 -- package-lock.json</pre><p>This helps catch temporary malicious lockfile changes that may have already been reverted.</p><h3>Check for RAT Activity</h3><h3>Linux / macOS</h3><pre>ps aux | grep node<br>find /tmp -mtime -7<br>crontab -l</pre><h3>Windows</h3><pre>Get-Process | Where-Object {$_.ProcessName -match &quot;node|crypto|plain&quot;}<br>schtasks /query</pre><p>Watch for unfamiliar scheduled tasks, background processes, or recently dropped files in temp directories.</p><h3>Hunt for Suspicious Network Traffic</h3><p>A reported IOC includes:</p><ul><li>sfrclak.com:8000</li></ul><p>Check for active connections:</p><pre>netstat -an | grep 8000<br>lsof -i :8000</pre><p>If your SIEM or firewall logs are available, search for outbound traffic to this domain or port.</p><h3>What To Do Next</h3><p>If those versions were ever installed, assume the environment may be compromised.</p><p>Recommended steps:</p><ol><li>isolate the affected machine</li><li>rotate all credentials</li><li>rebuild from a clean image</li><li>clear CI and Docker caches</li><li>invalidate old deployment artifacts</li></ol><p>This includes:</p><ul><li>GitHub tokens</li><li>npm access tokens</li><li>cloud credentials</li><li>SSH keys</li><li>production secrets</li></ul><p>Do not rely on simply uninstalling the package.</p><h3>Final Thoughts</h3><p>This incident is a strong reminder that application security no longer stops at your own codebase.</p><p>Every dependency you trust becomes part of your attack surface.</p><p>A single compromised maintainer account can impact thousands of downstream systems in hours.</p><p>That is the reality of modern software security.</p><h3>Disclaimer</h3><p>This article is intended for <strong>defensive cybersecurity awareness, threat hunting, and incident response guidance only</strong>. Always validate findings against your own logs, EDR telemetry, and forensic data before taking operational action.</p><blockquote>Also credit to NetworkChuck for sharing a practical detection guide that helped validate parts of the response workflow.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=993c2705a040" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Three.js Integration into WordPress Using the ThreeWP Plugin]]></title>
            <link>https://rondevs.medium.com/three-js-integration-into-wordpress-using-the-threewp-plugin-1c06491b8064?source=rss-25133f1d8ab7------2</link>
            <guid isPermaLink="false">https://medium.com/p/1c06491b8064</guid>
            <category><![CDATA[wordpress]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[wordpress-integration]]></category>
            <category><![CDATA[threejs]]></category>
            <category><![CDATA[3d-web]]></category>
            <dc:creator><![CDATA[Rownok Bosunia]]></dc:creator>
            <pubDate>Wed, 25 Sep 2024 10:54:41 GMT</pubDate>
            <atom:updated>2024-09-25T10:54:41.807Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E7Krf3rGbGfrFY7vkduT-g.png" /><figcaption>Integrating Three.js into WordPress using the ThreeWP Plugin</figcaption></figure><p><strong>Three.js</strong> is a powerful JavaScript library that allows developers to create 3D graphics and animations directly in a web browser. For WordPress users, integrating <strong>Three.js</strong> can unlock exciting possibilities, enabling interactive 3D elements on their sites. The <strong>ThreeWP</strong> plugin makes this integration seamless by simplifying the process and allowing you to easily add 3D graphics to your WordPress pages and posts.</p><p>In this article, we’ll walk you through how to integrate <strong>Three.js</strong> into WordPress using the ThreeWP plugin, creating an engaging 3D experience on your site.</p><h3>Why Use Three.js for WordPress 3D?</h3><p>Using <strong>Three.js</strong> to create 3D visuals on a <strong>WordPress</strong> site can significantly enhance user engagement and add an interactive dimension to your content. Whether you’re a developer looking to integrate 3D models or an agency wanting to create stunning visual experiences, WordPress with Three.js opens new possibilities.</p><p>Traditionally, 3D integrations require complex coding and management of external libraries. However, with the <strong>ThreeWP plugin</strong>, you can easily load and manage <strong>Three.js</strong> within your WordPress environment, without external dependencies or complicated setup.</p><h3>Step-by-Step Guide to Three.js Integration into WordPress</h3><h3>Step 1: Install the ThreeWP Plugin</h3><p>To start your journey of <strong>Three.js integration into WordPress</strong>, first install the <strong>ThreeWP plugin</strong>. This plugin simplifies loading Three.js scripts and its add-ons, allowing users to access 3D functionality on specific pages.</p><figure><img alt="Integrating Three.js into WordPress using the ThreeWP Plugin" src="https://cdn-images-1.medium.com/max/587/1*IOgW6Cf_OvSoCp_VhaJmYw.png" /></figure><ol><li>Login to your <strong>WordPress dashboard</strong>.</li><li>Go to <strong>Plugins</strong> &gt; <strong>Add New</strong>.</li><li>Search for <strong>ThreeWP</strong>.</li><li>Click <strong>Install Now</strong>, then <strong>Activate</strong>.</li></ol><p>With the plugin activated, you’re ready to start adding <strong>Three.js</strong> 3D graphics to your WordPress site.</p><h3>Step 2: Use the [use_threewp] Shortcode for WordPress 3D</h3><p>To load Three.js scripts on a specific page or post, add the [use_threewp] shortcode. This ensures that the 3D scripts are only loaded on pages where they&#39;re needed, optimizing performance.</p><ol><li>Go to the page where you want to add <strong>Three.js</strong> elements.</li></ol><p>2. Insert the following shortcode:</p><pre>[use_threewp]</pre><p>This step is essential to integrating <strong>Three.js</strong> into WordPress because it ensures the 3D library is loaded correctly.</p><h3>Step 3: Build a 3D Scene in WordPress with Three.js</h3><p>Now that you’ve activated the <strong>ThreeWP</strong> plugin and added the shortcode, you can begin embedding a custom <strong>Three.js</strong> scene in your WordPress post or page.</p><p>Here’s an example of a 3D rotating cube:</p><pre>&lt;script&gt;<br>document.addEventListener(&#39;DOMContentLoaded&#39;, function () {<br>    const { THREE, OrbitControls } = ThreeWP;<br><br>    const scene = new THREE.Scene();<br>    const camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000);<br>    const renderer = new THREE.WebGLRenderer();<br>    <br>    renderer.setSize(window.innerWidth, window.innerHeight);<br>    document.body.appendChild(renderer.domElement);<br><br>    const geometry = new THREE.BoxGeometry();<br>    const material = new THREE.MeshBasicMaterial({ color: 0x00ff00 });<br>    const cube = new THREE.Mesh(geometry, material);<br>    scene.add(cube);<br><br>    camera.position.z = 5;<br><br>    const controls = new OrbitControls(camera, renderer.domElement);<br><br>    function animate() {<br>        requestAnimationFrame(animate);<br>        cube.rotation.x += 0.01;<br>        cube.rotation.y += 0.01;<br>        controls.update();<br>        renderer.render(scene, camera);<br>    }<br><br>    animate();<br>});<br>&lt;/script&gt;</pre><p>In this example, we utilize the destructured objects THREE and OrbitControls provided by the <strong>ThreeWP</strong> plugin. This setup enables a rotating cube with <strong>3D controls</strong> that users can interact with on the page.</p><h3>Step 4: Save and Preview</h3><p>After embedding the <strong>Three.js</strong> code into an HTML element in your WordPress page, save and preview the page. If all steps are correctly followed, you should see an interactive 3D scene directly within the designated HTML area of your WordPress page, powered by <strong>Three.js</strong>. The <strong>ThreeWP</strong> plugin ensures that the Three.js scripts and any add-ons are properly loaded, allowing your 3D content to function smoothly.</p><h3>Step 5: Expand Your WordPress 3D Capabilities with Add-ons</h3><p>The <strong>ThreeWP</strong> plugin supports several <strong>Three.js</strong> add-ons, such as OrbitControls and GLTFLoader. These add-ons allow you to enhance the 3D experience by adding model loading capabilities and interactive camera controls.</p><p>To add more functionality, simply destructure the add-ons like this:</p><pre>const { THREE, GLTFLoader, OrbitControls } = ThreeWP;</pre><p>You can use this to load 3D models and add them to your <strong>WordPress with Three.js</strong> implementation.</p><h3>Optimizing WordPress 3D Performance</h3><p>Since 3D graphics can be resource-heavy, it’s important to keep performance in mind:</p><ul><li>Use optimized 3D models to reduce load times.</li><li>Minimize texture sizes.</li><li>Implement lazy loading for heavier assets to improve overall performance.</li></ul><h3>Conclusion</h3><p>Integrating <strong>Three.js into WordPress</strong> using the <strong>ThreeWP</strong> plugin is an efficient way to add dynamic 3D elements to your site. By utilizing the destructured approach provided by the plugin, you can easily load <strong>Three.js</strong> and popular add-ons like OrbitControls, enhancing your WordPress site with rich 3D content.</p><p>Whether you’re building interactive 3D visuals or showcasing complex models, <strong>WordPress with Three.js</strong> is a powerful combination that can transform your website’s interactivity. With the <strong>ThreeWP plugin</strong>, this process is simplified, allowing you to focus on creating stunning <strong>WordPress 3D</strong> experiences.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1c06491b8064" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Customizing Your Shell with Starship: A Modern, Fast, and Customizable Prompt]]></title>
            <link>https://rondevs.medium.com/customizing-your-shell-with-starship-a-modern-fast-and-customizable-prompt-2b458a57f32d?source=rss-25133f1d8ab7------2</link>
            <guid isPermaLink="false">https://medium.com/p/2b458a57f32d</guid>
            <category><![CDATA[starship]]></category>
            <category><![CDATA[shell-customization]]></category>
            <category><![CDATA[bash]]></category>
            <category><![CDATA[customization]]></category>
            <category><![CDATA[shell]]></category>
            <dc:creator><![CDATA[Rownok Bosunia]]></dc:creator>
            <pubDate>Mon, 09 Sep 2024 06:22:31 GMT</pubDate>
            <atom:updated>2024-09-09T06:22:31.660Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="customized bash shell with starship" src="https://cdn-images-1.medium.com/max/868/1*eCPlC-_7frMdZRoBPlKtGw.png" /><figcaption>customized bash shell with starship</figcaption></figure><p>Your command-line interface (CLI) is one of the most important tools in your development workflow. If you spend a significant amount of time in the terminal, why not make it more efficient and visually appealing? This is where Starship comes in — a blazing-fast, highly customizable, and minimalistic prompt designed for any shell. Whether you’re using Bash, Zsh, Fish, or something else, Starship brings flexibility, functionality, and beauty to your terminal experience.</p><p>In this article, we’ll explore how to get started with Starship, customize it, and take full advantage of its features to boost your productivity.</p><h3>What is Starship?</h3><p>Starship is a cross-shell prompt that works on almost any shell. It’s written in Rust, which makes it fast and efficient. The idea behind Starship is simple: give users an easy way to create a personalized, feature-rich prompt that works out of the box and can be easily tweaked.</p><p>Starship displays essential information about your environment, including:<br>- Current Git branch and status<br>- Python, Node.js, Go, and Rust versions in the current directory<br>- Kubernetes context<br>- Battery level<br>- Command execution time<br>- And much more</p><p>Now, let’s dive into how you can install and customize Starship for your shell.</p><h3>Installing Starship</h3><h4>1. Prerequisites</h4><p>Before installing Starship, ensure you have a shell and a package manager installed. If you’re on Linux, MacOS, or WSL, this is typically already set up.</p><h4>2. Installation</h4><p>Starship provides installation instructions for different platforms. Here’s how you can install it using a package manager:</p><h4>Install Latest Version<a href="https://starship.rs/#install-latest-version">​</a></h4><p>With Shell:</p><pre>curl -sS https://starship.rs/install.sh | sh</pre><h4>Homebrew (macOS/Linux):</h4><pre>brew install starship</pre><h4>Scoop (Windows):</h4><pre>scoop install starship</pre><p>You can also install Starship via other methods like `curl`, or check the official i<a href="https://starship.rs/#quick-install">nstallation guide</a> for your specific setup.</p><h4>3. Adding Starship to Your Shell</h4><p>Once installed, you need to add Starship to your shell configuration file. This step ensures that Starship is loaded when you open a new terminal window.</p><ol><li>For <strong>Bash</strong>, add this line to your <strong>.bashrc</strong>:</li></ol><pre>eval &quot;$(starship init bash)&quot;</pre><p>2. For <strong>Zsh</strong>, add this to your <strong>.zshrc</strong>:</p><pre>eval &quot;$(starship init zsh)&quot;</pre><p>3. For <strong>Fish</strong>, add this to your <strong>config.fish</strong>:</p><pre>starship init fish | source</pre><p>Afterward, restart your terminal or run</p><pre>source ~/.bashrc</pre><p>(or your shell’s equivalent) to load Starship.</p><h3>Customizing Starship:</h3><p>Out of the box, Starship is minimalistic but functional. To unlock its full potential, you’ll want to customize it. All of Starship’s configurations are done in a simple TOML file.</p><h4>1. Create the Configuration File</h4><p>The configuration file is usually placed in your home directory under <strong>.config/starship.toml</strong>. You can create it using:</p><pre>mkdir -p ~/.config &amp;&amp; touch ~/.config/starship.toml</pre><h4>2. Basic Customization</h4><p>Starship’s prompt is modular, meaning you can enable or disable specific sections or customize how they appear. Below is an example of a basic configuration that changes the appearance of the prompt:</p><pre># ~/.config/starship.toml<br># Customize the prompt symbol<br>[character]<br>symbol = &quot;➜&quot;<br>success_symbol = &quot;[✔](bold green)&quot;<br>error_symbol = &quot;[✗](bold red)&quot;<br># Show the current directory<br>[directory]<br>truncation_length = 3</pre><p>In this configuration:<br>- The <strong>character</strong> module customizes the command prompt symbol (`➜` by default).<br>- The `<strong>directory</strong>` module controls how the current directory is displayed. By setting `<strong>truncation_length = 3</strong>`, Starship shows only the last three directories in the path.</p><h4>3. Advanced Customization</h4><p>Let’s take it a step further with more advanced customizations, such as displaying programming language versions or battery levels.</p><pre># ~/.config/starship.toml<br># Change Node.js version display<br>[nodejs]<br>format = &quot;via [ $version](bold green) &quot;<br># Display Python virtual environment<br>[python]<br>symbol = &quot;🐍 &quot;<br># Show battery status<br>[battery]<br>threshold = 10<br>format = &quot;🔋 $percentage%&quot;</pre><p>Here’s what these configurations do:<br>- The <strong>node.js</strong> module displays the Node.js version in a bold green format with a custom symbol.<br>- The <strong>python</strong> module adds a Python snake icon when a virtual environment is activated.<br>- The <strong>battery</strong> module displays the battery percentage when it’s below 10%.</p><p>These are just a few examples of what’s possible with Starship. You can find the full list of modules and their customizable options in the <a href="https://starship.rs/config/">Starship documentation</a>.</p><h4>Using Starship with Git</h4><p>One of the most useful features of Starship is its Git integration. It shows you the current branch, whether you have staged changes, untracked files, and more.</p><p>Here’s an example configuration for Git:</p><pre># ~/.config/starship.toml<br>[git_branch]<br>symbol = &quot;🌿 &quot;<br>[git_status]<br>staged = &quot;[+](green)&quot;<br>untracked = &quot;[?](red)&quot;<br>modified = &quot;[*](yellow)&quot;</pre><p>Now, whenever you’re in a Git repository, Starship will display the current branch with a leaf symbol and show the status of your files using symbols for staged, modified, or untracked files.</p><h4>Performance Considerations</h4><p>Starship is incredibly fast because it only runs the modules you configure. However, if you have many modules that require external commands (like checking the version of a programming language), it can slow down your prompt slightly. To avoid this, you can fine-tune the modules you load based on the directories you’re working in.</p><p>For example, you can configure Starship to only show the <strong>node.js</strong> version if a <strong>package.json</strong> file exists in the current directory:</p><pre>[nodejs]<br>disabled = false</pre><p>This way, Starship won’t run unnecessary checks when you’re not in a Node.js project.</p><h3>Final Thoughts</h3><p>Starship is an excellent choice for developers who want a fast, modern, and customizable shell prompt. Its ease of use and extensive configuration options make it perfect for both beginners and advanced users.</p><p>If you haven’t already, give Starship a try! It’s a game-changer for anyone who spends time in the terminal. By tweaking it to show only the information you need, you’ll have a clean, informative, and efficient CLI experience.</p><p>Head over to <a href="https://starship.rs/">Starship’s website</a> to get started, and start customizing your shell today.</p><p>— -</p><p>Feel free to share your favorite Starship configurations or tips in the comments!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2b458a57f32d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[An In-Depth Guide to Three.js: Building 3D Models from Scratch]]></title>
            <link>https://rondevs.medium.com/an-in-depth-guide-to-three-js-building-3d-models-from-scratch-56030b639127?source=rss-25133f1d8ab7------2</link>
            <guid isPermaLink="false">https://medium.com/p/56030b639127</guid>
            <category><![CDATA[3d-website]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[threejs]]></category>
            <category><![CDATA[3d-web-development]]></category>
            <category><![CDATA[3d-modeling]]></category>
            <dc:creator><![CDATA[Rownok Bosunia]]></dc:creator>
            <pubDate>Wed, 28 Aug 2024 15:04:31 GMT</pubDate>
            <atom:updated>2024-08-28T17:40:12.958Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K9IP6GeDCYF13uD68j0xhg.png" /></figure><h3>Introduction to Three.js</h3><p>Three.js is a powerful JavaScript library that simplifies the creation of 3D graphics in a web browser. It abstracts the complexities of WebGL, allowing developers to create immersive 3D experiences with minimal code. Whether you’re building simple 3D models or complex interactive scenes, Three.js provides the tools you need to get started.</p><h3>Why Use Three.js?</h3><ul><li><strong>Cross-browser compatibility</strong>: Three.js ensures your 3D scenes work across all modern browsers.</li><li><strong>Easy to learn</strong>: The library abstracts WebGL, making it more accessible to developers.</li><li><strong>Extensive documentation and community support</strong>: With a large community, Three.js offers abundant resources, tutorials, and examples.</li><li><strong>Versatile</strong>: You can create anything from simple shapes to complex interactive environments.</li></ul><h3>Setting Up Three.js</h3><p>Before diving into creating 3D models, you need to set up your development environment.</p><h3>Installation</h3><p>There are multiple ways to include Three.js in your project:</p><ol><li><strong>Using a CDN</strong>: The simplest way is to include Three.js via a CDN in your HTML file.</li></ol><pre>&lt;script src=&quot;https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js&quot;&gt;&lt;/script&gt;</pre><p>2. <strong>Using npm</strong>: If you’re working with a module bundler like Webpack, install Three.js via npm:</p><pre>npm install three</pre><h3>Basic Structure of a Three.js Scene</h3><p>To understand how Three.js works, it’s essential to know the basic components of a 3D scene:</p><ol><li><strong>Scene</strong>: This is where all objects, lights, and cameras are placed.</li><li><strong>Camera</strong>: Defines what part of the scene is visible to the user.</li><li><strong>Renderer</strong>: Renders the scene from the camera’s perspective onto the canvas.</li><li><strong>Mesh</strong>: The combination of geometry (shape) and material (appearance).</li><li><strong>Light</strong>: Illuminates the scene, allowing objects to be visible.</li></ol><h3>Example: Setting Up a Basic Scene</h3><p>Here’s a basic example to get you started:</p><pre>&lt;!DOCTYPE html&gt;<br>&lt;html lang=&quot;en&quot;&gt;<br>&lt;head&gt;<br>    &lt;meta charset=&quot;UTF-8&quot;&gt;<br>    &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;<br>    &lt;title&gt;Three.js Basic Scene&lt;/title&gt;<br>    &lt;style&gt;<br>        body { margin: 0; }<br>        canvas { display: block; }<br>    &lt;/style&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br>    &lt;script src=&quot;https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js&quot;&gt;&lt;/script&gt;<br>    &lt;script&gt;<br>        // Create a scene<br>        const scene = new THREE.Scene();// Create a camera<br>        const camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000);<br>        camera.position.z = 5;<br>        // Create a renderer<br>        const renderer = new THREE.WebGLRenderer();<br>        renderer.setSize(window.innerWidth, window.innerHeight);<br>        document.body.appendChild(renderer.domElement);<br>        // Add a cube<br>        const geometry = new THREE.BoxGeometry();<br>        const material = new THREE.MeshBasicMaterial({ color: 0x00ff00 });<br>        const cube = new THREE.Mesh(geometry, material);<br>        scene.add(cube);<br>        // Animation loop<br>        function animate() {<br>            requestAnimationFrame(animate);<br>            // Rotate the cube<br>            cube.rotation.x += 0.01;<br>            cube.rotation.y += 0.01;<br>            renderer.render(scene, camera);<br>        }<br>        animate();<br>    &lt;/script&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;<br></pre><p>In this example:</p><ul><li>A scene is created using THREE.Scene().</li><li>A perspective camera is set up with a field of view of 75 degrees.</li><li>A WebGL renderer is used to render the scene.</li><li>A simple cube is created using BoxGeometry and MeshBasicMaterial.</li><li>The cube is rotated in an animation loop using requestAnimationFrame.</li></ul><h3>Creating 3D Models with Three.js</h3><h3>Working with Geometry</h3><p>Three.js provides several built-in geometries you can use to create 3D models. Some of the most commonly used geometries include:</p><ul><li><strong>BoxGeometry</strong>: A rectangular box.</li><li><strong>SphereGeometry</strong>: A sphere.</li><li><strong>PlaneGeometry</strong>: A flat plane.</li><li><strong>CylinderGeometry</strong>: A cylinder.</li><li><strong>TorusGeometry</strong>: A donut-shaped ring.</li></ul><h4>Example: Creating a Sphere</h4><pre>const geometry = new THREE.SphereGeometry(1, 32, 32);<br>const material = new THREE.MeshBasicMaterial({ color: 0xff0000 });<br>const sphere = new THREE.Mesh(geometry, material);<br>scene.add(sphere);</pre><p>This code creates a red sphere with a radius of 1 and 32 segments, which determines the smoothness of the sphere.</p><h3>Custom Geometry</h3><p>For more complex shapes, you might need to create custom geometry using THREE.BufferGeometry. This allows you to define the vertices and faces manually.</p><h4>Example: Custom Triangle</h4><pre>const geometry = new THREE.BufferGeometry();<br>const vertices = new Float32Array([<br>    -1.0, -1.0,  1.0,<br>     1.0, -1.0,  1.0,<br>     1.0,  1.0,  1.0<br>]);<br>geometry.setAttribute(&#39;position&#39;, new THREE.BufferAttribute(vertices, 3));<br>const material = new THREE.MeshBasicMaterial({ color: 0x0000ff });<br>const triangle = new THREE.Mesh(geometry, material);<br>scene.add(triangle);</pre><h3>Materials</h3><p>Materials define the appearance of the objects in your scene. Three.js provides a variety of materials, such as:</p><ul><li><strong>MeshBasicMaterial</strong>: A simple material that doesn’t react to light.</li><li><strong>MeshLambertMaterial</strong>: A material that reacts to light but without specular highlights.</li><li><strong>MeshPhongMaterial</strong>: A material that includes specular highlights, making it shiny.</li><li><strong>MeshStandardMaterial</strong>: A physically-based material that provides more realistic rendering.</li></ul><h4>Example: Using MeshStandardMaterial</h4><pre>const material = new THREE.MeshStandardMaterial({<br>    color: 0x00ff00,<br>    roughness: 0.5,<br>    metalness: 0.5<br>});<br>const cube = new THREE.Mesh(geometry, material);<br>scene.add(cube);</pre><p>In this example, MeshStandardMaterial gives the cube a metallic and rough appearance.</p><h3>Textures</h3><p>You can enhance your 3D models by applying textures. Textures are images mapped onto the surface of your geometry.</p><h4>Example: Applying a Texture</h4><pre>const textureLoader = new THREE.TextureLoader();<br>const texture = textureLoader.load(&#39;path/to/texture.jpg&#39;);<br>const material = new THREE.MeshBasicMaterial({ map: texture });<br>const cube = new THREE.Mesh(geometry, material);<br>scene.add(cube);</pre><h3>Lighting</h3><p>Lighting is crucial in 3D scenes as it affects how materials are displayed. Three.js offers several types of lights:</p><ul><li><strong>AmbientLight</strong>: A global light that illuminates all objects equally.</li><li><strong>PointLight</strong>: A light source that emits light in all directions from a single point.</li><li><strong>DirectionalLight</strong>: A light that emits parallel rays, similar to sunlight.</li><li><strong>SpotLight</strong>: A light source that emits light in a cone shape.</li></ul><h4>Example: Adding Ambient and Point Lights</h4><pre>const ambientLight = new THREE.AmbientLight(0x404040); // Soft white light<br>scene.add(ambientLight);<br>const pointLight = new THREE.PointLight(0xffffff, 1, 100);<br>pointLight.position.set(10, 10, 10);<br>scene.add(pointLight);</pre><h3>Advanced Techniques:</h3><h3>Loading 3D Models</h3><p>While you can create models using basic geometries, you might want to import more complex models from external sources. Three.js supports loading models in various formats such as .obj, .fbx, and .gltf.</p><h4>Example: Loading a GLTF Model</h4><pre>const loader = new THREE.GLTFLoader();<br>loader.load(&#39;path/to/model.gltf&#39;, function (gltf) {<br>    scene.add(gltf.scene);<br>}, undefined, function (error) {<br>    console.error(error);<br>});</pre><h3>Animations</h3><p>Three.js provides tools to animate objects. You can use the built-in THREE.Clock to handle time-based animations or import keyframe animations from external models.</p><h4>Example: Simple Animation</h4><pre>const clock = new THREE.Clock();<br>function animate() {<br>    requestAnimationFrame(animate);<br>    const delta = clock.getDelta();<br>    cube.rotation.x += delta * 0.5;<br>    cube.rotation.y += delta * 0.5;<br>    renderer.render(scene, camera);<br>}<br>animate();</pre><h3>Camera Controls</h3><p>For interactive scenes, you might want to allow users to control the camera. The THREE.OrbitControls library provides an easy way to add mouse-based controls.</p><h4>Example: Adding Orbit Controls</h4><pre>const controls = new THREE.OrbitControls(camera, renderer.domElement);<br>controls.enableDamping = true;<br>controls.dampingFactor = 0.25;<br>controls.enableZoom = true;</pre><h3>Post-Processing</h3><p>Post-processing effects can significantly enhance the visual quality of your 3D scenes by adding effects like bloom, depth of field, and motion blur. Three.js provides a powerful post-processing pipeline using THREE.EffectComposer, which allows you to chain multiple effects together.</p><h4>Example: Adding Bloom Effect</h4><pre>const composer = new THREE.EffectComposer(renderer);<br>const renderPass = new THREE.RenderPass(scene, camera);<br>composer.addPass(renderPass);<br>const bloomPass = new THREE.BloomPass(1.25);  // Intensity of the bloom<br>composer.addPass(bloomPass);<br>function animate() {<br>    requestAnimationFrame(animate);<br>    composer.render();  // Use composer to render the scene with post-processing<br>}<br>animate();</pre><p>In this example, the bloom effect is applied after rendering the scene, giving objects with bright areas a glowing appearance.</p><h3>Shadows</h3><p>Shadows add depth and realism to your scene. In Three.js, you can enable shadows by configuring both the lights and the renderer.</p><h4>Example: Enabling Shadows</h4><pre>// Enable shadows in the renderer<br>renderer.shadowMap.enabled = true;<br>// Create a spotlight that casts shadows<br>const spotLight = new THREE.SpotLight(0xffffff);<br>spotLight.position.set(10, 10, 10);<br>spotLight.castShadow = true;<br>scene.add(spotLight);<br>// Enable shadow casting and receiving on objects<br>cube.castShadow = true;<br>cube.receiveShadow = true;<br>const planeGeometry = new THREE.PlaneGeometry(200, 200);<br>const planeMaterial = new THREE.MeshStandardMaterial({ color: 0x808080 });<br>const plane = new THREE.Mesh(planeGeometry, planeMaterial);<br>plane.receiveShadow = true;<br>plane.rotation.x = -Math.PI / 2;<br>scene.add(plane);</pre><p>Here, shadows are enabled for both the renderer and the objects in the scene. The plane beneath the cube receives the shadow cast by the cube, adding realism to the scene.</p><h3>Physics Integration</h3><p>For more interactive and dynamic scenes, integrating physics can be crucial. Three.js can work with physics engines like Ammo.js, Cannon.js, or Oimo.js to simulate real-world physics such as gravity, collisions, and rigid body dynamics.</p><h4>Example: Basic Physics with Cannon.js</h4><pre>// Set up Cannon.js world<br>const world = new CANNON.World();<br>world.gravity.set(0, -9.82, 0);  // Earth&#39;s gravity<br>// Create a physics body for the cube<br>const shape = new CANNON.Box(new CANNON.Vec3(1, 1, 1));<br>const body = new CANNON.Body({ mass: 1 });<br>body.addShape(shape);<br>body.position.set(0, 10, 0);<br>world.addBody(body);<br>function animate() {<br>    requestAnimationFrame(animate);<br>    // Step the physics world<br>    world.step(1/60);<br>    // Update Three.js mesh position with physics simulation<br>    cube.position.copy(body.position);<br>    cube.quaternion.copy(body.quaternion);<br>    renderer.render(scene, camera);<br>}<br>animate();</pre><p>In this example, the cube’s position and rotation are controlled by the physics simulation, allowing it to fall under gravity and collide with other objects.</p><h3>Working with Large Scenes</h3><p>As your scene grows more complex, performance can become a concern. Three.js offers several strategies to optimize large scenes.</p><h4>Tips for Optimizing Performance</h4><ol><li><strong>Level of Detail (LOD)</strong>: Use LOD techniques to reduce the complexity of distant objects.</li><li><strong>Frustum Culling</strong>: Ensure that objects outside the camera’s view are not rendered.</li><li><strong>Instancing</strong>: Use THREE.InstancedMesh to efficiently render many identical objects.</li><li><strong>Texture Optimization</strong>: Use compressed textures and reduce texture resolution where possible.</li><li><strong>Efficient Geometry</strong>: Simplify geometry where detail isn’t necessary, and merge geometries when possible.</li></ol><h3>Exporting Your 3D Models</h3><p>Once your 3D model is complete, you might want to export it for use in other applications or share it online.</p><h4>Example: Exporting as GLTF</h4><p>Three.js allows you to export your scene or models in the GLTF format, which is widely supported and optimized for web applications.</p><pre>const exporter = new THREE.GLTFExporter();<br>exporter.parse(scene, function (gltf) {<br>    const blob = new Blob([JSON.stringify(gltf)], { type: &#39;application/json&#39; });<br>    const url = URL.createObjectURL(blob);<br>    const a = document.createElement(&#39;a&#39;);<br>    a.href = url;<br>    a.download = &#39;scene.gltf&#39;;<br>    a.click();<br>});</pre><p>This script allows you to download your entire scene as a .gltf file, which can then be imported into other 3D software or used directly in web applications.</p><h3>Conclusion</h3><p>Three.js is an incredibly versatile library that empowers developers to create stunning 3D graphics in the browser. From setting up a basic scene to implementing advanced features like physics, lighting, and post-processing effects, Three.js provides all the tools you need to bring your 3D visions to life.</p><p>Whether you’re a beginner starting with simple shapes or an advanced developer working on complex, interactive environments, the flexibility and power of Three.js make it an essential tool in the web developer’s toolkit. With its extensive documentation, active community, and continuous development, Three.js will continue to be a leading choice for web-based 3D graphics.</p><p>Now that you’ve learned the basics, it’s time to experiment and build your own 3D models and scenes. The only limit is your imagination. Happy coding!</p><p>This detailed guide should serve as a comprehensive introduction to Three.js and the various options it offers. As you dive deeper, you’ll discover even more advanced techniques and possibilities with this powerful library.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=56030b639127" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How To Customize Your Bash Shell To Look Cool]]></title>
            <link>https://rondevs.medium.com/how-to-customize-your-bash-shell-to-look-cool-5f92df325f0f?source=rss-25133f1d8ab7------2</link>
            <guid isPermaLink="false">https://medium.com/p/5f92df325f0f</guid>
            <category><![CDATA[terminal]]></category>
            <category><![CDATA[bash-shell]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[bash]]></category>
            <category><![CDATA[shell]]></category>
            <dc:creator><![CDATA[Rownok Bosunia]]></dc:creator>
            <pubDate>Fri, 29 Jul 2022 22:27:21 GMT</pubDate>
            <atom:updated>2023-05-06T19:27:12.912Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/868/1*CUxrJFX5aQNrSaQjUvQVTA.png" /></figure><p><strong>Do you find bash shell “Boring” in terms of looks?</strong></p><p><strong>Do you feel intimidated to customize your bash shell?</strong></p><p>Here’s some pro tips on how to customize your bash shell to look cool.</p><h4><strong>Install Oh-my-bash:</strong></h4><p>OMB will allow you to install themes and plugins on your bash shell.</p><p>To install oh-my-bash, run one of the commands below.</p><blockquote><strong>Via curl:</strong></blockquote><pre>bash -c “$(curl -fsSL https://raw.githubusercontent.com/ohmybash/oh-my-bash/master/tools/install.sh)&quot;</pre><blockquote><strong>Via wget:</strong></blockquote><pre>bash -c “$(wget <a href="https://raw.githubusercontent.com/ohmybash/oh-my-bash/master/tools/install.sh">https://raw.githubusercontent.com/ohmybash/oh-my-bash/master/tools/install.sh</a> -O -)”</pre><p>After installing oh-my-bash you’ll see the look has already changed.</p><p>You can change themes now very easily by editing your <em>.bashrc </em>file.</p><p>To change the theme go to your home directory and open <em>.bashrc</em> file your preferred text editor.</p><p>Choose your theme from here:</p><p><a href="https://github.com/ohmybash/oh-my-bash/wiki/Themes">Themes · ohmybash/oh-my-bash Wiki</a></p><p>Copy the name of your preferred theme and paste it here in your <em>.bashrc</em> file and save it.</p><pre>OSH_THEME=”put your theme name here”</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/868/1*hive5PXldoYSNtgOa5KKpw.png" /></figure><p><strong>And run:</strong></p><pre>Source ~/.bashrc</pre><h4><strong>Install sauce code pro font:</strong></h4><p>Download sauce code pro nerd font from here:</p><p><a href="https://www.nerdfonts.com/font-downloads">Nerd Fonts - Iconic font aggregator, glyphs/icons collection, &amp; fonts patcher</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/638/1*NSsdyun66lyzuEdHnRUYCQ.png" /></figure><p>And install sauce code pro nerd font medium complete mono .</p><p>Open up your bash shell and go to preferences and add sauce code pro to custom font</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/868/1*zhiK4hh9dBGets0MfXTB2Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/827/1*DcOpwhMUhYc2r4wK7CWYzg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/625/1*O5gT28wGWSmQ12enI6hCrA.png" /></figure><h4><strong>Install ble.sh:</strong></h4><p><em>Ble.sh</em> will give you features like <strong>syntax highlighting</strong>, <strong>auto-completion</strong> etc.</p><p>To install <em>ble.sh</em> run:</p><pre>git clone — recursive https://github.com/akinomyoga/ble.sh.git</pre><pre>make -C ble.sh install PREFIX=~/.local</pre><pre>echo ‘source ~/.local/share/blesh/ble.sh’ &gt;&gt; ~/.bashrc</pre><p><strong>Restart your terminal.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/868/1*8OS-zo5UY3J8RD8Lgu1l7g.png" /></figure><h4><strong>Install exa, a modern replacement for “<em>ls”</em>.</strong></h4><p>To install <em>exa</em> run,</p><blockquote><strong>Arch Linux:</strong></blockquote><pre>pacman -S exa</pre><blockquote><strong>Debian/ Ubuntu:</strong></blockquote><pre>apt install exa</pre><blockquote><strong>Fedora:</strong></blockquote><pre>dnf install exa</pre><blockquote><strong>Gentoo:</strong></blockquote><pre>emerge sys-apps/exa</pre><blockquote><strong>Homebrew:</strong></blockquote><pre>brew install exa</pre><blockquote><strong>MacPorts:</strong></blockquote><pre>port install exa</pre><blockquote><strong>openSUSE:</strong></blockquote><pre>zypper install exa</pre><p>Lastly add these two lines in your <em>.bashrc</em> file</p><pre>alias ll=”exa -l -g — icons”</pre><pre>alias lla=”exa -la -g — icons”</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/868/1*cZE_uEzCHg0-mq_id2n1CA.png" /></figure><p><strong>And run:</strong></p><pre>Source ~/.bashrc</pre><p>Now you have an awesome looking bash shell with cool features.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/868/1*CUxrJFX5aQNrSaQjUvQVTA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5f92df325f0f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>