-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathposts.xml
More file actions
156 lines (156 loc) · 85 KB
/
posts.xml
File metadata and controls
156 lines (156 loc) · 85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
<?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 Tharusha Jayasooriya on Medium]]></title>
<description><![CDATA[Stories by Tharusha Jayasooriya on Medium]]></description>
<link>https://medium.com/@tharushaj?source=rss-b89f1b6ae87c------2</link>
<image>
<url>https://cdn-images-1.medium.com/fit/c/150/150/1*J5sOlJBQDHsjwDzezJq_mw.jpeg</url>
<title>Stories by Tharusha Jayasooriya on Medium</title>
<link>https://medium.com/@tharushaj?source=rss-b89f1b6ae87c------2</link>
</image>
<generator>Medium</generator>
<lastBuildDate>Sun, 14 Dec 2025 15:27:49 GMT</lastBuildDate>
<atom:link href="https://medium.com/@tharushaj/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[Azure without the corporate jargon — Microsoft Foundry]]></title>
<link>https://tharushaj.medium.com/azure-without-the-corporate-jargon-microsoft-foundry-50b7ad6021c0?source=rss-b89f1b6ae87c------2</link>
<guid isPermaLink="false">https://medium.com/p/50b7ad6021c0</guid>
<category><![CDATA[microsoft-azure]]></category>
<category><![CDATA[openai]]></category>
<category><![CDATA[ai-agent]]></category>
<category><![CDATA[azure]]></category>
<category><![CDATA[ai]]></category>
<dc:creator><![CDATA[Tharusha Jayasooriya]]></dc:creator>
<pubDate>Sun, 14 Dec 2025 12:33:31 GMT</pubDate>
<atom:updated>2025-12-14T12:34:15.061Z</atom:updated>
<content:encoded><![CDATA[<h3>Azure without the corporate jargon: Microsoft Foundry</h3><p>If you’ve ever looked at Microsoft’s AI pages and thought, <em>“Okay… but what does this actually do?”</em> you’re not alone.</p><p>Microsoft documentation and announcements often use phrases like <strong>end-to-end platform</strong>, <strong>unified experience</strong>, <strong>enterprise-grade</strong>, or <strong>accelerate innovation</strong>. These words sound impressive, but they don’t always answer the real questions most developers have: What is this thing? What problem does it solve? What do I click first? So let’s strip away the corporate language and explain this properly.</p><p><strong>Microsoft Foundry</strong> (previously called <strong>Azure AI Foundry</strong>, and before that <strong>Azure AI Studio</strong>) is simply <strong>a single place on Azure where you build, test, and run AI-powered apps and agents</strong>.</p><p>That’s it.</p><p>It exists to make building AI apps on Azure <em>less confusing</em> and <em>less scattered</em>.</p><figure><img alt="microsoft foundry ai builder" src="https://cdn-images-1.medium.com/max/686/1*sFRSaCv6BncWjhQ1Ky0haQ.jpeg" /></figure><h3>What Microsoft Foundry actually is…</h3><p>Microsoft Foundry is an <strong>AI workspace</strong>.</p><p>Instead of you manually combining Azure OpenAI, search, storage, monitoring, prompt testing, and deployment Foundry puts these under <strong>one roof</strong>.</p><p>In Foundry, you can:</p><ul><li>choose an AI model,</li><li>test prompts in a chat playground,</li><li>deploy the model so your app can use it,</li><li>build AI “agents” that can follow steps and use tools,</li><li>connect your own documents so the AI answers from real data,</li><li>and monitor how everything behaves once it’s live.</li></ul><p>Think of it as <strong>VS Code, but for AI apps on Azure</strong>.</p><h3>The main idea: projects</h3><p>Everything in Foundry lives inside a <strong>project</strong>.</p><p>A project is just a workspace that holds:</p><ul><li>your deployed models,</li><li>chat history and test conversations,</li><li>uploaded files,</li><li>search indexes (for “chat with my docs” apps),</li><li>and agent configurations.</li></ul><p>Instead of spreading things across random Azure resources, a project keeps related AI work together.</p><p>If you’re working in a team, everyone works inside the same project.</p><h3>Foundry “new” vs “classic” (why there are two views)</h3><p>When you open Foundry, you might notice a toggle that switches between <strong>Foundry (new)</strong> and <strong>Foundry (classic)</strong>.</p><p>This confuses a lot of people, so here’s the simple explanation:</p><p><strong>Foundry (new)</strong><br>Focused on building modern AI apps and agents. Cleaner UI, easier agent workflows, better tooling.</p><p><strong>Foundry (classic)</strong><br>Shows more raw Azure-style resources and older layouts.</p><p>If you can’t find something, try switching views. You’re not doing anything wrong — Microsoft is still transitioning.</p><h3>How to use Microsoft Foundry (step by step)</h3><h3>Step 1: Open Foundry and create a project</h3><p>Go to, <a href="https://azure.microsoft.com/en-us/products/ai-foundry?wt.mc_id=studentamb_493568">this</a> URL and click “Build with foundry”</p><p>After login in in the foundry dashboard, create a <strong>new project</strong>. This will be your workspace.</p><h3>Step 2: Deploy a model</h3><p>Inside the project:</p><ol><li>Open the <strong>model catalog</strong></li><li>Choose a model (for example, a GPT-style chat model)</li><li>Deploy it</li></ol><p>Deploying simply means: <em>“make this model available for my app to call.”</em></p><h3>Step 3: Test prompts in the playground</h3><p>Before writing any code, use the <strong>playground</strong>.</p><p>Here you can:</p><ul><li>write a system prompt,</li><li>ask questions,</li><li>see how the model responds,</li><li>tweak wording until it behaves the way you want.</li></ul><p>This step saves a lot of time and money.</p><h3>Step 4: Call the model from code (simple example)</h3><p>Here’s a very basic Python example that calls a deployed model from a Foundry project:</p><pre>import os<br>from azure.identity import DefaultAzureCredential<br>from azure.ai.projects import AIProjectClient<br>project = AIProjectClient(<br> endpoint=os.environ["AZURE_AI_FOUNDRY_PROJECT_ENDPOINT"],<br> credential=DefaultAzureCredential(),<br>)<br>client = project.get_openai_client()<br>response = client.responses.create(<br> model=os.environ["AZURE_AI_FOUNDRY_MODEL_DEPLOYMENT_NAME"],<br> input="Explain recursion in simple terms."<br>)<br>print(response.output_text)</pre><p>What’s happening here:</p><ul><li>Azure signs you in automatically using your account</li><li>You tell it which project and model to use</li><li>You send text in</li><li>You get text out</li></ul><p>That’s all.</p><h3>What is an “agent” and when do you need one?</h3><p>A normal chat model just answers messages.</p><p>An <strong>agent</strong> is used when you want the AI to:</p><ul><li>follow steps,</li><li>use tools (search, APIs, internal functions),</li><li>work with files,</li><li>or handle longer tasks.</li></ul><p>Foundry makes creating and running agents much easier than doing this manually.</p><h3>Adding your own data (so the AI stops guessing)</h3><p>If you don’t connect your own data, the AI will rely on general knowledge.</p><p>To fix this, Foundry lets you:</p><ul><li>upload documents,</li><li>create a search index,</li><li>and ground the AI’s answers in that data.</li></ul><p>This is how you build <strong>reliable</strong> AI apps.</p><h3>How pricing works (simple version)</h3><p>Check <a href="https://azure.microsoft.com/en-us/pricing/details/ai-foundry?wt.mc_id=studentamb_493568">this</a> URL for detailed foundry pricing breakdown, in essence:</p><p>Foundry itself is a workspace.</p><p>You pay for:</p><ul><li>the models you deploy,</li><li>the tokens they use,</li><li>and any tools (search, vision, speech, etc.).</li></ul><p>There’s no mystery pricing layer — you pay for what you use.</p><h3>When should you use Microsoft Foundry?</h3><p>Use Foundry if you want:</p><ul><li>one place to build and manage AI apps,</li><li>less Azure setup pain,</li><li>easier path from testing → production,</li><li>built-in monitoring and evaluation.</li></ul><p>If you’re just making one quick API call, you <em>can</em> skip it — but the moment your app grows, Foundry makes life much easier.</p><h3>Final takeaway</h3><p>Microsoft Foundry is not magic.</p><p>It doesn’t “do AI for you.”</p><p>It simply <strong>organizes everything you need to build AI apps on Azure</strong> in a way that actually makes sense — once you ignore the corporate wording.</p><p>If you think of it as <strong>“my AI project workspace on Azure”</strong>, you’re already using it the right way.</p><p><strong>Learn more about Microsoft foundry </strong><a href="https://learn.microsoft.com/en-us/azure/ai-foundry/?view=foundry-classic?wt.mc_id=studentamb_493568"><strong>here</strong></a><strong>.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=50b7ad6021c0" width="1" height="1" alt="">]]></content:encoded>
</item>
<item>
<title><![CDATA[Exploring niche Azure products — Sending sms and email using Azure.]]></title>
<link>https://tharushaj.medium.com/exploring-niche-azure-products-sending-sms-and-email-using-azure-4d4861dda272?source=rss-b89f1b6ae87c------2</link>
<guid isPermaLink="false">https://medium.com/p/4d4861dda272</guid>
<category><![CDATA[email-marketing]]></category>
<category><![CDATA[azure]]></category>
<category><![CDATA[cloud-services]]></category>
<category><![CDATA[cloud]]></category>
<category><![CDATA[sms-marketing]]></category>
<dc:creator><![CDATA[Tharusha Jayasooriya]]></dc:creator>
<pubDate>Fri, 12 Dec 2025 13:02:51 GMT</pubDate>
<atom:updated>2025-12-13T10:55:16.309Z</atom:updated>
<content:encoded><![CDATA[<h3>How to send SMS and email using Azure.</h3><p>When people think about Microsoft Azure, they usually picture “big cloud things”: virtual machines, databases, containers, maybe some AI.</p><p>But Azure also has this slightly hidden, useful product: a way to send real SMS messages, emails, voice and video calls, and chat directly from your code, built on the same secure platform that powers Microsoft Teams.</p><p>In this post, we’ll zoom in on one super practical piece of it: <strong>sending and receiving SMS</strong>.</p><p>We’ll keep the language simple, walk through a concrete use case, and I’ll show you working code to send a text from a Node.js script.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tCKi_BoNa4tAH8aS2J-yHQ.jpeg" /></figure><h3>Why this is interesting (and a bit surprising)</h3><p><a href="https://azure.microsoft.com/en-us/products/communication-services?wt.mc_id=studentamb_493568">Azure Communication Services</a> (ACS) gives you APIs and SDKs for:</p><ul><li>SMS (text messages)</li><li>Email</li><li>Voice & video calls</li><li>Real-time chat</li><li>Telephony + Teams interoperability</li></ul><p>The surprising part:</p><ul><li>It runs on the <strong>same backbone as Microsoft Teams</strong>, which already handles millions of calls and messages every day.</li><li>You don’t need a separate third-party provider if you’re already in the Azure ecosystem.</li><li>You can buy phone numbers directly in the Azure portal and start sending SMS with just a few lines of code.</li></ul><p>So if you’re building things like:</p><ul><li>“Appointment reminder” texts</li><li>“Your one-time login code is…”</li><li>“Your parcel is out for delivery”</li><li>Hackathon / event notifications (“Round 2 starts now !”)</li></ul><p>…ACS is basically a built-in communication engine.</p><h3>What we’ll build</h3><p>We’ll build a tiny, realistic thing:</p><blockquote><strong><em>A simple SMS notification script using Node.js and Azure Communication Services.</em></strong></blockquote><p>You’ll be able to run:</p><pre>node send-sms.js</pre><p>…and get a real SMS on your phone like:</p><blockquote><em>“Hey, this is your Azure SMS bot saying hi !”</em></blockquote><p>We’ll also briefly look at how you can handle <em>incoming</em> SMS using Azure Functions.</p><p>First create an <a href="https://azure.microsoft.com/en-us/pricing/purchase-options/azure-account?wt.mc_id=studentamb_493568">Azure account</a> if you dont have it yet.</p><h3>Step 1 — Create an Azure Communication Services resource</h3><ol><li>Go to the <a href="https://azure.microsoft.com/en-us/get-started/azure-portal?wt.mc_id=studentamb_493568"><strong>Azure Portal</strong></a>.</li><li>Search for <strong>“Communication Services”</strong> and click <strong>Create</strong>.</li><li>Choose:</li></ol><ul><li>Subscription & Resource group</li><li>A name (for example: my-acs-demo)</li><li>A region close to you</li></ul><ol><li>Click <strong>Review + create</strong>, then <strong>Create</strong>.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*un27BLN8LOMyj1uWkmEu9w.png" /></figure><p>Once it finishes:</p><ol><li>Open the resource and, click “Manage Keys”.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lnPbXOExkhk1hLt9WJBbIA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RmVsJFcr3y2QwqDT1w4FmQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rgr2sRyFikHNf-CTTzZ8gA.png" /></figure><p>2. Copy the <strong>Connection string</strong> (we’ll use this in code).</p><p>This connection string is your main secret for accessing ACS from your backend.</p><h3>Step 2 — Get an SMS-enabled phone number</h3><p>Inside the same Communication Services resource:</p><ol><li>In the left menu, click <strong>Telephone And SMS →</strong> <strong>Phone numbers</strong>.</li><li>Click <strong>Get</strong> or <strong>+ Add</strong>.</li><li>Follow the wizard to acquire a <strong>toll-free</strong> or <strong>local</strong> number (availability depends on your region).</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qvezDKCiZwd-siTegbHhAA.png" /></figure><p>You’ll end up with something like:</p><blockquote><em>+14255550123</em></blockquote><p>This is your <strong>sending</strong> number (from).</p><h3>Step 3 — Set up a tiny Node.js project</h3><p>Requirements:</p><ul><li>Node.js installed (LTS is fine)</li><li>A terminal, ofc :)</li></ul><p>Create a folder and initialize a project:</p><pre>mkdir azure-sms-demo<br>cd azure-sms-demo<br>npm init -y</pre><p>Install the SMS SDK and dotenv:</p><pre>npm install @azure/communication-sms dotenv</pre><p>The @azure/communication-sms package is the official JavaScript SDK for the SMS part of Azure Communication Services.</p><h3>Step 4 — Store secrets in .env</h3><p>Create a .env file in the project root:</p><pre>ACS_CONNECTION_STRING=endpoint=https://<your-resource>.communication.azure.com/;accesskey=<your-access-key><br>ACS_FROM_NUMBER=+14255550123 # your ACS phone number<br>ACS_TO_NUMBER=+94XXXXXXXXX # your own phone (in E.164 format)</pre><p>A couple of notes:</p><ul><li>The connection string comes from the <strong>Keys & connection string</strong> blade in your ACS resource.</li><li>Phone numbers must be in <strong>E.164 format</strong>: + + country code + number (for example +14155550123).</li></ul><p>Also add .env to .gitignore so you don’t accidentally push secrets to GitHub:</p><pre>echo ".env" >> .gitignore</pre><h3>Step 5 — Send your first SMS (Node.js)</h3><p>Create a file called send-sms.js:</p><pre>// send-sms.js<br>require("dotenv").config();<br>const { SmsClient } = require("@azure/communication-sms");<br>const connectionString = process.env.ACS_CONNECTION_STRING;<br>const fromNumber = process.env.ACS_FROM_NUMBER;<br>const toNumber = process.env.ACS_TO_NUMBER;<br>if (!connectionString || !fromNumber || !toNumber) {<br> console.error("Please set ACS_CONNECTION_STRING, ACS_FROM_NUMBER, ACS_TO_NUMBER in .env");<br> process.exit(1);<br>}<br>// Create the SMS client using the connection string<br>const smsClient = new SmsClient(connectionString);<br>async function main() {<br> console.log("Sending SMS...");<br> // The SDK supports sending to one or many recipients<br> const sendResults = await smsClient.send({<br> from: fromNumber,<br> to: [toNumber],<br> message: "Hello from Azure Communication Services 👋",<br> });<br> for (const result of sendResults) {<br> if (result.successful) {<br> console.log(`✅ SMS sent to ${result.to}. Message ID: ${result.messageId}`);<br> } else {<br> console.error("❌ Failed to send SMS:", result);<br> }<br> }<br>}<br>main().catch((err) => {<br> console.error("Error sending SMS:", err);<br>});</pre><p>Now run it:</p><pre>node send-sms.js</pre><p>If everything is set up correctly, you should see something like:</p><pre>Sending SMS...<br>✅ SMS sent to +94XXXXXXXXX. Message ID: Outgoing_1234567890abcdef</pre><p>…and your phone should buzz 🎉</p><h3>Step 6 — Turn it into a simple “notification service”</h3><p>A one-off script is cool, but let’s imagine a more realistic use case:</p><blockquote><em>When your app does something important (new signup, payment success, new support ticket, etc.), you want to hit an endpoint like </em><em>POST /notify and send an SMS.</em></blockquote><p>Let’s make a tiny Express API that uses the same ACS client.</p><p>Install Express:</p><pre>npm install express</pre><p>Create server.js:</p><pre>// server.js<br>require("dotenv").config();<br>const express = require("express");<br>const { SmsClient } = require("@azure/communication-sms");<br>const app = express();<br>app.use(express.json());<br>const smsClient = new SmsClient(process.env.ACS_CONNECTION_STRING);<br>const fromNumber = process.env.ACS_FROM_NUMBER;<br>// Simple health check<br>app.get("/", (req, res) => {<br> res.send("Azure SMS notification service is running ✅");<br>});<br>app.post("/notify", async (req, res) => {<br> const { to, message } = req.body;<br> if (!to || !message) {<br> return res.status(400).json({ error: "Missing 'to' or 'message'" });<br> }<br> try {<br> const sendResults = await smsClient.send({<br> from: fromNumber,<br> to: Array.isArray(to) ? to : [to],<br> message,<br> });<br> const summary = sendResults.map((r) => ({<br> to: r.to,<br> successful: r.successful,<br> messageId: r.messageId,<br> }));<br> res.json({ ok: true, results: summary });<br> } catch (err) {<br> console.error("SMS send error:", err);<br> res.status(500).json({ error: "Failed to send SMS" });<br> }<br>});<br>const PORT = process.env.PORT || 3000;<br>app.listen(PORT, () => {<br> console.log(`Notification API running on http://localhost:${PORT}`);<br>});</pre><p>Run it:</p><pre>node server.js</pre><p>Then send a test request (for example with curl):</p><pre>curl -X POST http://localhost:3000/notify \<br> -H "Content-Type: application/json" \<br> -d '{<br> "to": "'$ACS_TO_NUMBER'",<br> "message": "Your order #1234 has shipped! 📦"<br> }'</pre><p>You now have a <strong>tiny SMS microservice</strong> you can call from:</p><ul><li>Your web app</li><li>A backend service</li><li>A serverless function</li><li>Even a GitHub Action, if you want build notifications by SMS</li></ul><h3>Step 7 — Bonus: Handle incoming SMS with Azure Functions</h3><p>Sending messages is only half the story.</p><p>Azure Communication Services can also <strong>raise events when an SMS is received</strong>, using <strong>Event Grid</strong>. You can subscribe to those events with an Azure Function and automatically respond or trigger workflows.</p><p>Typical flow:</p><ol><li>A user sends an SMS to your ACS number.</li><li>ACS publishes an SMSReceived event to Event Grid.</li><li>Event Grid triggers your Azure Function.</li><li>Your function reads the message and optionally replies using SmsClient.</li></ol><p>Here’s a rough example of an Azure Function (TypeScript) that auto-replies to incoming SMS:</p><pre>// index.ts (Azure Function with Event Grid trigger)<br>import { AzureFunction, Context } from "@azure/functions";<br>import { SmsClient } from "@azure/communication-sms";<br>const connectionString = process.env.ACS_CONNECTION_STRING!;<br>const smsClient = new SmsClient(connectionString);<br>const eventGridTrigger: AzureFunction = async (<br> context: Context,<br> eventGridEvent: any<br>): Promise<void> => {<br> const data = eventGridEvent.data;<br> const from = data.from; // The original sender<br> const to = data.to; // Your ACS number<br> const message = data.message;<br> context.log(`Received SMS from ${from} to ${to}: ${message}`);<br> // Simple auto-reply<br> await smsClient.send({<br> from: to,<br> to: [from],<br> message: "Thanks! We received your message ✅",<br> });<br>};<br>export default eventGridTrigger;</pre><p>With just this pattern, you could build:</p><ul><li>SMS-based “reply 1 / 2 / 3 to choose an option” menus</li><li>Simple keyword responders (e.g. text “INFO” to get opening hours)</li><li>A tiny SMS support bot for your project</li></ul><p>Without dealing with carriers directly or understanding telecom protocols.</p><h3>When should you consider Azure Communication Services?</h3><p>You should at least <em>try</em> ACS if:</p><ul><li>You’re already using <strong>Azure</strong> for hosting, databases, or other services.</li><li>You need <strong>SMS, email, chat, voice or video</strong> in your app and prefer a single, unified platform.</li><li>You like the idea of building on the same infrastructure that powers <strong>Microsoft Teams</strong>.</li></ul><p>A few concrete ideas:</p><ul><li>Notify users when a long-running job finishes.</li><li>Send 2FA / OTP codes for login (with proper security).</li><li>Broadcast important updates to event participants.</li><li>Build a lightweight SMS “support line” for your side project.</li><li>Connect ACS with <strong>Logic Apps / Power Automate</strong> to build no-code workflows that send SMS based on triggers.</li></ul><h3>Wrapping up</h3><p>If you want to go further, you can:</p><ul><li>Wrap this into a <strong>Next.js API route</strong>.</li><li>Turn it into a <strong>reminder bot</strong> (“text me my tasks every morning”).</li><li>Add <strong>email</strong> via ACS so your app has one unified communication layer.</li></ul><p>And the nicest part: once this is wired up, sending a text from your app feels as simple as calling a function.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4d4861dda272" width="1" height="1" alt="">]]></content:encoded>
</item>
<item>
<title><![CDATA[Forking for Freedom: Why Open Source Needs Its Rebels]]></title>
<link>https://tharushaj.medium.com/forking-for-freedom-why-open-source-needs-its-rebels-4a67709c0b3c?source=rss-b89f1b6ae87c------2</link>
<guid isPermaLink="false">https://medium.com/p/4a67709c0b3c</guid>
<category><![CDATA[freedom]]></category>
<category><![CDATA[free]]></category>
<category><![CDATA[software-development]]></category>
<category><![CDATA[open-source]]></category>
<category><![CDATA[software]]></category>
<dc:creator><![CDATA[Tharusha Jayasooriya]]></dc:creator>
<pubDate>Mon, 11 Nov 2024 12:25:15 GMT</pubDate>
<atom:updated>2025-05-31T15:29:08.653Z</atom:updated>
<content:encoded><![CDATA[<p>In the world of open-source software, the concept of “freedom” runs deeper than code, stretching into philosophy, community, and values. At its core, OSS is celebrated as “free as in freedom” a commitment not only to transparency and accessibility but to user autonomy and communal contribution. However, some open-source projects have been steering away from this ethos, adopting licenses like the Business Source License (BSL), which add a level of restriction on what users and companies can do with the software. While these licenses protect creators and their intellectual property, they often leave behind the OSS purists, prompting a wave of “rebels” who fork projects to maintain the philosophical purity of free software.</p><p>The phenomenon of forking taking the source code of a project and developing it independently might appear as a rebellion against established projects, but in a larger sense, it is often an act of preservation. By dissecting the necessity of these forks, the tech involved, and the implications for OSS, we explore why open source, at times, needs its rebels to safeguard its original mission.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/450/1*gDKY2VnhsnjkQX1HaNK0Tw.png" /><figcaption>Taken from <a href="https://www.amazon.com/Star-Wars-Propaganda-History-Persuasive/dp/0062466828/ref=sr_1_1?field-isbn=9780062466822&sr=8-1">https://www.amazon.com/Star-Wars-Propaganda-History-Persuasive/dp/0062466828/ref=sr_1_1?field-isbn=9780062466822&sr=8-1</a></figcaption></figure><h3>The Case of Forking: A Balance of Philosophy and Pragmatism</h3><p>Forking can be seen as both an act of defiance and a practical solution to diverging interests. When Oracle acquired MySQL in 2010, the database community grew concerned. Many felt that MySQL, the popular relational database system, would become another corporate asset with proprietary leanings, contradicting the very spirit of open-source. The response was MariaDB — a fork championed by MySQL’s original developers, who aimed to preserve MySQL’s open-source roots while allowing the project to grow on its own terms. The community’s response was immediate and overwhelmingly positive, and MariaDB quickly gained traction as a bastion of OSS philosophy.</p><p>Similarly, the relationship between Apache OpenOffice and LibreOffice showcases the delicate relationship of collaboration and divergence in OSS. While both projects serve as free, open-source office suites, LibreOffice emerged as a fork with the intent of advancing faster and more openly than OpenOffice, leading to improved functionality and a strong community base.</p><h3>The Constraints of BSL, “The Bull Sh**t Licence”</h3><p>The introduction of licenses like the BSL, or the Business Source License attempts to address the imbalance between OSS creators and large corporations that profit from free software without contributing back. Cloud giants like AWS and Google have famously taken popular open-source projects, modified them, and sold them as part of their cloud services. MongoDB, Elasticsearch, and Redis all faced this issue, where their developers saw major tech companies gaining from their work without the same commitment to contributing resources or code back to the original project.</p><p>To counter this, companies introduced BSL and similar licenses, which limit certain kinds of use by third parties, particularly commercial cloud services. The intent is to protect the project from exploitation and create a sustainable revenue model for developers. In a practical sense, BSL allows creators to maintain a degree of control over their work, protecting the project’s commercial value. But in the philosophical realm of OSS, these restrictive licenses spark debate, as they fall short of the ideals of “free as in freedom.”</p><p>The “freedom” in OSS is not merely about zero-cost software; it’s about the right to modify, distribute, and innovate without undue restriction even for commercial uses. BSL projects thus sit in a gray area, where they are technically open-source but no longer universally free. This shift sometimes leads developers to fork the project to restore the original openness, as seen with projects like OpenSearch, a community-driven fork of Elasticsearch. By creating OpenSearch, the open-source community reclaimed Elasticsearch from the perceived limitations of BSL, aiming to make it more accessible and fully in line with OSS principles.</p><h3>Forking as a Catalyst for Innovation and Independence</h3><p>Beyond its roots in rebellion, forking also serves as a practical mechanism for innovation. When a community diverges in its goals, a fork can push new features, optimizations, and design choices without the constraints of the original project’s roadmap. It provides a space for experimentation, where alternative visions of a project can flourish.</p><p>An example in recent years is Terraform. Originally open-source under HashiCorp, Terraform became immensely popular as an infrastructure-as-code tool, enabling developers to automate cloud infrastructure management. When HashiCorp recently switched to a more restrictive license, debates about its commitment to open-source values sparked. In response, the community began exploring Terraform forks, aiming to continue developing an open alternative that better aligned with the OSS ethos.</p><h3>The Rebel Alliance</h3><p>In the end, forking is a powerful testament to the freedom at the heart of OSS. It serves as a safeguard against monopolization, ensuring that no one entity can dictate the direction of a project unilaterally. The OSS ecosystem relies on this balancing force, where the community retains the ability to correct course by forging a new path when necessary.</p><p>But the act of forking should be undertaken with purpose and respect for the broader ecosystem. Each fork should ask: Are we adding value? Are we preserving something meaningful? Are we building something better? When driven by these motivations, forking transcends its rebellious image and becomes a constructive force, offering alternatives that uphold the principles of open-source.</p><p>In many ways, OSS needs its rebels. With them, the community can stay energized, bend to corporate interests, and maintain its commitment to universal access. Forking is not a betrayal of open source; it is its safeguard, its ability to evolve, resist, and adapt. The rebels of OSS remind us that the freedom to innovate, improve, and even dissent lies at the very core of open-source philosophy. And in this way, they ensure that open-source remains not just free to use, but free to be free.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4a67709c0b3c" width="1" height="1" alt="">]]></content:encoded>
</item>
<item>
<title><![CDATA[What is the best Linux distro for beginners?]]></title>
<link>https://tharushaj.medium.com/what-is-the-best-linux-distro-for-beginners-0854199c5899?source=rss-b89f1b6ae87c------2</link>
<guid isPermaLink="false">https://medium.com/p/0854199c5899</guid>
<category><![CDATA[desktop]]></category>
<category><![CDATA[linux]]></category>
<category><![CDATA[beginners-guide]]></category>
<category><![CDATA[linux-tutorial]]></category>
<category><![CDATA[popos]]></category>
<dc:creator><![CDATA[Tharusha Jayasooriya]]></dc:creator>
<pubDate>Sun, 06 Oct 2024 07:43:57 GMT</pubDate>
<atom:updated>2024-10-06T07:43:57.436Z</atom:updated>
<content:encoded><![CDATA[<p>Pop_os. Yep, that’s it. You probably were expecting a list of “top 10 best Linux distros for beginners” but the reality is these kinds of articles further confuse newcomers coming into the Linux ecosystem. I've been using Pop os for almost 4 years now on my laptop with a Nvidia graphics card and I’ve had an extremely smooth experience with it. So let’s discuss how to install, configure, and improve on what I think is the best Linux distro for beginners.</p><h3>How to install Pop_os!</h3><p>Much like any other distro, all you need is a USB drive and a device to flash the Pop_os ISO to it.</p><p>First, <strong>download the ISO </strong>from the official <a href="https://pop.system76.com/">Pop_os website</a>. If you are planning to install this on a system with Nvidia graphics choose the NVIDIA option. Note that this does mean you are installing proprietary drivers, but this is partly what makes Pop_os so easy to install. You basically have to do <strong>nothing</strong> except this to configure your graphics card. Trust me as someone who used to run pure Debian on an Nvidia system, this feels like magic.</p><p>Next, <strong>flash the ISO</strong> into a Flask drive.</p><p>If you are on Windows => Use <a href="https://rufus.ie/en/">Rufus</a></p><p>If you are on Linux => Use <a href="https://etcher.balena.io/">Balena Etcher</a></p><p>If you are on Android (yes, even Android! ) => Use <a href="https://play.google.com/store/apps/details?id=com.mixapplications.ventoy_app">Ventoy</a> (I have not tested this app)</p><p><strong>Prepare your system</strong></p><p><strong>NOTE: This is a very important step. If you are planning to dual boot this is not the tutorial for you. There are plenty of good tutorials on the internet for this.</strong></p><p>Plug in the USB to your system. You need to find the key that opens the BIOS. This will depend on your motherboard. It’s usually very easy to find with a simple Google search. Power on your system and immediately start pressing that BIOS key. It should open up your bios setting.</p><p>Find the setting that reads “boot devices”. You should see a list of devices in a particular order. Use the instructions given to change the order and bring your flash drive to the top of that list. (It usually shows the size of each boot device next to its name. This should help you in finding your flash drive from the list)</p><p>Save the setting and click the “reboot” option. Once the device boots up you should see a screen with the pop os logo and “Try or install pop os” button. After that, you should be greeted with a <strong>temporary</strong> pop os install.</p><p>Click on this icon :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5ey_rnnadnLivFItBxRLRg.png" /></figure><p>After this the process is pretty self-explanatory, when asked for the installation method click “clean install”. Eventually you will see this screen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tpYic5x2XqvkNg-WUoMweQ.png" /></figure><p>At this point click restart, but make sure to remove the Flash drive after the device shuts down.</p><p>And thats it, pop os will guide you through some additional configuration setups, but that’s all you need to do to install it, <strong>including your graphic drivers</strong>.</p><h3>Improve your Pop_OS! experience</h3><p>Pop os is amazing as is, but there are couple of things about it i purticulary dont like, so these are the stuff i use to fix these problems.</p><h4>Dash to panel.</h4><p>I hate how thick the bottom panel of Gnome is. But as with many things in Linux this is customizable. To do this we will be using a gnome extension.</p><p><em>(Gnome is the desktop environment used on Pop os, gnome extensions are a way to change the look and behavior of Gnome)</em></p><p>You need to install a couple of things to use gnome extensions.</p><p>Gnome tweaks => Go to your Pop show (Press meta/windows key to open search and search for shop) and search for “Gnome tweaks” click on it and click install.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WRrOqWsOR2dcEc5lZdi47Q.png" /></figure><p>Gnome Extension Manager=> Same as gnome tweaks install Gnome extension manager</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6pEH7QBz2q-AWnowMjpm2g.png" /></figure><p>Open the gnome extension manager, Make sure the user extension switch is turned on. Goto browse and search for “dash to panel”. Click install. Go back to the installed section, turn off cosmic dock, and turn on dash to panel. You should see all your icons on the top panel now. Much better!</p><h4>KDE Connect</h4><p>This is an amazing app that let’s your mobile device and pc communicate with each other. You can share clipboard, files, notifications etc using kde connect. Simple use the pop store to download KDE connect on your pc and use the play store/app store to download the KDE connect app.</p><p>To learn more about creating an Apple like ecosystem between your mobile and Linux pc check <a href="https://medium.com/@tharushajayasooriya/create-an-apple-like-ecosystem-with-linux-and-android-8b69e6941dc9">this article</a>.</p><h4><strong>If you are on a Nvidia and Intel on-board graphics hybrid system (Most laptops)</strong></h4><p>Make sure you turn on hybrid graphics. This will make your device use the onboard graphics by default and you and use the Nvidia graphics if you want. This will improve your battery life substantially.</p><p>Enjoy ✌🏽</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0854199c5899" width="1" height="1" alt="">]]></content:encoded>
</item>
<item>
<title><![CDATA[An extension that should be a default on every Gnome desktop.]]></title>
<link>https://tharushaj.medium.com/an-extension-that-should-be-a-default-on-every-gnome-desktop-320405f8c8a0?source=rss-b89f1b6ae87c------2</link>
<guid isPermaLink="false">https://medium.com/p/320405f8c8a0</guid>
<category><![CDATA[desktop-environments]]></category>
<category><![CDATA[linux]]></category>
<category><![CDATA[desktop]]></category>
<category><![CDATA[ubuntu]]></category>
<category><![CDATA[gnome]]></category>
<dc:creator><![CDATA[Tharusha Jayasooriya]]></dc:creator>
<pubDate>Sun, 29 Sep 2024 09:20:30 GMT</pubDate>
<atom:updated>2024-09-29T09:24:49.641Z</atom:updated>
<content:encoded><![CDATA[<p>I don’t know about you, but I want as much screen real estate as possible when working, especially on a laptop or a single monitor setup. But the default configuration of Gnome desktop does not seem to agree with this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jSHTWmxBwVYv7LFPC3Xa6A.png" /></figure><p>Why is that top bar so empty? Why is the dock so thick? also completely unrelated but why the f are there no minimize and maximize buttons on windows by default? Maybe it's an attempt to imitate a popular operating system’s UI. Whatever the reason is this really bothered me, and in my search for a solution I found one in the form of a gnome extension. Introducing,</p><h3>Dash To Panel</h3><p>“T<em>his extension moves the dash into the gnome main panel so that the application launchers and system tray are combined into a single panel, similar to that found in KDE Plasma and Windows 7+.</em>”</p><p>Sounds like heaven to me. And the difference is day and night. You no longer have two different bars on both sides of your monitor you only have one on whichever side you choose.</p><p>You can even make it thinner to save even more space.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vEd2TF7pkV4AVudb9VhImA.png" /></figure><p>Look at all that freedom! Also, the amount of customizability this extension gives you is amazing. This is my current configuration.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hSLJcfVCgFU7uAFSq274Yw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G3PiMiF-TUxFUOLFQPWUGA.png" /></figure><p><a href="https://extensions.gnome.org/extension/1160/dash-to-panel/">Here’s</a> a link to the extension. Enjoy ✌🏽</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=320405f8c8a0" width="1" height="1" alt="">]]></content:encoded>
</item>
<item>
<title><![CDATA[Is Ethereum scalable?]]></title>
<link>https://tharushaj.medium.com/is-ethereum-scalable-f92d02fdb741?source=rss-b89f1b6ae87c------2</link>
<guid isPermaLink="false">https://medium.com/p/f92d02fdb741</guid>
<category><![CDATA[eth]]></category>
<category><![CDATA[blockchain]]></category>
<category><![CDATA[ethereum]]></category>
<category><![CDATA[crypto]]></category>
<category><![CDATA[cryptocurrency]]></category>
<dc:creator><![CDATA[Tharusha Jayasooriya]]></dc:creator>
<pubDate>Thu, 15 Aug 2024 10:08:30 GMT</pubDate>
<atom:updated>2024-08-15T10:08:30.017Z</atom:updated>
<content:encoded><![CDATA[<h3>Introduction</h3><p>In July of 2024, the cryptocurrency network Ethereum hits its highest-ever TPS (Transaction per second). When you look at this graph it’s obvious that Ethereum is on the rise when it comes to TPS.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-iv9rtgpY8QK1aHz" /></figure><p>But how did Ethereum manage to hit such high numbers?</p><p>In this guide, we’ll dive into these concepts and try to understand why scalability matters and the different scaling solutions Ethereum uses to achieve these milestones.</p><h3>The Blockchain Trilemma</h3><p>To understand the blockchain trilemma, we need to first understand whats know as the “<strong>blockchain trifecta</strong>”. Which are</p><ol><li>Scalability</li><li>Security</li><li>Decentralization</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/467/0*7I9OJ7NE6I8qfjRR" /></figure><p>Much like how you hear about people struggling to balance social life, work, and sleep, the blockchain community believes that truly decentralized networks need to choose between security and scalability to be decentralized. This is called the blockchain trilemma.</p><p>For Ethereum decentralization is key. So Ethereum has chosen to provide high security and proper decentralization at the cost of low scalability.</p><h3>Addressing scalability</h3><h4>L1 and L2</h4><p>L1 or Layer 1 is the base of every blockchain. Ethereum and Bitcoin are examples of L1 blockchains.</p><p>L2 or layer 2 scaling solutions are systems that work on top of L1 systems to provide additional functionality.</p><p>L1 scaling solutions are then used in conjunction with layer 2 solutions to bring more scalable blockchains. Let’s look at each of these layers separately to understand the underlying technology used in each layer.</p><h4>L1 scaling solutions</h4><p>These solutions are also known as on-chain scaling since they refer to any direct modifications made to a blockchain to improve its throughput. L1 solutions involve enhancing the base protocol of the blockchain to accommodate a higher number of transactions per second.</p><p>These L1 solutions include shrading. This is the process of splitting the network into smaller, more manageable parts called shards.</p><p>Although other solutions like SegWit exist, Ethereum does not rely on these technologies.</p><h4>L2 scaling solutions</h4><p>L1 solutions alone face limitations in TPS, causing instability in the network and higher gas fees. To address these issues improve the stability of the network and keep gas costs down L2 scaling solutions have been introduced.</p><p>Some of the scaling solutions built into L2 include,</p><ul><li><strong>Nested blockchain:</strong></li></ul><p>Also known as plasma chains, this solution relies on blockchains that contain other blockchains in a parent-child blockchain relationship.</p><p>These solve the scalability issue by offloading certain transactions that need particular resources to other specialized blockchains.</p><ul><li><strong>State channels</strong></li></ul><p>These are essentially private and temporary communication channels established between two parties.</p><p>These solve the scalability issue by conducting transactions without the need to record each transaction on the main blockchain.</p><ul><li><strong>Rollups</strong></li></ul><p>This solution combines multiple transactions into a single transaction.</p><p>They solve the scalability issue by reducing the amount of data that needs to be processed and stored on the main chain. These are of two types.</p><h4>Optimistic Rollups</h4><p>These sit parallel to the blockchain and assume all transactions are valid hence the name “optimistic”. If the transaction is suspected to be invalid they simply revert back to the main blockchain to validate the transaction. These have something called a challenge period. Transactions are bundled and executed on Layer 2 if no fraud is detected within a challenge period.</p><h4>zk-Rollups</h4><p>zk-Rollups or zero Knowledge rollups use a cryptographic technique known as zero-knowledge proof to validate transactions. Transactions are bundled and accompanied by a cryptographic proof that verifies their correctness without revealing transaction details. This results in much cheaper and faster transactions, since it does not have to wait for a challenge period.</p><h3>Why scalability matters</h3><p>When the user base grows systems need to adapt to this new demand of resources. This adaptation is called scaling. As the technology gets complex scaling that technology also becomes increasingly complex.</p><p>It’s no different when it comes to blockchains. These blockchains only have a limited block space. When demand for transactions exceeds this capacity, users (validators) compete for inclusion.</p><ul><li><strong>Gas price</strong></li></ul><p>Due to this inclusion, users increase their gas prices to prioritize their transactions. This creates a bidding war, driving up gas costs for everyone. This is why during peak activity gas prices can skyrocket.</p><ul><li><strong>Unpredictability</strong></li></ul><p>Gas costs become highly volatile and unpredictable, complicating user experience and application design.</p><ul><li><strong>Better dApps</strong></li></ul><p>Better scalability allows for more diverse and complex applications on the blockchain.</p><ul><li><strong>User experience</strong></li></ul><p>Faster transaction processing and confirmations improve usability. Faster transactions can also enhance the user experience.</p><h3>FAQ’s</h3><h3>Is Ethereum scalable?</h3><p>While Ethereum has faced scalability challenges, the ecosystem is rapidly evolving. Layer 2 solutions have emerged as the primary scaling solution. These offer significant transaction speed and gas cost reduction.</p><h3>What is Off-chain and on-chain?</h3><p>Any transactions that are directly recorded on the blockchain are on-chain transactions. Every transaction, from sending ETH to interacting with smart contracts, is permanently recorded on the Ethereum mainnet. Token transfers and NFT mining (mining NFTs directly on Ethereum) are examples of on-chain transactions.</p><p>Any transaction that occurs outside the main blockchain is called off-chain. These transactions happen on separate networks or platforms that interact with the main chain.</p><p>State channels are an example of off-chain transactions. These are direct payment channels between parties, where only the opening and closing transactions occur on-chain.</p><h3>What is Ethereum 2.0?</h3><p>Ethereum 2.0 is an informal name used to describe a major set of upgrades designed to make the network more scalable, efficient, and environmentally friendly.</p><p>The main upgrade was the consensus Mechanism which used to be Proof of Work (PoW) before and was changed to Proof of Stake (PoS) in this update. This happened on September 15th, 2022. This was also known as “<a href="https://ethereum.org/en/upgrades/merge/">The Merge</a>”.</p><p>The Ethereum foundation prefers to call the new upgraded system “Ethereum” and, the new consensus layer as ETH 2 and the execution layer as ETH 1.</p><h3>How will Ethereum 2.0 affect scalability?</h3><p>Transferring to PoS will significantly reduce energy consumption which will in turn improve scalability. Along with new technologies such as Danksharding, Ethereum 2.0 is a significant improvement over Etherrium 1.0 in terms of scalability.</p><h3>What’s better PoS or PoW?</h3><p>While PoS is known for its low energy consumption and increasing accessibility, PoW is still being used widely due to PoS consensus mechanisms stake centralization issues.</p><h3>What is The Ethereum roadmap?</h3><p>The Ethereum roadmap outlines the specific improvements that will be made to the protocol in the future</p><h3>Conclusion</h3><p>The Ethereum ecosystem is rapidly evolving. As the technology matures, we can expect to see increased adoption of layer 2 solutions, leading to a more scalable and efficient Ethereum network.</p><p>According to the <a href="https://ethereum.org/en/roadmap/">Ethereum website</a>,</p><p><em>“</em><strong><em>Regular users are not required to actively participate in an upgrade, nor are they required to do anything to secure their assets</em></strong><em>”</em></p><p>But, it’s important for both developers and regular users to understand the developments in the Ethereum network for better decision-making.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o07EVCXh5J74gKkmLXR_Fw.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f92d02fdb741" width="1" height="1" alt="">]]></content:encoded>
</item>
<item>
<title><![CDATA[How secure is Ethereum?]]></title>
<link>https://tharushaj.medium.com/how-secure-is-ethereum-b76f4b2a9d15?source=rss-b89f1b6ae87c------2</link>
<guid isPermaLink="false">https://medium.com/p/b76f4b2a9d15</guid>
<category><![CDATA[blockchain]]></category>
<category><![CDATA[web3]]></category>
<category><![CDATA[ethereum]]></category>
<category><![CDATA[security]]></category>
<category><![CDATA[cryptocurrency]]></category>
<dc:creator><![CDATA[Tharusha Jayasooriya]]></dc:creator>
<pubDate>Sat, 10 Aug 2024 04:52:55 GMT</pubDate>
<atom:updated>2024-08-10T04:58:51.135Z</atom:updated>
<content:encoded><![CDATA[<h3>Introduction</h3><p>Blockchain security refers to the procedures and systems blockchains use to protect the blockchain and mitigate fraud.</p><p>Due to the decentralized nature and the use of cryptography, blockchains are generally secure. In fact, the reason most people use blockchains is to share data in a secure and tamper-proof way. Ethereum is no different.</p><p>But this does not mean blockchains like Ethereum are fail-proof. In this article, we’ll discuss different techniques blockchains use to secure their networks as well as how they can fail.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*QcbwK842h2kRrc-a" /></figure><h3>How is Ethereum secured?</h3><p>Ethereum like many other blockchains uses many techniques and systems to make their network secure. Some of these techniques include.</p><h4>Proof of Stake (PoS) consensus</h4><p>Ethereum transitioned from Proof-of-Work to Proof-of-Stake in 2022 as part of a set of upgrades typically referred to as “<a href="https://metana.io/blog/what-is-ethereum-2-0-eth-2-0-and-how-has-it-changed-the-world/">Ethereum 2.0</a>”. In PoS, validators stake their ETH to participate in block validation. Users who want to become validators lock up a certain amount of their stake in a smart contract. This is known as the “stake”.</p><p>Ethereum will then randomly choose a validator to create the next block. The more eth the user puts as stake the more likely the user will be able to create the block.</p><p>This system enhances security by making attacks economically unfeasible, as malicious actors would need to stake and potentially lose a large amount of ETH.</p><p>Also if a user is suspected of being malicious, they risk losing a portion or all of their staked ETH. This severe penalty discourages bad actors.</p><h4>Decentralization</h4><p>Ethereum is a decentralized blockchain platform. This means Ethereum isn’t operated or managed by any centralized entity instead consists of thousands of nodes that exist as a peer-to-peer network.</p><p>This distributed nature means that even if some nodes are compromised or go offline, the network continues to function. This also makes it incredibly difficult for a single entity to take control or manipulate a large part of the blockchain.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d10D9cLD2fMGOiQZDjg96A.jpeg" /><figcaption>Illustration showing blocks in the blockchain</figcaption></figure><h4>Use of Cryptography</h4><p>Cryptography is a technology used in many forms of applications for sharing and storing data securely. They use keys that are only known by certain parties to encrypt those valuable data.</p><p>Ethereum uses many cryptographic technologies in its operations. For instance,</p><ul><li><strong>Elliptic Curve Digital Signature Algorithm (ECDSA)</strong> for creating and verifying digital signatures, ensuring that only the owner of a private key can initiate transactions from their account.</li><li><strong>Keccak-256 hash function</strong> for generating unique identifiers for blocks, transactions, and addresses.</li></ul><h4>Slashing mechanisms</h4><p>This is part of the PoS consensus mechanism used on Ethereum. Essentially the slashing mechanism refers to the process of rewarding validators for contributing to the network, while also penalizing bad actors on the network. This is designed to deter validators from dishonest behavior.</p><p>According to <a href="https://beaconcha.in/validators/slashings">Beaconcha</a> as of August 2024, 439 validators have been slashed out of 916,000 active validators.</p><h4>Continuous updates and improvements</h4><p>Ethereum undergoes regular upgrades through a process of Ethereum Improvement Proposals (EIPs). These proposals include upgrades to aspects such as security and scalability. <a href="https://eips.ethereum.org/">List of ongoing EIPs</a>.</p><p>These ongoing improvements help Ethereum adapt to new challenges and maintain its security in the face of evolving threats.</p><h3>How can Ethereum security fail?</h3><p>Much like any other system, security fails of these systems always come down to two reasons. Vulnerabilities within the system itself, or due to certain actions performed by their users.</p><p>In the Ethereum world, you can think of them as vulnerabilities within the Ethereum network or issues with smart contracts and validators.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w_4PbtLNI-_SgiYw9MwPLw.jpeg" /></figure><h4>Vulnerabilities within the Ethereum network</h4><p>To understand these vulnerabilities let’s look at some previous attacks</p><ul><li>In 2016, an attacker exploited the reentrancy vulnerability to steal about US$60M.</li></ul><p>The vulnerability occurs when an external callee contract calls back to a function in the caller contract before the caller contract finishes. This allows the attacker to bypass the due validity check until the caller contract is drained of Ether or the transaction runs out of gas.</p><ul><li>In July 2017, a vulnerability in the Parity wallet contract caused the loss of US$31M</li></ul><p>A function called “innitWallet” within the WalletLibrary was exploited to change some high-profile contract owners. The attacker exploited this and simply changed the contract’s m_owners state variable to a list containing only their address.</p><h4>Vulnerabilities within smart contracts and validators</h4><p>Smart contracts are pieces of code that govern the behavior of transactions in the blockchain. These are built on top of the Ethereum network.</p><p>Some of the vulnerabilities found within smart contracts :</p><h4>Improper Signature Verification</h4><p>Networks like Ethereum rely heavily on signature verification. This signature acts as a digital fingerprint, proving their ownership and authorization.</p><p>Smart contracts developed with improper signature verification can lead to unauthorized access to funds.</p><h4>Signature Malleability</h4><p>This exploit lets attacked bypass security checks and access funds by altering the cryptographic signature of a transaction without affecting its validity.</p><p>To learn more about improper signature verification and signature malleability, read <a href="https://metana.io/blog/how-do-signatures-and-malleability-impact-web3-security/">this</a> article.</p><h4>Other vulnerabilities</h4><p>In April 2018, the MyEtherWallet wallet fell victim to a BGP and DNS hijacking attack, enabling the hacker to steal US$17M. DNS servers were hijacked to redirect users trying to access myetherwallet.com to a malicious server, which proceeded to empty the user’s wallet.</p><h3>How to improve Ethereum security?</h3><p>The Ethereum team continues to improve the security of the network. The Ethereum Foundation is currently working on security implementations such as <a href="https://ethresear.ch/t/view-merge-as-a-replacement-for-proposer-boost/13739">view merging</a> and <a href="https://ethereum.org/en/roadmap/single-slot-finality/">Single slot finality (SSF)</a>.</p><h4>For developers</h4><p>Smart contract developers directly contribute to the security of the Ethereum network, since the end user will likely use these 3rd party smart contracts and dApps to do transactions within the Ethereum network.</p><p>Developers need to follow secure coding practices and thorough tests before they make smart contracts public. They also need to upgrade and maintain these smart contracts so users won’t be victims of newer vulnerabilities.</p><p>To learn about common solidity security vulnerabilities & how to avoid them, read <a href="https://metana.io/blog/common-solidity-security-vulnerabilities-how-to-avoid-them/">this article</a>.</p><h4>For end users</h4><p>Most of the Ethereum-related scams are done by bad actors taking advantage of the misunderstanding most end users have surrounding blockchain technologies.</p><p>Most common attacks like giveaway scams and phishing scams can be avoided by following some very simple steps such as,</p><ul><li>Keeping private keys to yourself and never sharing them,</li><li>Using a hardware wallet,</li><li>Double-check transactions before sending,</li><li>Setting smart contract spending limits.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5rHU_6B1dHEIOjgAd8am9w.jpeg" /><figcaption>Hardware wallets, Ledger, and TREZOR</figcaption></figure><p>For tips to avoid crypto scams read <a href="https://metana.io/blog/protect-yourself-from-rug-pulls-tips-to-avoid-crypto-scams/">this article</a>.</p><h3>FAQ’s</h3><h4>How safe are smart contracts?</h4><p>Smart contract safety depends on the quality of the code and the diligence of the developers. While many contracts are secure, vulnerabilities can and do occur, sometimes leading to significant losses.</p><h4>How can I check if a smart contract is secure?</h4><p>You can look for published security audits, check if the contract’s code is verified on block explorers, and research the reputation of the project and its developers.</p><h4>What are digital signatures?</h4><p>These are mathematical schemes for verifying the authenticity of digital messages and documents. Digital signatures rely on public key cryptography.</p><h4>Are Ethereum transactions anonymous?</h4><p>Ethereum transactions are pseudonymous, not anonymous. While addresses aren’t directly linked to real-world identities, transaction patterns, and other on-chain data can potentially be used to identify users.</p><h4>What is a 51% attack?</h4><p>A 51% attack is when an entity controls more than 51% of the network’s validation power. Due to the PoS consensus mechanism used in Ethereum taking control of 51% of the network is economically infeasible.</p><h4>What is The Ethereum roadmap?</h4><p>The Ethereum roadmap outlines the specific improvements that will be made to the protocol in the future</p><h3>Conclusion</h3><p>Although by design Ethereum is meant to be a secure network, fraudulent activities still happen, either due to the network fault or due to badly designed smart contracts and user error.</p><p>It is important for developers and/or end users to understand these vulnerabilities and flaws in the network so that we can avoid these attacks and inspire trust within the blockchain ecosystem.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b76f4b2a9d15" width="1" height="1" alt="">]]></content:encoded>
</item>
<item>
<title><![CDATA[How search engines work, The absolute basics of indexing and retrieval.]]></title>
<link>https://tharushaj.medium.com/how-search-engines-work-the-absolute-basics-of-indexing-and-retrieval-7ff3f084cb4c?source=rss-b89f1b6ae87c------2</link>
<guid isPermaLink="false">https://medium.com/p/7ff3f084cb4c</guid>
<category><![CDATA[data-analysis]]></category>
<category><![CDATA[mathematics]]></category>
<category><![CDATA[data-science]]></category>
<category><![CDATA[algorithms]]></category>
<category><![CDATA[search-engines]]></category>
<dc:creator><![CDATA[Tharusha Jayasooriya]]></dc:creator>
<pubDate>Wed, 17 Jul 2024 15:41:30 GMT</pubDate>
<atom:updated>2025-05-07T04:46:14.428Z</atom:updated>
<content:encoded><![CDATA[<p>Imagine you’re looking for a single sentence in a library containing every book ever written. Sounds impossible, right? Yet, that’s essentially what search engines do every day, looking through billions of web pages to find exactly what you’re looking for in a fraction of a second. It’s like having a super-powered librarian who can read every book simultaneously and instantly point you to the exact page you need.</p><p>But how do they work. Let’s break down how a simple search engine would work step by step.</p><h3>Step 1. Document Crawling and Preprocessing</h3><p>In data science ETL stands for Extract, Transform and Load. This essentially is the first few steps in a search engine algorithm.</p><h4>Step 1.1 Extract</h4><p>Search engines like Google and Bing systematically browse and download billion of websites. They use programs know as <strong>web crawlers</strong> to follow links and discover these pages. In the most basic search engines only text is extracted from these websites. Modern search engines like Google use computer vision to parse information from images within those websites as well. Additionally metadata such as meta descriptions and titles may also be extracted.</p><h4>Step 1.2 Transform</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*JwERFlHxiAqyrQqFj7ksuw.jpeg" /></figure><p>In this stage those extracted text is altered. Following are some of the processes done in this stage.</p><ul><li>Tokenization: Breaking text into individual words or terms.</li><li>Lowercasing: Converting all text to lowercase for consistency.</li><li>Stopword removal: Removing common words like “the” or “and” that don’t carry significant meaning.</li><li>Stemming or lemmatization: Reducing words to their root form (e.g., “running” to “run”). Lemmatization is much more effective than stemming although it also required significantly more processing power and time.</li></ul><h3>Step 2.Load</h3><p>In the load stage those parsed data is then stored in a format optimized for quick retrieval.</p><h3>Step 2.1 Inverted Indexing</h3><p>Instead of iterating through every document looking for a word, it’s much quicker to keep track of every document in which a certain word appears. Inverted index table does exactly this. It keeps a record of every unique term and the documents it appears in. This is an example of a Inverted Index table</p><p>word_1 | doc_1,doc_99,doc_6789</p><p>word_2 | doc_99,doc_890,doc_7789</p><p>word_3 | doc_1,doc_99,doc_100</p><p>word_4 | doc_4,doc_6,doc_80</p><p>If the user does a query like “word_1 word_3” then the search algorithm know it only needs to retrieve information about doc_1, _doc_99 and doc_6789, doc_100 instead of all the other documents.</p><h3>Step 2.2 Term Frequency-Inverse Document Frequency (TF-IDF)</h3><p>This fancy set of words refers to a technique that allows to determine how important a word is within a set of document.</p><p><strong>Term Frequency (TF): How often a term appears in a document. Formula for TF is as follows.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/585/1*FiXrArFDmOrcHJGtpWBK8w.png" /></figure><p><strong>Inverse Document Frequency (IDF): Measures how common or rare a term is across all documents. The formula is as follows.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/518/1*U9C7QfcJPXFeSrtypel8DA.png" /></figure><p>Corpus is a word used to refer to the entire collection of documents.</p><p><strong>TF-IDF is calculated by simply multiplying these two values.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/567/1*sTlLiCS_lNbLEdx0OXf7Pg.png" /></figure><p>What these search engine algorithms do is they pre-calculate and store these tf-idf values for every unique word in the entire database. This way those values can then be retrieved extremely fast and can be used to find and rank document relevant to a query.</p><p>At this point what need to be stored to make the search engine work is done. Or in another words, for this set of documents Load is completed.</p><h3>Step 3. Document Ranking</h3><p>This is where the math gets a bit confusing, but I’ll try my best to explain it.</p><p>If the query is just a single word its as easy as</p><ol><li>Use inverted index table to look up for all appearances on that word</li><li>Sort the result by TF-IDF score for that particular term and return the top N number of document.</li></ol><p>(To be clear this is how a very basic search engine algorithm would do this)</p><p>When the query consists of a bunch of terms this gets much more complicated.</p><h3>Step 3.1 Query Processing</h3><p>When the user enters a query. The search algorithm, first performs step 1.2 for the query in order to clean it up. Then TF value for the query is also calculated. An adjusted formula looks something like this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/515/1*65IJB4i0s-OpwR5flkbBYw.png" /></figure><h3>Step 3.2 Vector representation</h3><p>The purpose of this step is to bring together all the values we calculated so far and use them all to mathematically find the most relevant documents. To do this, search algorithms use vector mathematics.</p><p>Imagine a document as a unique point in a high-dimensional space. Each dimension (axis) corresponds to a unique keyword in our entire document collection (Corpus).</p><p>The value of a particular point (or a document), is the TF-IDF value of a term (or a axis). Higher TF-IDF scores translate to higher values on that particular dimension in the vector space. Kind of like this,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*b02ivpKttbtlXvC2xXDiXQ.png" /></figure><p><em>The above example shows a 2 dimensional example, meaning only a two words are considered. In a real example this will be a high dimensional graph.</em></p><p>Now imagine the query TF-IDF values we discussed earlier in 3.1 also, represented in this same graph.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*lvc8thMaGG-gp_BO55l6Mg.png" /></figure><h3>Step 3.3 Cosine Similarity</h3><p>Now, with both documents and queries represented as vectors, cosine similarity comes into play. The formula for cosine similarity between two vectors, DocVector (representing a document) and QueryVector (representing the user’s query), is as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/501/1*WlUrncG_LUdhWz6zFhrrDw.png" /></figure><p>Like this cosine similarity is calculated to each document with the query.</p><p><strong>Documents with higher cosine similarity scores are considered more relevant to the query.</strong></p><h3>Step 4. Result Presentation</h3><p>And that leads us to the final step. It’s as simple as sorting those cosine similarity score by high to low and presenting a particular number of results. 🎉</p><p>Now, it’s important to understand that modern search engines like Google and Bing have evolved far beyond the basic example we’ve discussed. They employ numerous advanced techniques and technologies like Machine Learning and AI, personalized results and knowledge graphs to provide more accurate, relevant, and personalized results.</p><p>Thank you for reading.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7ff3f084cb4c" width="1" height="1" alt="">]]></content:encoded>
</item>
<item>
<title><![CDATA[Set up animated wallpapers on Linux (Gnome/KDE)]]></title>
<link>https://tharushaj.medium.com/how-to-get-live-wallpapers-on-linux-gnome-kde-c52282d719fa?source=rss-b89f1b6ae87c------2</link>
<guid isPermaLink="false">https://medium.com/p/c52282d719fa</guid>
<category><![CDATA[aesthetics]]></category>
<category><![CDATA[open-source]]></category>
<category><![CDATA[wallpaper]]></category>
<category><![CDATA[linux]]></category>
<dc:creator><![CDATA[Tharusha Jayasooriya]]></dc:creator>
<pubDate>Fri, 27 Oct 2023 05:28:30 GMT</pubDate>
<atom:updated>2024-06-30T07:34:06.992Z</atom:updated>
<content:encoded><![CDATA[<p>I recently discovered an amazing piece of software that lets you <strong>pick any video file as your desktop background</strong> for your Linux.</p><h3>Hidamari ーひだまりー</h3><p><a href="https://github.com/jeffshee/hidamari">This</a> open source python program is what allows us to set a live wallpaper. To install;</p><p>First open a terminal and run</p><pre> flatpak --version</pre><p>If you get an output like “Flatpak 1.14.4” then you have <a href="https://flatpak.org/">Flatpak</a> already installed. If you get something like “command not found” then you need to install flatpak first.</p><p><strong>If you already have Flatpak installed</strong>. Open a terminal and run;</p><pre>flatpak install flathub io.github.jeffshee.Hidamari</pre><p>If you don’t, go to <a href="https://flatpak.org/setup/">this</a> website and click on your distribution. It will give you a detailed list of instructions to install Flatpak on your system. <strong>Then run the above command to install Hidamari</strong>.</p><h3>Setting up your live wallpaper</h3><p>First go to your application menu and search for “Hidamari” and launch it. Or run,</p><pre>flatpak run io.github.jeffshee.Hidamari</pre><p>from a terminal. <em>On my system (Pop_os 22.04 GNOME with Nvidia Proprietary drivers) it takes around a 1–2 minutes to Hidamari app to launch. I have no idea why.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JTfOMl17JRdBmOwpFKtRKA.png" /></figure><p>Click on the folder icon on the top left and browse for the video file you want as your background.</p><p>You can find many of these on YouTube. You can use a website like <a href="http://yt1s.com/">this</a> to download them. Or you use many <a href="https://mylivewallpapers.com/">other websites</a> to get live/animated wallpapers. <a href="https://www.youtube.com/watch?v=2wIACHP04qQ&list=PLFAoLYoZ_IxY3mMaG0X9OrvJFyVHSOZRn">Here’s</a> a playlist of wallpapers I really enjoy !</p><p>In the Hidamari app, click on the video thumbnail and click “Apply” to apply. You can also stream a video or a web page (including WebGL games) using the tabs above as well. (<em>You need a constant internet connection to do this</em>).</p><p><em>Please note that according to their GitHub page, Hidamari </em><strong><em>works on Wayland </em></strong><em>as well, but I haven’t tried it. It works perfectly with my X11 Gnome.</em></p><p><strong>If you enjoy this application, please consider </strong><a href="https://www.buymeacoffee.com/jeffshee"><strong>supporting them</strong></a><strong>!</strong></p><p>And that’s it ! If you have issues, you can check their <a href="https://github.com/jeffshee/hidamari">GitHub page</a> or leave a comment, and I’ll try and answer it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KJzgFddeMYdy-xMt2cWdSA.png" /></figure><p>I you enjoyed this read, consider <a href="https://buymeacoffee.com/tharushaj">supporting me</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c52282d719fa" width="1" height="1" alt="">]]></content:encoded>
</item>
<item>
<title><![CDATA[Create an Apple like ecosystem with Linux and Android]]></title>
<link>https://tharushaj.medium.com/create-an-apple-like-ecosystem-with-linux-and-android-8b69e6941dc9?source=rss-b89f1b6ae87c------2</link>
<guid isPermaLink="false">https://medium.com/p/8b69e6941dc9</guid>
<category><![CDATA[linux]]></category>
<category><![CDATA[linux-tutorial]]></category>
<category><![CDATA[android]]></category>
<category><![CDATA[ecosystem]]></category>
<category><![CDATA[apple]]></category>
<dc:creator><![CDATA[Tharusha Jayasooriya]]></dc:creator>
<pubDate>Sun, 15 Oct 2023 14:54:14 GMT</pubDate>
<atom:updated>2024-06-30T07:34:46.319Z</atom:updated>
<content:encoded><![CDATA[<p>We’ve all heard and seen how great and useful the Apple ecosystem can be. But for those who don't have an iPhone and a macOS device, a Linux-Android ecosystem might be a viable option.</p><p>In this article, we’ll take a look at a set of tools that lets you,</p><ul><li><strong>Share files seamlessly and wirelessly between your devices</strong></li><li><strong>Sync notification between devices (Including replying to messages from your pc)</strong></li><li><strong>Pause play media on your pc with phone</strong></li><li><strong>Use one keyboard and Mouse between devices (Yes, even on your mobile phone)</strong></li><li><strong>Share clipboard</strong></li></ul><p>and many more…</p><p>All of these can be achieved by installing a few software and tweaking some very simple settings on your Linux machine.</p><p>The first software we will install which by itself provide most of the features we talked about is called “<strong>KDE connect</strong>”.</p><h3>1.KDE connect</h3><blockquote>KDE Connect is a multi-platform application developed by KDE, which facilitates wireless communications and data transfer between devices over local networks.</blockquote><p>Although the name might imply, you <strong>do not need to have the KDE Desktop Environment to run KDE connect.</strong></p><p>To install on Linux, go to your application center on your Linux desktop and search for “KDE connect” and install it there. Or if you want to use your terminal look for a package called kdeconnect-kde, kdeconnect-plasma, just kdeconnect or kde-connect in your distribution repo. For example, on Debian it's justsudo apt install kdeconnect.</p><p>KDE connect also requires you to have the KDE connect app installed on your phone. To do so, go to Google Play Store and search for kde connect and install it there. You can also use the F-droid app as well (to get updates automatically). Or you can find the apk file <a href="https://f-droid.org/packages/org.kde.kdeconnect_tp/">here</a>.</p><p>After installing on both devices, open the kde app in your phone and look in available devices, you will find your pc there. Click on it and click on “<em>request pairing</em>”. A notification will pop up on your Linux desktop and ask you for permission to connect, click allow.</p><p>If the notification didn't show up, look for kde connect on your application menu on Linux and try running “request pairing” from your android device again.</p><h4>Setting up kde connect to achieve these features.</h4><p>Some of these feasters are disabled by default on kde connect, to enable them you need to enable them on both pc and android side. On Linux, open kde connect app and clicking plugin setting and enabling those features there. On android, click on the three dots and click plugin settings.</p><p>The app will also need some permission to perform some tasks. Upon opening the android app, you will be seen the following screen. You can click on each of these and follow the instructions, the app provides.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/350/1*BTpEjRHQeIMsxnGLfXoDEQ.png" /><figcaption>kde connect permissions</figcaption></figure><p><strong>To set up your primary mobile storage as a storage location:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VbQGiRCr-R7GSndaQOIdGw.png" /><figcaption>How to set your primary mobile storage as a storage location</figcaption></figure><h4>On your Linux,</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/445/1*VWU3ggyqAdkaWkKVueAbTA.png" /><figcaption>KDE connect tray icon</figcaption></figure><p>Click on the mobile phone icon on your Linux desktop panel, then the hamburger menu and click browse this file. And just like that, you have access to your entire mobile file system wirelessly.</p><p><strong>With this you can now share clipboard, control the media player on your pc with your phone, sync notification, pause media on call and many more…</strong></p><h3>2. Sharing a single keyboard and mouse (Universal Control)</h3><p>The next part of this tutorial will be setting up universal keyboard and mouse. You can do this with KDE connect, but this method let you simple drag your mouse outside your monitor into your phone screen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/690/1*xqJeRuZfd48mhLAHZDL2LQ.gif" /><figcaption>Universal control</figcaption></figure><h4>Unfortunately, the simplest way to achieve this involves using a paid proprietary software called DeskDock.</h4><p><em>A free version of DeskDock is available, but it only allows you to share a mouse and not the keyboard.</em></p><p>To proceed, you need to unlock USB debugging on your phone, to do so;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mp1bM0Mp7qReXMY0Slt30A.png" /><figcaption>Enabling USB debugging on android</figcaption></figure><p>Now head to Google Play Store and install the DeskDock app.</p><p>On your Linux computer, First install ADB (Android Development Bridge). Simply use your distribution's package manager to install adb. On Debian, it’s sudo apt install adb.</p><p>You also need Java JRE 1.7 or above to run DeskDock on Linux. To check whether you have it run java --version. If you get something like “openjdk …” you already have it installed. If not, you need to install it first. This also varies on different systems (<em>a simple google search will probably lead you to a tutorial on how to do thi</em>s). On Debian, it's sudo apt install default-jre.</p><p>Next up is connecting your devices through ADB. Unfortunately, you need to do this every time either your phone or your pc reconnects to your Wi-Fi.</p><p>For the initial set-up, you need to connect your pc and android device with a USB cable. If you had USB debugging enabled as show before, you will be prompted asking whether you want to trust the connected device. Click Allow. On your Linux terminal, run adb devices. You should see something that looks like this,</p><pre>List of devices attached<br>3300d0315750948d device</pre><p>Now you need to change this connection so that the ADB is connected wirelessly. Here's a simple shell script to do that.</p><pre>ip_addr=$(adb shell ip addr show wlan0 | grep "inet\s" | awk '{print $2}' | awk -F'/' '{print $1}') #look for you'r phones ip address<br>echo $ip_addr<br>port=5555 <br>adb tcpip $port #starting adb in tcptip on port 5555<br>adb connect "${ip_addr}:${port}" #connecting to your phone<br>adb devices</pre><p>To run this, first create a .sh file and paste this text into it (using a text editor like vim or nano). Make the file executable by running chmod +x ./<file_name>.sh. Then run the file with./<file_name>.sh. (Your phone need to be connected via USB when you run this script). You should get an output like “connected to 192.168.1.2:5555”. If not, you might have run the script a couple more times.</p><p>Next, go to <a href="https://www.fdmobileinventions.com/deskdock-server/">this</a> page and scroll down and click on Linux. Extract the zip file you just downloaded. To run DeckDock run :</p><p>java -jar <desk_dock_jar_download_location>.jar</p><p>Now simply click the connect button on the DeskDock mobile app, and you should be good to go. Simply drag your mouse to the right bottom and drag it outside your monitor, your cursor should appear on your phone. You can change the layout by right-clicking on the new icon on your system tray and clicking on settings.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/536/1*1w2jS9VsFxHkKdQaY0yozQ.png" /><figcaption>DeskDock settings</figcaption></figure><p>You can also append the previous bash script so that it will start DeskDock after connecting your phone.</p><pre>ip_addr=$(adb shell ip addr show wlan0 | grep "inet\s" | awk '{print $2}' | awk -F'/' '{print $1}') #look for you'r phones ip address<br>echo $ip_addr<br>port=5555 <br>adb tcpip $port #starting adb in tcptip on port 5555<br>adb connect "${ip_addr}:${port}" #connecting to your phone<br>adb devices<br>nohup java -jar <desk_dock_jar_download_location>.jar &</pre><p><em>nohup is used to run the command in background so that you can close the terminal. </em>After you run this script, you can press ctlr+c to exit. DeskDock will run in the background.</p><h3>3. Routing your pc audio through phone or vise versa</h3><p>Imagine a situation where you're watching a video on your PC with your headphones connected, and you get a call. It would be nice if you can simply answer and start talking using the same headphones.</p><p>If you have a <a href="https://www.soundguys.com/bluetooth-multipoint-explained-28601/">multipoint Bluetooth</a> headphones, you can easily achieve something similar to this by connecting both devices to your headphones. If you don’t have one or if you have a wired headphone and don't want to buy something like a mixer, here's a trick. <strong>The solution is to stream your pc audio to your phone and have your headphones connected to your phone. This way, you can hear both pc and mobile audio using the same headphones.</strong></p><p>The software we are using for this is called <strong>AudioRelay (proprietary software</strong>). If you run a Debian system, AudioRelay offer a .deb package which you can install with;</p><p>sudo apt install ./<audio_realy_deb_location>.deb. If you're not running Debian, they also offer an executable (extract the tar.gz and look inside the “bin” folder), which you can just double-click to run. You can download either from <a href="https://audiorelay.net/downloads">here</a>.</p><p>You also need to install the AudioRelay app on your mobile phone via Google Play Store.</p><p><em>Please note that the following instructions are taken directly from the </em><a href="https://docs.audiorelay.net/instructions/linux/stream-audio-from-your-linux-pc-to-your-phone"><em>AudioRelay website</em></a><em>.</em></p><p>First, you need to create a permanent virtual audio device. To do so;</p><ul><li>Open the file /etc/pulse/default.pa using vim or nano (ex: vim /etc/pulse/default.pa)</li><li>Add these lines to the end</li></ul><pre># Creates a device which your PC will output sound to.<br># AudioRelay will be able to listen to it.<br>load-module module-null-sink sink_name=audiorelay-speakers sink_properties=device.description=AudioRelay-Speakers</pre><ul><li>Save and exit</li><li>Type pulseaudio -k to make pulseaudio reload the file.</li><li>Install pavucontrol if you don't have already by running</li></ul><p>sudo apt install pavucontrol</p><ul><li>Open <strong>Output Devices</strong> from<strong> </strong>your application menu</li><li>Set <strong>AudioRelay-Speakers </strong>as the default output device</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/862/1*1gTD5dTHORX1OoeMb7nZoQ.png" /><figcaption>Volume control panel on Linux</figcaption></figure><p>Now open AudioReay on your PC, Go to the server tab and Select <strong>Monitor of AudioRelay-Speakers</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/889/1*GPuQYUBMb5qMdOLA46oz3A.png" /><figcaption>AudioRelay interface</figcaption></figure><p>Open AudioRelay app on your phone and click on player. Click on your pc. It should start streaming your Linux system audio to your phone.</p><p>That's it for this tutorial. Of course most features of the Apple ecosystem is still missing but with just a few software you can achieve at least some of it. <strong>This was simple me showcasing my own setup that I use every day. Hope you enjoy.</strong></p><p>I you enjoyed this read, consider <a href="https://buymeacoffee.com/tharushaj">supporting me</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8b69e6941dc9" width="1" height="1" alt="">]]></content:encoded>
</item>
</channel>
</rss>