field | optional | description |
---|---|---|
ts | N | BSON Timestamp. Often converted to 64bit INT for JSON |
h | Y | Random hash |
v | N | oplog protocol version. default 1. |
op | N | Type of op. one of i , u , d , n , c |
ns | N | BSON Namespacestring. Serialised as db.collection |
o | N | Operation applied. object |
o2 | Y | Object 2. Additional information, usually operand |
fromMigrate | Y | Boolean. Indicates if this operation is part of chunk migration between shards |
This file contains 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
set -ex | |
docker run --rm --volume "/var/lib/go-agent/pipelines/:/clean" busybox chown -R $(id -u):$(id -g) /clean/${PIPELINE_NAME} > /dev/null 2>&1 || true | |
rm -rf /var/lib/go-agent/pipelines/${PIPELINE_NAME} |
This file contains 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/env bash | |
set -x | |
awslocal s3 mb s3://my-bucket | |
cat > requests.csv <<EOF | |
"email1" | |
"email2" | |
"email3" | |
EOF |
This file contains 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 botocore | |
from botocore.exceptions import ClientError | |
from mock import patch | |
import boto3 | |
from util import get_credentials | |
orig = botocore.client.BaseClient._make_api_call | |
def mock_get_cluster_credentials(self, operation_name, kwarg): | |
if operation_name == 'GetClusterCredentials': |
This file contains 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
# Reads Bluteooth LE Eddystone beacon URL from Microbit | |
# https://github.com/frawau/aioblescan/blob/master/aioblescan/__main__.py#L27 | |
# enable bluetooth without sudo https://www.raspberrypi.org/forums/viewtopic.php?t=108581 | |
import asyncio | |
import aioblescan as aiobs | |
from datetime import datetime | |
from aioblescan.plugins import EddyStone |
This file contains 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
basic.forever(function () { | |
control.waitMicros(5000) | |
bluetooth.advertiseUrl( | |
"adc/" + pins.analogReadPin(AnalogPin.P0) + "/" + pins.analogReadPin(AnalogPin.P1) + "/" + pins.analogReadPin(AnalogPin.P2), | |
7, | |
false | |
) | |
}) |
This file contains 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
// list databases | |
db; | |
//select database to use | |
use test; | |
// find existing collections | |
db.getCollectionNames(); | |
//insert 1 document into a collection that doesn't exist |
This file contains 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
from bson import Timestamp | |
from datetime import datetime | |
ts=Timestamp(datetime.utcnow(), 1) | |
def ts_to_int(ts): | |
return (ts.time << 32) + ts.inc | |
def int_to_ts(t): | |
return Timestamp(t>>32, t & (2**32)-1) |
This file contains 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
{ | |
"ts": 6642324230736183304, | |
"h": -1695843663874728470, | |
"v": 2, | |
"op": "u", | |
"ns": "analysts.analysts", | |
"o": { | |
"$set": { | |
"r": 0 | |
} |
This file contains 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
from __future__ import print_function | |
import snowplow_analytics_sdk.event_transformer | |
import snowplow_analytics_sdk.snowplow_event_transformation_exception | |
import base64 | |
import json | |
print('Loading function') |
NewerOlder