Skip to content

Instantly share code, notes, and snippets.

@jtbonhomme
jtbonhomme / README.md
Created February 28, 2020 07:24 — forked from ryu1kn/README.md
Getting GCP access token from a service account key JSON file

Getting GCP access token from a service account key

Use your service account's key JSON file to get an access token to call Google APIs.

Good for seeing how things work, including the creation of JWT token.

To create a JWT token, you can replace create-jwt-token.sh script with tools like step.

If you just want to get an access token for a service account,

@ryu1kn
ryu1kn / README.md
Last active March 18, 2024 14:19
Getting GCP access token from a service account key JSON file

Getting GCP access token from a service account key

Use your service account's key JSON file to get an access token to call Google APIs.

Good for seeing how things work, including the creation of JWT token.

To create a JWT token, you can replace create-jwt-token.sh script with tools like step.

If you just want to get an access token for a service account,

@cablespaghetti
cablespaghetti / gist:54de0ae93449e4698f0206a0e85514be
Last active November 2, 2022 14:20
Example terraform for ASG with spot instances
#
# Configuration for Autoscaling group.
#
resource "aws_launch_template" "eks-cluster-worker-nodes" {
iam_instance_profile = { name = "${aws_iam_instance_profile.eks-cluster-worker-nodes.name}" }
image_id = "${data.aws_ami.eks-worker.id}"
name = "${var.cluster-name}-eks-cluster-worker-nodes"
vpc_security_group_ids = ["${aws_security_group.eks-cluster-worker-nodes.id}"]
key_name = "${var.ssh-key-name}"
instance_type = "${local.host-types[0]}"
@jtbonhomme
jtbonhomme / client.go
Last active February 6, 2018 14:34
gRPC example
package main
import (
"bufio"
"bytes"
"fmt"
"log"
"net/http"
pb "test_protobuf/post"
proto "github.com/golang/protobuf/proto"
@asukakenji
asukakenji / 0-go-os-arch.md
Last active April 24, 2024 06:51
Go (Golang) GOOS and GOARCH

Go (Golang) GOOS and GOARCH

All of the following information is based on go version go1.17.1 darwin/amd64.

GOOS Values

GOOS Out of the Box
aix
android
@ipbastola
ipbastola / jq to filter by value.md
Last active April 25, 2024 17:14
JQ to filter JSON by value

JQ to filter JSON by value

Syntax: cat <filename> | jq -c '.[] | select( .<key> | contains("<value>"))'

Example: To get json record having _id equal 611

cat my.json | jq -c '.[] | select( ._id | contains(611))'

Remember: if JSON value has no double quotes (eg. for numeric) to do not supply in filter i.e. in contains(611)

@michaellihs
michaellihs / tmux-cheat-sheet.md
Last active May 3, 2024 10:55
tmux Cheat Sheet
@jtbonhomme
jtbonhomme / gist:9d9c2acd2f1aa6cb0320
Created November 20, 2015 17:33 — forked from mharsch/gist:5188206
serve HLS (HTTP Live Streaming) content from node.js

HLS streaming from node

Provided that you already have a file or stream segmenter generating your .m3u8 playlist and .ts segment files (such as the ffmpeg 'hls' muxer), this little node server will serve up those files to an HLS compatible client (e.g. Safari). If you're using node for your streaming app already, this obviates the need to serve the HLS stream from a separate web server.

loosely based on https://gist.github.com/bnerd/2011232

// loosely based on https://gist.github.com/bnerd/2011232
// requires node.js >= v0.10.0
// assumes that HLS segmenter filename base is 'out'
// and that the HLS playlist and .ts files are in the current directory
@staltz
staltz / introrx.md
Last active May 7, 2024 09:38
The introduction to Reactive Programming you've been missing
@tim-jansen
tim-jansen / import_confluence.py
Created August 18, 2013 19:40
Script to bulk import textile files into Confluence Wiki. Very useful to convert a redmine wiki to Confluence. To export redmine wiki pages to textile you can use http://stbuehler.de/blog/article/2011/06/04/exporting_redmine_wiki_pages.html We used this and "https://bitbucket.org/simbtecnologia/github-to-jira" to migrate from github/redmine tool…
"""
Script to import multiple directories with textile files into Confluence Wikis. Can be used with OnDemand instances.
To use as redmine migration tool, you need to export wiki pages in textile format. One way is described in: http://stbuehler.de/blog/article/2011/06/04/exporting_redmine_wiki_pages.html
~/redmine $ RAILS_ENV=production ./script/console -s
def export_text(p)
c = p.content_for_version(nil)