<?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 Denno kariuki on Medium]]></title>
        <description><![CDATA[Stories by Denno kariuki on Medium]]></description>
        <link>https://medium.com/@kariukidennisde?source=rss-8fbe53f1d7e4------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*CN2E4ATf0BB15uQlEJXmrg.jpeg</url>
            <title>Stories by Denno kariuki on Medium</title>
            <link>https://medium.com/@kariukidennisde?source=rss-8fbe53f1d7e4------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 15:24:22 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kariukidennisde/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[Holier Than Thou!]]></title>
            <link>https://medium.com/@kariukidennisde/holier-than-thou-7a3b10102c90?source=rss-8fbe53f1d7e4------2</link>
            <guid isPermaLink="false">https://medium.com/p/7a3b10102c90</guid>
            <category><![CDATA[christian-living]]></category>
            <category><![CDATA[alcoholism]]></category>
            <category><![CDATA[christianity]]></category>
            <dc:creator><![CDATA[Denno kariuki]]></dc:creator>
            <pubDate>Wed, 09 Sep 2026 15:48:34 GMT</pubDate>
            <atom:updated>2026-09-09T15:48:34.978Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ho-RlJwcvR4YJ4puW89j4A.jpeg" /></figure><p>This piece was born out of a reflection sparked by a social media conversation.</p><p>Recently, Nairobi hosted a mega Christian summit; a five-day marathon of praise, worship, and sermons delivered by renowned pastors from around the world, with some of the biggest names in gospel music leading the worship. Most of the attendees were young people. The common refrain was that we were witnessing a revival: a generation returning to Christianity after choosing to live, as many put it, “religion-free.”</p><p>After the summit, still high on all that energy and passion, groups of young people camped outside major clubs and started their own Christian rave. They sang, danced, and even asked the resident DJs to play some of the gospel music they could relate to. In its own way, it was quite something: taking the revival straight to the doorstep of the clubs.</p><p>In my view, though, some of the song requests and chants crossed a line. Before my fellow Christians reach for their stones and stop reading, I get the point. It is an expression of the joy that comes with knowing Christ. But I don’t believe you can condemn people into understanding God’s love.</p><p>I’m nudged to write about this because I feel that, in our passion for reaching the lost, we are missing something. We are so eager to tell people about the better life in Christ that we sometimes forget what it feels like to be the person on the other side of that message; already tired, ashamed, and looking for a way out.</p><p>For context, as I write this, I’m in my second year of recovering from alcoholism. I remember too well what it felt like. I had convinced myself that excessive drinking was a fun lifestyle and that, as an adult, you couldn’t face this crooked world sober. In the bottle, I had a companion, one whose tipsiness and blackouts offered temporary vacations from the tough realities of my business and personal life.</p><p>The other half of me knew it sucked. I hated the hangovers, the nights hugging toilet bowls, the bar brawls, the regrettable decisions and, worst of all, the emptiness that hit once the high wore off. After finishing this, go read <a href="https://mueni.substack.com/p/maji-maji-rebellion">Maji Maji Rebellion</a> by Mueni. She captures the reality of this loop far better than I ever could.</p><p>At the top of all this is the realization that you have a new master. This hits hardest when you’re drinking alone. You look at the bottle and realize you are no longer the captain of this ship. Somewhere deep inside, there is still a small part of you trying to break out of captivity. You manage a day, maybe a month, and then somehow find yourself back in the same box. And when this master starts ignoring the fact that you have work, a relationship, even a family, the self-hate creeps in. You feel despicable. You hate yourself for not even being considerate towards yourself.</p><p>So I can only imagine the man or woman I was two years ago, sitting in a club with a bottle in hand, alone and trying to make sense of this crooked world with their unquestioning master. They were already beaten down. They knew they were slaves and hated it. Then, all of a sudden, they are mobbed by a group demanding music and raising chants that remind them their lifestyle is not worthy, that they are sinners and need to change their ways.</p><p>As if their current master wasn’t demanding enough!</p><p>Two years ago, I was loved out of my master. I walked into a church drunk, my old master still in hand. There were no judgments, no bombastic side-eyes from the people around me. More importantly, the pastor did not change the sermon to make a point about the drunkard who had just walked in. They simply continued with the message they had prepared. On my second Sunday there, the pastor said that anyone struggling and in need of prayer could approach any of the pastors. My own conviction pushed me to ask for prayer.</p><p>There was no judgment from the pastor I approached. They didn’t cringe at my alcohol breath. They hugged me afterwards. There was dignity. Dignity that I had lost to my old master. Dignity that I fear we might take away when we mob people outside clubs with condemnation.</p><p>Maybe this is what we are missing in our excitement to reach the lost. The person outside that club may not need another reminder that they are a sinner. They probably know. They may have spent the whole night negotiating with the bottle, losing every round, and hating themselves for it.</p><p>Jesus never seemed particularly interested in kicking people when they were down. He ate with Zacchaeus. He defended the woman caught in adultery. He sat with sinners and tax collectors. He met people in the middle of their mess and offered them dignity before demanding a better life.</p><p>Perhaps the revival we are praying for is not just about getting more people into church. Perhaps it is about becoming the kind of Christians that a drunk person can walk up to without first having to sober up, fix their life and submit a CV for sainthood.</p><p>Because some people don’t need us to tell them they are lost.</p><p>They need someone to show them they can still be found.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7a3b10102c90" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[An Identity struggle (Does it really end?)— A book review]]></title>
            <link>https://medium.com/@kariukidennisde/an-identity-struggle-does-it-really-end-a-book-review-7fa7a66022d0?source=rss-8fbe53f1d7e4------2</link>
            <guid isPermaLink="false">https://medium.com/p/7fa7a66022d0</guid>
            <category><![CDATA[identity]]></category>
            <category><![CDATA[books]]></category>
            <category><![CDATA[life]]></category>
            <dc:creator><![CDATA[Denno kariuki]]></dc:creator>
            <pubDate>Mon, 24 Nov 2025 20:32:22 GMT</pubDate>
            <atom:updated>2025-11-24T20:32:22.662Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VvmMeQoGnTXiJzUU5N2Gfw.jpeg" /></figure><p>I’ve just flipped the last page of this masterpiece by <strong>Adhyambo Sijenyi</strong>, and I can’t believe I’ve read through it in such a short time. From the moment I picked it up, I couldn’t put it down. I’m completely engrossed in the elegant storytelling and the exploration of ideas that unfold in the reflections after every chapter.</p><p>In this book, The author explores some questions that almost every one of us has wondered.<br><em>Does the identity struggle within me really end? Who am i really? I’m i the poster child of my growing up? Is my career my definition? I’m i authentic to myself or I’m I living a persona created by social media or creek of friends?</em></p><p>In the first five chapters, we meet <strong>Maya</strong> who deep down is an artist but her parents curate a doctors career out of her, <strong>Alex</strong> an immigrant who feels lost between choosing his origin Mexican heritage and his New York identity, <strong>LaToya</strong>, a corporate baddie who has crafted an ‘acceptable corporate image’ that she hates and limits her potential, <strong>Daniel</strong> who has lived through the ravages of war and cant figure out what identity to move forward with and <strong>Sofia</strong> who has a picture perfect identity on social media but has not experienced it in her own life.</p><p>The author really brings these characters to life and shows what they go through every day as they try to figure out who they are. The imagery in the book makes you feel like you’re right there watching everything happen. And the switches to Spanish and Swahili make the characters feel even more real and authentic.</p><p>Every character reaches a turning point in their struggle — a moment when they realize they’ve been living behind a mask, one that has slowly been suffocating their true self. The author captures the relief that comes with this realization in a remarkably beautiful way. It’s a mix of contentment and quiet resignation, a sense that the performance is finally over and that becoming oneself doesn’t have to be a lifelong battle.</p><p>The author portrays identity as a tapestry woven from the many moments that shape a life. The struggle itself becomes something beautiful — vibrant, textured, and full of intricate patterns.</p><p>The literal piece is closed by the author with a powerful reflection. That identity is not a puzzle to solve but a dynamic garden to be tended. The author embraces self-acceptance and a change in view of the painful chapters of life as critical parts to our identity narratives.</p><blockquote><strong>By embracing our own complexity, we naturally develop a more inclusive worldview and a deeper capacity for empathy — A. Sijenyi</strong></blockquote><p>If you’re into stories about people figuring out who they really are (and who doesn’t secretly love that?), this book is a must-read. It’ll grab you, tug at your heart, and maybe make you question your own life choices — like why you haven’t been reading it sooner. Seriously, give it a shot — you might even finish it faster than your last online shopping spree.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7fa7a66022d0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[God Only Knows!– Lessons I’d Tell My Younger Self]]></title>
            <link>https://medium.com/@kariukidennisde/god-only-knows-lessons-id-tell-my-younger-self-bf840862c287?source=rss-8fbe53f1d7e4------2</link>
            <guid isPermaLink="false">https://medium.com/p/bf840862c287</guid>
            <category><![CDATA[life-lessons]]></category>
            <dc:creator><![CDATA[Denno kariuki]]></dc:creator>
            <pubDate>Mon, 14 Jul 2025 05:03:39 GMT</pubDate>
            <atom:updated>2025-07-14T05:03:39.205Z</atom:updated>
            <content:encoded><![CDATA[<p>Time has a subtle yet relentless way of reminding us just how small we are , like grains of sand on a vast, endless beach. Most of us drift unnoticed, but now and then, a brightly colored grain catches the light and demands attention.</p><p>This particular article is inspired by a reflection on the past. A great friend of mine asked me what I would do differently if I could go back 20 years to a moment. That question took me aback. I have lived, loved, and laughed, and couldn’t think of anything I would change. We sat in silence. And once again, time did its magic. I drifted into memories — times I wished I had made better decisions. I cringed at the people and things I once liked , only to be proven wrong by time. I wish I could turn back the dial and say no to a few of those dates. Inasmuch as I wished Marty(Back to the Future) could lend me a time machine car and fly back a few years to do some editing, my friend interrupted me with a corny joke, which reminded me I’m only here because of those decisions. Nevertheless, wishful thinking isn’t a crime. After a heated debate, I narrowed down on some things that I could tell my younger self if I could go back in time.</p><p><strong>You are not competitive; the world made you be.</strong></p><p>Every teenager has big goals, dreams, and ambitions. The dreams are driven by optimism and hope for a better life, perhaps better than they grew up having. I was no different. My mother tells me that when I was really young, I once said I wanted to be a priest. I grew up catholic, and in hindsight, I really admired the demeanor and respect accorded to the local priests. They always got the good food at the village weddings and drove the most capable cars in the village. However much the purpose was skewed, it was a desire, a desire to become something bigger than myself. Over time, this desire morphed into other things. In pre-school, I wanted to be a doctor, in high school an electrical engineer, and in uni, a computer engineer. Throughout, the dreams were driven by the influence around me. Nowhere else is as influential as uni. Undergrads from all walks of life meet in one place, not prepared for the culture shocks or lifestyle changes that will hit them. In hindsight, I really admire the Misfits. The people who did not blend in or clique in throughout their uni life. They left this phase of life unscathed by the battle to fit in, which was cutthroat and sometimes ended in slippery slopes.</p><p>It starts simple, like who is more fashionable, who has a good taste in music, who can afford to host good vibe parties, and a girlfriend? No? How about two? How much beer can one’s stomach hold before they black out? The stakes always kept rising. For some reason, my uni fit in was never positive. No one ever competed to be financially fit, eat healthy, or work out.</p><p>This is how I started feeding the monster, the monster to always fit in. Live life like it was a competition on who gets to something or somewhere first. In my first Job, I highly under quoted my skills just to out compete other bidders. It did work, but at what cost! In my first long-term relationship, I struggled financially to create a trophy girlfriend. She had to be dreamy, the dates had to be flashy, otherwise they don’t count. Looking back now as I write this, I can’t help but laugh. That was as superficial as a relationship could get. My late teens were met by the African savanna startups wave. Who was I to be left behind? I started several startups. Of course, most of them were half-baked ideas — driven more by fear of missing out than real passion.</p><p>Somewhere along the way, I discovered two things that actually bring me joy: adventure riding and cooking. Don’t get it twisted, I’m a horrible cook. I hail from a tribe that is well known for mixing multiple recipes in the same pot. I, however, enjoy it. I’m patient following a recipe. I am not afraid to experiment, and so far I have not poisoned myself(yet). My family is quite adventurous. We want to spend as little time as possible in the house. As for riding , there’s nothing like the wind on your face and knuckles, the hum of the engine, the freedom of the open road. Cars bore me. Flying freaks me out. But motorcycles? They make me feel alive. The rest is just external influence and too much internal stress to fit in.</p><p><strong>In life, you will lose people, some will come back, and more will turn up.</strong></p><p>I think there should be more emphasis on how to handle losing friends when growing up. We see our parents handle grief when losing loved ones to death, holy wood has taught us to use rebounds when we lose girlfriends. Alpha men on social media have covered detaching from one’s spouse in marriage, but none of them have spoken about how devastating it is to lose a long-term friend.</p><p>For the teen decade of my life, I was always around the same social group of friends. We went to the same high school, same university, formed businesses together, saw each other through young adulthood, and then insulted the heck out of each other, everyone going their separate ways. Yes, you heard me right. Decades of friendships thrown into the pits for very juvenile reasons.</p><p>I very much remember the years that followed. The feeling of betrayal that does not go away. The wishful thinking that things would have worked out differently. The insecurity and lack of trust to let anyone else close. Most of these feelings don’t go away with wishful thinking. Healthy adults let the feelings in and go through them, but not me. I figured if I drowned them far enough, then perhaps the feelings would die. When a man chooses to die, he plans where and how he will die. My personal choice was the bar counter. I remember the emotionless nights next to my bottles, a hollowness inside that feels like the abyss. A being devoid of all connections to anything, be it family, religion, love, or actual joy. Sometimes I choose to dance or mingle with other revelers, and this would reignite my soul until we both realize we are in the club for the same reason: emptiness.</p><p>My young mind and heart were never prepared for this. In hindsight, I should have given time. Time works wonders. In time, you understand people need to grow at their own pace and build their own path. An understanding that you will not always be right and that does not make you wrong either. To err is human is thrown around lightly, but that is just how friendships should be understood; no one is perfect. Instead of choosing a self-destructive path to process emotions, extend self-kindness inward and take time to feel terrible.</p><p>I am glad some of those friendships reignited, and a lot of forgiveness and a lot of grace has been extended. In some cases, the separation actually paid off. Meeting other versions of the same people is beautiful and amazing! It takes a lot of courage to admit that sometimes we are the stumbling blocks in our relationships, and external perspectives can be a real game changer</p><p>Time, as always, did its magic.</p><p>I’ve forgiven. I’ve been forgiven. I’ve grown.</p><p>And while I still wish Marty and his time machine were real, I’m learning to accept that every wrong turn helped shape this version of me.</p><p>God only knows where I’m headed. But I like where I’ve come from.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bf840862c287" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mining Election data with python.]]></title>
            <link>https://medium.com/@kariukidennisde/mining-election-data-with-python-269b6620ef78?source=rss-8fbe53f1d7e4------2</link>
            <guid isPermaLink="false">https://medium.com/p/269b6620ef78</guid>
            <category><![CDATA[data]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Denno kariuki]]></dc:creator>
            <pubDate>Thu, 21 Jul 2022 17:35:55 GMT</pubDate>
            <atom:updated>2022-07-22T04:06:23.241Z</atom:updated>
            <content:encoded><![CDATA[<p>When I wrote this article, my country was in an electioneering period. Like most other young people, my interest in politics was as much as the attention span of a goldfish. As much as young people don’t want to acknowledge it, politics and governance affect us in more ways than we want to admit.</p><p><strong>The problem:</strong></p><p>During a campaign period, the media covers a subset of candidates so much that we think we have limited choices. A large number of young people don’t even know the candidates that are lined up for their local voting block. The comprehensive source of information is the government gazette, a 600-page pdf, or blogs sometimes littered with misinformation.</p><p><strong>The solution:</strong></p><p><strong><em>An election aspirants search engine.</em></strong></p><p>A couple of<strong><em> </em></strong><a href="http://neverest.co.ke/"><strong><em>excellent engineers</em></strong></a>, myself included, sat down and proposed to automate the list of aspirants and have it online for easy access.</p><p>Sounds simple? So we thought. Our journey building <a href="https://kurayangu.co.ke/"><strong><em>kurayangu.co.ke</em></strong></a> was full of exciting data challenges.</p><p>Here is the list for fellow nerds who want to know some of the tools used.</p><ul><li><strong>python tabula</strong></li><li><strong>pandas</strong></li><li><strong>openpyxl</strong></li><li><strong>pyshp</strong></li><li><strong>beutifulsoup4</strong></li></ul><p><strong>Challenge 1: Data acquisition(PDF mining)</strong></p><p>As I mentioned, the primary data source we were dealing with was in pdf format. Since the pdf sources had data in table formats, our first option was to quickly pipe the pdf through <a href="https://tabula-py.readthedocs.io/en/latest/"><strong>python tabula</strong></a> and parse it into a database.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w-41euDmu9zFmHZzdEr3rA.png" /><figcaption>using python tabula to read in pdfs</figcaption></figure><p>This approach backfired as the results differed from page to page. Creating an algorithm that would be consistent would be an uphill task.</p><p>To overcome this, we converted the pdfs to excel. For this, we just used an <a href="https://www.ilovepdf.com/"><strong>online tool and downloaded the excel</strong></a> workbook.</p><p><strong>Challenge 2: Data clean-up</strong>.</p><p>In as much as the conversion tool did a great job of giving us the candidates in 118 sheets, the data had a lot of repeated headers within the sheets and binary data that made our importers go haywire.</p><p>Sometimes code needs human help. After a lot of copying and pasting sheets into each other, we finally had five clean sheets in the workbook to work with. Using<a href="https://pandas.pydata.org/"> <strong><em>pandas and openpyxl</em></strong></a>, we created a simple algorithm to import data sheet by sheet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KVyfgy20LJN3lvk4vAsnMg.png" /><figcaption>read in a data sheet using pandas and openpyxl</figcaption></figure><p><strong>Challenge 3: Insufficient data</strong></p><p>Since our goal was to have the search engine have as much information as possible, we embarked on a task to enrich it.</p><p>For boundaries and delimitation data, we mined official government shape files using <a href="https://pypi.org/project/pyshp/"><strong><em>pyshp</em></strong></a> and scoured reliable websites for any missing candidates using <a href="https://pypi.org/project/beautifulsoup4/"><strong><em>beutifulsoup4</em></strong></a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cofS3MNOePIO7ahGwruPEw.png" /><figcaption>Scraping data with BeautifulSoup</figcaption></figure><p><strong>Wrapping up!</strong></p><p>Having collected enough data to run our search engine, we wrapped it in a Django app and exposed endpoints with the Django rest framework.</p><p>We wrote a nuxt-js front-end app to interface the API and Bingo! Everything works!</p><p>Feel free to explore the final <a href="https://kurayangu.co.ke/"><strong><em>result here</em></strong></a>, and don’t shy away from giving feedback.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=269b6620ef78" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Freeradius Full-cycle testing]]></title>
            <link>https://medium.com/@kariukidennisde/freeradius-full-cycle-testing-c06a0ee0803e?source=rss-8fbe53f1d7e4------2</link>
            <guid isPermaLink="false">https://medium.com/p/c06a0ee0803e</guid>
            <category><![CDATA[radius]]></category>
            <category><![CDATA[mikrotik]]></category>
            <category><![CDATA[freeradius]]></category>
            <category><![CDATA[bash-script]]></category>
            <category><![CDATA[testing]]></category>
            <dc:creator><![CDATA[Denno kariuki]]></dc:creator>
            <pubDate>Sat, 30 Apr 2022 18:20:59 GMT</pubDate>
            <atom:updated>2022-04-30T18:20:59.564Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nc1xZlZLjD1BNYIWPElLlw.gif" /></figure><p>You are definitely using an internet connection from your <strong>internet service provider(ISP)</strong> to read this page. You have a subscription with your <strong>ISP</strong>, and it comes with a billing period or limits on the amount of bandwidth you can consume</p><p>Behind the scenes lies a combination of software, used to <strong><em>validate your subscription, account for the bandwidth you use, and disconnect you once the subscription expires or runs out</em></strong>.</p><p>The most popular software used by small and medium-sized <strong>ISPs</strong> is a <a href="https://en.wikipedia.org/wiki/RADIUS"><strong>RADIUS SERVER</strong></a>, and the most commonly used radius server is the <a href="https://freeradius.org/"><strong>freeradius</strong></a>. Freeradius is popular because it’s highly scalable<em>(capable of handling thousands of requests per second)</em> and open source!</p><p><strong>HOW DOES IT WORK?</strong></p><p>For your home router to connect you to the internet, It consults with your <strong>ISP’s radius</strong> server for access.</p><p>In most cases, access is issued based on the router&#39;s MAC address, a username and password combination, an assigned IP address, or a captive portal where users can create accounts and purchase internet subscriptions.</p><p><strong><em>Freeradius achieves this in 4 steps.</em></strong></p><ol><li><strong>Authentication/Authorization</strong> — Confirmation on whether your credentials have a valid subscription based on the rules your internet service provider has set</li><li><strong>Accounting Start </strong>— When the radius server has validated that your internet subscription is valid, a session is opened to keep track of the packets used and the time the home router was online.</li><li><strong>Accounting interim updates</strong> — At different intervals, the radius server gets reports of how much bandwidth the home router has used during its open session</li><li><strong>Accounting stop — </strong>For any termination reason, a session is closed, and the home router no longer has an internet connection</li></ol><p><strong>TESTING ALL THE STEPS.</strong></p><p>As an internet service provider, troubleshooting customer connection issues begins at the internet subscription status. Tests are carried out using <strong>radclient</strong> to send packets to the radius server the router would send.</p><p>Let us start by installing a rad-client for our tests.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6c81012d3962641ac1cadd12795d442b/href">https://medium.com/media/6c81012d3962641ac1cadd12795d442b/href</a></iframe><p>This bash script simulates an entire Authorization and accounting cycle. Replace the variables to match your test environment.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6c30bd0249285c77c9dbe5479738967b/href">https://medium.com/media/6c30bd0249285c77c9dbe5479738967b/href</a></iframe><p>All wrapped up! You can validate the status of any subscriptions from a radius server and simulate an entire billing cycle.</p><p>Managing a radius server can be trivial for small and medium-sized internet service providers. A fully managed radius server with a management interface comes in handy and shortens the length of time taken to set up your customers.</p><p>Feel free to explore <a href="https://nikoradius.com/"><strong>Nikoradius</strong></a>, a leading ISP’s billing software, and focus on expanding your network.</p><p><strong>Happy Coding!</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c06a0ee0803e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Playing around with Django JWT]]></title>
            <link>https://medium.com/@kariukidennisde/playing-around-with-django-jwt-753e18225f25?source=rss-8fbe53f1d7e4------2</link>
            <guid isPermaLink="false">https://medium.com/p/753e18225f25</guid>
            <category><![CDATA[django]]></category>
            <category><![CDATA[jwt]]></category>
            <category><![CDATA[django-rest-framework]]></category>
            <dc:creator><![CDATA[Denno kariuki]]></dc:creator>
            <pubDate>Wed, 01 Dec 2021 16:25:41 GMT</pubDate>
            <atom:updated>2021-12-01T16:25:41.204Z</atom:updated>
            <content:encoded><![CDATA[<p>Among the frameworks i have interacted with, Django comes as advertised. Django totally lives up to its tagline “<strong><em>The web framework for professionals with deadlines” . </em></strong>It has a smooth learning curve and follows most of the principles that ensure secure,robust and efficient development.</p><p>Django can be extended to build rest APIs faster with <a href="https://www.django-rest-framework.org/"><strong>django rest framework</strong></a><strong>. </strong>Though django rest framework has its own mechanism for authentication, sometimes you might need to extend the authentication to support<strong> </strong><a href="https://jwt.io/introduction/"><strong>JWT(JSON Web Token)</strong></a>. This can be done with <a href="https://github.com/jpadilla/django-rest-framework-jwt"><strong>django-rest-framework-jwt</strong></a><strong>. </strong>Django JWT<strong> </strong>is<strong> </strong>a robust library for authenticating rest APIs. This requires a pair credentials(mostly a username and password) set to return a token the user can use for identification in subsequent requests.For most use cases, the username and password approach is sufficient but sometimes a custom authentication technique is required.</p><blockquote>One scenario i have encountered is when authentication is not only credentials based. A user just needs to add their phone number and receive a one time confirmation password via <strong>SMS</strong> to get authenticated.</blockquote><p>In this article, we will go through how <a href="https://github.com/jpadilla/django-rest-framework-jwt"><strong>django-rest-framework-jwt</strong></a> can be extended to fit any authentication use case. To get started, we will create a django app that will handle our custom authentication; say mobile.</p><p>Under serializers.py, create a serializer that expects the phone number and generates a one time password</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9d3119b0ddb6d867b24c814db802652e/href">https://medium.com/media/9d3119b0ddb6d867b24c814db802652e/href</a></iframe><p>Since we need to store the one time password and its related user, lets create the MobileToken model. The model holds a Boolean value <strong><em>is_used</em></strong> to make sure the One time passwords are used only once</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/571687e278d8f70b69875cb18f1006b6/href">https://medium.com/media/571687e278d8f70b69875cb18f1006b6/href</a></iframe><p>The serializer now knows how to expect and validate data. The next step is to attach the serializer above to a viewset that handles the users request in the manner specified by the serializer.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2bf36a2acef36d2a47a31c0850edcc06/href">https://medium.com/media/2bf36a2acef36d2a47a31c0850edcc06/href</a></iframe><p>Any user can now provide their phone number and get sent a random digit one time password for authentication via SMS.</p><p>Next, we will create a serializer that receives the one time password, verifies it and returns a user token. Under your serializers.py file, add the following class</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b166f96a328179b4cd09bbabf705d91f/href">https://medium.com/media/b166f96a328179b4cd09bbabf705d91f/href</a></iframe><p>The MobileTokenBaseSerializer validates the onetime passwords submitted by the user. It checks for conditions that the one time password must satisfy . The validated value is then converted to a JWT token by the MobileToken serializer that is returned to the user.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=753e18225f25" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Supervisor periodic restart]]></title>
            <link>https://medium.com/@kariukidennisde/supervisor-periodic-restart-be46a05f4419?source=rss-8fbe53f1d7e4------2</link>
            <guid isPermaLink="false">https://medium.com/p/be46a05f4419</guid>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[supervisord]]></category>
            <category><![CDATA[cron]]></category>
            <dc:creator><![CDATA[Denno kariuki]]></dc:creator>
            <pubDate>Wed, 01 Dec 2021 16:22:47 GMT</pubDate>
            <atom:updated>2021-12-01T16:22:47.605Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/650/1*D7qii70TozVlSte9spfKOA.jpeg" /></figure><p>When automating process management, <a href="http://supervisord.org/">supervisor</a> is a very handy tool to make sure your service/app is up and running always in any Unix system. It bundles loads of important configurations that handle autostart, environment bootstrap, and auto restarts.</p><p>Sometimes for one reason or the other, you might require to periodically restart your service or program that you are running. This does not come out of the box with supervisor. A few hacks could achieve the desired effect without modifying your program. In this article, I will outline two approaches</p><ul><li>Adding a program unit that sleeps for period x and triggers restarts</li><li>Using crontab to schedule the restart trigger</li></ul><p><strong><em>Supposing we have a program “</em>foo”<em> added to supervisor and we would like to periodically restart it every hour</em>.</strong></p><p>A normal restart would be done by running the command:-</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f4f1da530cce2262f0b4b3d224c219c1/href">https://medium.com/media/f4f1da530cce2262f0b4b3d224c219c1/href</a></iframe><p>This would then ask for your sudo password and restart the service. Our restart methods will have to input the sudo password too. This can however be changed by adding the running user to the supervisor&#39;s user group like this:-</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ac4c8be330aff776ed7ecb7d08c52243/href">https://medium.com/media/ac4c8be330aff776ed7ecb7d08c52243/href</a></iframe><p><strong>Bingo!</strong> now we can run the supervisor commands without having to type our sudo password. let&#39;s have a look at the two methods outlined above</p><p><strong>Method 1: Using crontab</strong></p><p>This is perhaps the easier of the two methods. All that is needed is to add a crontab entry that runs the restart command. If we wanted to restart our program every 1 hour, then the crontab entry would be like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d22fb5a1af59098e9fd002c9a4a24bde/href">https://medium.com/media/d22fb5a1af59098e9fd002c9a4a24bde/href</a></iframe><p><strong>Method 2: Supervisor program</strong></p><p>The approach here is to create a program that sleeps for x time and then runs the restart command. After restarting, the program will exit and supervisor will restart it maintaining the cycle. The supervisor program would look like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c0bd2982d5cf487dd7e42511780d93ee/href">https://medium.com/media/c0bd2982d5cf487dd7e42511780d93ee/href</a></iframe><p>All wrapped up! The restart strategies outlined here can be used for other scheduling purposes too.</p><p><em>NOTE: Both approaches do not go into detail about how to avoid data loss in case the program is restarted when performing a crucial operation.</em></p><p>Happy coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=be46a05f4419" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Resumeable uploads in go-lang]]></title>
            <link>https://medium.com/@kariukidennisde/resumeable-uploads-in-go-lang-469c5c3590f5?source=rss-8fbe53f1d7e4------2</link>
            <guid isPermaLink="false">https://medium.com/p/469c5c3590f5</guid>
            <category><![CDATA[go]]></category>
            <category><![CDATA[upload]]></category>
            <category><![CDATA[golang]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[uploading]]></category>
            <dc:creator><![CDATA[Denno kariuki]]></dc:creator>
            <pubDate>Sat, 11 Jan 2020 17:06:20 GMT</pubDate>
            <atom:updated>2020-01-11T17:11:49.695Z</atom:updated>
            <content:encoded><![CDATA[<h3>Resumeable uploads in Golang</h3><p>Recently I was working on a media streaming platform which allows users to share bulky content.On the platform, users can share files as huge as movie files or documentaries! To ensure users had uninterrupted uploads,I faced two main challenges:</p><ul><li>Creating resume-able uploads on the client side to allow users to cancel or resume uploads. <em>Also works better on low internet connection zones because the file is uploaded as small chunks.</em></li><li>Handling chunked uploads on the go-lang server side</li></ul><p>Implementing resumeable uploads on the client side is quite straight forward. Having used it before, I jumped on to my favorite up-loader library <a href="http://www.resumablejs.com/">resumable.js</a>. The configuration of resumable.js is easy, thanks to the open source community.</p><p>First create a division where uploads will be dropped or selected from.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e1dcf691d7c3a02f453b88de70f01b18/href">https://medium.com/media/e1dcf691d7c3a02f453b88de70f01b18/href</a></iframe><p>Embed resumable.js and target your go-lang API upload endpoint as illustrated easily on the documentation.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8111a83fdbaefeee2ecf74844c2b71f9/href">https://medium.com/media/8111a83fdbaefeee2ecf74844c2b71f9/href</a></iframe><p>Bingo!!</p><p>Your small html page is now ready to perform resumable uploads. Resumable.js chunks the file via the HTML5 file APIs and uploads all the chunks independently.</p><p>To develop a server side endpoint requires the understanding of how resumable.js works. The endpoint must accept a GET and POST request that are handled in this manner:</p><ul><li><strong>GET</strong> — verifies if the chunk resumable.js is asking about is already uploaded</li><li><strong>POST</strong> — Accepts a chunk and uploads it</li></ul><p>The go-lang implementation would look like this</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/bf3e5d252f045c6d9c1f46a4bae53a3e/href">https://medium.com/media/bf3e5d252f045c6d9c1f46a4bae53a3e/href</a></iframe><p>The chunked parts i.e part1,part2…part(n) are now in your temporary folder. The second challenge presents itself, recombining the chunks back to the original file.</p><p>Note that I have left out the section that recombines the uploads in the upload handler. This is because you might consider implementing this as an asynchronous task/job.</p><p>After quite some trial and error sessions, mostly involving memory management, I went back to the <a href="https://golang.org/src/os/file.go">go-lang file api</a> where I realized I could solve my problem with go-lang file functions. The approach is to create an empty file then write each chunk at the right index i.e where it was originally.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/811d967b2ffc523c818c5d784173d65d/href">https://medium.com/media/811d967b2ffc523c818c5d784173d65d/href</a></iframe><p>In case the page is not rendered by the same go-lang app(You are running it on an independent Vue js or React app), make sure you enable CORS.This can simply be done with this super cool <a href="https://github.com/rs/cors">library</a></p><p>Done!</p><blockquote>Resumabe.js has alot of cool apis and events you can play with such as showing progress of uploads and many more.Happy coding</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=469c5c3590f5" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>