Skip to content

Instantly share code, notes, and snippets.

🏃‍♀

Steren steren

🏃‍♀
Block or report user

Report or block steren

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@steren
steren / cloudbuild.yaml
Created Aug 10, 2019
Use Cloud Build for arbitrary container execution (in this case, run ffmpeg)
View cloudbuild.yaml
steps:
- name: 'jrottenberg/ffmpeg'
args: ['-i', 'input.mp4', 'output.avi']
artifacts:
objects:
location: 'gs://steren-test-oneshot/'
paths: ['output.avi']
@steren
steren / loadtest.sh
Last active Mar 31, 2019
Send load to URL
View loadtest.sh
# Read docs at https://artillery.io/docs/cli-reference/#quick
npx artillery quick --rate 1 --duration 20 https://myapp.dev
@steren
steren / curl.sh
Last active Aug 1, 2019
Query GCP metadata server
View curl.sh
$ curl -H "Metadata-Flavor:Google" http://metadata.google.internal/coproject/project-id
@steren
steren / package.json
Last active Aug 11, 2018
TypeScript to JS
View package.json
{
"name": "hello-ts",
"version": "1.0.0",
"description": "Hello TS",
"scripts": {
"start": "node server.js",
"gcp-build": "nom run build",
"build": "tsc server.ts"
},
"author": "Steren <steren@google.com>",
@steren
steren / Dockerfile
Last active Sep 24, 2018
Function to generate traffic for a minute on a given URL
View Dockerfile
FROM node:8
WORKDIR /usr/src/app
COPY package*.json ./
ENV NODE_ENV=production
RUN npm install --production
COPY . .
CMD [ "npm", "start" ]
View gist:dea86dd2352445f926e4d926db709469
FROM node:8
# Install utilities
RUN apt-get update --fix-missing && apt-get -y upgrade
# Install latest chrome dev package.
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
&& sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \
&& apt-get update \
&& apt-get install -y google-chrome-unstable --no-install-recommends \
@steren
steren / bunyan.js
Created Jun 16, 2018
Extracting trace from header and sending to Logs for correlation
View bunyan.js
const express = require('express');
const app = express();
const bunyan = require('bunyan');
const {LoggingBunyan} = require('@google-cloud/logging-bunyan');
const loggingBunyan = new LoggingBunyan();
const project = 'steren-test';
@steren
steren / bunyan-trace.js
Last active Jun 16, 2018
Use both Stackdriver Trace and Logging modules for automated trace collection in logs to enable logs correlation
View bunyan-trace.js
require('@google-cloud/trace-agent').start();
const express = require('express');
const app = express();
const bunyan = require('bunyan');
const {LoggingBunyan} = require('@google-cloud/logging-bunyan');
const loggingBunyan = new LoggingBunyan();
@steren
steren / app.yaml
Last active May 15, 2018
Simple Node.js hello world for App Engine standard
View app.yaml
runtime: nodejs8
@steren
steren / package.json
Last active Sep 21, 2017
Node.js app to generate a thumbnail of the given URL
View package.json
{
"name": "web-thumbnails",
"version": "1.0.0",
"engines": {
"node": "^8.4.0"
},
"description": "Generate thumbnails of web pages",
"main": "server.js",
"scripts": {
"start": "node server.js",
You can’t perform that action at this time.