Skip to content

Instantly share code, notes, and snippets.

View devendraap's full-sized avatar
🎯
Focusing

Devendra Parhate devendraap

🎯
Focusing
  • Bangalore, India
View GitHub Profile
@devendraap
devendraap / README.md
Created January 24, 2024 09:41 — forked from yogendra/README.md
Run a Docker Registry with TLS

Run Docker Registry with TLS

There are many instances that I need to do this. Especially if I am installing K8s in an internet restricted environment (example: [Install TKG in Internet restricted env][install-tkg-internet-restricted])

So I like to use [docker registry][docker-registry] and [mkcert][mkcert] to play with this scenario

  1. Create directories for certs and data

    mkdir -p data certs
@devendraap
devendraap / dropbox-spec.json
Last active April 10, 2024 14:32
dropbox-spec.json
{
"openapi": "3.0.0",
"info": {
"title": "Dropbox API Reference",
"description": "The powerful, yet simple, Dropbox API allows you to manage and control content and team settings programmatically and extend Dropbox capabilities in new and powerful ways. This is a collection that includes requests to all endpoints in the Dropbox API. \n\nThe Dropbox API is divided in two groups of endpoints: User Endpoints and Business Endpoints. Operations that would most likely be executed by a user, such as file operations, are in the User Endpoints folder. Operations that would most likely be executed by a team administrator, such as adding users to groups, live in the Business Endpoints folder. \n\nIf you are new to Dropbox Business and Team Administration, please have a look at the [Dropobox Admin Guide](https://help.dropbox.com/guide/admin/how-to-get-started#dropbox-admin-guide). \n\nIf you want more information on how to use our API please refer to our [Developer Portal](https://www.dropbox.com/developers).
@devendraap
devendraap / postgres_queries_and_commands.sql
Created May 3, 2023 19:26 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
import akka.NotUsed
import akka.actor.ActorSystem
import akka.stream.ClosedShape
import akka.stream.scaladsl.{Broadcast, Flow, GraphDSL, RunnableGraph, Sink, Source, Zip}
object Main {
implicit val system = ActorSystem("GraphBasics")
def print2000(): Unit = {
implicit val system = ActorSystem()
@devendraap
devendraap / python_sol.py
Last active January 21, 2021 17:53
Solution
def find_match(text: str, words: list) -> list:
matched = []
for p in range(len(text)):
for word in words:
if text[p:p + len(word)] == word:
matched.append([p, p + len(word)])
return sorted(matched)
def add_tags(text: str, matched: list) -> str:
{ "url": "github.com" }
as