Skip to content

Instantly share code, notes, and snippets.

View manzil-infinity180's full-sized avatar
🎯
Focusing

Rahul Vishwakarma manzil-infinity180

🎯
Focusing
View GitHub Profile
@manzil-infinity180
manzil-infinity180 / localhost-ssl-certificate.md
Created March 25, 2025 20:43 — forked from ethicka/localhost-ssl-certificate.md
Localhost SSL Certificate on Mac OS

🚨 2020 Update: I recommend using mkcert to generate local certificates. You can do everything below by just running the commands brew install mkcert and mkcert -install. Keep it simple!


This gives you that beautiful green lock in Chrome. I'm assuming you're putting your SSL documents in /etc/ssl, but you can put them anywhere and replace the references in the following commands. Tested successfully on Mac OS Sierra and High Sierra.

Set up localhost.conf

sudo nano /etc/ssl/localhost/localhost.conf

@manzil-infinity180
manzil-infinity180 / helm-crud.go
Last active March 17, 2025 19:45
Install chart using go-sdk
// https://github.com/helm/helm/issues/7310
// https://github.com/helm/helm/issues/12931
// helm 3.0.2 SDK - example of install from remote repository #7310
// https://github.com/helm/helm/issues/12907
// https://github.com/helm/helm-www/pull/1543
import (
"log"
"os"
@manzil-infinity180
manzil-infinity180 / Youtube Video Id and get the specified time.md
Last active March 12, 2025 08:47
Youtube Video Id and get the specified time
function getYoutubeIdAndTimestamp(url: string) {
    if (!url) {
        return { videoId: null, startTime: 0 };
    }

    // Regular expression to extract YouTube video ID
    const idPattern = /^(?:https?:\/\/)?(?:www\.)?(?:youtu\.be\/|(?:m\.)?youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$/;
    const idMatch = url.match(idPattern);
    const videoId = idMatch ? idMatch[1] : null;
@manzil-infinity180
manzil-infinity180 / restclient.go
Created March 10, 2025 17:55 — forked from manuelmazzuola/restclient.go
how to implement a RESTClientGetter for helm action pkg
package main
import (
"k8s.io/apimachinery/pkg/api/meta"
"k8s.io/client-go/discovery"
"k8s.io/client-go/discovery/cached/memory"
"k8s.io/client-go/rest"
"k8s.io/client-go/restmapper"
"k8s.io/client-go/tools/clientcmd"
"k8s.io/client-go/tools/clientcmd/api"
@manzil-infinity180
manzil-infinity180 / TypeError: The "chunk" argument must be of type string or an instance of Buffer or Uint8Array
Created February 22, 2025 13:04
TypeError: The "chunk" argument must be of type string or an instance of Buffer or Uint8Array. Received an instance of Promise
TypeError: The "chunk" argument must be of type string or an instance of Buffer or Uint8Array. Received an instance of Promise
at write_ (node:_http_outgoing:945:11)
at ServerResponse.end (node:_http_outgoing:1102:5)
at /Users/rahulxf/JourneyToXYZ/socket.io-prometheus-metrics/dist/index.js:58:17
at Layer.handle [as handle_request] (/Users/rahulxf/JourneyToXYZ/socket.io-prometheus-metrics/node_modules/express/lib/router/layer.js:95:5)
at next (/Users/rahulxf/JourneyToXYZ/socket.io-prometheus-metrics/node_modules/express/lib/router/route.js:149:13)
at Route.dispatch (/Users/rahulxf/JourneyToXYZ/socket.io-prometheus-metrics/node_modules/express/lib/router/route.js:119:3)
at Layer.handle [as handle_request] (/Users/rahulxf/JourneyToXYZ/socket.io-prometheus-metrics/node_modules/express/lib/router/layer.js:95:5)
at /Users/rahulxf/JourneyToXYZ/socket.io-prometheus-metrics/node_modules/express/lib/router/index.js:284:15
at Function.process_params (/Users/rahulxf/JourneyToXYZ/socket
@manzil-infinity180
manzil-infinity180 / docker-pull-problem
Last active February 22, 2025 07:34
Docket pull problem
https://github.com/docker/for-mac/issues/7306#issuecomment-2663147749
-> https://github.com/docker/for-mac/issues/7306#issuecomment-2663111516
I am also getting similar issue from last week
```
docker run --name rss-reader-db -e POSTGRES_PASSWORD=admin -e POSTGRES_DB=golangWebRss --volume pg-data:/var/lib/postgresql/data --publish 5432:5432 -d postgres:bookworm
Unable to find image 'postgres:bookworm' locally
bookworm: Pulling from library/postgres
@manzil-infinity180
manzil-infinity180 / user-agent.js
Created November 28, 2024 18:39
Custom Latest User Agent
export function generateUserAgents(count: number): string[] {
const userAgents: string[] = [];
const baseOS = [
"X11; Linux i686",
"X11; Linux x86_64",
"X11; Ubuntu i686",
"X11; Ubuntu x86_64",
"X11; Fedora i686",
"Macintosh; Intel Mac OS X 10_15_7",
"Macintosh; Intel Mac OS X 13_5",
@manzil-infinity180
manzil-infinity180 / user-agent.txt
Created November 28, 2024 18:37
Latest 10000 User Agent
This file has been truncated, but you can view the full file.
Mozilla/5.0 (X11; Ubuntu x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.259.40 Safari/537.36
Mozilla/5.0 (X11; Fedora i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.357.58 Safari/537.36
Mozilla/5.0 (X11; Fedora i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.455.72 Safari/537.36
Mozilla/5.0 (X11; Fedora i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.480.49 Safari/537.36
Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.443.60 Safari/537.36
Mozilla/5.0 (X11; Ubuntu i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.465.80 Safari/537.36
Mozilla/5.0 (X11; Ubuntu i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.295.6 Safari/537.36
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.269.50 Safari/537.36
Mozilla/5.0 (Macintosh; Intel Mac OS X 13_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.76.94 Safari/537.36