SELECT CONCAT(table_schema, '.', table_name),
CONCAT(ROUND(table_rows / 1000000, 2), 'M') rows,
CONCAT(ROUND(data_length / ( 1024 * 1024 * 1024 ), 2), 'G') DATA,
CONCAT(ROUND(index_length / ( 1024 * 1024 * 1024 ), 2), 'G') idx,
CONCAT(ROUND(( data_length + index_length ) / ( 1024 * 1024 * 1024 ), 2), 'G') total_size,
ROUND(index_length / data_length, 2) idxfrac
FROM information_schema.TABLES
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"os" | |
"fmt" | |
"log" | |
"debug/elf" | |
) | |
func main() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\n\n | |
content_type: %{content_type}\n | |
filename_effective: %{filename_effective}\n | |
ftp_entry_path: %{ftp_entry_path}\n | |
http_code: %{http_code}\n | |
http_connect: %{http_connect}\n | |
local_ip: %{local_ip}\n | |
local_port: %{local_port}\n | |
num_connects: %{num_connects}\n | |
num_redirects: %{num_redirects}\n |
tcpdump -A -s 10240 'tcp port 80 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)' | egrep --line-buffered "^........(GET |HTTP\/|POST |HEAD )|^[A-Za-z0-9-]+: " | sed -r 's/^........(GET |HTTP\/|POST |HEAD )/\n\1/g'
tcpdump -i ens4 -A -s 10240 'dst 172.21.43.252 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)'
sudo tcpdump -i lo -s0 -nl -w- dst port postgres | strings -n8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"github.com/gographics/imagick/imagick" | |
) | |
func main() { | |
imagick.Initialize() | |
defer imagick.Terminate() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
from rdbtools import RdbParser, RdbCallback | |
class MyCallback(RdbCallback) : | |
def set(self, key, value, expiry,info): | |
if expiry is None: | |
print('%s = %s' % (str(key), str(expiry))) | |
callback = MyCallback() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# example cron script to post logs to Jenkins | |
# exit on error | |
set -e | |
log=`mktemp -t tmp.XXXX` | |
timer=`date +"%s"` | |
jenkins_job=$1 | |
jenkins_server=http://192.168.33.10:8080/job/$jenkins_job/postBuildResult |