Skip to content

Instantly share code, notes, and snippets.

View naveensrinivasan's full-sized avatar

Naveen naveensrinivasan

View GitHub Profile
@plentz
plentz / nginx.conf
Last active April 18, 2024 12:42
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active April 18, 2024 10:01
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@BlakeStevenson
BlakeStevenson / texas-dps.js
Last active March 24, 2024 01:20
Create an appointment at the Texas DPS at the closest location, soonest time, programatically.
const axios = require('axios');
async function getLocations() {
const locationsData = await axios.post("https://publicapi.txdpsscheduler.com/api/AvailableLocation", {
"TypeId": 71,
"ZipCode": "10001",
"CityName": "",
"PreferredDay": 0
});
return locationsData.data;
}
@mgoodness
mgoodness / k8s-svc-annotations.md
Last active March 11, 2024 16:24
AWS ELB-related annotations for Kubernetes Services (as of v1.12.0)
  • service.beta.kubernetes.io/aws-load-balancer-access-log-emit-interval (in minutes)
  • service.beta.kubernetes.io/aws-load-balancer-access-log-enabled (true|false)
  • service.beta.kubernetes.io/aws-load-balancer-access-log-s3-bucket-name
  • service.beta.kubernetes.io/aws-load-balancer-access-log-s3-bucket-prefix
  • service.beta.kubernetes.io/aws-load-balancer-additional-resource-tags (comma-separated list of key=value)
  • service.beta.kubernetes.io/aws-load-balancer-backend-protocol (http|https|ssl|tcp)
  • service.beta.kubernetes.io/aws-load-balancer-connection-draining-enabled (true|false)
@lavalamp
lavalamp / The Three Go Landmines.markdown
Last active February 16, 2024 12:16
Golang landmines

There are three easy to make mistakes in go. I present them here in the way they are often found in the wild, not in the way that is easiest to understand.

All three of these mistakes have been made in Kubernetes code, getting past code review at least once each that I know of.

  1. Loop variables are scoped outside the loop.

What do these lines do? Make predictions and then scroll down.

func print(pi *int) { fmt.Println(*pi) }
@subfuzion
subfuzion / github-wiki-how-to.md
Last active January 15, 2024 15:17
GitHub Wiki How-To

How do I clone a GitHub wiki?

Any GitHub wiki can be cloned by appending wiki.git to the repo url, so the clone url for the repo https://myorg/myrepo/ is: git@github.com:myorg/myrepo.wiki.git (for ssh) or https://github.com/my/myrepo.wiki.git (for https).

You make edits, and commit and push your changes, like any normal repo. This wiki repo is distinct from any clone of the project repo (the repo without wiki.get appended).

How do I add images to a wiki page?

@dergachev
dergachev / README.md
Created October 10, 2012 16:49
Vagrant tutorial

Vagrant Setup

This tutorial guides you through creating your first Vagrant project.

We start with a generic Ubuntu VM, and use the Chef provisioning tool to:

  • install packages for vim, git
  • create user accounts, as specified in included JSON config files
  • install specified user dotfiles (.bashrc, .vimrc, etc) from a git repository

Afterwards, we'll see how easy it is to package our newly provisioned VM

@eloo
eloo / node_exporter.default
Last active December 22, 2023 09:00
Init.d script for prometheus node exporter
# Set the command-line arguments to pass to the server.
ARGS='-web.listen-address=:9100 -collector.diskstats.ignored-devices="^(ram|loop|fd)\\d+$"'
# Prometheus-node-exporter supports the following options:
# -collector.diskstats.ignored-devices="^(ram|loop|fd|(h|s|v|xv)d[a-z])\\d+$": Regexp of devices to ignore for diskstats.
# -collector.filesystem.ignored-mount-points="^/(sys|proc|dev)($|/)": Regexp of mount points to ignore for filesystem collector.
# -collector.ipvs.procfs="/proc": procfs mountpoint.
# -collector.megacli.command="megacli": Command to run megacli.
# -collector.ntp.server="": NTP server to use for ntp collector.
# -collector.textfile.directory="": Directory to read text files with metrics from.
@dmitshur
dmitshur / gist:6927554
Last active September 17, 2023 07:35
[Legacy GOPATH mode] How to `go get` private repos using SSH key auth instead of password auth.

WARNING: This gist was created in 2013 and targets the legacy GOPATH mode. If you're reading this in 2021 or later, you're likely better served by reading https://tip.golang.org/cmd/go/#hdr-Configuration_for_downloading_non_public_code and https://golang.org/ref/mod#private-modules.

$ ssh -A vm
$ git config --global url."git@github.com:".insteadOf "https://github.com/"
$ cat ~/.gitconfig
[url "git@github.com:"]
	insteadOf = https://github.com/
$ go get github.com/private/repo && echo Success!
Success!