Skip to content

Instantly share code, notes, and snippets.

SELECT TABLE_SCHEMA, TABLE_NAME, ROUND((DATA_LENGTH + INDEX_LENGTH) / 1024 / 1024 / 1024, 2) AS `Size / GB`
FROM information_schema.TABLES
ORDER BY (DATA_LENGTH + INDEX_LENGTH) DESC;
@aivis
aivis / nginx.conf
Created May 3, 2017 19:07 — forked from erikcw/nginx.conf
Simple nginx lua script to add UUID to each request for end to end request tracking.
# Dependencies
# nginx_lua
# lua uuid module (luarocks install uuid)
http {
# this will be the request id
map $host $request_uuid {
default '';
}
$guzzle = new \GuzzleHttp\Client();

// make sure your {YOUR-INPUT-KEY} is valid 
$res = $guzzle->request('POST', 'https://api.understand.io/{YOUR-INPUT-KEY}', [
    'json' => ['key2' => ['sub' => 123]]
]);

var_dump((string)$res->getBody()); // string(25) "{"count":1,"status":true}"
@aivis
aivis / captcha.md
Last active September 14, 2016 08:39
$.post('https://epak.csdd.lv/pswrestore/?cmd=pswRestore&contentOnly=false', {captcha: 1, email: '[email protected]'});
#!/usr/bin/env bash
apt-get -y update
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev
cd /tmp
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p194.tar.gz
tar -xvzf ruby-1.9.3-p194.tar.gz
cd ruby-1.9.3-p194/
./configure --prefix=/usr/local
make
make install