GeekCoding101

  • Home
  • GenAI
    • Daily AI Insights
    • Machine Learning
    • Transformer
    • Azure AI
  • DevOps
    • Kubernetes
    • Terraform
  • Technology
    • Cybersecurity
    • System Design
    • Coding Notes
  • About
  • Contact
Where Curiosity Meets Code!
Start your tech adventure one line of code at a time.
Machine Learning

Mastering Multiple Features & Vectorization: Supervised Machine Learning – Day 4 and 5

So difficult to manage some time on this Day 4 was a long day for me, just got 15mins before bed to quickly skim through the video "multiple features" and "vectorization part 1". Day 5, a longer day than yesterday... went to urgent care in morning... then back-to-back meeting after come back.... lunch... back-to-back meeting again... need to step out again... Anyway, that's life. Multiple features (variables) and Vectorization In "multiple features", Andrew uses crispy language explained how to simplify the multiple features formula by using vector and dot product. In "Part 1", Andrew introduced how to use NumPy to do dot product and said GPU is good at this type of calculation. Numpy function can use parallel hardware (like GPU) to make dot product fast. In "Part 2", Andrew further introduced why computer can do dot product fast. He used gradient descent as an example. The lab was informative, I walked through all of them though I've known most of them before. More linkes about Vectorization can be find here. Questions for helping myself learning I created the following questions to test my knowledge later. What is x(4)1 in above graph?   Ps. feel free to check out the series of my Supervised Machine Learning journey.

April 17, 2024 0comments 133hotness 0likes Geekcoding101 Read all
Machine Learning

Supervised Machine Learning – Day 2 & 3 - On My Way To Becoming A Machine Learning Person

A brief introduction Day 2 I was busy and managed only 15 mins for "Supervised Machine Learning" video + 15 mins watched But what is a neural network? | Chapter 1, Deep learning from 3blue1brown. Day 3 I managed 30+ mins on "Supervised Machine Learning", and some time spent on articles reading, like Parul Pandey's Understanding the Mathematics behind Gradient Descent, it's really good. I like math 😂 So this notes are mixed. Notes Implementing gradient descent Notation I was struggling in writting Latex for the formula, then found this table is useful (source is here): Andrew said I don't need to worry about the derivative and calculas at all, I trust him, next I dived into my bookcases and found out my advanced mathmatics books used in college, and spent 15 mins to review, yes, I don't need. Snapped two epic shots of my "Advanced Mathematics" book used in my college time to show off my killer skills in derivative and calculus - pretty sure I've unlocked Math Wizard status! Reading online Okay. Reading some online articles. If we are able to compute the derivative of a function, we know in which direction to proceed to minimize it (for the cost function). From Parul Pandey, Understanding the Mathematics behind Gradient Descent Parul briefly introduced Power rule and Chain rule, fortunately, I still remember them learnt from colleage. I am so proud. After reviewing various explanations of gradient descent, I truly appreciate Andrew's straightforward and precise approach! He was kiddish some times drawing a stick man walking down a hill…

April 15, 2024 0comments 184hotness 1likes Geekcoding101 Read all
Machine Learning

Supervised Machine Learning - Day 1

The Beginning As I've been advancing technologies of my AI-powered product knowlege base chatbot which based on Django/LangChain/OpenAI/Chroma/Gradio which is sitting on AI application/framework layer, I also have kept an eye on how to build a pipeline for assessing the accuracy of machine learning models which is a part of AI Devops/infra. But I realized that I have no idea how to meature a model's accuracy. This makes me upset. Then I started looking for answers. My first google search on this is "how to measure llm accuracy", it brought me to Evaluating Large Language Models (LLMs): A Standard Set of Metrics for Accurate Assessment, it's informative. It's not a lengthy article and I read through it. This opens a new world to me. There are standard set of metrics for evaluating LLMs, including: I don't know all of them and where to start! I have to tell meself, "Man, you don't know machine learning..." So my next search was "machine learning course", Andrew Ng's Supervised Machine Learning: Regression and Classification now came on top of the google search results! It's so famous and I knew this before! Then I made a decision, I want to take action now and finish it thoroughly! I immedially enrolled into the course. Now let's start the journey! Day 1 Started Basics 1. What is ML? Defined by Arthur Samuel back in the 1950 😯 "Field of study that gives computers the ability to learn without being explicitly programmed." The above claims gaves the key point (The highlighted part) which could answer the question from…

