Skip to content

Instantly share code, notes, and snippets.

View dipankardas011's full-sized avatar
:octocat:
Hustling

Dipankar Das dipankardas011

:octocat:
Hustling
View GitHub Profile
@dipankardas011
dipankardas011 / info.md
Last active October 7, 2024 04:58
Green software foundation (Carbon Aware SDK)
docker run --rm -p 8080:8080 \
 -e DataSources__EmissionsDataSource="WattTime" \
 -e DataSources__ForecastDataSource="WattTime" \
 -e DataSources__Configurations__WattTime__Type="WattTime" \
 -e DataSources__Configurations__WattTime__username="" \
 -e DataSources__Configurations__WattTime__password="" \
ghcr.io/green-software-foundation/carbon-aware-sdk
@dipankardas011
dipankardas011 / git_log.go
Last active October 11, 2024 04:48
git log without os exec
package main
import (
"fmt"
"sort"
"strconv"
"time"
"github.com/go-git/go-git/v5"
"github.com/go-git/go-git/v5/plumbing/object"
@dipankardas011
dipankardas011 / info.md
Last active September 8, 2024 06:11
For important commands

Some of the important commands

git tag -s -a v1.3.1 -m "version v1.3.1 is out"

@dipankardas011
dipankardas011 / eks_version.go
Created July 30, 2024 15:43
kubernetes version check for eks
package main
import (
"context"
"fmt"
"log"
"github.com/aws/aws-sdk-go-v2/config"
"github.com/aws/aws-sdk-go-v2/service/eks"
"github.com/aws/aws-sdk-go/aws"
@dipankardas011
dipankardas011 / pyenv.md
Last active July 25, 2024 05:14
python pyenv command to install
curl https://pyenv.run | bash

pyenv doctor

env PYTHON_CONFIGURE_OPTS='--enable-optimizations --with-lto' PYTHON_CFLAGS='-march=native -mtune=native' pyenv install 3.12

pyenv rehash
@dipankardas011
dipankardas011 / main.go
Created July 14, 2024 09:36
control the rate of messages
package main
import (
"fmt"
"sync/atomic"
"time"
)
func smoothOutListening(rc <-chan string) {
var ops atomic.Uint64
@dipankardas011
dipankardas011 / main.go
Created July 13, 2024 18:00
go workerpools
package main
import (
"fmt"
"log/slog"
"net/http"
"sync"
)
var urls = []string{
@dipankardas011
dipankardas011 / main.go
Last active May 11, 2024 09:14
go time ticker and context timeout
package main
import (
"context"
"fmt"
"os"
"os/signal"
"syscall"
"time"
)
@dipankardas011
dipankardas011 / main.go
Last active May 3, 2024 09:05
Without kubernetes service exposed how to get http client connect?
package main
import (
"crypto/tls"
"crypto/x509"
"fmt"
"io"
"log"
"net/http"
"os"
@dipankardas011
dipankardas011 / .zshrc
Created February 29, 2024 09:48
zshrc-server
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
export PATH=$HOME/.local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH=$HOME/.oh-my-zsh
ZSH_THEME="gnzh"
plugins=(git z)