Skip to content

Instantly share code, notes, and snippets.

View cig0's full-sized avatar
💭
Simplicity is the ultimate sophistication

Martín Cigorraga cig0

💭
Simplicity is the ultimate sophistication
View GitHub Profile
@cig0
cig0 / bash_strict_mode.md
Created April 11, 2024 02:04 — forked from mohanpedala/bash_strict_mode.md
set -e, -u, -o, -x pipefail explanation
@cig0
cig0 / delete_all_object_versions.sh
Created July 26, 2022 14:24 — forked from weavenet/delete_all_object_versions.sh
Delete all versions of all files in s3 versioned bucket using AWS CLI and jq.
#!/bin/bash
bucket=$1
set -e
echo "Removing all versions from $bucket"
versions=`aws s3api list-object-versions --bucket $bucket |jq '.Versions'`
markers=`aws s3api list-object-versions --bucket $bucket |jq '.DeleteMarkers'`
@cig0
cig0 / tmux.md
Created December 31, 2021 16:01 — forked from andreyvit/tmux.md
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@cig0
cig0 / bash.generate.random.alphanumeric.string.sh
Created August 12, 2021 14:53 — forked from earthgecko/bash.generate.random.alphanumeric.string.sh
shell/bash generate random alphanumeric string
#!/bin/bash
# bash generate random alphanumeric string
#
# bash generate random 32 character alphanumeric string (upper and lowercase) and
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
# bash generate random 32 character alphanumeric string (lowercase only)
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1
@cig0
cig0 / comments-trick.json
Created August 12, 2021 13:34 — forked from MoOx/comments-trick.json
How to make comment in JSON file
{
"//field": "These 'double quote' 'double quote' are used as comments, because JSON doesnt' allow comment",
"field": {},
"#another-field": "Another comment",
"another-field": {},
"/*stuff": "Be careful to use them when you have full control of the content :)",
"stuff": [],
"bla": "bla"
}
@cig0
cig0 / GitCommit.sublime-syntax
Created July 29, 2021 22:41 — forked from MormonJesus69420/GitCommit.sublime-syntax
Syntax file for SublimeMerge
%YAML 1.2
---
# Highlight regular git commits, merge commits, and tags.
name: Git Commit
file_extensions:
- COMMIT_EDITMSG
- MERGE_MSG
- TAG_EDITMSG
scope: text.git.commit
AWSTemplateFormatVersion: 2010-09-09
Resources:
OrdersTable:
Type: AWS::DynamoDB::Table
Properties:
TableName: AuthorsTable_prod
AttributeDefinitions:
- AttributeName: "AuthorName"
AttributeType: "S"
- AttributeName: "BookTitle"
@cig0
cig0 / kubedump.sh
Created December 9, 2020 13:04 — forked from negz/kubedump.sh
Dump Kubernetes cluster resources as YAML
#!/usr/bin/env bash
set -e
CONTEXT="$1"
if [[ -z ${CONTEXT} ]]; then
echo "Usage: $0 KUBE-CONTEXT"
exit 1
fi
@cig0
cig0 / pre-push
Created September 10, 2019 14:58 — forked from kalpeshsingh/pre-push
A pre-push git hook that notify Amazon Chime group
#!/bin/sh
branch="$(git rev-parse --abbrev-ref HEAD)"
# get computer name to append in Chime message
username=$USER
# a branch name where you want to prevent git push. In this case, it's "master"
if [ "$branch" = "master" ]; then
echo "You can't commit directly to '"${branch}"' branch" # webstorm or intellij will show this as popup
@cig0
cig0 / links.md
Created April 25, 2019 15:34 — forked from g0t4/links.md
Starting Point Files for Jenkins2 Getting Started course