View gist:5dbfac7e93dcb3018c5ade677f9da9e1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" install vim-plug | |
if empty(glob('~/.vim/autoload/plug.vim')) | |
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs | |
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim | |
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC | |
endif | |
" Plug installed plugins | |
call plug#begin('~/.vim/plugged') | |
Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' } |
View gist:132a2d45ff03b9fb0d3fe3a1534b6ecf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# List of plugins | |
set -g @plugin 'tmux-plugins/tpm' | |
set -g @plugin 'tmux-plugins/tmux-sensible' | |
set -g @plugin 'tmux-plugins/tmux-yank' | |
set -g @plugin "arcticicestudio/nord-tmux" | |
set -g @plugin 'swaroopch/tmux-pomodoro' | |
# force Vi mode | |
# really you should export VISUAL or EDITOR environment variable, see manual |
View gist:e40f83b026ea04522a7993dda5785ed3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Output warning on match but continue | |
warn: | |
- '(?i)user(name)?\W*[:=,]\W*.+$' | |
- '\/Users\/\w+\/' | |
# Fail immediately upon match | |
fail: | |
- '(?i)db_(user(name)?|pass(word)?|name)\W*[:=,]\W*.+$' | |
- '(?i)pass(word)?\W*[:=,]\W*.+$' | |
- '\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,6}\b' |
View inf.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
type human interface { | |
walk() | |
talk() | |
} | |
type person struct { | |
firstName string |
View gist:005c5ac101df30ee5dd6edae487a900f
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Install vim-plug `sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \ | |
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'` | |
2. clone `souvikhaldar/dotfiles` repo and run `copyToSystem.sh`. | |
2. Open `vimrc` file and do `:PlugInstall` (ignore the `autocmd` error the first time you open vimrc) |
View map.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
func ConvertMapToKVSlice(m map[string]int) (kv []KV) { | |
for k, v := range m { | |
kv = append(kv, KV{k, v}) | |
} | |
return | |
} | |
type KV struct { |
View qr.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Importing the module pyqrcode | |
import pyqrcode | |
# data for the QR code | |
s = input("Enter the data to be put in the QR code: ") | |
# Generate QR code by the help of create function | |
url = pyqrcode.create(s) | |
# name of the geneated file | |
name = input("Enter name for the generated image file: ") | |
filename = name + ".svg" | |
url.svg(filename, scale = 8) |
View nodeExporterPromConfig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
scrape_configs: | |
- job_name: 'node' | |
static_configs: | |
- targets: ['<TARGET_IP>:9100'] |
View prometheusConfig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global: | |
scrape_interval: 15s | |
# By default, scrape targets every 15 seconds. | |
# Attach these labels to any time series or alerts when communicating with | |
# external systems (federation, remote storage, Alertmanager). | |
external_labels: | |
monitor: 'codelab-monitor' | |
# A scrape configuration containing exactly one endpoint to scrape: | |
# Here it's Prometheus itself. | |
scrape_configs: |
View prometheusUnitFile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Prometheus | |
Wants=network-online.target | |
After=network-online.target | |
[Service] | |
Type=simple | |
ExecStart=/usr/local/bin/prometheus --config.file=/etc/prometheus.yml | |
[Install] | |
WantedBy=multi-user.target |
NewerOlder