<?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 Lewis Munene on Medium]]></title>
        <description><![CDATA[Stories by Lewis Munene on Medium]]></description>
        <link>https://medium.com/@lewimuchiri?source=rss-aa50a5798816------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*2BOVGjzQF5k2UDMS</url>
            <title>Stories by Lewis Munene on Medium</title>
            <link>https://medium.com/@lewimuchiri?source=rss-aa50a5798816------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 16:57:47 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@lewimuchiri/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[Setting up a Monorepo with Gradle and Spring Boot and Version Catalogs]]></title>
            <link>https://medium.com/@lewimuchiri/setting-up-a-gradle-monorepo-with-spring-boot-and-version-catalogs-41fdf1112dac?source=rss-aa50a5798816------2</link>
            <guid isPermaLink="false">https://medium.com/p/41fdf1112dac</guid>
            <category><![CDATA[monorepo]]></category>
            <category><![CDATA[gradle]]></category>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[tutorial]]></category>
            <dc:creator><![CDATA[Lewis Munene]]></dc:creator>
            <pubDate>Mon, 05 Aug 2024 21:40:04 GMT</pubDate>
            <atom:updated>2024-08-08T08:26:07.741Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>This tutorial uses the following configuration: <em>Gradle 8.9 (Kotlin), Spring Boot 3.3.2, Java 21, buildSrc, Version Catalog and IntelliJ IDE.</em></blockquote><h4>What is a Monorepo?</h4><p>A Monorepo is a single repository that contains multiple distinct projects.</p><p>Monorepos are useful in microservice architecture because they allow you to bundle together microservices that belong to the same domain and have them reside in the same repository. If you use GitHub, which also supports monorepos, then they can all reside in the same GitHub repository.</p><h4>Setting up a Monorepo for a Spring Boot Project</h4><ol><li>Open your IDE (we will use IntelliJ for this tutorial) and go to <strong><em>File &gt;&gt; New &gt;&gt; Project</em></strong>. The “New Project” dialog will appear (screenshot below). Give the project a preferred name (we have named it “monorepo-demo”) and use your preferred folder as the location. The other settings can remain as they are in the screenshot below. After that, click on “Create”</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/983/1*rTQawgyq88PyxdhBgg1gOg.png" /></figure><p>IntelliJ will create a new stand-alone project as you can see on the next screenshot, so we need to move a few things around to make it a monorepo</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sW5uEDb4qKvQvPV8eCi5zg.png" /></figure><p>2. Create a new empty directory named <em>“buildSrc”</em> under your root directory. Gradle automatically detects a folder with this name within the directory and configures it as a Gradle configuration source. The shared build scripts will reside here. Leave it empty for now</p><p>3. Create three other empty directories under your root directory. These will contain your project sources and their configurations. We shall name the directories <em>“project-1”, “project-2” </em>and<em> “shared”. “project-1” </em>and<em> “project-2” </em>will be our projects while<em> “shared” </em>will be our common-lib project, which will contain utilities that can be shared by the other projects.</p><p>4. Delete the <em>“src”</em> folder and <em>“build.gradle.kts”</em> files that IntelliJ had created.</p><p>Your directory structure should now look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/636/1*2pujM2RpJm0ICodxuckRPA.png" /></figure><p>5. Add a new folder, <em>“src”</em> within the “buildSrc” folder. Under “src” add a new folder <em>“main”</em> and under “main” add the folder <em>“kotlin”. </em>In the “kotlin” folder, add a file <em>“java-conventions.gradle.kts”</em>. See screenshot below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/643/1*hEP6CHLXfMxdJt4PBTDn_w.png" /></figure><p>6. Add the following to your “java-conventions.gradle.kts”:</p><pre>// buildSrc/src/main/kotlin/java-conventions.gradle.kts<br><br>plugins {<br>    java<br>    id(&quot;io.freefair.lombok&quot;) // Note: version is NOT specified here. See Step 7<br>    // add any other Gradle plugins here<br>}<br><br>repositories {<br>    mavenCentral()<br>}<br><br>java {<br>    toolchain {<br>        languageVersion.set(JavaLanguageVersion.of(21))<br>    }<br>}<br><br>dependencies {<br> // add any dependencies that you want to apply to all your monorepo projects here<br>}</pre><p>Any dependency or plugin added to this file will apply to all projects in the monorepo.</p><p>7. Add a <em>“build.gradle.kts” </em>file in “buildSrc” folder. This file should contain the repositories declaration, at least declaring the gradlePluginPortal, and also the coordinates of the buildSrc Gradle plugins within the “dependencies” block.</p><pre>plugins {<br>    `kotlin-dsl`<br>}<br><br>repositories {<br>    gradlePluginPortal()<br>}<br><br>dependencies {<br>  // Provide the coordinates for your Gradle plugins here, including their versions<br>  implementation(&quot;io.freefair.gradle:lombok-plugin:8.6&quot;)<br>}</pre><p>8. Add a <em>“build.gradle.kts”</em>, within the “project-1”, “project-2” and “shared” directories. This is where you add configurations that are specific to the projects. For example, if project-1 needs a certain dependency that project-2 does not need, then that configuration is done here. The files should at least look like this:</p><pre>// project-1/build.gradle.kts<br><br>plugins {<br>  id (&quot;java-conventions&quot;) // imports everything that was declared in &quot;/buildSrc/src/main/kotlin/java-conventions.gradle.kts&quot;<br><br>  // add other project-specific plugins here<br>}<br><br>dependencies {<br>  implementation(project(&quot;:shared&quot;)) // project-1 imports &quot;shared&quot; as a dependency<br><br>  // add project-specific dependencies here<br>}</pre><p>By now your repository should look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/667/1*EKFq8tK4tRJDGi_osXRbwA.png" /></figure><p>9. Include all your projects in the Gradle configuration by modifying the <em>“settings.gradle.kts”</em> file as follows:</p><pre>// settings.gradle.kts<br><br>rootProject.name = &quot;monorepo-demo&quot;<br><br>include(&quot;project-1&quot;)<br>include(&quot;project-2&quot;)<br>include(&quot;shared&quot;)</pre><h4>Version Catalogs</h4><p>Gradle Version Catalogs is a way of centralizing the management of dependency versions across multiple projects in a monorepo. If your projects share certain dependecies, then you want the versions of those dependencies to be the same and hence the management of those versions should be centralized. The buildSrc folder is an alternative way of sharing dependencies and their versions, but it is not ideal in situations where certain dependencies are not used by certain projects in that monorepo. Adding such dependencies here forces all projects to import them even if they do not need them. Version Catalogs however allow the centralization of dependency versions while enabling different projects to import or ignore those dependencies.</p><h4>Setting up a Version Catalog for your Monorepo</h4><p>The Version catalog is declared in the “settings.gradle.kts” configuration file. This is where you specify the versions for all the shared dependencies in your monorepo. Your “settings.gradle.kts” file should look like this:</p><pre>// settings.gradle.kts<br><br>rootProject.name = &quot;monorepo-demo&quot;<br><br>include(&quot;project-1&quot;)<br>include(&quot;project-2&quot;)<br>include(&quot;shared&quot;)<br><br>dependencyResolutionManagement {<br>  versionCatalogs {<br>    create(&quot;springboot&quot;) {<br>       library(&quot;bom&quot;, &quot;org.springframework.boot:spring-boot-dependencies:3.3.2&quot;)<br>    }<br><br>    create(&quot;kafka&quot;) {<br>       library(&quot;protobuf.serializer&quot;, &quot;io.confluent:kafka-protobuf-serializer:7.6.1&quot;)<br>    }<br><br>    create(&quot;libs&quot;) {<br>       library(&quot;lib1&quot;, &quot;lib1-coordinates-and-version&quot;)<br>       library(&quot;lib2&quot;, &quot;lib2-coordinates-and-version&quot;)<br>       // add other libraries here<br>    }<br><br>    // add other library blocks here<br>  }<br>}</pre><p>To reference a dependency that’s included in the version catalog, you import it using the catalog name and the dependency alias. For example, to import spring-boot-dependencies and kafka-protobuf-serializer into your projects, you would do the following in each project’s “build.gradle.kts”:</p><pre>// project-1/build.gradle.kts<br><br>dependencies {<br>  implementation(platform(springboot.bom))<br><br>  implementation(kafka.protobuf.serializer)<br><br>  implementation(libs.lib1)<br>}</pre><p>Note that the dependencies are imported into the project using the syntax &lt;catalogName&gt;.&lt;alias&gt;. This also offers code completion for the IDE. The catalogName is the name you used as an argument to the create() method while the alias is the name you used as the first argument to the library() method in “settings.gradle.kts”.</p><p>The alias names are automatically converted to dot-notation format. If you used underscores to separate individual words in the alias or even dash characters, Gradle will convert this to dot notation so you will import your dependency using dot notation.</p><p>For example:</p><ol><li>first-second-third becomes first.second.third</li><li>first_second_third becomes first.second.third</li><li>firstSecondThird remains as firstSecondThird</li></ol><p>You can now do ./gradlew build on a terminal at the root of the monorepo and Gradle will build your project</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=41fdf1112dac" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Transfer Large Files between Phone and PC using SMB File Share]]></title>
            <link>https://medium.com/@lewimuchiri/how-to-transfer-large-files-between-phone-and-pc-using-smb-file-share-17f5040c48af?source=rss-aa50a5798816------2</link>
            <guid isPermaLink="false">https://medium.com/p/17f5040c48af</guid>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[step-by-step-guide]]></category>
            <dc:creator><![CDATA[Lewis Munene]]></dc:creator>
            <pubDate>Tue, 16 Jul 2024 08:52:39 GMT</pubDate>
            <atom:updated>2024-07-16T10:11:01.242Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to Transfer Large Files between Phone and PC using SMB</h3><p>While there exists several ways of transferring files between phone and PC, you will find limitations on transfer speed and capability to transfer entire folders on most or all of these approaches. Again, the Android OS sometimes restricts copying of files from the “Android” directory via USB. Here we explore SMB (Server Message Block) protocol and a step-by-step approach to transfer large files (greater than 50GB) from your phone to PC (and vice versa).</p><p><em>This tutorial uses a Windows 11 PC and Samsung Galaxy S24+ Android phone.</em></p><h4>Enable SMB on Windows</h4><ol><li>Lauch Control Panel (Type “Control Panel” on the Windows search box and click on the Control Panel search result)</li><li>Click on “Programs”</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*so3CUquYiKuXaaVItxc5Hw.png" /><figcaption>Control Panel</figcaption></figure><p>3. Click on “Programs and Features” on the next screen</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k-HepwQOEnUczWpPdn-g3g.png" /><figcaption>Programs</figcaption></figure><p>4. Click on “Turn Windows features on or off”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KyTjK7QYZU8G3DVpsDgOcg.png" /></figure><p>5. On the dialog that appears, ensure “SMB Direct” is checked and click on OK. Additionally, uncheck the <strong>SMB 1.0/CIFS File Sharing Support </strong>as it has some vulnerabilities and could compromise your network. This option is used to enable SMB 1.0. Here we are using SMB Direct.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/545/1*vpH1EaAXABDm0-VtKR3YVw.png" /></figure><p>6. Open <strong>Control Panel</strong> &gt; <strong>Network and Internet </strong>&gt; <strong>Network and Sharing Center</strong> &gt; <strong>Change Advanced Sharing settings </strong>&gt; <strong>All Networks</strong> &gt; then turn off <strong>Password Protected Sharing. </strong>Additionally, enable<strong> Public folder sharing</strong></p><p>7. Navigate to the folder you want to share, right-click on it and select “Properties”</p><p>8. Open the “Sharing” tab, then click on “Share”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/475/1*M_UHb_I0cU7IiM2HOLQaKw.png" /></figure><p>9. Select “Everyone” and give them “Read/Write” permission level. If you cannot see “Everyone”, select the drop-down that’s there and choose “Everyone”. After that you click on “Add”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/650/1*2ZQJDaqZqHfRqU9ytiOP_w.png" /></figure><p>10. Click on “Share” button.</p><p>With this, the folder you selected is now available for SMB file transfer. Any file or folder that you add to it will be publicly accessible to any device that is connected to this machine via SMB.</p><h4>Access SMB-Shared Folder on Phone</h4><p><em>The tutorial uses Samsung Galaxy s24+. The steps may be different for other phones</em></p><ol><li>Open the Samsung “My Files” app</li><li>Under “Storage”, select “Network Storage”</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/421/1*MvUDqlTQBEzt86cgbM-l9A.png" /></figure><p>3. Click on “Add Network Storage” and select “Network drive (SMBv2/SMBv3)”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/427/1*ybZnj2luMw45yN7Mhrpxrw.png" /></figure><p>4. The phone will scan for shared drives and display a list of available servers. Select the one that matches your PC (The PC name will be displayed)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/397/1*hjsCJOq98pMbQNd0Hr5dcA.png" /></figure><p>5. Select “Sign in anonymously” to avoid typing your credentials and click on “Add”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/407/1*e7TeNfSmNE4sh1lUgJiBJA.png" /></figure><p>The folder that you shared will appear on the list.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/417/1*GWBz7iX5Nvh2fXEtMTGJzA.png" /></figure><p>To add files from the phone to that folder (so that they can be accessed on PC), navigate to the desired file or folder using the Samsung “My Files” app, long-press it and click on “Copy”. After that navigate back to the shared folder (Network Storage &gt; Select your PC &gt; Select the shared folder), then “Paste” it there.</p><p>Do the same on the PC side to share files/folders from PC to phone.</p><p>In short, anything that is added to the shared folder is accessible to both the phone and the PC.</p><p>The SMB protocol is very reliable and can transfer very large files very fast.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=17f5040c48af" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>