Skip to content

Instantly share code, notes, and snippets.

View Olex1313's full-sized avatar
:shipit:
$HOME

Alexey Olex1313

:shipit:
$HOME
  • Moscow, Russia
View GitHub Profile
@Olex1313
Olex1313 / transcribe_lections.sh
Created June 16, 2025 09:18
Transcribe all uni lections from a s3 bucket with whisper cpp
#!/bin/bash
S3_BUCKET="hpc-lections"
WHISPER_CPP_PATH="whisper.cpp"
MODEL="large-v3"
LANG="ru"
AUDIO_EXTRACT=true
command -v aws >/dev/null 2>&1 || { echo >&2 "AWS CLI required."; exit 1; }
command -v ffmpeg >/dev/null 2>&1 && HAS_FFMPEG=true || HAS_FFMPEG=false
@Olex1313
Olex1313 / gist:7c6ffefef1491a231fb7a3fb3a78590c
Created April 25, 2025 08:53
Foundry VTT docker image from existing foundry distro
FROM node:23-alpine
# This is where the app data is stored (should not require a volume)
ENV FOUNDRY_APP_DIR=/home/foundry/app
# This is where persistence data is stored (make it a volume)
ENV FOUNDRY_DATA_DIR=/home/foundry/data
ENV UID=1000
ENV GUID=1000
set -g default-terminal "xterm-256color"
set -g prefix C-w
set-window-option -g mode-keys vi
bind -T copy-mode-vi v send -X begin-selection
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "pbcopy"
bind P paste-buffer
bind -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel
setw -g mouse on
set-option -s set-clipboard on
set-option -g default-command "reattach-to-user-namespace -l zsh"
@Olex1313
Olex1313 / clear_proto.go
Created October 9, 2023 06:23
Example cleanup function for protobuf message
func clearProtoFields(msg proto.Message, sensitiveFieldAnnotation *protoimpl.ExtensionInfo) proto.Message {
clonedMsg := proto.Clone(msg)
reflectMsg := proto.MessageReflect(clonedMsg)
var messagesToCheck []protoreflect.Message
messagesToCheck = append(messagesToCheck, reflectMsg)
for len(messagesToCheck) != 0 {
lastIdx := len(messagesToCheck) - 1
visitMessage := messagesToCheck[lastIdx]
messagesToCheck = messagesToCheck[:lastIdx]