<?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 Michael de Silva on Medium]]></title>
        <description><![CDATA[Stories by Michael de Silva on Medium]]></description>
        <link>https://medium.com/@bsodmike?source=rss-bb088c3885a9------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*vqqsPdMHrAoSMdIY.png</url>
            <title>Stories by Michael de Silva on Medium</title>
            <link>https://medium.com/@bsodmike?source=rss-bb088c3885a9------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 19:49:03 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@bsodmike/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[TIL: $5,000 and 5-years too late, I am migrating my dev AWS to On-prem]]></title>
            <link>https://medium.com/@bsodmike/til-5-000-and-5-years-too-late-i-am-migrating-my-dev-aws-to-on-prem-cf06a7ebd4eb?source=rss-bb088c3885a9------2</link>
            <guid isPermaLink="false">https://medium.com/p/cf06a7ebd4eb</guid>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[money]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Michael de Silva]]></dc:creator>
            <pubDate>Tue, 19 Nov 2024 16:55:45 GMT</pubDate>
            <atom:updated>2024-11-20T03:41:16.672Z</atom:updated>
            <content:encoded><![CDATA[<p>As a soloprenure I have always thought “time is money”, and whilst it made sense before, as I am now facing the plight that many engineers who work remotely are most likely facing today, and that’s finding a job.</p><p>Whilst the challenges I face are a bit more unique to my situation, both due to geographic implications and due to only being able to work 100% remotely, I think everyone in the software space are used to moving either from client to client, contract to contract, or if gravitational waves align with the ocean tide, in your favour, working with multiple clients concurrently.</p><p>To stem the hemorraging from my nearly depleted savings, I started to look at the most obvious areas of wastage, and my recently snowballing AWS spend is where I started.</p><h3>AWS: Let it go, let it go… LET IT GO!!</h3><p>The <strong>Cost Explorer </strong>was the main tool I used to figure out what to do, and my largest expenses were by running 2x EC2 instances: (a) t3.small and (b) t3.medium. Both have reserved plans and I was able to list the remaining 17-months for the t3.medium for $160, and hopefully someone will purchase this.</p><p><strong>Route 53</strong>: This is something I took for granted starting out, but I had 11 hosted zones, which is $5.5/month right off the bat. A single ELB was eating some $12/month, EIPs etc and the bill adds up quick.</p><p>My triage plan lead me to a wonderful discovery with Cloudflare. When I last played with Argo tunnels, they were charging $5/tunnel, but fast-forward to 2021 and they’ve been offering a “free plan” (yes, all this time, but at least I’m 3-years late to the party…). Thankfully I run a Dell R740xd in my homelab and I am now running two VMs specifically for production workloads like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m0VEWPmjlLAOPI_xaJbCEg.png" /><figcaption>VMs running in XCP-ng, managed via XOA.</figcaption></figure><h3>Step 1: Redirect DNS zone files NS to the Cloudflare Nameservers</h3><p>To do this, you need to create a “Website” in the Cloudflare dashboard. Make sure to choose the “free” plan, and let it copy across your existing DNS records (whatever it can find).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8oG3kHpyGEKEMG1A8xexBA.png" /><figcaption>Add a domain as a “website” to start managing via the DNS NS.</figcaption></figure><p>You can manage the DNS zone file using this interface</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*njTG4y3vybXBDFu20NP7hw.png" /></figure><p>Once this was done, the next step is to setup a corresponding tunnel, which you can find at <strong>Dashboard &gt; Zero Trust &gt; Networks &gt; Tunnels</strong>.</p><p>Make sure you go with the <strong>Cloudflared</strong> option. WARP is for machine to machine tunnels, but instead we want to proxy external access to a tunnel endpoint — which means the agent running inside your VM, in our case either a Debian or Ubuntu VM.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mc2cnAzbjkuFA6fMRw0TIA.png" /></figure><p>Give your tunnel a name and it’ll take you to a list of instructions; choose your VM type, let’s say Debian. Then you just need to run the install commands to install the cloudflared service. The final command is an activation token. Once both are setup, hit next and you’ll be taken to this view where you get to route your traffic.</p><p>Choose the domain from the domain list, and then either HTTP or HTTPS (for purposes of this simple example) and <strong>localhost:8080</strong>. To test this out a simple trick is to start a python script or some process to listen at port 8080. Another option is to just install nginx and point the tunnel at port 80 (if you’re in a hurry), just use a subdomain with a SHA hash to ward off the bots till you confirm it’s set up. You can then delete the public hostname “connector”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2Zx49SVI6fL8Djwgc8A6Lg.png" /></figure><p>Great, we’ve now rid ourselves of</p><ul><li>Route 53 hosted zone costs</li><li>EC2 LB costs</li><li>TLS (provided by Cloudflare) is proxied to the tunnel endpoint</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PPy2tXq3b7Ogr2SMeGq4oA.jpeg" /><figcaption>Great Scott! It’s sucking 1.21 gigawatts!!</figcaption></figure><p>You can visit <a href="https://desilva.io/">https://desilva.io</a> and you’ll get to my selfhosted blog.</p><h3>Step 2: S3 Life-cycle Rules</h3><p>Before I started this migration, I had some critical backups in AWS from my private ZFS cluster, and being more afraid having lost more GB than I can count to past data failures, setup an AWS Glacier life-cycle rule.</p><p>However, by tweaking the rules on my largest bucket, I’ve brought it down from 1.2TB to ~350GB, but with the risk of minimal retention. If you look at Glacier costs, for a single dev, the costs aren’t worth it. If everything burns down, the cost to download your content might cost as much as a small PC and a few hard-drives.</p><h3>Step 3: Bye bye EC2…</h3><p>Oh yes, don’t forget to shutdown any EC2 instances, and disconnect Elastic IPs (EIPs). You can keep these around till your selfhosted solution has proven itself. There will be a month cost for volumes and snapshots.</p><p>I’m still seeing some costs listed as <em>EC2-Other</em> and a few cents under VPC, so I need to trace down as to what these are really.</p><h3>Step 4: Bye bye Freshbooks</h3><p>During this time, I’ve been happily paying $9.99/month but recently they’ve increased their pricing to $15/month.</p><p>Say hello to <a href="https://invoiceninja.com/pricing-plans/">https://invoiceninja.com/pricing-plans/</a> which also has a free tier.</p><h3>Conclusion</h3><p>I should be looking at around $35–40/month with these changes; I’m still relying on S3 for block storage and am still running the <strong>t3.small</strong> instance, which I will migrate over the weekend.</p><p>Do share if you’ve found any of this useful or if you have any suggestions. Are there any FOSS solutions you are using to keep your online cost down as a developer?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cf06a7ebd4eb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Micro-expressions are Beautiful — Here’s a ‘tongue-firmly-in-cheek’ spin (for the lulz) of The Sale…]]></title>
            <link>https://medium.com/@bsodmike/micro-expressions-are-beautiful-heres-a-tongue-firmly-in-cheek-spin-for-the-lulz-of-the-sale-b692ec055c8e?source=rss-bb088c3885a9------2</link>
            <guid isPermaLink="false">https://medium.com/p/b692ec055c8e</guid>
            <category><![CDATA[news]]></category>
            <category><![CDATA[watches]]></category>
            <category><![CDATA[luxury]]></category>
            <category><![CDATA[humor]]></category>
            <category><![CDATA[money]]></category>
            <dc:creator><![CDATA[Michael de Silva]]></dc:creator>
            <pubDate>Sat, 28 Oct 2017 03:30:17 GMT</pubDate>
            <atom:updated>2017-10-29T18:49:33.259Z</atom:updated>
            <content:encoded><![CDATA[<h3>Micro-expressions are Beautiful — Here’s a ‘tongue-firmly-in-cheek’ spin (for the lulz) of The Sale Of Paul Newman’s Rolex Daytona, brought to you by a micro-expressions expert.</h3><p>It’s rather incredible when you actually think about it. A wristwatch, is nothing but a simple tool, a timepiece, that serves a function. Nothing more.</p><p>By 1794, Thomas Mudge had set the stage — the framework from which, the perpetual calendar as we know it today, had been laid out.</p><p>In that time, a perpetual calendar timepiece represented the absolute pinnacle of luxury that anyone in the world could imagine of possessing — if King Midas had the ‘WIS’ bug, he may have chosen a completely different object to encompass all his desires.</p><p>With the buyer’s premium included, as of a mere two-days ago, the Patek Phillippe 1518 held the record at fetching US$11 Million at auction held by Phillips in Association with Bacs &amp; Russo in November 2016.</p><p>On October 26, 2017 the hammer had fallen, at the hands of the most esteem Aurel Bacs (of Bacs &amp; Russo), fetching US$17,752,500 (including buyer’s premium) at Philips in New York City.</p><p>Let’s set the stage — imagine your ex’s Father has a certain obsession with living dangerously, pretty much, at the edge of the seat of his very life. Yes, going about in circles is that important to him. One day, he visits you — <em>still</em> <em>current and relevant, at this point in time at least! — </em>and goes “Sonny, tell you what, I’m going to give you this here timepiece. It is a Chronograph, and I want you to push this plunger at here 2 O’clock when the gun goes off, and push the one at 4 O’clock when I cross the finish line — got it?”</p><p>“Gee mister — I’d love to!”</p><p>Years have passed since and you’re no longer “<em>attached</em>” to your ex, although attached to your wrist is that timing tool gifted to you by Paul Newman — with its very utilitarian look complemented by seemingly funny looking sub-dials and funny looking markers. Lines with squares at the end — obviously the designer hadn’t gone to college, right?</p><p>This rather unsuspecting Sonny goes through his younger years to one day discover someone else point at his wrist whilst emphatically yelling out “Paul Newman watch, Paul Newman watch”. The watch he was wearing had taken on his relatives name. Only to be identified by a Japanese tourist at that!</p><p>It’s at this point that the column-wheel and gears start to mesh inside said Sonny’s mind, for a considerable amount of time that almost feels like an age in itself.</p><p>Fast forward to the night of the opening spectacle in New York City — instead of hitting broadway or dining at McDonalds like most normies would, we find a group of individuals huddled into a room. With a podium in the middle.</p><p>The Gentleman wields a pummel in his hand, with a certain swagger and charisma, speaks tongues and — pop, crackle, bang! The room is alive.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qoDs-vWdSHsO32q_B7WO8Q.png" /></figure><p>Bacs confirms he’s received an advance bid of US$1 Millon, so folks hang on to your hats, monocle, and pocket watches — it’s going to be a long-drawn out night.</p><p>Or so the crowd thought — well at least far more drawn out than 1 second. Queue the most epic, jaw-drop, recorded live at a watch auction. Inside a room mostly filled with men with bald-spots mind you.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pQ9Hz9QmqPWfOHRCDaa87g.png" /><figcaption>I think I’m crushing on the lady on the left. She’s so unimpressed, she really must have high standards. Probably morals to match too. Bacs on the otherhand, well, it would be hard to trust him now. *strikes him off my trusted mates list*… Anyone have a fancy Montblanc pencil to help me out here?</figcaption></figure><p>If you <a href="https://www.youtube.com/watch?v=1_QCxOkCQHw">watch the live video on YouTube, I urge you. Scrub the timeline</a>. There’s actual jaw-sag action going on, and maybe some salivating too (it’s hard to tell from the dire 1080p that HODINKEE has decided to torture us with, in this day and age of 4K and 8K footage mind you!).</p><p>“US$10 Million. On the phone. WUT?” — goes through the mind of Bacs. Holy Mother Ballin AF. Yup, that Gulfstream G650 is on my Christmas Wishlist on Amazon. Here’s a *mental* 1-click buy now.</p><p>It’s even more interesting to watch Paul Newman’s daughter’s reaction. You don’t need a totally unqualified micro-expressions expert such as myself to explain the depth and breath of emotions she’s experiencing right now.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IbN0VS12TLa6r0PGcGlVsg.png" /></figure><p>“I can buy <em>how many shoes</em> for that?”</p><p>James’ expression on the left here is one of dumbfoundedness — that or he’s a really cool cucumber.</p><p>Let us now contemplate some of the action towards the end, and to set the stage bidding had surpassed US$12 Million and the last bid was US$15 Million.</p><p>A cheeky buyer decides to pony up the last few pennies from his Daughter’s trust fund — “Would you take $15.1M?” a lady cries out from the back..</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FHOrsvw2MkCMc_0tSyAAkw.png" /><figcaption>“Look what.. Look what you just made me do &lt;OH..!!!&gt;”</figcaption></figure><p>It’s hard to assume, but let’s do that cause it’s fun. I suppose this is the image we should all keep in our minds when a grown man soils himself, to the point he has to inhale a large volume of air. It’s simple Physics. The human gut has a fixed volume of air; bowels move, and well, we are forced to <em>inhale</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ywr6VFvXVFzEt4WTXeUnxw.png" /><figcaption>“Oh drat, I thought it was just gas…”</figcaption></figure><p>You may not want to agree with Physics Mr. Bacs, but I have a feeling you’d be rushing off that podium very quickly at the end…</p><p>The hammer falls at US$15.5 Million (before buyer’s premium) and the smiles break out. It was really hard watching a man wave a pummel about, soil himself, and well make us richer…right? But someone’s got to do it!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sBxZMjpKP3IWQmd1Frvcxw.png" /><figcaption>“MONEY SHOT BABY…”</figcaption></figure><p>I’m seriously in all admiration of this Gentleman. He’s done the mic drop, at the pinnacle of his career. First order of business, break out a well aged Cohiba Behike (he’s reaching for it) and exit stage left to the little boys room.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kRm-II4_tKqcuflJrXza3A.png" /></figure><p>Satire and my ‘tongue-in-cheek’ remarks aside — in all seriousness now — It is fabulous that the funds will be given to the Paul Newman trust/charity to touch and improve the lives of many. And make for a very nice tax-write off…</p><p>Some say that Sonny has been seen frequenting local laundromats, struggling to operate a simple spin-cycle. Well, Sonny, I guess it’s time to get 101&#39;d in how to launder like Walter White.</p><p>*mic drop…* — I’ve actually just run to the loo. That was exciting!</p><p>Thanks to HODINKEE for the video coverage (albeit in an antiquated 1080p — Come on Ben!) and to Aurel for an incredible achievement.</p><p>P.S. I thought it would be interesting to portray events in a humorous manner, and mean no disrespect to any of the individuals portrayed or mentioned. This writing is purely fictional, a figment of my wild wild imagination.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b692ec055c8e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Buying Bitcoin (First time!) in a hurry — To buy a TREZOR]]></title>
            <link>https://medium.com/@bsodmike/buying-bitcoin-first-time-in-a-hurry-to-buy-a-trezor-b4560acdad1c?source=rss-bb088c3885a9------2</link>
            <guid isPermaLink="false">https://medium.com/p/b4560acdad1c</guid>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[bitcoin]]></category>
            <dc:creator><![CDATA[Michael de Silva]]></dc:creator>
            <pubDate>Sat, 10 Jun 2017 04:48:56 GMT</pubDate>
            <atom:updated>2017-06-10T12:19:36.948Z</atom:updated>
            <content:encoded><![CDATA[<p>I thought I’d share the experience I had trying to buy Bitcoin, for the very first time. Given that I live in Asia, in a fairly remote place, I could only resort to funding my Bitcoin purchase via Credit Card.</p><p><a href="https://www.coinbase.com/">Coinbase</a> looked like the simplest option, but I was out of luck as my location wasn’t supported (I plan to setup a Coinbase account via VPN later on), and after sometime of head scratching and hitting Google, I stumbled on <a href="https://www.coinmama.com/">CoinMama</a>. I only needed US$128/- worth of BTC to place my order, so I entered my details and placed my first order.</p><p>If you only have an American Express card — you’re out of luck. CoinMama worked when using a VISA card.</p><h3>Not accounting for fees.</h3><p>This is where I made my first mistake, and the fees at CoinMama were pretty high; I ended up with less BTC in Coinbase and had to resort to placing a second purchase. I’d suggest you always calculate and even spreadsheet fees/expenses before fully executing a purchase or alternatively, purchase an amount much larger than you’ll ultimately need.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j4PC9pBp1pjoW2hcDY9ajw.png" /><figcaption>Having miscalculated fees, I had to make multiple orders for BTC. You now know better!</figcaption></figure><h3>Grab a coffee.</h3><p>This was the most unexpected, and painful aspect of the process. Waiting.</p><p>My first order credited the account within 25 minutes — and Coinbase only considers the funds available after a minimum of 3-confirmations. The second purchase, however, took over a hour to just get 2-confirmations.</p><p>Just make sure you have some physical money on hand, if you were planning to buy that coffee with Bitcoin.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fZQ3h62oVFRWJpFho15CIw.png" /><figcaption>Having purchased the TREZOR I have a balance of ~$45.37.</figcaption></figure><h3>Time to order my TREZOR.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Hoajd_EIQgBysizHMBwvJA.png" /></figure><p>Finally, it was time to complete my order on the TREZOR website, and once my details were provided I was given details on where to send the BTC. Again, the waiting.</p><p>Not a very pleasant experience, say at least compared to PayPal.</p><p>However, those keen eyed amongst you will notice I have a BTC balance of around US$45ish.</p><p><a href="https://medium.com/@bsodmike/mining-ethereum-for-fun-profit-d4e52eba6b1a">Since I’ve started to mine Ethereum</a> and the potential for growth in that space, I wanted to convert my BTC to ETH.</p><h3>Shapeshift. Go.</h3><p>I discovered Shapeshift, and this again involved my having to make a payment to their system and waiting for it to exchange and credit the amount of ETH agreed upon to my wallet. Notice again, there are fees involved, so make sure you account for them before hand.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gI42E2LqCYUN4pBkDFdkNw.png" /></figure><p>This step took over 15 minutes, and since you never create an account on Shapeshift, make sure to copy and store the URL of the page you’re waiting on — it’s the only way to go back to see what’s happened. Of course, any failure should send those BTCs back to your wallet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DraVaKa-ZcdVN5Rx94l_wQ.png" /></figure><p>If you were paying attention, before I Shapeshifted my BTC balance to ETH, I started with ~$45.37, which of course got less due to the Shapeshifting fee, leaving me with ~$40.69 at the time of writing. How can I make up for my loss?</p><p>Well, that’s where my ETH mining efforts come in. I should be receiving my very first ETH pay-out of 0.05 ETH at which time, this should cover my ‘losses’ in this experiment to purchase a TREZOR.</p><p>I’ve basically added 0.05 ETH to the value that I currently hold in my Ethereum wallet and if I convert that figure, you can see it puts me at ~$55.18</p><p>All things considered, that’s not too bad and makes mining a decent practice to aid covering costs involved with each transaction.</p><p>However, the barrier to easily purchase BTC can be a pain, especially without access to Bitcoin ATMs, along with high fees to do so.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8V8LthkkPPhfUY7SvVFdoQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b4560acdad1c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mining Ethereum — for Fun & Profit]]></title>
            <link>https://medium.com/@bsodmike/mining-ethereum-for-fun-profit-d4e52eba6b1a?source=rss-bb088c3885a9------2</link>
            <guid isPermaLink="false">https://medium.com/p/d4e52eba6b1a</guid>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[bitcoin-mining]]></category>
            <dc:creator><![CDATA[Michael de Silva]]></dc:creator>
            <pubDate>Wed, 07 Jun 2017 14:07:13 GMT</pubDate>
            <atom:updated>2017-06-08T01:40:08.840Z</atom:updated>
            <content:encoded><![CDATA[<p>I stumbled on news today that GPU based mining was back in vogue and realised that this will only continue for a short-period of time, until better support of existing GPU architecture comes around (for example GTX1080s) or tailored ASICs.</p><p>Interestingly, the sweet spot right now are the GTX1060s to GTX1070s, capable of mining ~26 Mh/s (that’s Million hashes per second) — consider, that CPU mining on a 6700K would barely be able to crank out 1 Mh/s. These runs would either be nVidia CUDA optimised or AMD optimised.</p><p>As a result, <a href="http://wccftech.com/amd-gpu-supply-exhausted-by-cryptocurrency/">global AMD GPU supply seems to have been exhausted</a> with miners snagging these lower end cards for the ‘sweet’ spot of high-hash rates per watt.</p><p>Yes, the biggest cost in mining is power draw and to this end, wanted to run a simulation on my Intel i7 6850K productivity rig with a GeForce GTX1080 (which isn’t ideal…)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G3SuadMolIB-f8p8BRpu-w.png" /></figure><p>I decided to try running my miner via nanopool and you’ll find stats of this on the left, for the past 6-hours.</p><p>Setup and getting up and running was as simple as downloading Claymore from the nanopool site, configuring my wallet details and it was a case of releasing the Kraken!</p><p>I also wanted to try this on Linux, and this however, was a more interesting experience as for <em>my linux use</em>, I was looking to try this via CPU mining. This is due to my dedicated linux box running an Intel 6700k relying on its APU-integrated graphics — it has no discrete GPU.</p><p>Do not confuse yourself with <a href="https://github.com/ethereum/cpp-ethereum">https://github.com/ethereum/cpp-ethereum</a> which is a Ethereum client (it runs inside an Ethereum network) but instead either consider <a href="https://github.com/Genoil/cpp-ethereum/">https://github.com/Genoil/cpp-ethereum/</a> or <a href="https://github.com/ethereum-mining/ethminer">https://github.com/ethereum-mining/ethminer</a>. Genoil’s version was a bit tedious to setup as I had to resolve all CMake dependencies by hand, whereas the latter tool uses the <a href="https://docs.hunter.sh/">Hunter</a> package-manager to nicely resolve these for you.</p><p>On my 6850K rig, power-draw is estimated at an additional 125W (using Corsair Link software tied to my PSU) which works out to ~US$25/month in total kW/h costs.</p><p>I should be able to compute ~$90/month for the time-being and am curious as to where things will lead in the cryptocurrency mining world. It’s worth to note that much higher hash-rates/watt are to be had mining zCash though.</p><p>In any case, miners will only be able to turn a profit in the short-term as long as Ethereum continues with its Proof-of-Work (PoW) model, although I hear that the <a href="https://github.com/ethereum/wiki/wiki/Proof-of-Stake-FAQ">switch to Proof-of-Stake (PoS)</a> is likely to happen Q4/early 2018.</p><p>Should you look to try your hand at this I recommend #ethereum-mining on Freenode as well as <a href="https://gitter.im/ethereum-mining/ethminer">this Gitter group</a>.</p><p>For those looking to build their own <a href="http://www.cryptobadger.com/build-your-own-ethereum-mining-rig">ethereum mining rig, this is a rather fantastic guide</a>.</p><p>Alternatively, consider running this <a href="https://github.com/unsalted/docker-nheqminer-cuda">fantastic Docker container to mine ZCash</a> (with CPU support!) and you can <a href="https://jaxx.io/">setup a local-wallet with Jaxx</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d4e52eba6b1a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Ephemeral Docker Build Slaves with Jenkins]]></title>
            <link>https://medium.com/@bsodmike/ephemeral-docker-build-slaves-with-jenkins-71869e2b890d?source=rss-bb088c3885a9------2</link>
            <guid isPermaLink="false">https://medium.com/p/71869e2b890d</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[jenkins]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Michael de Silva]]></dc:creator>
            <pubDate>Fri, 07 Apr 2017 08:21:29 GMT</pubDate>
            <atom:updated>2017-04-07T08:21:29.018Z</atom:updated>
            <content:encoded><![CDATA[<p>While I primarily specialise in Rails-centric web-app development, I’ve recently been leveraging Node.js for use-cases ideal to its use.</p><p>Even though, this isn’t the primary motivator, I have been keen to hack on a build pipeline that I could leverage sometime in the future.</p><p>If you break out Google, you’ll most likely find a fair few articles taking the approach of connecting to docker containers via JNLP (Java Network Launch Protocol), and in this scenario, you end up running docker inside docker (Inception anyone?) — and the trick to this is that you pass the Docker socket to the container by mapping -v /var/run/docker.sock: /var/run/docker.sock</p><p>Instead, the approach I’ve used is to utilise the AWS EC2 plugin for Jenkins, and use that to fire up an executor, then run the job on the executor.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GEasagOYjPexYgIGyCVWMQ.png" /><figcaption>Building a docker image for a test app, with pipeline stages defined by a Jenkinsfile.</figcaption></figure><p>For this exercise as well, I am also running Jenkins entirely within Docker as well, on a dedicated jenkins box.</p><p>My first attempt at this included installing Docker as part of the EC2 init script — and this was the initial stumbling block that I faced. Installing Docker requires re-initialising the group assignment for the Docker GID; I attempted sudo su - $USER or sudo newgrp docker at the end of the init script without much luck, and therefore resorted to the most sensible approach.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eVPSeiKHLwf3yKvDd4W3Jw.png" /><figcaption>Successful build of the Docker image via a slave executor in Jenkins.</figcaption></figure><p>The silver-bullet (in this case!) was to create an EC2 AMI image which already had Docker installed — it was that simple! An additional bonus from this is the init script has less work to do, so it runs faster as well, and as a result the slave executor boots up much quicker.</p><p>This Jenkins pipeline comes into its own once the Jenkinsfile is scripted to also push the image to a private Docker repository (such as <a href="https://aws.amazon.com/ecr/">AWS’s ECR service</a>) and then trigger webhooks accordingly, depending on the pipeline stages reached.</p><p>A simple pipeline could consist of a stage where tests are run, and then the image is built. Once the tests pass, notification can be sent back to Github — this allows Github to flag a potential Pull-Request as having passed CI testing. If the image is built, a webhook can be POSTed to notify a new ‘build’ is ready to be deployed to the production environment.</p><p>This approach is rather scalable to the demands of most teams, given that multiple executors may be spooled up, preventing executor-job backlog. A fast feedback loop is always a plus for productivity and team velocity.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=71869e2b890d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Potential Pitfalls of Using NodeJS in Production]]></title>
            <link>https://medium.com/@bsodmike/potential-pitfalls-of-using-nodejs-in-production-a3cc9b90eb5d?source=rss-bb088c3885a9------2</link>
            <guid isPermaLink="false">https://medium.com/p/a3cc9b90eb5d</guid>
            <category><![CDATA[rails]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[web-app-development]]></category>
            <category><![CDATA[nodejs]]></category>
            <dc:creator><![CDATA[Michael de Silva]]></dc:creator>
            <pubDate>Tue, 28 Feb 2017 19:29:13 GMT</pubDate>
            <atom:updated>2017-03-30T17:16:09.103Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Do take note that </em><a href="https://medium.com/ninjadevs/node-7-6-koa-2-asynchronous-flow-control-made-right-b0d41c6ba570"><em>Koa 2 is making big waves in the NodeJS space</em></a><em>. The article links to details on Promises, Generators &amp; async/await approaches.</em></p><p>As a disclaimer, I would like to mention that for the past 5–6 years I’ve run many production apps to eCommerce platforms based on Rails, with automation ranging from Chef, Ansible to AWS OpsWorks (to just name a few); I’ve worked on solutions for Raden.com to Autoglym.com plus many more.</p><p>The bulk of these systems relied on Spree (now Solidus) for the eCommerce aspect, with bespoke tailoring of the checkout flow and payment integration processes (usually via ActiveMerchant) and API integrations with the clients ERP of choice — from Microsoft Dynamics NAV to SAP etc.</p><p>Almost 6-months ago, I was approached by a startup to assist with their undertaking of assisting with their MVP — and like most startups, this code-base had “CHURN” written all over it. The proverbial cart was truly before the horse then, and still the same even today.</p><p>The battle between a short-financial runway, bootstrapping an ROI funnel and pragmatic business pressures, paint a similar picture for most startups.</p><p>Since local talent comprise of a much larger pool of ‘Javascript’ developers — the sort who know a bit of PHP &amp; use jQuery as a crutch (or mix vanilla JS &amp; jQuery ad-hoc!) — the project continues in NodeJS.</p><p>This is a brief look at some of the largest hurdles that have presented themselves.</p><h3>1. NPM: The Package buffet — free for all.</h3><p>I share much of the sentiment shared in <a href="https://blog.geekforbrains.com/after-a-year-of-using-nodejs-in-production-78eecef1f65a">‘After a Year of Using NodeJS in Production’ by Gavin Vickery </a>— as a lot of the pain-points I have experienced, have already been succinctly articulated by him.</p><p>Dependency management is exacerbated by the magnitude of choice provided via the <a href="https://www.npmjs.com/">NPM </a>eco-system. Whilst choice can be a good thing, I feel too much of it can be a hindrance too. As a sniff-test — I like to go through each package’s Github page, issue-tracker, just to see how well they are being supported and maintained, as well as glean through internals.</p><p>However, it’s impossible to master (Node) in a realistic sense given that every code-base you come across in the future, has a high-degree of having a very different make-up of dependencies. The same could be said of other eco-systems, but none are of similar magnitude.</p><p>For new comers though, it is advisable to get to grips with the most popular dependencies, such as <a href="http://passportjs.org/">PassportJS</a>, which has been excellent.</p><p>NPM has also lead to dependency bloat, where authors of libraries tend to build upon even 10–20 line ‘libraries’, just because it’s more convenient (really?) to add a 10–20 line package to their library rather than include that same code as a utility function.</p><p>And this leads me to <a href="https://yarnpkg.com/en/">Yarn</a>, which is the defacto package manager that we are using — for better or worse, since it is quick at resolving dependencies.</p><h3>2. NodeJS/Express: Bare Bones &amp; Bring Your Own Security.</h3><p>This would be the largest concern, especially when NodeJS is waved around by those of little experience.</p><p>The code-base I mentioned earlier, started out without any ‘security’ packages included, and even though I added <a href="https://github.com/krakenjs/lusca">lusca</a> as a dependency, due to reasons out of my control, this app runs in production without any CSRF or CORS protection (skipping other levels of basic security as well).</p><p>I normally do not care too much for opinionated frameworks, but at least when it comes to aspects such as basic security, it wouldn’t be such a bad thing for this to at least be included in by default, plus provide means for overriding/replacing.</p><p>I’ve come to appreciate the degree of security offered by Rails ‘out of the box’ and reminds me of an excellent talk by <a href="https://youtu.be/2Ex8EEv-WPs">Yehuda Katz ‘Why Rails is Hard’</a>, where he explains that there’s a level of unknown security hazards that are continuously being patched and handled in Rails (and maintained too!) by the community — this is of immense value to those leveraging Rails, as it means those implementing Rails solutions, do not necessarily need to spend as much time diving into the security space to protect their apps (although, I’d urge you to do so, if you can spare the time).</p><h3>3. Callback Hell Antipatterns</h3><p>This is a fun one, and to get around this, our code-base is a cluttered mix of old-school query(&#39;SELECT * FROM ...&#39;, function(err, rows) { ... }) based calls.</p><p>I made sure to leverage Promises early using <a href="http://bluebirdjs.com/docs/getting-started.html">Bluebird</a>, as this is the only saving grace till Node 7 can be adopted for async/await. Its quite good, fast and does a nice job of making things “just work”</p><p>There are other options such as co <a href="https://github.com/tj/co">generators </a>though as well as the <a href="http://caolan.github.io/async/">async </a>package.</p><p>Of course Promises themselves aren’t a silver-bullet especially when it comes to error-handling.</p><h3>4. Exception (or Error) Handling. LOLWUT?</h3><p>Good luck with that. Yes, seriously. Here’s quote from Gavin —</p><blockquote>Coming from other languages such as Python, Ruby or PHP you’d expect throwing and catching errors, or even returning an error from a function would be a straightforward way of handling errors. Not so with Node. Instead, you get to pass your errors around in your callbacks (or promises) — thats right, no throwing of exceptions. This works until you’re more than a few callbacks deep and trying to follow a stack trace. Not to mention if you forget to return your callback on an error, it continues to run and triggers another set of errors after you returned the initial one. You’ll need to double your client invoices to makeup for debug time.</blockquote><p>For the time being, I’ve tried to couple use of Honeybadger wherever there’s a try/catch block or a promise.then().catch() block for a Promise, so as to provide further context along with a stack-trace. It’s still a struggle, and boy, do I miss Rails exceptions about now!</p><h3>5. Migrations — Do You Even Need ‘Em?</h3><p>New comers to Node will not have much of an idea of what it takes to run robust systems at scale in Production or be aware of Continuous Integration practices.</p><p>Here’s a quick summary of the <a href="https://kostasbariotis.com/data-migration-with-nodejs/">value of migration</a>s —</p><blockquote>Shorter release cycles often require database changes. Having those changes under version control allows us to make changes safely and in a more consistent way. A crucial part of following such methodologies is the evolutionary design which can help us keep track of how the database evolved along with our application. That way our data can rollback at any point of the history hand in hand with our app.</blockquote><blockquote>Evolving our database design along with our core functioning data during the application development, and doing that in a seamless way, requires the use of more sophisticated processes like Database migrations, which essentially are the management of incremental, reversible changes to our databases.</blockquote><blockquote>Database migrations are all about treating our database as another piece of code while applying core principles of Continuous Integration. Publishing new features along with the database changes, without requiring manual Ops work and removing any hands-on session from the DB is the way to move forward and create robust apps.</blockquote><p>The platforms that I normally craft for my clients are typically subjected to the <a href="https://12factor.net/">twelve-factor methodology</a>, however, the last code-base I spoke about does not have any migrations.</p><p>As such, our current workflow is one that hails back to 1980s (or older) approach of copying tables and data from a development database to production — this is an absolutely painful process, and data-integrity… well, there is none at the moment. Good thing it’s a startup right? #shithappens #movefast</p><h3>6. Data Access Objects (DAO) vs. Object Relational Mappers (ORMs)</h3><p>In hindsight, I should have moved this higher up the list, but this is another crucial area in which I personally found options lacking in the Node space.</p><p>However, I have heard that <a href="http://krakenjs.com/">Kraken.js</a> has options for DAO, so whilst I haven’t checked it thoroughly, I’d suggest you do so along with <a href="http://knexjs.org/">Knex.js</a> and <a href="https://github.com/sequelize/sequelize">Sequelize</a>.</p><h3>Node in Production</h3><p>The approach that I have taken is to build a stack in AWS that implements <a href="http://mwdesilva.com/posts/cheap-ssl-domain-registration-with-amazon-aws-route-53-certificate-manager">TLS/SSL offloading</a> and running the NodeJS app instance within a Docker container, with Nginx routing traffic to the app container and serving/caching static assets.</p><p>The Node instance itself is managed by <a href="http://pm2.keymetrics.io/">PM2</a>.</p><h3>Thoughts on Node/Express</h3><p>Whilst Node has its warts, as do all languages/frameworks/stacks do — there are some aspects that are great. For example, we needed to generate some PDFs and <a href="http://pdfkit.org/">PDFkit</a> has been great at that particular task.</p><p>However, I would not recommend it for large-scale products, unless you are able to —</p><ul><li>Dedicate time to plan the base code-base, including dependencies etc.</li><li>Curate dependencies, security solutions from scratch.</li><li>Take your time in crafting your solution.</li><li>Leverage unit testing and BDD practices as well (Selenium/PhantomJS + user stories).</li><li>Test and test again (and automate everything).</li><li>CI/CD/Zero-downtime deploys are a must. It is 2017 after all.</li></ul><p>Whilst Rails has its demons as well, I would consider having Rails run the backend as an API based app, and architect the frontend with NodeJS making API calls to the Rails backend. ‘<a href="https://medium.com/the-node-js-collection/why-the-hell-would-you-use-node-js-4b053b94ab8e#.h6bseazba">Why the Hell Would You Use Node.js</a>’ proposes that <em>NodeJS should not be used</em> for web-apps with a relational backend.</p><blockquote><em>It’s possible and not uncommon to use Node.js solely as a public-facing facade, while keeping your Rails back-end and its easy-access to a relational DB.</em></blockquote><p>ActiveRecord would be considered a time-tested ORM given its exposure in production at Basecamp, and potentially is more feature complete than ORM options in NPM-land.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a3cc9b90eb5d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Curiosity lead me to realise that Fox Movies are using AWS SQS, thanks to Deadpool]]></title>
            <link>https://medium.com/hackernoon/curiosity-lead-me-to-realise-that-fox-movies-are-using-aws-sqs-thanks-to-deadpool-aa0d896ce063?source=rss-bb088c3885a9------2</link>
            <guid isPermaLink="false">https://medium.com/p/aa0d896ce063</guid>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Michael de Silva]]></dc:creator>
            <pubDate>Sun, 24 Jan 2016 23:29:15 GMT</pubDate>
            <atom:updated>2019-04-27T04:42:28.145Z</atom:updated>
            <content:encoded><![CDATA[<p>Having watched a couple <a href="https://hackernoon.com/tagged/trailers">trailers</a> of the upcoming flick <a href="https://hackernoon.com/tagged/deadpool">Deadpool</a> with Van Wilder… sorry, I mean Ryan Renolds, lead me to an interesting discovery. It’s hosted at <a href="http://www.deadpoolcore.com/">http://www.deadpoolcore.com/</a></p><p>I’m curious by nature and whenever I stumble across something interesting, I tend to start digging with my Chrome inspector. I thought some fancy web-font was being used and my initial digging took me to some CSS, then to the page body under the inspector’s “Elements” tab.</p><p>My eyes were instantly drawn to</p><pre>&lt;script type=”text/javascript” src=”//forms.foxfilm.com/signupv231.js”&gt;&lt;/script&gt; </pre><p>This bit of JS would setup the global <em>constructor</em> FoxSignup which allows one to essentially setup the form with the bare minimum</p><pre>var foxSignup = new FoxSignup();</pre><pre>$(“#signup-form”).validate(foxSignup.formValidatorOptions());</pre><p>A <a href="https://github.com/bsodmike/inertialbox-signup-es6/blob/master/src/js/signup.js#L182">convenient comment revealed</a> the signup payload is posted to a singular end-point — one that I plan to build either with Sinatra or a scaled-down version of Rails — which in turn pushes the payload to <a href="https://aws.amazon.com/sqs/">AWS SQS (a message queuing service)</a>.</p><p>Earlier this week <a href="https://www.npmjs.com/package/generator-gulp-foundation-sass-babel-browserify">I released an upgraded version of a Yeoman generator</a> that supports ES6 via Babel.js ‘out of the box’, and I decided to use this to bootstrap a really quick test. In the example below, my attempt sends the identical payload to the Fox server, and I still receive a success response.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cMHy5T6S5NOiXVPg8Zw9aQ.png" /></figure><p>You will find the <a href="https://github.com/bsodmike/inertialbox-signup-es6/blob/fox-clone/src/js/signup.js">end-result available on Github</a> in the ‘fox-clone’ branch, although I plan to make changes for personal use within the master branch.</p><p>Having switched to ES6, there are some niceties that I’m baking in such as easy overriding</p><pre>var foxSignup = new FoxSignup();</pre><pre>FoxSignup.prototype.sendTracking = function(response) {<br>  console.log(&#39;override and send tracking...&#39;);<br>}</pre><pre>FoxSignup.prototype.ajaxCallback = function(response) {<br>  console.log(&#39;override and handle callback: %O&#39;, response);<br>}</pre><pre>$(&quot;#signup-form&quot;).validate(foxSignup.formValidatorOptions());</pre><p>I also want to clean up the validation aspect, which currently relies on a very specific payload tied to Fox’s use-case.</p><p>If you found this article interesting, do let me know your thoughts in the comments and <a href="https://twitter.com/bsodmike">hit me up on twitter</a>!</p><figure><a href="http://bit.ly/HackernoonFB"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0hqOaABQ7XGPT-OYNgiUBg.png" /></a></figure><figure><a href="https://goo.gl/k7XYbx"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Vgw1jkA6hgnvwzTsfMlnpg.png" /></a></figure><figure><a href="https://goo.gl/4ofytp"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gKBpq1ruUi0FVK2UM_I4tQ.png" /></a></figure><blockquote><a href="http://bit.ly/Hackernoon">Hacker Noon</a> is how hackers start their afternoons. We’re a part of the <a href="http://bit.ly/atAMIatAMI">@AMI</a> family. We are now <a href="http://bit.ly/hackernoonsubmission">accepting submissions</a> and happy to <a href="/service/mailto:partners@amipublications.com">discuss advertising &amp; sponsorship</a> opportunities.</blockquote><blockquote>If you enjoyed this story, we recommend reading our <a href="http://bit.ly/hackernoonlatestt">latest tech stories</a> and <a href="https://hackernoon.com/trending">trending tech stories</a>. Until next time, don’t take the realities of the world for granted!</blockquote><figure><a href="https://goo.gl/Ahtev1"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*35tCjoPcvq6LbB3I6Wegqw.jpeg" /></a></figure><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fupscri.be%2Fdde502%3Fas_embed%3Dtrue&amp;dntp=1&amp;url=https%3A%2F%2Fupscri.be%2Fhackernoon%2F&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=upscri" width="800" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/3c851dac986ab6dbb2d1aaa91205a8eb/href">https://medium.com/media/3c851dac986ab6dbb2d1aaa91205a8eb/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aa0d896ce063" width="1" height="1" alt=""><hr><p><a href="https://medium.com/hackernoon/curiosity-lead-me-to-realise-that-fox-movies-are-using-aws-sqs-thanks-to-deadpool-aa0d896ce063">Curiosity lead me to realise that Fox Movies are using AWS SQS, thanks to Deadpool</a> was originally published in <a href="https://medium.com/hackernoon">HackerNoon.com</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>