Skip to content

Instantly share code, notes, and snippets.

@vietcf
vietcf / mysql
Created December 14, 2016 03:08
mysql> select TABLE_SCHEMA, table_name, round(data_length/1024/1024) as data_length_mb, round(data_free/1024/1024) as data_free_mb from information_schema.tables where round(data_free/1024/1024) > 100 order by data_free_mb;
+--------------+---------------+----------------+--------------+
| TABLE_SCHEMA | table_name | data_length_mb | data_free_mb |
+--------------+---------------+----------------+--------------+
| f319_xen | xf_search | 14 | 104 |
| f319_xen | xf_user_alert | 0 | 115 |
+--------------+---------------+----------------+--------------+
@vietcf
vietcf / nginx.conf
Created August 30, 2016 04:52 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@vietcf
vietcf / check_port
Last active August 29, 2015 14:15 — forked from hafthanhf/check_port
#!/bin/bash
OK=0
CRITICAL=2
STATE=0
PLUGIN_PATH="/usr/local/nagios/libexec/"
OID_sysDescr=SNMPv2-MIB::sysDescr.0
OID_hostname=SNMPv2-MIB::sysName.0
COMMUNITY=bimat
VERSION="1.1"
author="hafthanhf"
import socket
if __name__ == "__main__":
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect(("localhost", 9000))
data = "some data"
sock.sendall(data)
result = sock.recv(1024)
print result
sock.close()