Skip to content

Instantly share code, notes, and snippets.

View seeker815's full-sized avatar

Sai Kothapalle seeker815

  • self
  • Bangalore, India
View GitHub Profile
@seeker815
seeker815 / connect-k8s.md
Created April 18, 2022 12:22 — forked from Piotr1215/connect-k8s.md
Keep cluster connections separate

How to keep cluster connections cleanly separated

With time the .kube/config file will contain a mix of dev, test and prod cluster references. It is easy to forget switching off from a prod cluster context and make a mistake and run for example kubectl delete ns crossplane-system.

Direnv based setup

Use the following setup to avoid these kinds of errors and keep clusters separate.

Install direnv

@seeker815
seeker815 / mysql-client-k8s.md
Created April 17, 2022 08:15 — forked from vishnuhd/mysql-client-k8s.md
mysql-client in Kubernetes to test your connection to mysql server

mysql-client in Kubernetes to test your connection to mysql server

kubectl run mysql-client --image=mysql:5.7 -it --rm --restart=Never -- /bin/bash

mysql -h mysql-service -uroot -proot_password -e 'SHOW databases;'

OR

mysql -h mysql-service -uroot -proot_password

top (the UNIX process inspector) cheat sheet

This is a list of the most helpful keyboard commands I use within top.

The basics

h shows help on interactive commands. Also see the top manual page

q to quit the program.

@seeker815
seeker815 / Jenkinsfile
Created February 25, 2021 09:37 — forked from gazoakley/Jenkinsfile
Jenkinsfile for running Terraform
pipeline {
agent any
parameters {
string(name: 'environment', defaultValue: 'default', description: 'Workspace/environment file to use for deployment')
string(name: 'version', defaultValue: '', description: 'Version variable to pass to Terraform')
booleanParam(name: 'autoApprove', defaultValue: false, description: 'Automatically run apply after generating plan?')
}
environment {
@seeker815
seeker815 / mockedS3Client.go
Created November 10, 2020 12:36 — forked from kamermans/mockedS3Client.go
Thread-Safe AWS S3 Mock for Golang (works with GetObject, PutObject, DeleteObject, HeadBucket)
package something
import (
"bytes"
"errors"
"fmt"
"io/ioutil"
"net/url"
"path"
"sync"
@seeker815
seeker815 / GO-Fillslice.md
Created November 5, 2020 11:04 — forked from taylorza/GO-Fillslice.md
Golang - Fill slice/array with a pattern

Filling an array or slice with a repeated pattern

Looking for an efficient pure GO approach to copy repeating patterns into a slice, for a toy project, I ran a few tests and discovered a neat approach to significantly improve performance. For the toy project, I am using this to fill a background buffer with a specific RGB color pattern, so improving this performance significantly improved my acheivable framerate.

All the test were run with a buffer of 73437 bytes, allocated as follows

var bigSlice = make([]byte, 73437, 73437)

Fill the slice with the value 65 by looping through each element and setting the value

@seeker815
seeker815 / ubuntu-hardening.md
Created October 21, 2020 10:25 — forked from lokhman/ubuntu-hardening.md
List of things for hardening Ubuntu

System Updates

http://bookofzeus.com/harden-ubuntu/initial-setup/system-updates/

Keeping the system updated is vital before starting anything on your system. This will prevent people to use known vulnerabilities to enter in your system.

sudo apt-get update
sudo apt-get upgrade
sudo apt-get autoremove
sudo apt-get autoclean
@seeker815
seeker815 / reflection.go
Created September 30, 2020 07:04 — forked from drewolson/reflection.go
Golang Reflection Example
package main
import (
"fmt"
"reflect"
)
type Foo struct {
FirstName string `tag_name:"tag 1"`
LastName string `tag_name:"tag 2"`
@seeker815
seeker815 / _aws_golang_examples.md
Created April 10, 2020 16:51 — forked from eferro/_aws_golang_examples.md
golang aws: examples

AWS Golang SDK examples