Skip to content

Instantly share code, notes, and snippets.

@ankurcha
ankurcha / list-storage-transferjobs.py
Created January 16, 2020 05:15
Simple python script to list running transfer jobs
import googleapiclient.discovery
import warnings
warnings.filterwarnings("ignore", "Your application has authenticated using end user credentials")
storagetransfer = googleapiclient.discovery.build('storagetransfer', 'v1')
def printTable(myDict, colList=None):
""" Pretty print a list of dictionaries (myDict) as a dynamically sized table.
If column names (colList) aren't specified, they will show in random order.
@ankurcha
ankurcha / linkerd.yaml
Last active May 16, 2017 16:46
Linkerd configuration
# runs linkerd in a daemonset, in linker-to-linker mode, with TLS for all calls
# from linkerd to linkerd
---
apiVersion: v1
kind: ConfigMap
metadata:
name: l5d-config
data:
config.yaml: |-
admin:
@ankurcha
ankurcha / ViewRegistryPollerTransform.java
Created January 5, 2017 20:33
Refreshing PCollectionView by polling view registry
public class ViewRegistryPollerTransform extends PTransform<PCollection<Row>, PCollection<MaterializedViewGenerator>> {
// configuration
private AnalyticsPipelineOptions opts;
private Duration bucketDuration;
public ViewRegistryPollerTransform(AnalyticsPipelineOptions opts, Duration bucketDuration) {
this.opts = opts;
this.bucketDuration = bucketDuration;
}
import com.brightcove.rna.model.Events;
import com.brightcove.rna.model.Row;
import io.grpc.Context;
import org.jetbrains.annotations.NotNull;
import org.mapdb.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
[u'video'] 6418
[] 3741
[u'date'] 765
[u'day'] 694
[u'player', u'video'] 393
[u'country'] 274
[u'device_type'] 254
[u'country', u'video'] 176
[u'referrer_domain', u'video'] 176
[u'player'] 147
com.google.bigtable.repackaged.com.google.cloud.grpc.io.IOExceptionWithStatus: Error in response stream
at com.google.bigtable.repackaged.com.google.cloud.grpc.scanner.ResultQueueEntry$ExceptionResultQueueEntry.getResponseOrThrow(ResultQueueEntry.java:88)
at com.google.bigtable.repackaged.com.google.cloud.grpc.scanner.ResponseQueueReader.getNextMergedRow(ResponseQueueReader.java:95)
at com.google.bigtable.repackaged.com.google.cloud.grpc.scanner.StreamingBigtableResultScanner.next(StreamingBigtableResultScanner.java:60)
at com.google.bigtable.repackaged.com.google.cloud.grpc.scanner.StreamingBigtableResultScanner.next(StreamingBigtableResultScanner.java:34)
at com.google.bigtable.repackaged.com.google.cloud.grpc.scanner.ResumingStreamingResultScanner.next(ResumingStreamingResultScanner.java:89)
at com.google.bigtable.repackaged.com.google.cloud.grpc.scanner.ResumingStreamingResultScanner.next(ResumingStreamingResultScanner.java:35)
at com.google.cloud.bigtable.dataflow.CloudBigtableIO$1.next(CloudBigta
@ankurcha
ankurcha / Readme.md
Created August 19, 2016 17:48
Kubernetes secrets creation scripts for mutual authentication and ssl generation
strict digraph "StepGraph" {
subgraph "cluster AnalyticsTransform" {
style=filled;
bgcolor=white;
labeljust=left;
tooltip="AnalyticsTransform";
label="AnalyticsTransform";
subgraph "cluster AnalyticsTransform/ActivityEvents" {
style=filled;
bgcolor=white;
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/bin/bash
# bash <(curl -L -s https://start.codenvy.com/install-single)
#
# allowed options:
# --multi
# --silent
# --version=<VERSION TO INSTALL>
# --hostname=<CODENVY HOSTNAME>
# --systemAdminName=<SYSTEM ADMIN NAME>