Skip to content

Instantly share code, notes, and snippets.

View dmitriyminer's full-sized avatar

Dmytro Tananayskiy dmitriyminer

View GitHub Profile
@chadmcrowell
chadmcrowell / bash-completion-kubectl.sh
Created October 5, 2023 14:49
bash autocomplete for kubectl
#!/bin/bash
apt update && apt install -y bash-completion
echo 'source <(kubectl completion bash)' >> ~/.bashrc
echo 'source /usr/share/bash-completion/bash_completion' >> ~/.bashrc
echo 'alias k=kubectl' >> ~/.bashrc
echo 'complete -o default -F __start_kubectl k' >> ~/.bashrc
source ~/.bashrc
@alexedwards
alexedwards / main.go
Last active May 31, 2024 02:15
Password hashing and verification with Argon2id
package main
import (
"crypto/rand"
"crypto/subtle"
"encoding/base64"
"errors"
"fmt"
"log"
"strings"
@rvolykh
rvolykh / README.md
Last active December 10, 2018 17:59
Docker cleanup

Free docker memory

Cleanup unused (Original source)

Remove all stopped containers

docker container prune

Remove all unused volumes

@ashfame
ashfame / deploy-all-lambdas.sh
Last active February 25, 2018 18:27
Bash script to deploy lambdas to all regions using Up - https://blog.ashfame.com/?p=1288
#!/usr/bin/env bash
declare -a regions=(
us-east-2 #US East (Ohio)
us-east-1 #US East (N. Virginia)
us-west-1 #US West (N. California)
us-west-2 #US West (Oregon)
ap-northeast-1 #Asia Pacific (Tokyo)
ap-northeast-2 #Asia Pacific (Seoul)
ap-south-1 #Asia Pacific (Mumbai)
@isyufu
isyufu / grep.sh
Created October 16, 2017 03:45
grep cheat sheet
#!/bin/sh
#http://www.thegeekstuff.com/2011/01/advanced-regular-expressions-in-grep-command-with-10-examples-%E2%80%93-part-ii/
# GENERAL
# print lines begining with range of letters
grep ^[A-D] table.txt
# REGEX
@umayr
umayr / recover-deleted-branch.sh
Created April 1, 2016 11:41
How to recover a deleted branch
## Pre-requisite: You have to know your last commit message from your deleted branch.
git reflog
# Search for message in the list
# a901eda HEAD@{18}: commit: <last commit message>
# Now you have two options, either checkout revision or HEAD
git checkout a901eda
# Or
git checkout HEAD@{18}
Edgar Rodrigues Sandi
Edgar Sandi
tw/@EdgarSandi
fb/EdgarSandi
G+/EdgarSandi
Ln/EdgarSandi
Oracle PL/SQL - 24h
Aula 1 - 17/01
@sloria
sloria / bobp-python.md
Last active June 12, 2024 15:02
A "Best of the Best Practices" (BOBP) guide to developing in Python.

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General

Values

  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active June 5, 2024 22:16
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active June 14, 2024 11:43
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'