Skip to content

Instantly share code, notes, and snippets.

View pushp1997's full-sized avatar
📚
Learning

Pushp Vashisht pushp1997

📚
Learning
View GitHub Profile
version: "3"
services:
fastapi:
build: .
ports:
- "8000:80"
depends_on:
- loki
environment:
import logging
from os import getenv
from fastapi import FastAPI
from multiprocessing import Queue
from logging_loki import LokiQueueHandler
app = FastAPI()
loki_logs_handler = LokiQueueHandler(
Queue(-1),
@pushp1997
pushp1997 / profile.ps1
Last active April 19, 2022 08:44
Local powershell functions
# Write functions in profile to persist
# > notepad $profile
# Paste the below functions.
Function ssh-prod {
ssh -i C:\Users\Pushp\.ssh\prodPemFile.pem [email protected]
}
Function pgadmin {
$message = "Go to 127.0.0.1:5050 and login with email: [email protected] and password: 1234"
docker run -d -t -i -e PGADMIN_DEFAULT_EMAIL='[email protected]' -e PGADMIN_DEFAULT_PASSWORD='1234' -p 5050:80 --name pgadmin dpage/pgadmin4
@pushp1997
pushp1997 / GFG Unblocker.js
Created April 11, 2022 06:13 — forked from ahmedazhar05/GFG Unblocker.js
To unblock the signup modal in GeeksForGeeks website
javascript: (function() {
if (/^https?:\/\/(www\.)?geeksforgeeks\./g.test(document.URL)) {
document.querySelector(".login-modal-div").style.display = "none";
window.onscroll = null;
document.body.style.position = "initial";
} else alert("This feature only works in GeeksForGeeks site");
})();
@pushp1997
pushp1997 / Open-Containing-Folder-with-ranger.md
Created July 9, 2021 09:18
How to "Open Containing Folder" with ranger?
cp /usr/share/applications/ranger.desktop ~/.local/share/applications/ranger.desktop

nvim ~/.local/share/applications/ranger.desktop

Change these parameters to the respective values

Terminal=false
@pushp1997
pushp1997 / backup_logs_s3.py
Last active July 29, 2020 07:56
Use Python & Boto3 to Backup files / logs to AWS S3
import boto3
from botocore.exceptions import ClientError
import os
from datetime import datetime, timedelta
import schedule
import time
def upload_file_to_s3(file_name, bucket, object_name=None, folder_name=None):
"""
Upload a file to an S3 bucket.
@pushp1997
pushp1997 / backup_logs_s3(Step 6).py
Last active July 29, 2020 07:56
Use Python & Boto3 to Backup files / logs to AWS S3
import boto3
from botocore.exceptions import ClientError
import os
from datetime import datetime, timedelta
def upload_file_to_s3(file_name, bucket, object_name=None, folder_name=None):
"""
Upload a file to an S3 bucket.
Params:
@pushp1997
pushp1997 / backup_logs_s3(Step 5).py
Last active July 29, 2020 07:55
Use Python & Boto3 to Backup files / logs to AWS S3
import boto3
from botocore.exceptions import ClientError
import os
def upload_file_to_s3(file_name, bucket, object_name=None, folder_name=None):
"""
Upload a file to an S3 bucket.
Params:
file_name: File to upload
@pushp1997
pushp1997 / backup_logs_s3(Step 4).py
Last active July 29, 2020 07:55
Use Python & Boto3 to Backup files / logs to AWS S3
import boto3
from botocore.exceptions import ClientError
def upload_file_to_s3(file_name, bucket, object_name=None, folder_name=None):
"""
Upload a file to an S3 bucket.
Params:
file_name: File to upload
@pushp1997
pushp1997 / index.html
Created August 18, 2019 19:26
Random Quote Machine Using React
<script src="https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js"></script>
<div id="root"></div>