Skip to content

Instantly share code, notes, and snippets.

View kameshsampath's full-sized avatar

Kamesh Sampath kameshsampath

View GitHub Profile
@kameshsampath
kameshsampath / Taskfile.yaml
Created February 20, 2023 07:44
A taskfile to install tools for rust
# https://taskfile.dev
version: "3"
tasks:
default:
desc: The default task that will be run when task is called without explicit task name
aliases:
- all
cmds:
- task: install_packages
@kameshsampath
kameshsampath / Dockefile.rustlang.zig
Last active February 20, 2023 07:43
A custom docker file with rustlang tools and dependencies
#syntax=docker/dockerfile:1.3-labs
FROM --platform=$TARGETPLATFORM rust:1.67-alpine3.17 AS bins
ARG TARGETPLATFORM
RUN --mount=type=cache,target=/usr/local/cargo/registry \
apk add -U --no-cache alpine-sdk gcompat go-task \
&& cargo install cargo-zigbuild
@kameshsampath
kameshsampath / grpc_envoy.yaml
Created November 16, 2022 05:15
Envoy YAML to expose gRPC service over http
admin:
access_log_path: /tmp/admin_access.log
address:
socket_address: { address: 0.0.0.0, port_value: 9901 }
static_resources:
listeners:
- name: listener_0
address:
socket_address: { address: 0.0.0.0, port_value: 10000 }
# Instructions for fresh install
$ sh <(curl -L https://nixos.org/nix/install) --darwin-use-unencrypted-nix-store-volume --daemon
# reboot
$ source /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
$ echo 'export NIX_PATH=darwin-config=$HOME/.nixpkgs/darwin-configuration.nix:$HOME/.nix-defexpr/channels${NIX_PATH:+:}$NIX_PATH' | tee -a ~/.zshrc
$ echo 'source $HOME/.nix-profile/etc/profile.d/hm-session-vars.sh' | tee -a ~/.zshrc
$ nix-channel --add https://nixos.org/channels/nixpkgs-unstable
$ nix-channel --add https://github.com/LnL7/nix-darwin/archive/master.tar.gz darwin
$ nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager
@kameshsampath
kameshsampath / gateway-cors-1.yaml
Created August 2, 2021 15:25
Allowing CORS Origins
apiVersion: gateway.solo.io/v1
kind: VirtualService
metadata:
name: fruits-api
namespace: my-gloo
spec:
displayName: FruitsAPI
virtualHost:
options:
cors:
msg: "[protoc -I/Users/kameshs/git/solo-io/gloo/vendor_any -I/Users/kameshs/git/solo-io/gloo/vendor_any/github.com/solo-io/protoc-gen-ext -I/Users/kameshs/git/solo-io/gloo/vendor_any/github.com/solo-io/protoc-gen-ext/external -I/Users/kameshs/git/solo-io/gloo/vendor_any/github.com/envoyproxy/protoc-gen-validate -I/Users/kameshs/git/solo-io/gloo/vendor_any/github.com/solo-io/gloo/projects/gloo/api/external -I/Users/kameshs/git/solo-io/gloo/vendor_any/github.com/solo-io/solo-kit/api/external --openapi_out=yaml=true,single_file=false,max_description_characters=0,include_description=false:/var/folders/42/cf1r2rm562b3ss1cf_dt38rc0000gn/T/405539825/external_options -o /var/folders/42/cf1r2rm562b3ss1cf_dt38rc0000gn/T/schema-gen-979669148 --include_imports --include_source_info github.com/solo-io/gloo/projects/gateway/api/v1/external_options.proto] failed: github.com/solo-io/gloo/projects/gateway/api/v1/external_options.proto:9:1: warning: Import google/protobuf/wrappers.proto is unused.\ngithub.com/solo-io/gloo/proj
@kameshsampath
kameshsampath / Civo_MarketPlace_Vagrantfile
Created May 26, 2021 06:40
Vagrant vm to test the CIVO marketpalce apps
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/focal64"
config.vm.provider "virtualbox" do |vb|
vb.gui = false
vb.memory = "512"
@kameshsampath
kameshsampath / start_minikube.sh
Created July 27, 2020 14:33
Start Minikube with some extra configs
#!/usr/bin/env bash
set -eu
PROFILE_NAME=${PROFILE_NAME:-bgcdemo}
MEMORY=${MEMORY:-8192}
CPUS=${CPUS:-4}
# Enable if you are going to use Tekton with Knative
EXTRA_CONFIG="apiserver.enable-admission-plugins=\
@kameshsampath
kameshsampath / setup_knative_serving.sh
Created July 27, 2020 14:31
A simple shell script to deploy Knative serving on minikube or KinD clusters
#!/bin/bash
set -eu
set -o pipefail
knative_version=${KNATIVE_VERSION:-v0.16.0}
knative_serving_version=${KNATIVE_SERVING_VERSION:-v0.16.0}
###################################
# Ingress
#!/usr/bin/env ansible-playbook -c local
---
- hosts: localhost
connection: local
vars:
ocp_version: 4.5.2
okd_image: quay.io/openshift/okd:4.5.0-0.okd-2020-07-14-153706-ga
tasks: