Skip to content

Instantly share code, notes, and snippets.

View ylacancellera's full-sized avatar

Yoann La Cancellera ylacancellera

View GitHub Profile
@ylacancellera
ylacancellera / gist:4b154fcb3170e08bc37f6ebf87886150
Last active October 23, 2023 12:24
oltp_rw_percent_large_text_compressed
#!/usr/bin/env sysbench
-- replace oltp_common.lua
-- cp oltp_common.lua /usr/share/sysbench/oltp_common.lua
-- usage
-- oltp_rw_unoptimized.lua \
-- --mysql-host=192.168.56.40 \
-- --mysql-password=sbtest \
" vim-bootstrap 2022-10-10 13:46:47
"*****************************************************************************
"" Vim-Plug core
"*****************************************************************************
let vimplug_exists=expand('~/.vim/autoload/plug.vim')
if has('win32')&&!has('win64')
let curl_exists=expand('C:\Windows\Sysnative\curl.exe')
else
let curl_exists=expand('curl')
#!/usr/bin/env sysbench
-- replace oltp_common.lua
-- cp oltp_common.lua /usr/share/sysbench/oltp_common.lua
-- usage
-- oltp_rw_unoptimized.lua \
-- --mysql-host=192.168.56.40 \
-- --mysql-password=sbtest \
-- Copyright (C) 2006-2018 Alexey Kopytov <akopytov@gmail.com>
-- This program 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 2 of the License, or
-- (at your option) any later version.
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
set optimizer_switch='use_invisible_indexes=on';
set optimizer_switch='skip_scan=off';
set optimizer_switch='hash_join=off';
set optimizer_switch='subquery_to_derived=on';
set optimizer_switch='hypergraph_optimizer=on';
set optimizer_switch='derived_condition_pushdown=off';
grep -oPz "CREATE TABLE \`.*\` \(\n(.*\`.*\`.*\n)*\) ENGINE=.*\n" output.txt | sed -Ee 's/^\).*[^(),]$/\0;/' > ddl.sql
echo -e $(grep "\"message\":" slowquery_logs.json | grep -o "#.*;") | sed -e 's/# Time/\n# Time/g' | sed -e 's/;\s*$/;/' > slowquery.log
cat << 'EOF' >> /tmp/ptstalk_trigger_non_primary.sh
#!/bin/bash
trg_plugin() {
mysql $EXT_ARGV -sN -e "select case when variable_value = 'Primary' then 0 else 1 end from information_schema.global_status where variable_name ='wsrep_cluster_status';"
}
EOF
chmod +x /tmp/ptstalk_trigger_non_primary.sh
sudo ./pt-stalk --stalk --function=/tmp/ptstalk_trigger_non_primary.sh --threshold=0 --cycles=1 --dest="${PTDEST}" -- --user=root --password=<mysql-root-pass>; &
cat << 'EOF' > /tmp/ptstalk_trigger_fc_active.sh
#!/bin/bash
trg_plugin() {
mysql $EXT_ARGV -sN -e "select case when variable_value = 'false' then 0 else 1 end from information_schema.global_status where variable_name ='wsrep_flow_control_active';"
}
EOF
chmod +x /tmp/ptstalk_trigger_fc_active.sh
sudo ./pt-stalk --stalk --function=/tmp/ptstalk_trigger_fc_active.sh --threshold=0 --cycles=1 --dest="${PTDEST}" -- --user=root --password=<mysql-root-pass>; &
@ylacancellera
ylacancellera / config.h
Created September 6, 2022 19:37
lily vial
#pragma once
/* VIAL UID for Lily58*/
#define VIAL_KEYBOARD_UID {0x7E, 0xFD, 0xFC, 0x5B, 0x7D, 0x39, 0x48, 0x06}
/* VIAL secure unlock keystroke - currently both big keys (typ. SPACE/ENTER) */
#define VIAL_UNLOCK_COMBO_ROWS {4, 9}
#define VIAL_UNLOCK_COMBO_COLS {4, 4}
/* Space reduction */