Skip to content

Instantly share code, notes, and snippets.

View bibendi's full-sized avatar

Misha Merkushin bibendi

View GitHub Profile
@bibendi
bibendi / force-star-before-issue.yml
Created February 11, 2026 12:55
GitHub Action: force-star-before-issue
name: Close Issue if Creator Didn't Star Repo
on:
issues:
types: [opened, reopened]
jobs:
check-star:
runs-on: ubuntu-latest
steps:
@bibendi
bibendi / Makefile
Last active October 12, 2025 18:13
Linux Shadowsocks Client Proxy
SERVICE = shadowsocks-local
CONFIG = /etc/shadowsocks-libev/config.json
GREEN = \033[0;32m
RED = \033[0;31m
RESET = \033[0m
.PHONY: help install start stop status enable disable test logs
help:
@echo "Доступные цели:"
@bibendi
bibendi / Get started with local and remote LLM GPT.md
Last active December 15, 2024 17:06
Get started with local and remote LLM GPT.md

[[GPT]] Гайд для тех, кто не хочет делиться своими данными при общении с AI чатами или сэкономить 20 баксов на подписку, а тратить не больше 5 в крипте. То есть с LLM моделя можно работать как полностью локально (важна оперативка), либо через провайдера OpenRouter. Сначала немного теории. Что такое [[LLM]] модели https://www.youtube.com/watch?v=zjkBMFhNj_g

Private local LLM

Для работа offline с [[LLM]] модели вам нужно следующее:

  • Устанавливаем Ollama сервер. Это как Docker, только для моделей
    • Скачиваем сервере с https://ollama.com/
    • Выбираем модель https://ollama.com/library и скачиваем ее. Если у вас не более 16Gb RAM, то я рекомендую wizardlm2:7b. Это неплохая модель, немного хуже, чем chatGPT 3.5.
    • Команда следующая: ollama run wizardlm2:7b-q5_K_M. После скачивания запуститься промт, в котором можно проверить модель, ну либо сразу закрыть. На верхней панели должна появиться иконка с запущенной ламой.

Remote LLM

@bibendi
bibendi / .zshrc
Last active December 24, 2021 07:15
Dual architecture on M1 Apple Silicon
# Homebrew
_ARCH=$(arch)
PROMPT="$_ARCH $PROMPT"
if [[ "$_ARCH" == "i386" ]]; then
local brew_path="/usr/local/homebrew/bin"
local brew_opt_path="/usr/local/homebrew/opt"
local nvm_path="$HOME/.nvm-x86"
local rbenv_path="$HOME/.rbenv-x86"
fi
if [[ "$_ARCH" == "arm64" ]]; then
@bibendi
bibendi / installing-ruby-2.5.1-on-m1.md
Created December 22, 2021 09:16 — forked from MarkBennett/installing-ruby-2.5.1-on-m1.md
Installing Ruby 2.5 on Mac M1
@bibendi
bibendi / db.rake
Created November 9, 2021 06:45
Disabling schema dumping for the statistics database on Rails 6.
raise "Remove patches below in Rails 7" if Rails::VERSION::MAJOR == 7
Rake::Task["db:schema:load:statistics"]&.clear
Rake::Task["db:_dump:statistics"]&.clear
Rake::Task["db:schema:dump:statistics"]&.clear
Rake::Task["db:test:load_schema:statistics"]&.clear
namespace :db do
namespace :schema do
desc "Creates a database schema file (either db/schema.rb or db/structure.sql, depending on `config.active_record.schema_format`)"
task dump: :load_config do
namespace :db do
namespace :bloat do
desc 'Поиск распухших таблиц'
task :tables => :environment do
redis = Redis::Namespace.new('db:bloat')
connection = ActiveRecord::Base.connection
connection.tables.each do |table_name|
begin
rows_counted = redis.hget('tables', table_name)
class MutationRoot < Common::GraphQL::MutationRoot
with_options authenticate: true do
field :create_direct_upload, mutation: Mutations::CreateDirectUpload
end
with_options authenticate: true, user_checks: {completed: true} do
field :follow_user, mutation: Mutations::FollowUser
field :unfollow_user, mutation: Mutations::UnfollowUser
end
end
# frozen_string_literal: true
module CoreBy
module FieldExtensions
# GraphQL field extension allows returning URL of Active Storage attachment.
# TODO: Move to `graphql-field_attachment` gem?
class AttachmentUrlField < GraphQL::Schema::FieldExtension
attr_reader :attachment_assoc
def apply
@bibendi
bibendi / rkn_unblock.md
Created November 7, 2019 19:37 — forked from furdarius/rkn_unblock.md
Настройка обхода РКН на роутере