Skip to content

Instantly share code, notes, and snippets.

View AnilPothula's full-sized avatar
🎯
Focusing

Anil Pothula AnilPothula

🎯
Focusing
  • Dallas, TX
  • 03:17 (UTC -05:00)
View GitHub Profile
@AnilPothula
AnilPothula / aws-cli-ecs-cheat.sh
Created January 3, 2021 14:43 — forked from alvarow/aws-cli-ecs-cheat.sh
My AWS CLI ECS cheat sheet
# Get number of running containers of a service
aws --profile saml --output json ecs describe-services --cluster DIT-DMZ --service adp-e-bot-kafka | jq '.services[]|.desiredCount'
# Get a list of all task definitions
aws --profile saml --output text ecs list-task-definition-families
# Get the JSONs of a task definition
aws --profile saml --output json ecs describe-task-definition --task-def DIT-adp-e-bot | jq '.taskDefinition|if .networkMode then {family: .family, volumes: .volumes, containerDefinitions: .containerDefinitions, networkMode: .networkMode} else {family: .family, volumes: .volumes, containerDefinitions: .containerDefinitions} end'
# Get all task definition and save each as a JSON
@AnilPothula
AnilPothula / README.md
Created January 3, 2021 14:48 — forked from DocX/README.md
Connect to bash inside running ECS container by cluster and service name
@AnilPothula
AnilPothula / ecr-lifecycle-policy.json
Created February 1, 2021 22:01 — forked from shcallaway/ecr-lifecycle-policy.json
Lifecycle policy that caps prod and stage images at 25 each and all others at 75 for a total of 125
{
"rules": [
{
"rulePriority": 10,
"description": "Cap production images at 25.",
"selection": {
"tagStatus": "tagged",
"countType": "imageCountMoreThan",
"tagPrefixList": [
"prod"
@AnilPothula
AnilPothula / count-ecr-images.sh
Created February 1, 2021 22:01 — forked from shcallaway/count-ecr-images.sh
Count the number of images in an AWS ECR repository
#!/bin/bash
aws ecr list-images --repository-name $1 | jq '.imageIds | unique_by(.imageDigest) | length'
@AnilPothula
AnilPothula / rm_mysql.md
Created February 21, 2021 16:22 — forked from vitorbritto/rm_mysql.md
Remove MySQL completely from Mac OSX

Remove MySQL completely

  1. Open the Terminal

  2. Use mysqldump to backup your databases

  3. Check for MySQL processes with: ps -ax | grep mysql

  4. Stop and kill any MySQL processes

  5. Analyze MySQL on HomeBrew:

brew remove mysql

@AnilPothula
AnilPothula / MySQL_macOS_Sierra.md
Created February 21, 2021 16:28 — forked from nrollr/MySQL_macOS_Sierra.md
Install MySQL on Sierra using Homebrew

Install MySQL on macOS Sierra

This procedure explains how to install MySQL using Homebrew on macOS Sierra 10.12

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.

Install MySQL

At this time of writing, Homebrew has MySQL version 5.7.15 as default formulae in its main repository :

@AnilPothula
AnilPothula / aws-s3-list-objects.py
Created March 14, 2021 21:14 — forked from mindyyy-hsu/aws-s3-list-objects.py
AWS Simple-Storage-Service (S3) objects list and export to csv.
import boto3
import pandas
AWS_ACCESS_KEY_ID = 'YOUR_AWS_ACCESS_KEY_ID'
AWS_SECRET_ACCESS_KEY = 'YOUR_AWS_SECRET_ACCESS_KEY'
# connect to s3
s3 = boto3.client(
's3',
aws_access_key_id=AWS_ACCESS_KEY_ID,
@AnilPothula
AnilPothula / read-access.sql
Created April 19, 2022 01:03 — forked from oinopion/read-access.sql
How to create read only user in PostgreSQL
-- Create a group
CREATE ROLE readaccess;
-- Grant access to existing tables
GRANT USAGE ON SCHEMA public TO readaccess;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO readaccess;
-- Grant access to future tables
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO readaccess;
@AnilPothula
AnilPothula / tmux-cheatsheet.markdown
Created November 19, 2022 10:55 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@AnilPothula
AnilPothula / iterm2.md
Created February 11, 2025 15:30 — forked from squarism/iterm2.md
An iTerm2 Cheatsheet

Tabs and Windows

Function Shortcut
New Tab + T
Close Tab or Window + W (same as many mac apps)
Go to Tab + Number Key (ie: ⌘2 is 2nd tab)
Go to Split Pane by Direction + Option + Arrow Key
Cycle iTerm Windows + backtick (true of all mac apps and works with desktops/mission control)