Skip to content

Instantly share code, notes, and snippets.

View sergeyklay's full-sized avatar

Serghei Iakovlev sergeyklay

View GitHub Profile
{
"mcpServers": {
"knowledgebase_db": {
"type": "stdio",
"command": "uv",
"args": [
"run",
"python",
"./.cursor/postgres.py",
"--db",
@sergeyklay
sergeyklay / sed-cheatsheet.md
Last active April 8, 2025 06:13
Sed Cheatsheet

Sed Cheat Sheet

Sed command line options

sed [options] sed-command [input-file]
Option Description Example
@sergeyklay
sergeyklay / journalctl-cheatsheet.md
Last active April 8, 2025 04:54
Journalctl Cheat Sheet

Journalctl Cheat Sheet

Configuration

Permissions

To see messages from other users and the system as well as performing various log operations from a regular user add it to the group:

sudo usermod -aG systemd-journal $USER

My Personal WeeChat Cheat Sheet

Requirements

You need at least WeeChat 3.2-dev

Install

Ubuntu/Debian

@sergeyklay
sergeyklay / simple-rag-example.py
Last active January 23, 2025 19:50
A Retrieval-Augmented Generation (RAG) proof-of-concept that uses Dense Passage Retrieval (DPR) and GPT-2 to answer questions from a document.
import sys
from typing import List, Optional, Tuple
import faiss
import numpy as np
import torch
from transformers import (
AutoModelForCausalLM,
AutoTokenizer,
DPRContextEncoder,
#!/usr/bin/env bash
# Copyright (C) 2025 Serghei Iakovlev <gnu@serghei.pl>
#
# This file is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# This file is distributed in the hope that it will be useful,
@sergeyklay
sergeyklay / CMakeLists.txt
Last active December 30, 2024 16:37
CMakeLists.txt for PHP-extension. This CMake file is just for syntax highlighting in CLion.
cmake_minimum_required(VERSION 3.5)
project(extname
VERSION 1.0.0
LANGUAGES C)
message(STATUS "Begin cmaking of PHP extension ...")
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Debug CACHE STRING
@sergeyklay
sergeyklay / phpenv-install.md
Last active November 10, 2024 14:36
Multiple PHP versions using phpenv and php-build

Multiple PHP versions using phpenv and php-build

Install dependecies

Debian/Ubuntu users

sudo apt install \
  autoconf \
  bison \

Find Repositories Without CODEOWNERS

This script fetches all repositories within a specified GitHub organization and identifies those without a CODEOWNERS file in repository root. It excludes archived/disabled repositories and forks.

Prerequisites

  1. Ensure you have Node.js installed.
  2. Install the required packages using npm:
diff --git a/init.el b/init.el
index c431854..014d90c 100644
--- a/init.el
+++ b/init.el
@@ -284,7 +284,6 @@ Set DEBUG=1 in the command line or use --debug-init to enable this.")
;;;; Project management
(use-package project
- :defer t
:commands (project-find-file