jq is useful to slice, filter, map and transform structured json data.
brew install jq
| -- show running queries (pre 9.2) | |
| SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
| FROM pg_stat_activity | |
| WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
| ORDER BY query_start desc; | |
| -- show running queries (9.2) | |
| SELECT pid, age(clock_timestamp(), query_start), usename, query | |
| FROM pg_stat_activity | |
| WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
| # to generate your dhparam.pem file, run in the terminal | |
| openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
This can be applied generically but usually applies to Linux nodes that have a local caching nameserver running, which means pointing to an IP in the loopback range (127.0.0.0/8). Ubuntu 18.04 Bionic Beaver does this by default.
sudo systemctl mask systemd-resolved
rm -f /etc/resolv.conf
sudo ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf
| import { join } from 'path' | |
| import { readdir, stat } from 'fs-promise' | |
| async function rreaddir (dir, allFiles = []) { | |
| const files = (await readdir(dir)).map(f => join(dir, f)) | |
| allFiles.push(...files) | |
| await Promise.all(files.map(async f => ( | |
| (await stat(f)).isDirectory() && rreaddir(f, allFiles) | |
| ))) | |
| return allFiles |
| AWSTemplateFormatVersion: 2010-09-09 | |
| Parameters: | |
| RootDomainName: | |
| Type: String | |
| Mappings: | |
| RegionMap: | |
| us-east-1: | |
| S3HostedZoneID: Z3AQBSTGFYJSTF | |
| S3WebsiteEndpoint: s3-website-us-east-1.amazonaws.com | |
| us-west-1: |
| AWSTemplateFormatVersion: 2010-09-09 | |
| Parameters: | |
| RootDomainName: | |
| Type: String | |
| Mappings: | |
| RegionMap: | |
| us-east-1: | |
| S3HostedZoneID: Z3AQBSTGFYJSTF | |
| S3WebsiteEndpoint: s3-website-us-east-1.amazonaws.com | |
| us-west-1: |
Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...
// see: https://github.com/chadoe/docker-cleanup-volumes
$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm