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
// ==UserScript== | |
// @name cloud.mail.ru folder size sum | |
// @description Shows folder sum size in Mb for russian locale | |
// @match *://cloud.mail.* | |
// ==/UserScript== | |
const getSizeInMb = (size) => { | |
switch (true) { | |
case size.includes('МБ'): | |
return parseFloat(size.substring(0, size.length - 3)); |
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
SELECT table_name AS "Table", | |
ROUND(((data_length + index_length) / 1024 / 1024), 2) AS "Size (MB)" | |
FROM information_schema.TABLES | |
WHERE table_schema = "database_name" | |
ORDER BY (data_length + index_length) DESC; |
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
# Backup | |
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
# Restore | |
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |
# Backup to gzip | |
pg_dump db_name | gzip > dump_name.sql.gz | |
# Restore from gzip |
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
var elems = document.getElementsByClassName('collection'); | |
for (let idx in elems) { | |
var elem = elems[idx]; | |
var countElem = elem.querySelector('.count'); | |
if (countElem.textContent !== "") { | |
continue; | |
} | |
var actionsElem = elem.querySelector('.actions'); |