Skip to content

Instantly share code, notes, and snippets.

View gotwarlost's full-sized avatar

Krishnan Anantheswaran gotwarlost

View GitHub Profile
SyntaxError: /root/redstone-dispatcher/node_modules/gulp/node_modules/vinyl-fs/node_modules/glob-watcher/node_modules/gaze/node_modules/globule/node_modules/glob/node_modules/graceful-fs/graceful-fs.js: Invalid number (80:53)
78 | switch (req.constructor.name) {
79 | case 'OpenReq':
> 80 | open(req.path, req.flags || "r", req.mode || 0777, req.cb)
| ^
81 | break
82 | case 'ReaddirReq':
83 | readdir(req.path, req.cb)
at Parser.pp.raise (/root/redstone-dispatcher/node_modules/babel/node_modules/babel-core/node_modules/babylon/lib/parser/location.js:24:13)
at Parser.readNumber (/root/redstone-dispatcher/node_modules/babel/node_modules/babel-core/node_modules/babylon/lib/tokenizer/index.js:666:12)
import {realpathSync} from 'fs';
import {programVisitor} from 'istanbul-lib-instrument';
function getRealpath(n) {
try {
return realpathSync(n) || n
} catch (e) {
return n
}
}
@gotwarlost
gotwarlost / code-diff.txt
Last active June 24, 2016 05:09
Issues with babel source map generation
@@ -33,6 +33,7 @@ var SourceMap = function () {
this.position = position;
this.opts = opts;
this.last = { generated: {}, original: {} };
+ this.seen = {};
if (opts.sourceMaps) {
this.map = new _sourceMap2.default.SourceMapGenerator({
@@ -89,6 +90,12 @@ var SourceMap = function () {
this._lastSourceLine = sourcePos.line;
@gotwarlost
gotwarlost / compact.log
Last active June 29, 2016 04:08
Babel generate slowness for object expression assignments in non-compact mode
$ ./node_modules/.bin/babel-node bin/test-render-perf.js --compact
Sample prog: var foo={s0:{start:{line:0,column:0},end:{line:1,column:20}},s1:{start:{line:1,column:0},end:{line:2,column:20}}};
Items: 2 , time: 1
Items: 4 , time: 1
Items: 8 , time: 4
Items: 16 , time: 6
Items: 32 , time: 6
Items: 64 , time: 3
Items: 128 , time: 4
Items: 256 , time: 12
@gotwarlost
gotwarlost / create-services.sh
Last active March 25, 2019 21:08
istio install steps
#!/bin/bash
for count in {1..770}
do
kubectl -n istio-test apply -f - <<EOF
apiVersion: v1
kind: Service
metadata:
name: reg${count}
spec:
@gotwarlost
gotwarlost / Dockerfile
Last active May 6, 2019 19:09
istio test of 2 services pointing to 2 container ports
FROM golang:1.10 as builder
COPY ./main.go /go/src/twoports/main.go
WORKDIR /go/src/twoports
ENV CGO_ENABLED 0
RUN go install .
# so we can get `curl`
FROM tutum/curl
COPY --from=builder /go/bin/twoports /usr/bin/twoports
@gotwarlost
gotwarlost / deploy.yaml
Created May 5, 2019 20:23
envoy sidecar errors when a service maps 2 service ports to the same container port
apiVersion: v1
kind: Namespace
metadata:
name: twosvcports
labels:
istio-injection: enabled
---
apiVersion: v1
kind: ServiceAccount
metadata:
@gotwarlost
gotwarlost / go.mod
Created October 17, 2019 07:15
Pod events as seen by a watcher
module cd.splunkdev.com/kanantheswaran/podwatch
go 1.13
require (
github.com/gogo/protobuf v1.3.1 // indirect
github.com/googleapis/gnostic v0.3.1 // indirect
github.com/hashicorp/golang-lru v0.5.3 // indirect
github.com/imdario/mergo v0.3.8 // indirect
github.com/json-iterator/go v1.1.7 // indirect
@gotwarlost
gotwarlost / main.go
Last active December 17, 2019 18:17
program that shows the new CA cert with the same key is not valid for old clients when the subject of the cert is differen
package main
import (
"crypto/rand"
"crypto/rsa"
"crypto/tls"
"crypto/x509"
"crypto/x509/pkix"
"encoding/pem"
"fmt"