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
""" | |
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") |
(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 tolocalhost
, not on to all networks. Modify file/etc/default/prometheus-node-exporter
:# Set the command-line arguments to pass to the server.
- 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.
- Get the full path name of the APK file for the desired package.
#/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 |
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.
#!/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) |
#!/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. |
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' |