Skip to content

Instantly share code, notes, and snippets.

@azharism
azharism / k8s-install.md
Created May 8, 2024 08:34 — forked from NotHarshhaa/k8s-install.md
k8s step-by-step installation guide on Ubuntu 20.04 from scratch

Certainly! Here's a step-by-step guide to installing Kubernetes (K8s) on Ubuntu 20.04 from scratch. This guide will walk you through the process of setting up a basic Kubernetes cluster using kubeadm, kubelet, and kubectl.

Prerequisites:

  1. Ubuntu 20.04: You should have a clean installation of Ubuntu 20.04 on the machines where you plan to set up your Kubernetes cluster.

  2. Minimum 2 Nodes: For a basic Kubernetes cluster, you need at least two nodes - one for the master and one or more for worker nodes.

  3. Network Configuration: Ensure that your nodes can communicate with each other over the network. You should have a static IP address for each node.

@JolandaVerhoef
JolandaVerhoef / Compose-PhotoGrid.kt
Created June 30, 2023 12:14
Photogrid with multi-select and zoomable images
/*
* Copyright 2023 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@irazasyed
irazasyed / outbound-email-with-cloudflare.md
Last active May 8, 2024 08:34
Using Gmail SMTP with Cloudflare Email Routing: A Step-by-Step Guide

Using Gmail SMTP with Cloudflare Email Routing: Step-by-Step Guide

Learn how to send emails through Gmail SMTP with Cloudflare Email Routing in this comprehensive guide.

Step 1: Enable 2-Factor Authentication

To proceed with this method, ensure that you have enabled two-factor authentication for your Google account. If you haven't done so already, you can follow the link to set it up → Enable 2FA in your Google account.

Step 2: Create an App Password for Mail

@xirkus
xirkus / yubikey+gpupgp+ssh_howto.md
Last active May 8, 2024 08:34
Security Adventures 1. How to get yubikey+gpg+ssh+gitbhub working on MacOS

I've spent the day trying to get this setup working with GitHub and given the number of gotcha's I encountered, it seemed like a good idea to document how I finally got this working with as few hacks as possible. There's a lot of documentation out there (some of it old and misleading) and committing here for posterity will help me remember this when I inevitably need to do this again.

Rationale

Passwords are simply not enough these days. Regardless of the company, breaches (and the associated Personally Identifiable Information harvested) are a matter of not if, but when. There are a number of things you can do to protect yourself, but being on the tin-foil-hat side of paranoia, means there are a few Commandents that I adhere to (and recommend for other folks)[Insert link to Fight Club Rules for the Secure Internet].

That being said, if you use 2-factor authentication and have committed to using a hardware token such as the Yubikey, then you're already ahead of the curve. The problem is that wh

@rjescobar
rjescobar / extend-trial-jetbrains-windows.bat
Created August 31, 2021 02:53
JetBrains IDE trial reset windows
REM Delete eval folder with licence key and options.xml which contains a reference to it
for %%I in ("WebStorm", "IntelliJ", "CLion", "Rider", "GoLand", "PhpStorm", "Resharper", "PyCharm") do (
for /d %%a in ("%USERPROFILE%\.%%I*") do (
rd /s /q "%%a/config/eval"
del /q "%%a\config\options\other.xml"
)
)
REM Delete registry key and jetbrains folder (not sure if needet but however)
rmdir /s /q "%APPDATA%\JetBrains"
@rmtuckerphx
rmtuckerphx / direnv-win.md
Last active May 8, 2024 08:33
Steps to install direnv on Windows

direnv on Windows

Overview

In JavaScript projects, I used to use dotenv so that I could put local environment variables in a .env file for local development. But dotenv requires you to add code to your project. With direnv, you can put local env vars in a .envrc file and those env vars are loaded automatically in the shell.

Steps to install

For these steps, it is assummed that you have installed Git Bash on Windows. I also use VSCode as my editor.

  1. Create a folder such as c:\tools to put the direnv.exe file and add it to the Windows PATH
@AlexV525
AlexV525 / init.gradle.kts
Last active May 8, 2024 08:33
Mirroring Gradle repositories
// Thanks to: https://gist.github.com/bennyhuo/af7c43cc4831661193605e124f539942
val urlMappings = mapOf(
"https://dl.google.com/dl/android/maven2" to "https://mirrors.tencent.com/nexus/repository/maven-public/",
"https://repo.maven.apache.org/maven2" to "https://mirrors.tencent.com/nexus/repository/maven-public/",
"https://plugins.gradle.org/m2" to "https://mirrors.tencent.com/nexus/repository/gradle-plugins/"
)
fun RepositoryHandler.mirroring() {
all {
@ahoward
ahoward / caching-https-creds.markdown
Created June 6, 2012 21:42
Fix Username/Password prompting for github repos cloned via https scheme

github recently switched to an https scheme as the default for cloning repos. as a side effect you may suddenly be prompted for a 'Username' and 'Password' when you push where, previously, you were able to do so without typing in credentials. the solution is to cause git to cache https credentials which is easy, since git uses curl under the covers

in your home directory create a file called '.netrc', for example

/Users/ahoward/.netrc

in it put these contents

@rodrigoborgesdeoliveira
rodrigoborgesdeoliveira / ActiveYouTubeURLFormats.txt
Last active May 8, 2024 08:29 — forked from ScottCooper92/gist:ea11b690ba4b1278e049
Example of the YouTube videos URL formats
http://www.youtube.com/watch?v=-wtIMTCHWuI
http://youtube.com/watch?v=-wtIMTCHWuI
http://m.youtube.com/watch?v=-wtIMTCHWuI
https://www.youtube.com/watch?v=lalOy8Mbfdc
https://youtube.com/watch?v=lalOy8Mbfdc
https://m.youtube.com/watch?v=lalOy8Mbfdc
http://www.youtube.com/watch?v=yZv2daTWRZU&feature=em-uploademail
http://youtube.com/watch?v=yZv2daTWRZU&feature=em-uploademail
http://m.youtube.com/watch?v=yZv2daTWRZU&feature=em-uploademail
@mjbalcueva
mjbalcueva / password-input.tsx
Last active May 8, 2024 08:29
shadcn ui custom password input
"use client"
import { forwardRef, useState } from "react"
import { EyeIcon, EyeOffIcon } from "lucide-react"
import { Button } from "@/components/ui/button"
import { Input, InputProps } from "@/components/ui/input"
import { cn } from "@/lib/utils"
const PasswordInput = forwardRef<HTMLInputElement, InputProps>(
({ className, ...props }, ref) => {