Skip to content

Instantly share code, notes, and snippets.

View doytsujin's full-sized avatar
🎯
Private Account

Alexander Chernov doytsujin

🎯
Private Account
View GitHub Profile
@doytsujin
doytsujin / gist:b804d86ffc574d83df2d6d63f3a1f6e8
Created April 20, 2025 15:52 — forked from seanh/gist:3414107
Basic Orientation to CKAN (for developers)

Basic Orientation to CKAN (for developers)

Some of the most important layers in the CKAN code architecture, going from lowest-level up to highest-level:

##Database

CKAN uses SQLAlchemy (http://www.sqlalchemy.org/) to handle communication between CKAN source code and the PostgreSQL database (http://www.postgresql.org/).

Model

@doytsujin
doytsujin / Dockerfile
Created March 24, 2025 14:54 — forked from gyndav/Dockerfile
install Scala and sbt on Alpine Linux
FROM openjdk:8u151-jre-alpine
ENV SCALA_VERSION=2.12.4 \
SCALA_HOME=/usr/share/scala
# NOTE: bash is used by scala/scalac scripts, and it cannot be easily replaced with ash.
RUN apk add --no-cache --virtual=.build-dependencies wget ca-certificates && \
apk add --no-cache bash curl jq && \
cd "/tmp" && \
wget --no-verbose "https://downloads.typesafe.com/scala/${SCALA_VERSION}/scala-${SCALA_VERSION}.tgz" && \
@doytsujin
doytsujin / scrollablechart.js
Created November 19, 2024 01:48
GPU scrollable chart
<script>
// API Base URL
const apiUrl = "https://localhost/api/gpu-frequency";
// Chart instance and data storage
let gpuChart;
let chartData = { timestamps: [], frequencies: [] }; // To store fetched data
let isFetching = false; // Prevent multiple simultaneous fetches
// Fetch data for a specific time range
@doytsujin
doytsujin / DWM-ON-OS-X.md
Created March 21, 2024 17:25 — forked from vangberg/DWM-ON-OS-X.md
dwm on os x [work in progress!]

Installing and configuring dwm on OS X

  1. Install XQuartz (http://xquartz.macosforge.org) which is the development version of the X11.app that ships with OS X, which means it is way more up to date. I have had some weird issues with X11.app v. 2.3-something. XQuartz 2.5.0 fixed that.

  2. Install dwm from Homebrew, brew install dwm. This makes a bunch of necessary tweaks to the DWM configuration.

  3. Add the following script to $PATH, name it dwm-launch and chmod 755:

    cd ~
    

while true

@doytsujin
doytsujin / ssh_key.tf
Created March 13, 2024 19:11 — forked from irvingpop/ssh_key.tf
Terraform external data source example - dynamic SSH key generation
# ssh key generator data source expects the below 3 inputs, and produces 3 outputs for use:
# "${data.external.ssh_key_generator.result.public_key}" (contents)
# "${data.external.ssh_key_generator.result.private_key}" (contents)
# "${data.external.ssh_key_generator.result.private_key_file}" (path)
data "external" "ssh_key_generator" {
program = ["bash", "${path.root}/../ssh_key_generator.sh"]
query = {
customer_name = "${var.customer_name}"
customer_group = "${var.customer_group}"
@doytsujin
doytsujin / README.md
Created March 13, 2024 19:11 — forked from GusAntoniassi/README.md
Terraform external data provider - Shell script with input without jq

This is an example workaround for getting Terraform input variables when you won't have jq available in the executing machine.

Uses sed to parse the input JSON to extract a certain key from the input JSON.

Warning: this hasn't really been well-tested, it will pretty much work only with string values and will likely break for strings that have quotes. Might give you an idea of how to improve it for your implementation though.

Basic
======
[Shift]+[Mod]+[Enter] - launch terminal.
[Mod]+[b] - show/hide bar.
[Mod]+[p] - dmenu for running programs like the x-www-browser.
[Mod]+[Enter] - toggles windows between master and stack.
[Shift]+[Mod]+[2] - to move window to the 2 tag.
@doytsujin
doytsujin / 00-usb-keyboard.rules
Created June 5, 2023 19:55 — forked from PofMagicfingers/00-usb-keyboard.rules
Keyboard layout auto change with udev
ATTRS{idVendor}=="060b", ATTRS{idProduct}=="5252", OWNER="pof"
ACTION=="add", RUN+="/usr/local/bin/usb-keyboard-udev in"
ACTION=="remove", RUN+="/usr/local/bin/usb-keyboard-udev out"
@doytsujin
doytsujin / whisper-audio-to-text.py
Created January 27, 2023 02:42 — forked from rasbt/whisper-audio-to-text.py
Transcribes audio files using OpenAI Whisper
# Setup:
# conda create -n whisper python=3.9
# conda activate whisper
# https://github.com/openai/whisper
# pip install git+https://github.com/openai/whisper.git
# Usage:
# python whisper-audio-to-text.py --audio_dir my_files --out_dir texts
import argparse
@doytsujin
doytsujin / Twelve_Go_Best_Practices.md
Created December 23, 2022 00:54 — forked from pzurek/Twelve_Go_Best_Practices.md
Twelve Go Best Practices