Skip to content

Instantly share code, notes, and snippets.

View Magnus167's full-sized avatar
🧘
thinking...

Palash Tyagi Magnus167

🧘
thinking...
View GitHub Profile
FROM python:3.12-slim AS base
RUN pip install uv
ADD requirements.txt .
RUN uv pip install --system --no-cache-dir -r requirements.txt
ADD *.py .
ADD data/ /data/
from flask import Flask, render_template_string
app = Flask(__name__)
APP_URL = "http://localhost:8501/"
TEMPLATE = f"""
<!doctype html>
<html>
<head>
import streamlit as st
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import dash_utils
import concurrent.futures as cf
def calc_errors_page():
import streamlit as st
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
# Create sample dataframes for demonstration
DF_CALC = pd.DataFrame(
{
"Name": ["USD_EQXR", "GBP_EQXR", "EUR_CDS", "JPY_CDS", "GOLD_PRICE"],
"Status": [
#!/bin/bash
# Usage: myscript --base branchA --head branchB
# This script iterates through directories starting with "MYREPO" in the current folder,
# checks if they are Git repositories, updates the specified branches, and saves the commit
# diff (with a custom format) into a release info file for each repo.
# Define your repository prefix
PREFIX="MYREPO"
# Parse command-line arguments
@Magnus167
Magnus167 / portainer-templates.json
Created January 3, 2025 11:08
portainer-templates.json. thanks to www.technorabilia.com, github.com/Lissy93, and github.com/Portainer
This file has been truncated, but you can view the full file.
{
"version": "2",
"templates": [
{
"type": 1,
"title": "Adguardhome-sync",
"name": "Adguardhome-sync",
"note": "Portainer App Templates by <a href='https://www.technorabilia.com' target='_blank'>Technorabilia</a> based on data provided by <a href='https://www.linuxserver.io' target='_blank'>LinuxServer.io</a>.</p><p>Don't forget to create the volume directories on the host file system.</p><p>mkdir -p /volume1/docker/adguardhome-sync/config</p>",
"description": "[Adguardhome-sync](https://github.com/bakito/adguardhome-sync/) is a tool to synchronize AdGuardHome config to replica instances.",
"platform": "linux",
@Magnus167
Magnus167 / portainer-templates.json
Created January 3, 2025 11:07
portainer-templates.json.
This file has been truncated, but you can view the full file.
{
"version": "2",
"templates": [
{
"type": 1,
"title": "Adguardhome-sync",
"name": "Adguardhome-sync",
"note": "Portainer App Templates by <a href='https://www.technorabilia.com' target='_blank'>Technorabilia</a> based on data provided by <a href='https://www.linuxserver.io' target='_blank'>LinuxServer.io</a>.</p><p>Don't forget to create the volume directories on the host file system.</p><p>mkdir -p /volume1/docker/adguardhome-sync/config</p>",
"description": "[Adguardhome-sync](https://github.com/bakito/adguardhome-sync/) is a tool to synchronize AdGuardHome config to replica instances.",
"platform": "linux",
net.set_options("""
{
"nodes": {
"font": {
"size": 16
},
"shape": "box"
},
"edges": {
"arrows": {
@Magnus167
Magnus167 / chrome-history-exporter.py
Last active December 29, 2024 03:19
Chrome history export for analytics
import sqlite3
import pandas as pd
USERNAME = "your_username"
# Path to the Chrome history file
history_db = fr"C:\Users\{USERNAME}\AppData\Local\Google\Chrome\User Data\Default\History"
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Mermaid Chart with ELK Layout</title>
</head>
<body>
<div class="mermaid">
graph TD