Skip to content

Instantly share code, notes, and snippets.

@typon
Last active September 24, 2024 17:52
Show Gist options
  • Save typon/4ab35162ce0ceb821eecb6c3cf316e02 to your computer and use it in GitHub Desktop.
Save typon/4ab35162ce0ceb821eecb6c3cf316e02 to your computer and use it in GitHub Desktop.
description
[[Snippets]]
Description = "Tail the latest modified file that ends with .log"
Filename = "/Users/hasfaro/.config/pet/snippet.toml"
Output = ""
Tag = ["", "bash"]
command = "tail -f `ls -t *.log | head -n1`"
[[Snippets]]
Description = "Show all changed files between this branch and master"
Filename = "/Users/hasfaro/.config/pet/snippet.toml"
Output = ""
Tag = ["", "git"]
command = "git diff --name-only origin/master"
[[Snippets]]
Description = "Store git credentials locally"
Filename = "/Users/hasfaro/.config/pet/snippet.toml"
Output = ""
Tag = ["", "git"]
command = "git config --global credential.helper store"
[[Snippets]]
Description = "Clone covariant-apps repo"
Filename = "/Users/hasfaro/.config/pet/snippet.toml"
Output = ""
Tag = ["covariant", "git"]
command = "git clone https://github.com/embodiedintelligence/covariant-apps.git"
[[Snippets]]
Description = "Reset hard local branch to match remote"
Filename = "/Users/hasfaro/.config/pet/snippet.toml"
Output = ""
Tag = ["git"]
command = "git reset --hard @{u}"
[[Snippets]]
Description = "Check if port is currently used."
Filename = "/Users/hasfaro/.config/pet/snippet.toml"
Output = ""
Tag = ["networking"]
command = "sudo lsof -i -P -n | grep <port>"
[[Snippets]]
Description = "Clone lab42_vr"
Filename = "/Users/hasfaro/.config/pet/snippet.toml"
Output = ""
Tag = ["covariant", "git"]
command = "git clone ssh://git.amazon.com/pkg/FAR-lab42_vr --recursive"
[[Snippets]]
Description = "Show all unresolved conversations from PR"
Filename = "/Users/hasfaro/.config/pet/snippet.toml"
Output = ""
Tag = ["covariant", "git"]
command = "gh api graphql -f owner=\"embodiedintelligence\" -f repo=\"covariant-apps\" -F pr=\"<pr_number>\" -f query='\n query FetchReviewComments($owner: String!, $repo: String!, $pr: Int!) {\n repository(owner: $owner, name: $repo) {\n pullRequest(number: $pr) {\n url\n reviewDecision\n reviewThreads(first: 100) {\n edges {\n node {\n isResolved\n isOutdated\n isCollapsed\n comments(first: 100) {\n totalCount\n nodes {\n author {\n login\n }\n body\n url\n }\n }\n }\n }\n }\n }\n }\n }\n' | jq '.data.repository.pullRequest.reviewThreads.edges | map(select(.node.isResolved == false))'\n"
[[Snippets]]
Description = "Launch notebook in lab42vr"
Filename = "/Users/hasfaro/.config/pet/snippet.toml"
Output = ""
Tag = ["covariant"]
command = "bazel run covariant/dev_tools/jupyter -- notebook --ip=0.0.0.0 --NotebookApp.token='' --NotebookApp.password='' --NotebookApp.notebook_dir='/root/lab42_vr' --allow-root"
[[Snippets]]
Description = "Launch pytest in GDB"
Filename = "/Users/hasfaro/.config/pet/snippet.toml"
Output = ""
Tag = ["covariant", "debug"]
command = "gdb --args $(which python) -m pytest -sv <path>"
[[Snippets]]
Description = "Kill Kitting App instances"
Filename = "/Users/hasfaro/.config/pet/snippet.toml"
Output = ""
Tag = ["covariant", "kitting"]
command = "ps aux | grep python | grep -e production | awk '{print $2}' | xargs --no-run-if-empty sudo kill -9"
[[Snippets]]
Description = "Change shell to zsh"
Filename = "/Users/hasfaro/.config/pet/snippet.toml"
Output = ""
Tag = ["shell", "zsh"]
command = "chsh -s $(which zsh)"
[[Snippets]]
Description = "Login to AWS"
Filename = "/Users/hasfaro/.config/pet/snippet.toml"
Output = ""
Tag = ["aws", "docker"]
command = "aws ecr get-login-password --region us-east-2 | docker login --username AWS --password-stdin https://673492702245.dkr.ecr.us-east-2.amazonaws.com"
[[Snippets]]
Description = "Get AWS Credentials from Conduit"
Filename = "/Users/hasfaro/.config/pet/snippet.toml"
Output = ""
Tag = ["aws", "cred"]
command = "ada credentials update --account=673492702245 --provider=conduit --role=IibsAdminAccess-DO-NOT-DELETE --once"
[[Snippets]]
Description = "Start AWS SSM Session for Port Forwarding for RDP"
Filename = "/Users/hasfaro/.config/pet/snippet.toml"
Output = ""
Tag = ["aws", "rdp"]
command = "aws ssm start-session --target i-0a6c4e9c8e4ced53e --document-name AWS-StartPortForwardingSession --parameters \"localPortNumber=55678,portNumber=3389\""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment