Skip to content

Instantly share code, notes, and snippets.

@kennycyb
kennycyb / .vimrc
Created November 7, 2023 14:47
.vimrc
set number
set incsearch
set mouse=a
set tabstop=2
set shiftwidth=2
set expandtab
set autoindent
set smartindent
set nocompatible
syntax on
@kennycyb
kennycyb / aws-s3-objects-size.sh
Created October 31, 2023 14:18
AWS | S3 | Calculate Objects Size
```
#!/bin/bash
# Define the name of the CSV file
file="bucket_list.csv"
# Read the CSV file and calculate the size of each bucket
while IFS=',' read -r name region
do
echo "Calculating size of bucket: $name in region $region"
@kennycyb
kennycyb / aws-s3-bucket-list.sh
Created October 31, 2023 14:12
AWS | S3 | Bucket List
```
#!/bin/bash
# List all S3 buckets
buckets=$(aws s3 ls | awk '{print $3}')
# Print the list of buckets and their region
echo "List of S3 buckets and their regions:"
for bucket in $buckets
do

CURL

Run a curl command in kubernetes

kubectl run curl-x --image=radial/busyboxplus:curl -i --tty --rm

REDIS

@kennycyb
kennycyb / shell-random.md
Last active September 26, 2019 08:47
Shell: random string

Generate a random string using shell command:

head /dev/urandom | LC_ALL=C tr -dc 'A-Za-z0-9!"#$%&'\''()*+,-./:;<=>?@[\]^_`{|}~' | head -c128

Add user to docker group

To allow a user to execute docker command without 'sudo'

$ sudo groupadd docker

$ sudo usermod -aG docker $USER

~/.vimrc

set number
set incsearch
set mouse=a
set tabstop=2
set shiftwidth=2
set expandtab
set autoindent

set smartindent

Remove all AT jobs

atrm $(atq | cut -f1)

Delete all nodes and relationships

match (n) detach delete n