Skip to content

Instantly share code, notes, and snippets.

View Voronenko's full-sized avatar
turning coffee into code since late 90s

Vyacheslav Voronenko

turning coffee into code since late 90s
View GitHub Profile
@Voronenko
Voronenko / cloudwatch_log_insights_mysql_slow_query_examples.md
Created June 23, 2023 12:38 — forked from qiangxue/cloudwatch_log_insights_mysql_slow_query_examples.md
CloudWatch Log Insights query examples for MySQL slow query log.

Filtering queries

Find slowest write queries

parse @message /Query_time: (?<queryTime>.*?) Lock_time: (<?lockTime>.*?) Rows_sent: (?<rowsSent>.*?) Rows_examined: (?<rowsExamined>.*?)\s(?<query>.*?)$/
  | filter @message like /(?i)insert/
  | sort queryTime desc
  | limit 10
@Voronenko
Voronenko / slow_query_log_dump.py
Created June 23, 2023 12:36 — forked from diafygi/slow_query_log_dump.py
Script to transform Amazon RDS slow log table into the MySQL slow query log format
"""
Queries the slowlog database table maintained by Amazon RDS and outputs it in
the normal MySQL slow log text format. Modified version of the script by
memonic (Thanks!) at https://gist.github.com/1481025
Things to change in this script for your own setup:
<root_user> to your mysql root user (e.g. "root")
<root_pass> to your mysql root password (e.g. "hunter2")
<host_domain> to your mysql root password (e.g. "prod-01.w3rfs2.us-east-1.rds.amazonaws.com")
@Voronenko
Voronenko / export-node-stats.md
Created October 30, 2022 21:58 — forked from ScriptingSquirrel/export-node-stats.md
Setup prometheus-node-exporter and push stats to Pushgateway with cron job

(Assuming a Debian 8-like system)

  • Install prometheus-node-exporter

    $ sudo apt update && sudo apt install prometheus-node-exporter
  • Configure prometheus-node-exporter to expose metrics only to localhost, not on to all networks. Modify file /etc/default/prometheus-node-exporter:

    # Set the command-line arguments to pass to the server.
@Voronenko
Voronenko / borg-borgmatic.markdown
Created July 18, 2022 08:37 — forked from BoxedBrain/borg-borgmatic.markdown
Install Borg-Backup & Borgmatic

Install Borg-Backup & Borgmatic

update packages

sudo apt update

Borg installation

go to tmp folder

cd /tmp/
@Voronenko
Voronenko / pull_apk.md
Created December 23, 2021 14:40 — forked from oozzal/pull_apk.md
Pull Apk from device
  1. Determine the package name of the app, e.g. "com.example.someapp". Skip this step if you already know the package name.

adb shell pm list packages

Look through the list of package names and try to find a match between the app in question and the package name. This is usually easy, but note that the package name can be completely unrelated to the app name. If you can't recognize the app from the list of package names, try finding the app in Google Play using a browser. The URL for an app in Google Play contains the package name.

  1. Get the full path name of the APK file for the desired package.
@Voronenko
Voronenko / getAppVersion.sh
Created November 21, 2021 21:08 — forked from martinschneider/getAppVersion.sh
Bash script to extract version information from APK and IPA files
#/bin/bash
#
# Extract the app version number from an APK/IPA file (on Linux)
#
# Required tools: aapt, plistutil, xmllint
#
# Usage:
# ------
# getAppVersion.sh android pathToApk
# getAppVersion.sh ios pathToIpa AppName.app
@Voronenko
Voronenko / How to Install JDK MacOS Homebrew.md
Created November 17, 2021 13:53 — forked from gwpantazes/How to Install JDK MacOS Homebrew.md
How to install different JDK versions on MacOS with Homebrew

How To Install Different JDK Versions on MacOS with Homebrew

Keywords: Java, JDK (Java Development Kit), MacOS, Homebrew, Specific Version

This how-to guide covers how to install different versions of the JDK on MacOS with Homebrew.

Table of Contents

@Voronenko
Voronenko / dashbord-to-jsonnet.py
Created September 30, 2021 11:05 — forked from tennix/dashbord-to-jsonnet.py
Convert Grafana dashboard json to jsonnet
#!/usr/bin/env python
import json
from jinja2 import Template
# git clone https://github.com/pingcap/tidb-docker-compose
# cd tidb-docker-compose
# git clone https://github.com/tennix/grafonnet-lib -b table
# python dashboard-to-jsonnet.py > pd.jsonnet
# jsonnet -J grafonnet-lib pd.jsonnet > config/dashboards/generated-pd.json
with open('config/dashboards/pd.json', 'r') as f:
data = json.load(f)
@Voronenko
Voronenko / sh2ju.sh
Created February 1, 2021 09:50 — forked from double16/sh2ju.sh
junit bash commands
#!/bin/bash
### Copyright 2010 Manuel Carrasco Moñino. (manolo at apache.org)
### Copyright 2016 Patrick Double (pat at patdouble.com)
###
### Licensed under the Apache License, Version 2.0.
### You may obtain a copy of it at
### http://www.apache.org/licenses/LICENSE-2.0
###
### A library for shell scripts which creates reports in jUnit format.
@Voronenko
Voronenko / HUAWEI_E3531.sh
Created November 18, 2020 08:00 — forked from elacheche/HUAWEI_E3531.sh
Little script to enable HUAWEI E3531 on Ubuntu
sudo apt-get update && sudo apt-get install usb-modeswitch && v=$(lsusb | grep "Huawei" | awk '{ print $6 }' | awk -F: '{ print $1 }'); p=$(lsusb | grep "Huawei" | awk '{ print $6 }' | awk -F: '{ print $2 }'); sudo usb_modeswitch -v $v -p $p -M '55534243123456780000000000000011062000000100000000000000000000'