Skip to content

Instantly share code, notes, and snippets.

View filimonov's full-sized avatar

filimonov filimonov

View GitHub Profile
@filimonov
filimonov / replug_vbox_network.cmd
Last active May 22, 2026 11:24
"Replug" the cable of running VirtualBox VM (network freeze in guest VM after host windows hybernate - awake)
@echo off
set VboxManageEXE="%VBOX_MSI_INSTALL_PATH%\VBoxManage.exe"
set ListRunningVMS=%VboxManageEXE% list runningvms
for /f tokens^=2^,4^ delims^=^" %%p in ('%ListRunningVMS%') do (
echo "%%p"
%VBoxManageEXE% controlvm %%p setlinkstate1 off
%VBoxManageEXE% controlvm %%p setlinkstate1 on
)

Claude Code TeammateTool - Source Code Analysis

This is not a proposal. This documents existing but hidden functionality found in Claude Code v2.1.19 binary, plus speculation on how it could be used.


Executive Summary

TeammateTool already exists in Claude Code. We extracted this from the compiled binary at ~/.local/share/claude/versions/2.1.19 using strings analysis. The feature is fully implemented but gated behind feature flags (I9() && qFB()).

@filimonov
filimonov / gist:691990c8e5ce901ca4734482c7cc81f9
Last active April 7, 2025 08:57
vscode + clickhouse-client: poorman integration
  1. File->Preferences->Settings terminal.integrated.scrollback, Increase the buffer size for terminal (i use 100000)

  2. File->Prefernces->Keyboard shortcuts workbench.action.terminal.runSelectedText set up some binding like Ctrl+Shift+'

  3. Open terminal window: Terminal->New Terminal

  4. Run clickhouse-client in a terminal.

@filimonov
filimonov / gist:c37a31d30692b78fddec1fd439c1f7eb
Last active April 5, 2024 06:52
perl stack trace from gdb (also from coredump)
define perl_stack
set $end=my_perl->Icurstackinfo->si_cxix
set $i=0
while ($i<$end)
printf "%d:%s\n", my_perl->Icurstackinfo->si_cxstack[$i].cx_u.cx_blk.blku_oldcop->cop_line, my_perl->Icurstackinfo->si_cxstack[$i].cx_u.cx_blk.blku_oldcop->cop_file
set $i=$i+1
end
printf "%d:%s\n",my_perl->Icurcop->cop_line, my_perl->Icurcop->cop_file
end
@filimonov
filimonov / clickhouse_build_centos.sh
Last active January 26, 2024 01:26
Clickhouse build on Centos 6/ Centos 7 / RedHat
# Tested on Centos 6.9 and Centos 7.4. ClickHouse vesion 1.1.54236
# Official build instructions:
# https://github.com/yandex/ClickHouse/blob/master/doc/build.md
# See also https://github.com/redsoftbiz/clickhouse-rpm
# and https://github.com/Altinity/clickhouse-rpm
export THREADS=$(grep -c ^processor /proc/cpuinfo)
# Determine RHEL major version
RHEL_VERSION=`rpm -qa --queryformat '%{VERSION}\n' '(redhat|sl|slf|centos|oraclelinux|goslinux)-release(|-server|-workstation|-client|-computenode)'`
@filimonov
filimonov / runningDifference_group_by.sql
Created July 4, 2018 10:17
clickhouse runningDifference inside groups
DROP TABLE IF EXISTS test;
CREATE TABLE test (sessionid String, timestamp DateTime) ENGINE = Log;
INSERT INTO test SELECT 's1', arrayJoin([now(), now() + 10, now() + 21, now() + 33]);
INSERT INTO test SELECT 's2', arrayJoin([now()+33, now() + 34, now() + 35, now() + 36]);
INSERT INTO test SELECT 's3', arrayJoin([now()+40, now() + 60, now() + 61, now() + 80]);
WITH
groupArray( timestamp ) as all_timestamps_in_group,
# uname -a
# Linux ip-172-31-1-128 5.4.0-1038-aws #40-Ubuntu SMP Fri Feb 5 23:53:34 UTC 2021 aarch64 aarch64 aarch64 GNU/Linux
git clone --depth=1 --branch=docker_server_from_ci_builds https://github.com/filimonov/ClickHouse.git
cd ClickHouse/docker/server/
docker build . --network host --build-arg single_binary_location="https://builds.clickhouse.tech/master/aarch64/clickhouse"
docker image ls
docker tag 98f169cda25a altinity/clickhouse-server:21.4.1.6307-testing-arm
docker login
@filimonov
filimonov / random_ascii_data.sql
Created January 2, 2019 09:37
fill table with random ascii data in ClickHouse
CREATE TABLE ascii_random_data ENGINE=TinyLog
AS
WITH
arrayStringConcat(
arrayMap(
x -> reinterpretAsString( toUInt8( rand(x) % 96 + 0x20 ) ),
range( 1024 )
)
) as str1024,
substring(str1024, 1, 512 + bitAnd(rand(),0x1FF) ) as str
@filimonov
filimonov / _etc_clickhouse-server_dict_sources.xml
Created August 31, 2018 09:17
ClickHouse dictionaries with connection credentials substituted from another file
<?xml version="1.0"?>
<yandex>
<mysql_config>
<port>3306</port>
<user>user</user>
<password>123</password>
<replica>
<host>mysql_host</host>
<priority>1</priority>