Problem You'd like to know how big is your PostgreSQL database. Solution Just run this query: SELECT pg_size_pretty(pg_database_size('database')) where: * database - your database name Read also PostgreSQL Disk Usage… »
Problem You'd like to know how big is the replication lag between master and slave on PostgreSQL. Solution You may run this query on your slave host: SELECT EXTRACT(EPOCH FROM (now() - pg_last_… »
Problem You want to delete plenty of branches in 1 line, e.g. you want to delete all release branches, named like: "release-1.0.0", "release-1.0.1" and so on Solution git branch -D… »
Problem You want to view all tables related to specific table by foreign keys. Or you'd like to see all tables related to specific column. Solution You can use this simple query: For specific table… »
Problem You have an unstable Docker container and need restart it automatically when it down. Solution Docker has useful parameter --restart with three options: no - do not restart container, default behavior always - restart… »
Problem: You need to group list of objects by field to map by object field. You have list of objects and need to group them by some field and get a Map<Field, List&… »
Problem You have big Collection of objects and would like to partition by NUMBER elements. As a result you'd like to have Collection with Collection, each of them containing NUMBER elements. For example: You have… »
Problem You need to get file over http and get it updates in realtime, like tail -f does it. Very useful if you have access to you logs only over http or ftp. Solution Script… »
Problem Sometimes you need to split your data by specific number of lines and paste them to another string using delimiter. Solution Script partition.py Partition STDIN by NUMBER of lines and put them into… »
Problem: You need to redirect user using javascript. Using vanilla JS, jQuery not nessesary Solution 1: Use this if you NOT need to put page to history // similar behavior as an HTTP redirect window.location.… »
Problem You forget or don't know administrator password for mysql or mariaDB. You should have access to server (terminal or ssh) Solution To reset mysql administrator (root) password you should: 1. Stop database: sudo systemctl… »