Skip to content

Instantly share code, notes, and snippets.

View yatender-oktalk's full-sized avatar
✌️
Focusing

Yatender Singh yatender-oktalk

✌️
Focusing
View GitHub Profile
@yatender-oktalk
yatender-oktalk / jobs.py
Created December 5, 2023 11:46
Scrapping the naukri.com and extracting the data from it
from selenium import webdriver
from datetime import datetime
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.keys import Keys
from selenium.common.exceptions import NoSuchElementException
from time import time
from time import sleep
import pandas as pd
@yatender-oktalk
yatender-oktalk / Dockerfile
Created June 2, 2022 02:27
docker folder containing files to start private blockchain
FROM ethereum/client-go:v1.10.17
ARG ACCOUNT_PASSWORD
ENTRYPOINT sleep infinity
@yatender-oktalk
yatender-oktalk / config.ex
Last active March 25, 2021 09:02
Prom_ex
config :tracker, Tracker.PromEx,
manual_metrics_start_delay: :no_delay,
drop_metrics_groups: [],
grafana: [
host: System.get_env("GRAFANA_HOST", "http://localhost:3000"),
auth_token: "eyJrIjoienZWWURQYnJVOG5xS1RCdGFmdHdsQ3Q0YUVKVXQ0NVciLCJuIjoidHJhY2tlcl9hcHAiLCJpZCI6MX0=",
upload_dashboard_on_start: true,
folder_name: "tracer_dashboard",
annotate_app_lifecycle: true
]
# my global config
global:
scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
# scrape_timeout is set to the global default (10s).
# Alertmanager configuration
alerting:
alertmanagers:
- static_configs:
@yatender-oktalk
yatender-oktalk / sender_application.ex
Last active February 8, 2021 04:39
Async tasks in a process failsafe
defmodule Sender.Application do
# See https://hexdocs.pm/elixir/Application.html
# for more information on OTP Applications
@moduledoc false
use Application
@impl true
def start(_type, _args) do
children = [
@yatender-oktalk
yatender-oktalk / change-3-zipkin_ranom.ex
Created October 14, 2020 07:34
change-3-zipkin_random
...
def second_event(delay) do
OpenTelemetry.Tracer.start_span("second_event_span")
# again mimicing the same stuff
Process.sleep(delay)
# use set_attributes api to add the attributes during the span
OpenTelemetry.Span.set_attributes([{"delay_data", delay}])
OpenTelemetry.Tracer.end_span()
@yatender-oktalk
yatender-oktalk / change-2-zipkin_random.ex
Last active October 14, 2020 07:08
change-2-zipkin_random.ex
defmodule ZipkinRandom do
...
def hello do
OpenTelemetry.Tracer.start_span("span_name_1")
Process.sleep(100)
second_event(200)
@yatender-oktalk
yatender-oktalk / change-1-application.ex
Created October 14, 2020 06:51
setup-zipkin-random-open-telemetry
defmodule ZipkinRandom.Application do
# See https://hexdocs.pm/elixir/Application.html
# for more information on OTP Applications
@moduledoc false
use Application
def start(_type, _args) do
# register your tracer so that opentelemtry knows that
# it needs to start tracing the events
defmodule ExChain.Blockchain do
@moduledoc """
This module contains the blockchain related functions
"""
alias __MODULE__
alias ExChain.Blockchain.Block
...
@spec valid_chain?(Blockchain.t()) :: boolean()
defmodule ExChain.BlockchainTest do
...
test "when we temper data in existing chain", %{
blockchain: blockchain
} do
blockchain =
blockchain
|> Blockchain.add_block("blockchain-data-block-1")