>
file redirects stdout to file1>
file redirects stdout to file2>
file redirects stderr to file&>
file redirects stdout and stderr to file
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
iconv -c -t UTF-8 <file> | tr -dC '[:print:]\t\n' | awk '{for(i = 1; i <= NF; i++) {a[$i]++}} END {for(k in a) if(a[k] >= 1) {print k, a[k]}}' | sort -n -k2 --reverse | less |
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
const fn = ({ a, o }) => ({a, ...o}); | |
const obj = { a:1, o: { b: 2, c: 3 } }; | |
const r = fn(obj); | |
// r = { a: 1, b: 2, c: 3 } |
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
// doesn't work | |
const counter = { | |
val: 0, | |
next: () => ++this.val, // eslint-disable-line no-plusplus | |
}; | |
counter.val; // 0 | |
counter.next(); | |
counter.val; // 0 | |
// DOES work |
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
#!/usr/bin/python | |
from azure.storage import BlobService | |
import argparse | |
parser = argparse.ArgumentParser() | |
parser.add_argument("container", help="the blob container") | |
parser.add_argument("blob", help="the blob name") | |
parser.add_argument("-s", "--snapshot", help="take a new snapshot", action="store_true") | |
parser.add_argument("-d", "--delete", help="delete a snapshot") |
Using from https://github.com/wurstmeister/kafka-docker.git and docker-compose.yml
is:
version: '2'
services:
zookeeper:
image: wurstmeister/zookeeper
ports:
- "2181:2181"
volumes:
You'll get the same exception if the index was created defining a PRIMARY KEY or UNIQUE constraint (ref).
In that case the simple solution is to use the ALTER-TABLE-command instead:
ALTER TABLE tbl1 DROP CONSTRAINT ix_cox
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
find . -name "node_modules" -type d -prune -exec rm -rf '{}' + |
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
/* | |
* AWS Sdk KMS spike: (assuming node v6.6+) | |
* 1 - Create master key at KMS | |
* 2 - Copy alias or ARN | |
* 3 - run this i.e. | |
* $ node spike.js KEY_ALIAS YOUR_PLAINTEXT_TO_ENCRYPT | |
* | |
* Taken from https://gist.github.com/raytung/f7dc78bb4310d02217111246da8cfdb3 | |
*/ | |
const AWS = require('aws-sdk'); |