Skip to content

Instantly share code, notes, and snippets.

View kameshsampath's full-sized avatar

Kamesh Sampath kameshsampath

View GitHub Profile
@kameshsampath
kameshsampath / podman_pods_mariadb.txt
Created November 22, 2019 06:16
Running mariadb as podman pods
podman run -dt --rm --pod new:db --name mariadb -e MYSQL_ROOT_PASSWORD=superS3cret! -e MYSQL_USER=demo -e MYSQL_DATABASE=demodb -e MYSQL_PASSWORD=password -p 3306:3306 -p 8082:8080 mariadb:10.4.4
podman run -dt --rm --pod db --name adminer adminer:4.7.3-standalone
@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
#!/bin/sh
set -x
set -e
NUM_CPUS=`grep -c ^processor /proc/cpuinfo`
echo "building using $NUM_CPUS CPUs"
ENVOY_DIR=/opt/envoy_env
@kameshsampath
kameshsampath / getLatestIstio.ps1
Last active February 12, 2022 00:21
The PowerShell script that can be used to download latest version of Istio analogus to https://git.io/getLatestIstio
param(
[string] $IstioVersion = "0.3.0"
)
$url = "https://github.com/istio/istio/releases/download/$($IstioVersion)/istio_$($IstioVersion)_win.zip"
$Path = Get-Location
$output = [IO.Path]::Combine($Path, "istio_$($IstioVersion)_win.zip”)
Write-Host "Downloading Istio from $url to path " $Path -ForegroundColor Green
@kameshsampath
kameshsampath / stream_profile.json
Last active August 24, 2021 14:34
VSCode profile for streaming
{
"files.exclude": {
"**/.classpath": true,
"**/.factorypath": true,
"**/.idea": true,
"**/.iml": true,
"**/.mvn": true,
"**/.project": true,
"**/.settings": true,
"**/.vagrant": true,
@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