Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)
First one found from of
import { decode } from "blurhash" | |
export function blurHashToDataURL(hash: string | undefined): string | undefined { | |
if (!hash) return undefined | |
const pixels = decode(hash, 32, 32) | |
const dataURL = parsePixels(pixels, 32, 32) | |
return dataURL | |
} |
Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)
First one found from of
# 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 | |
In some cases, it is possible that PostgreSQL tables get corrupted. This can happen in case of hardware failures (e.g. hard disk drives with write-back cache enabled, RAID controllers with faulty/worn out battery backup, etc.), as clearly reported in this wiki page. Furthermore, it can happen in case of incorrect setup, as well.
One of the symptoms of such corruptions is the following message:
ERROR: missing chunk number 0 for toast value 123456 in pg_toast_45678
This almost surely indicates that a corrupted chunk is present within a table file. But there is a good way to get rid of it.
#!/bin/sh | |
set -ex | |
PATH=/bin:/sbin:/usr/bin:/usr/sbin | |
KEYMAP="us us" | |
HOST=alpine | |
USER=anon | |
ROOT_FS=ext4 | |
BOOT_FS=ext4 |
--- | |
### | |
# Elasticsearch Rolling restart using Ansible | |
### | |
## | |
## Why is this needed? | |
## | |
# | |
# Even if you use a serial setting to limit the number of nodes processed at one |
cat /usr/share/grafana/grafana-backup.sh | |
#!/bin/bash | |
DB="/var/lib/grafana/grafana.db" | |
BACKUP="/data/backup/grafana/grafana.db-$(date +%Y%m%d).bck" | |
SQLITE=/usr/bin/sqlite3 | |
ZIP=/bin/gzip | |
${SQLITE} ${DB} ".backup ${BACKUP}" | |
${ZIP} ${BACKUP} |
/* | |
Setup: | |
npm install ws | |
Usage: | |
Create an API key in Rancher and start up with: | |
node socket.js address.of.rancher:8080 access_key secret_key project_id | |
*/ | |
var WebSocket = require('ws'); |
About a year and a half ago, I wrote a "periodic update" of the npm CLI road map. Apparently the period is 19 months! Of the 7 high-level items on the list, we've since addressed 3, which I'm going to call "not bad", given that at least one of the things we shipped, which turned out to be npm@3
, is probably the most substantial rewrite of npm's core installer since the very early days of the CLI.
npm's developers need to trust its tests. They're the single most important signal that a new version of npm is not going to break users' workflows when a new release is pushed out. Unfortunately, we don't, and once we realized that, it became clear that we could no longer put off working on the test suite until we do trust the tests.
Here's the requirements we identified: