Skip to content

Instantly share code, notes, and snippets.

View jjmartres's full-sized avatar
🚀
looking for a new position !

Jean-Jacques Martrès jjmartres

🚀
looking for a new position !
View GitHub Profile
#!/bin/bash
/usr/bin/mysql -e "SELECT s.schema_name, CONCAT(IFNULL(ROUND((SUM(t.data_length)+SUM(t.index_length))/1024/1024,2),0.00),\"Mb\") total_size, CONCAT(IFNULL(ROUND(((SUM(t.data_length)+SUM(t.index_length))-SUM(t.
data_free))/1024/1024,2),0.00),\"Mb\") data_used, CONCAT(IFNULL(ROUND(SUM(data_free)/1024/1024,2),0.00),\"Mb\") data_free, IFNULL(ROUND((((SUM(t.data_length)+SUM(t.index_length))-SUM(t.data_free))/((SUM(t.data
_length)+SUM(t.index_length)))*100),2),0) pct_used FROM INFORMATION_SCHEMA.SCHEMATA s, INFORMATION_SCHEMA.TABLES t WHERE s.schema_name = 'khp_nms_db_01' GROUP BY s.schema_name ORDER BY total_size DESC; SELECT
s.schema_name, table_name, CONCAT(IFNULL(ROUND((SUM(t.data_length)+SUM(t.index_length))/1024/1024,2),0.00),\"Mb\") total_size, CONCAT(IFNULL(ROUND(((SUM(t.data_length)+SUM(t.index_length))-SUM(t.data_free))/10
24/1024,2),0.00),\"Mb\") data_used, CONCAT(IFNULL(ROUND(SUM(data_free)/1024/1024,2),0.00),\"Mb\") data_free, IFNULL(ROUND((((SUM(t.data_length)+SUM(t.index_length))-SUM(t
@jjmartres
jjmartres / README.md
Last active July 9, 2021 06:54 — forked from e7d/README.md
Build a Squid transparent proxy from source code
#!/bin/bash
#
# Watch current directory (recursively) for file changes, and execute
# a command when a file or directory is created, modified or deleted.
#
# Written by: Senko Rasic <[email protected]>
#
# Requires Linux, bash and inotifywait (from inotify-tools package).
#
# To avoid executing the command multiple times when a sequence of
@jjmartres
jjmartres / README.md
Created September 12, 2013 08:33 — forked from mbostock/.block

Run like so:

node gist-clone-all.js username

You'll want to replace "username" with your own username.

This script clones using the push URL, so you should probably be the owner of the gists. You could also use this to clone someone else's gists, but in that case you may wish to edit the code to use gist_pull_url instead.

@jjmartres
jjmartres / osx.sh
Created March 15, 2013 19:50 — forked from edsonaj/osx.sh
#!/bin/bash
# Based on https://github.com/mathiasbynens/dotfiles/blob/master/.osx
###############################################################################
# General UI/UX #
###############################################################################
# Set computer name (as done via System Preferences → Sharing)
scutil --set ComputerName "Edson Alves Junior's MacBook Pro"
scutil --set HostName "Edson Alves Junior's MacBook Pro"
@jjmartres
jjmartres / osx.sh
Created March 15, 2013 19:27 — forked from edsonaj/osx.sh
#!/bin/bash
# Based on https://github.com/mathiasbynens/dotfiles/blob/master/.osx
###############################################################################
# General UI/UX #
###############################################################################
# Set computer name (as done via System Preferences → Sharing)
scutil --set ComputerName "Edson Alves Junior's MacBook Pro"
scutil --set HostName "Edson Alves Junior's MacBook Pro"