April 13, 2024 0comments 410hotness 1likes Geekcoding101 Read all
Coding Notes

Fix Font in VSCode Terminal

The Font Problem in VSCode After done the configuration in Terminal Mastery: Crafting A Productivity Environment With ITerm, Tmux, And Beyond, we got a nice terminal: However, after I installed VSCode, the terminal couldn't display certain glyphs, it looks like this: The Fix We need to fix it by updating the font family in VSCode. 1. Identify the name of font family. Open Font Book on Mac, we can see: The font supports those glyphs is "MesloLGM Nerd Font Mono", that's also what I configured for iTerm2. 2. Go to VSCode, go to Command + comma, go to settings, search "terminal.integrated.fontFamily", set the font name as below: 3. Now we can see it displays correctly:   Well done!

April 12, 2024 0comments 864hotness 0likes Geekcoding101 Read all
Coding Notes

Terminal Mastery: Crafting a Productivity Environment with iTerm, tmux, and Beyond

I love working on Linux terminals Rewind a decade or so, and you'd find me ensconced within the embrace of a Linux terminal for the duration of my day. Here, amidst the digital ebb and flow, I thrived—maneuvering files and folders with finesse, weaving code in Vim, orchestrating services maintenance, decoding kernel dumps, and seamlessly transitioning across a mosaic of tmux sessions. The graphical user interface? A distant thought, unnecessary for the tapestry of tasks at hand. Like all geeks, every tech enthusiast harbors a unique sanctuary of productivity—a bespoke digital workshop where code flows like poetry, and ideas ignite with the spark of creativity. It’s a realm where custom tools and secret utilities interlace, forming the backbone of unparalleled efficiency and innovation. Today, I'm pulling back the curtain to reveal the intricacies of my personal setup on Mac. I invite you on this meticulous journey through the configuration of my Mac-based development sanctuary. Together, let's traverse this path, transforming the mundane into the magnificent, one command, one tool, one revelation at a time. iTerm2 After account setup on Mac, the initial terminal looks like this when I logged in: Let's equip it with iTerm2! What is iTerm2? iTerm2 is a replacement for Terminal and the successor to iTerm. It works on Macs with macOS 10.14 or newer. iTerm2 brings the terminal into the modern age with features you never knew you always wanted. Why Do I Want It? Check out the impressive features and screenshots. If you spend a lot of time in a terminal, then you'll appreciate all the…

April 10, 2024 0comments 791hotness 0likes Geekcoding101 Read all
Coding Notes

An Adventurer's Guide to Base64, Base64URL, and Base32 Encoding

Hey there! Recently, I encountered some encoding issues. Then I realized that, looks like I haven't seen any articles give a crispy yet interesting explanation on Base64/Base64URL/Base32 encoding! Ah! I should write one! So, grab your gear, and let's decode these fascinating encoding schemes together! The Enigma of Base64 Encoding Why do we need Base64? Imagine you're sending a beautiful picture postcard through the digital world, but the postal service (the internet, in this case) only handles plain text. How do you do it? Enter Base64 encoding – it's like magic that transforms binary data (like images) into a text format that can easily travel through the internet without getting corrupted. Base64 takes your binary data and represents it as text using 64 different characters: In more details, it will: It's widely used in email attachments, data URLs in web pages, and anywhere you need to squeeze binary data into text-only zones. A simple text like "Hello!" when encoded in Base64, turns into "SGVsbG8h". Usage of Base64 in Data URIs Data URIs (Uniform Resource Identifiers) offer a powerful way to embed binary data, such as images, directly into HTML or CSS files, using Base64 encoding. This method eliminates the need for external file references, resulting in fewer HTTP requests and potentially faster page loads. Here's how it works in practice: Embedding an Image in HTML Using Data URI Let's say you have a small logo or icon that you want to include directly in your HTML page without linking to an external file. You can use Base64 to encode the…

