Skip to content

Instantly share code, notes, and snippets.

View zomberg's full-sized avatar

zomberg zomberg

View GitHub Profile
@zomberg
zomberg / gist:7235b1620bf6bad6e6082b876325bc85
Created May 19, 2021 11:00
Find and kill process by port
sudo netstat -plten | grep {PORT}
sudo kill -8 {PID}
def flattify(array)
array.each_with_object([]) do |element, result|
flattened = element.is_a?(Array) ? flattify(element) : element
result.push(flattened)
end
end
puts flattify([[1, 2, [3]], 4])
@zomberg
zomberg / gist:d85d08556ee3978e8b47335369dd4611
Created January 28, 2017 09:28
Calculate size of databases
SELECT
table_schema,
ROUND(SUM(data_length + index_length) / 1024 / 1024) "size, MB"
FROM information_schema.TABLES
WHERE table_schema NOT IN ('mysql', 'information_schema', 'performance_schema', 'test')
GROUP BY table_schema;
php -i |grep -C4 -i version
http://www.debiantutorials.com/install-mysql-server-5-6-debian-7-8/
ab -n 1000 -c 10 -k -H "Accept-Encoding: gzip, deflate" http://symfony-bootstrap.local/