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
<?php | |
/** | |
* Get random elements by segments | |
* | |
* If you pass 100 elements with limit 5, it will return 5 elements in following order: | |
* | |
* First: rand between 0 - 20 | |
* Second: rand between 20 - 40 | |
* Third: rand between 40 - 60 |
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
ls | |
ls *{pattern}* "list files like *pattern*" | |
ls -la | |
ll | |
tail -f {filename} | |
tail {filename} | |
head {filename} | |
cat {filename} | |
grep {what} {filename} "occurence in file" | |
grep {what} {filename} -A 20 -B 20 "-A lines after, -B lines before" |
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_schema AS `Database`, | |
table_name AS `Table`, | |
ROUND(((data_length + index_length) / 1024 / 1024 / 1024), | |
2) `Size in GB` | |
FROM | |
information_schema.TABLES | |
WHERE | |
ROUND(((data_length + index_length) / 1024 / 1024 / 1024), 2) > 1 | |
ORDER BY (data_length + index_length) DESC; |