This content from this markdown file has moved a new, happier home where it can serve more people. Please check it out : https://docs.microsoft.com/azure/azure-cache-for-redis/cache-best-practices.
This file contains hidden or 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
| blueprint: | |
| name: Aqara Magic Cube | |
| description: Control anything using Aqara Magic Cube. | |
| domain: automation | |
| input: | |
| remote: | |
| name: Magic Cube | |
| description: Select the Aqara Magic Cube device | |
| selector: | |
| device: |
My Elasticsearch cheatsheet with example usage via rest api (still a work-in-progress)
This file contains hidden or 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
| # COPY REAL TIME / NEW DATA | |
| while true; do exec redis-cli -h [old-endpoint] monitor | sed -u 's/.*]//' | grep -vi "get\|ping" | redis-cli -h [new-endpoint] >> /dev/null; done; | |
| # COPY DATA ON REDIS with TTL | |
| redis-cli -h [old-endpoint] --scan | while read key; do tempTTL=$(redis-cli -h [old-endpoint] TTL "$key"); ttl=$tempTTL;if [ $tempTTL -lt 0 ]; then ttl=0; fi; redis-cli -h [old-endpoint] --raw DUMP "$key" | head -c -1 |redis-cli -x -h [new-endpoint] RESTORE "$key" $ttl; echo "copied $key $ttl"; done |
This file contains hidden or 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
| // All material is licensed under the Apache License Version 2.0, January 2004 | |
| // http://www.apache.org/licenses/LICENSE-2.0 | |
| // go test -run none -bench . -benchtime 3s -benchmem | |
| // Tests to see how each algorithm compare. | |
| package main | |
| import ( | |
| "bytes" |
This file contains hidden or 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
| package main | |
| import ( | |
| "bytes" | |
| "compress/gzip" | |
| "compress/lzw" | |
| b64 "encoding/base64" | |
| "encoding/binary" | |
| "encoding/json" | |
| "fmt" |
Sniffing HTTP request/response with tcpdump
tcpdump -A -s 0 'tcp dst port 80 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)'
Sniffing TCP request/response with tcpdump to UTF-8
tcpdump tcp port 2112 -s 16000 -w - | tr -t '[^[:print:]]' ''
Sniffing Datadog Metrics sent
This file contains hidden or 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
| import initStoryshots, { | |
| multiSnapshotWithOptions, | |
| imageSnapshot | |
| } from "@storybook/addon-storyshots"; | |
| import path from "path"; | |
| initStoryshots({ | |
| suite: "Storyshots", | |
| integrityOptions: { cwd: __dirname }, | |
| test: multiSnapshotWithOptions({}) |
This file contains hidden or 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
| { | |
| "name": "storybook-example", | |
| "version": "0.1.0", | |
| "private": true, | |
| "dependencies": { | |
| "axios": "^0.18.0", | |
| "cross-env": "^5.1.4", | |
| "npm-run-all": "^4.1.2", | |
| "react": "^16.3.1", | |
| "react-dom": "^16.3.1", |
NewerOlder