April 9, 2024 0comments 832hotness 0likes Geekcoding101 Read all
Coding Notes

Vue: Secrets to Resolving Empty index.html in WebHistory

Greetings Hi there! I was trying some new stuff about VUE recently. I downloaded a free version of VUE Argon dashboard code and tried to compile it locally. It's straghtforward: Then I got the dist folder: Interesting... Then I double clicked the index.html, expecting it will display the beautiful landing page, but it didn't happen... This is strange... What went wrong? I tried npm run serve, it works well, I can see the portal and navigate between pages without issues. I must fix this! Should be quick! Bingo! The root cause is that the VUE project used router with createWebHistory instead of createWebHashHistory! It resulted a differenve ways to handle static assets and routing. Using createWebHistory in Production environment is required as it provides several significant benefits: I just want to use createWebHashHistory in my local development environment. The fix Now, the fix is easy. First, modify scripts in package.json to specify mode for serve and build, and I added two new items serve_prod and build_dev: Second, creating or editing vue.config.js as below: Lastly, update src/router/index.js to handle the mode accordingly: The original code was: Now it looks like this: Now, run npm run build_dev again, I can see the portal 😎 Thanks for reading! Have a good day! Thanks for reading! Have a good day!

April 8, 2024 0comments 792hotness 0likes Geekcoding101 Read all
Coding Notes

Crafting A Bash Script with Tmux

The Background... I have Django/Vue development environment running locally. To streamline my Django development, I typically open six tmux windows 😎 : I used one Tmux session to hold all above. However, my laptop sometimes needs to reboot, after reboot, all of my windows are gone 😓 I have configured tmux-resurrect and tmux-continuum to try to handle this scenario, but they couldn't re-run those commands even they could restore the windows correctly. Let me show you the screenshots. The problem... Typically, my development windows look like this: As you see, the services are running within the respective windows. If I save them with tmux-resurrect, after reboot, of course tmux-resurrect and tmux-continuum could restore them, but services and all environment variables are gone. To simulate, let me kill all sessions in tmux, check the output: Now start tmux again, here are the status I can see, tmux restored the previous saved windows: Let's check the window now: None of the services is running 🙉 The Complain... As the supreme overlord of geekcoding101.com, I simply cannot let such imperfection slide. Not on my watch. Nope, not happening. This ain't it, chief. Okay, let's fix it! The Fix... .... Okay! I wrote a script.. oh no! Two scripts! One is called start_tmux_dev_env.sh to create all windows, it will invoke prepare_dev_env.sh which export functions to initialize environment variables in specific windows. A snippet of start_tmux_dev_env.sh: The prepare_dev_env.sh looks like: The End... Now, after reboot, I can just invoke script start_tmux_dev_env.sh and it will spin up all windows for me in seconds! I'M Really Pround…

April 6, 2024 0comments 784hotness 0likes Geekcoding101 Read all
Cybersecurity

Mastering Openssl Command and NSS Database Management

Greetings to all you geeks out there! It's a pleasure to have you here at geekcoding101.com! With almost 20 years immersed in the vibrant world of Linux and security domain, I've encountered a myriad of tools and technologies that have shaped my journey. Today, I'm excited to introduce you OpenSSL and Certutil—two indispensable utilities that play pivotal roles in managing digital certificates and encryption. Whether you're safeguarding your web servers or securing communications, understanding these tools is crucial. I've distilled my insights and tips into this post, aiming to arm you with the knowledge to leverage these powerful utilities effectively. Enjoy! Openssl OpenSSL is an open-source software library that provides a robust, commercial-grade, and full-featured toolkit for SSL and TLS protocols, as well as a general-purpose cryptography library. It is widely used by internet servers, including the majority that implement secure web (HTTPS) connections, as well as in countless other security-sensitive applications. Here are some key aspects of OpenSSL: Core Features Query Information Query on Private Key: openssl rsa -in privatekey.pem -check Query All Information: openssl x509 -in certificate.pem -text -noout Query Subject: openssl x509 -in certificate.pem -subject -noout Query Validity: openssl x509 -in certificate.pem -dates -noout Query Purpose: openssl x509 -in certificate.pem -purpose -noout Example: Certificate purposes: SSL client : No SSL client CA : Yes SSL server : No SSL server CA : Yes Netscape SSL server : No Netscape SSL server CA : Yes S/MIME signing : No S/MIME signing CA : Yes S/MIME encryption : No S/MIME encryption CA : Yes CRL signing : No CRL…

April 5, 2024 0comments 589hotness 0likes Geekcoding101 Read all
Cybersecurity

Unlocking Web Security: Master JWT Authentication

Introduction JSON Web Tokens (JWTs) play a crucial role in web application security. In this blog, we walkthrough the concept of JWT, focusing on the different types of claims, the structure of a JWT, and the algorithms used in signatures, and finally I will implement JWT authentication from scratch in Node.js and Express.js. This is my 4th article in Auth101! It’s 2024 now! Looking forward to a wonderful year filled with cool tech updates, new tricks in cyber security, and a bunch of fun coding adventures. I can’t wait to dive into more authentication topics with you all 😃 Understanding JWT JSON Web Tokens (JWTs) originated as a compact and self-contained way for securely transmitting information between parties as a JSON object. Defined in RFC 7519, JWTs have become a widely adopted standard in the field of web security for their simplicity and versatility. A JWT is a string comprising three parts separated by dots (.): Base64Url encoded header, Base64Url encoded payload, and signature. It typically looks like xxxxx.yyyyy.zzzzz. Let’s deep dive into the three parts: Header, Payload, and Signature. Header The header typically consists of the token type and the signing algorithm, such as HMAC SHA256 or RSA. For example:{ "alg": "HS256", "typ": "JWT" } Payload The payload contains claims, which are statements about an entity and additional metadata. Claims are categorized into registered, public, and private claims. The later two are for custom claims. Public claims are collision-resistant while private claims are subject to possible collisions. In a JWT, a claim appears as a name/value pair where the name is always a string…

January 15, 2024 0comments 470hotness 0likes Geekcoding101 Read all
1…23456
Newest Hotest Random
Newest Hotest Random
A 12 Factor Crash Course in Python: Build Clean, Scalable FastAPI Apps the Right Way Golang Range Loop Reference - Why Your Loop Keeps Giving You the Same Pointer (and How to Fix It) Terraform Associate Exam: A Powerful Guide about How to Prepare It Terraform Meta Arguments Unlocked: Practical Patterns for Clean Infrastructure Code Mastering Terraform with AWS Guide Part 1: Launch Real AWS Infrastructure with VPC, IAM and EC2 ExternalName and LoadBalancer - Ultimate Kubernetes Tutorial Part 5
Terraform Meta Arguments Unlocked: Practical Patterns for Clean Infrastructure CodeTerraform Associate Exam: A Powerful Guide about How to Prepare ItGolang Range Loop Reference - Why Your Loop Keeps Giving You the Same Pointer (and How to Fix It)A 12 Factor Crash Course in Python: Build Clean, Scalable FastAPI Apps the Right Way
Mastering Terraform with AWS Guide Part 1: Launch Real AWS Infrastructure with VPC, IAM and EC2 Transformers Demystified - Day 2 - Unlocking the Genius of Self-Attention and AI's Greatest Breakthrough Pretraining vs. Fine-Tuning: What's the Difference? Ultimate Kubernetes Tutorial Part 1: Setting Up a Thriving Multi-Node Cluster on Mac What Are Parameters? Why Are “Bigger” Models Often “Smarter”? Tmux Notes
Newest comment
Tag aggregation
Machine Learning Supervised Machine Learning notes AI cybersecurity Daily.AI.Insight Transformer security

COPYRIGHT © 2024 GeekCoding101. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang