Movies

Charlie 777

Mac cheatsheet

Save screenshots to custom folder defaults write com.apple.screencapture location /path/to/new/folder

AWS Cheatsheet

ECR # How to get ECR credentials and dcoker login aws ecr get-login-password --region <region>> | docker login --username AWS --password-stdin <account_no>.dkr.ecr.<region>>.amazonaws.com

Git Cheatsheet

To delete merged branches git branch --merged | grep -Ev "(^\*|master|main|dev)" | xargs git branch -d To retrieve commits between dates git log --after="2020-03-17" --before="2020-03-19" To retrieve full commit history of a file Note: works even for deleted files If you know path to the file. git log --all --full-history -- <path-to-file> If you do not know the path to the file. git log --all --full-history -- "**/thefile.*" Reset a file to it’s state in master git checkout origin/master -- <path-to-file> Script to pull latest changes from master and rebase the current branch Filename: pull_and_rebase.sh #! /bin/zsh # Pull from latest master and rebase # the current branch on master current_branch=$(git rev-parse --abbrev-ref HEAD) echo "### Rebasing $current_branch on master" git checkout master echo "### Pulling latest master" git pull -r echo "### Switching back to $current_branch" git checkout $current_branch git rebase master echo "### Rebase complete" chmod a+x pull_and_rebase. …

Python Cheatsheet

URLS # To unquote a URL import urllib url = "http://example.com/abc%3D123%26def%3D456" unquoted_url = urllib.parse.unquote(url)

Docker cheatsheet

Using Docker host services To use services in host machine, use host.docker.internal as the host. eg: to connect to host mysql Kill running containers docker kill $(docker ps -q) Removing Dangling images docker rmi $(docker images --filter "dangling=true" -q --no-trunc) Delete all stopped containers docker rm $(docker ps -a -q) Delete an image(s) docker rmi <image_name>:<tag> <image_name>:<tag> docker rmi <image_id> Prune commands # delete all resources docker system prune -a # delete all dangling images docker image prune -f # delete all containers docker container prune -f # delete build cache docker builder prune -f

Command Line Tools

k9s - Terminal UI for Kubernetes lazygit - Terminal UI for Git

Podcasts

The Knowledge Project The Changelog Latent Space: The AI Engineer Podcast Acquired Huberman Lab Think like a CEO

pyenv Cheatsheet

To create a virtualenv pyenv virtualenv <python_version> <env_name> To activate a virtualenv pyenv activate python_3.7.17 To list virtualenvs pyenv virtualenvs To remove a virtualenv pyenv virtualenv-delete <env_name>

Linux Commandline

Know the size of the uncompressed file without extracting gzip -l <file_name> | awk 'NR==2 {print $2}' | numfmt --to=iec-i --suffix=B Enddate of ssl certificate cho | openssl s_client -servername <domain> -connect <domain> 2>/dev/null | openssl x509 -noout -enddate Find a file recursively find needs a starting point, . is the current directory find . -name "*.py"