Skip to content

Instantly share code, notes, and snippets.

Avatar
🇮🇳
👨‍💻 from 🏠

Arunvel Sriram arunvelsriram

🇮🇳
👨‍💻 from 🏠
View GitHub Profile
@arunvelsriram
arunvelsriram / main.go
Created Aug 11, 2020
Simple logging middleware using logrus for HTTP server provided by GoLang's net/http
View main.go
package main
import (
"fmt"
"net/http"
"time"
"github.com/sirupsen/logrus"
)
View my-vim-cheatsheet.md
  • Ctrl + O / Ctrl + I - Navigate to next / previous cursor position
  • gd - goto definition
  • Ctrl + d - Move down 1/2 screen
  • Ctrl + u - Move up 1/2 screen
  • "*y - Copy to system clipboard
  • "*p - Pasting from system clipboard
  • :redir @* | set guifont | redir END - Copy output of command to clipboard. @* is clipboard register
View editing-state.md

Editing Terraform State

  1. Pull the state
terraform state pull > temp.tfstate
  1. Edit temp.tfstate in your favourite editor

  2. Push the state

View How-to-Win-Friends-and-Influence-People.md

How to Win Friends and Influence People

Fundamental Techniques in Handling People

  1. Don't criticize, condemn, or complain.
  2. Give honest and sincere appreciation.
  3. Arouse in the other person an eager want.
  4. Never show others that you are not interested in what they have to say.
@arunvelsriram
arunvelsriram / dashboards.sh
Last active Mar 6, 2019
Fuzzy search over Grafana dashboards (filtered by tag) and open them from the command-line
View dashboards.sh
#!/usr/bin/env bash
## Tested on Grafana v5.1.3
function dashboards {
base_url="<BASE-URL>"
dashboards=$(curl -s -H "Authorization: Bearer <TOKEN>" \
$base_url/api/search?query=\&tag=<TAG> \
| jq -r '.[]')
titles=$(echo $dashboards | jq -r '.title' | fzf --height 10 --reverse --multi)
[ -z "$titles" ] && return
View keybase.md

Keybase proof

I hereby claim:

  • I am arunvelsriram on github.
  • I am arunvelsriram (https://keybase.io/arunvelsriram) on keybase.
  • I have a public key whose fingerprint is 603A 233B FD61 6CF4 9B19 0768 BAAE F633 460D 68C2

To claim this, I am signing this object:

@arunvelsriram
arunvelsriram / osmc_raspberrypi.md
Last active Nov 17, 2017
OSMC on RaspberryPi 3
View osmc_raspberrypi.md
@arunvelsriram
arunvelsriram / raspberrypi_kali_linux.md
Last active Nov 16, 2017
Using TL-WN722N USB wireless adapter (TP-Link) in Kali Linux installed on RaspberryPi
View raspberrypi_kali_linux.md

Using TL-WN722N USB wireless adapter (TP-Link) in Kali Linux installed on RaspberryPi

apt-get update
apt-get upgrade
apt-get install firmware-atheros
@arunvelsriram
arunvelsriram / di_terraform.tf
Created Aug 21, 2017
Terraform dependency injection style de-coupling resources
View di_terraform.tf
# di_terraform.tf
# Example Terraform configuration that shows de-coupling resources (Amazon S3 bucket and bucket policy)
# with the help of modules analogous to dependency injection technique
# modules/s3_bucket/main.tf
# Base S3 bucket that can be attached a policy
variable "bucket_name" {}
variable "region" {
@arunvelsriram
arunvelsriram / webpack.config.js
Last active May 15, 2017 — forked from learncodeacademy/webpack.config.js
Sample Basic Webpack Config
View webpack.config.js
var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var debug = process.env.NODE_ENV !== 'production';
var plugins = [
new HtmlWebpackPlugin()
];
module.exports = {
context: __dirname + '/src',