Skip to content

Instantly share code, notes, and snippets.

@sasha-id
sasha-id / proxmoxlxcjellyfin.md
Created September 30, 2024 06:51 — forked from parasbhanot/proxmoxlxcjellyfin.md
Proxmox LXC Alpine Docker Jellyfin

How to setup VA-API within Proxmox LXC Unprivileged container

Proxmox configuration

No drivers need to be installed on the proxmox, from now called host.

Find GIDs of video and render group on host:

cat /etc/group | grep video

cat /etc/group | grep render

@sasha-id
sasha-id / README.md
Created September 13, 2024 06:16 — forked from kdmukai/README.md
Create a Bitcoin Core node in Proxmox

Create a Bitcoin Core Node CT in Proxmox

Create the CT:

  • Debian 12 image
  • 4GB system disk in local-lvm
  • 6GB RAM, 0 swap

Add a data disk mount point

In the CT's "Resources" > "Add" > "Mount point":

  • Storage: "Directory" disk from above
@sasha-id
sasha-id / codedeploy-install.sh
Created February 27, 2023 23:15
Installs CodeDeploy agent and its prerequisites on Ubuntu 22.04 given AWS CodeDeploy team doesn't exist
#!/bin/bash
# Installs CodeDeploy agent and its prerequisites on Ubuntu 22.04 given AWS CodeDeploy team doesn't exist
# https://docs.aws.amazon.com/codedeploy/latest/userguide/codedeploy-agent.html#codedeploy-agent-version-history
CODEDEPLOY_VERSION=1.4.1-2244
sudo apt update
sudo apt install ruby-full ruby-webrick wget -y
cd /tmp
@sasha-id
sasha-id / vscode-snippets.rb
Created September 10, 2022 16:36
VScode snippets shortcuts for typescript/react, dash docset
cheatsheet do
title 'VSCode snippets' # Will be displayed by Dash in the docset list
docset_file_name 'VSCode-snippets' # Used for the filename of the docset
keyword 'typescript' # Used as the initial search keyword (listed in Preferences > Docsets)
# resources 'resources_dir' # An optional resources folder which can contain images or anything else
introduction 'Snippet shortcuts for vscode' # Optional, can contain Markdown or HTML
# https://github.com/accierro/react-typescript-snippets
category do
@sasha-id
sasha-id / query.sql
Created August 2, 2022 19:35
Query to find locking pids
select pid,
usename,
pg_blocking_pids(pid) as blocked_by,
query as blocked_query
from pg_stat_activity
where cardinality(pg_blocking_pids(pid)) > 0;
@sasha-id
sasha-id / __init__.py
Created July 20, 2022 05:15
jinja2 webpack extension for flask/quart: add this to __init__.py
# Webpack loader: manifest.json map generated by webpacker
manifest = orjson.loads(open(f'{app.static_folder}/dist/manifest.json').read())
def webpack(pack):
filename = 'bundle.js' if app.config['ENV'] == 'development' else manifest.get(pack)
return f'{app.static_url_path}/dist/{filename}'
app.jinja_env.globals.update(webpack=webpack)
# Use in template <script src="{{ webpack('main.js') }}"></script>
@sasha-id
sasha-id / decode-django-session.py
Created June 11, 2022 02:03
Decode django (version 4) session outside django
from django.core import signing
from django.conf import settings
from django.utils.module_loading import import_string
session_data = 'xxxxxxx'
settings.configure(SECRET_KEY = 'XXXX')
signing.loads(
session_data,
salt="django.contrib.sessions.SessionStore",
@sasha-id
sasha-id / aws-s3-copy-with-versions.rb
Created November 30, 2021 13:08
Copy S3 bucket from one account to another with versions
require 'aws-sdk-s3'
require 'concurrent'
source_bucket = 'xxx'
dest_bucket = 'xxx'
acl = 'public-read'
client = Aws::S3::Client.new(
region: 'ap-southeast-2',
@sasha-id
sasha-id / export.sh
Created November 10, 2021 09:19
EB export env variables
export $(cat /opt/elasticbeanstalk/deployment/env | xargs)
@sasha-id
sasha-id / gist:2df77ec7c3b27b965f3b7ac0a997ce36
Created January 21, 2021 05:45 — forked from den-crane/gist:6eff375752a236a456e1b3dc2ca7db62
Clickhouse example AggregatingMergeTree, (max, min, avg ) State / Merge
DROP TABLE IF EXISTS requests;
CREATE TABLE requests (
request_date Date,
request_time DateTime,
response_time Int,
request_uri String)
ENGINE = MergeTree(request_date, (request_time, request_uri), 8192);