Skip to content

Instantly share code, notes, and snippets.

View ChrisVo's full-sized avatar

Chris ChrisVo

  • Orange County, CA
View GitHub Profile
@ChrisVo
ChrisVo / rclone_clone.sh
Created May 27, 2020 02:26
Check if rclone process exist, if not run rclone sync.
#!/bin/bash
id_of_rclone=$(pidof -o %PPID -x "rclone")
if [ "$?" -eq 0 ]; then
echo "Already cloning... exiting."
exit 1
fi
/media/dmg/chrisanhvo/bin/rclone sync SOURCE/ DESTINATION/
exit
@ChrisVo
ChrisVo / export_sb_logs.sh
Created May 19, 2020 19:04
How to export all of AWS SnowBall Edge Support Logs
for i in $(snowballEdge list-logs | jq -r '.[] | .[] | .LogArn'); do snowballedge get-log --log-arn $i; done
@ChrisVo
ChrisVo / aws.sg.unused
Created July 18, 2019 21:01 — forked from thibautsacreste/aws.sg.unused
Bash: list unused AWS security groups
#!/usr/bin/env bash
# lists all unused AWS security groups.
# a group is considered unused if it's not attached to any network interface.
# requires aws-cli and jq.
# all groups
aws ec2 describe-security-groups \
| jq --raw-output '.SecurityGroups[] | [.GroupName, .GroupId] | @tsv' \
| sort > /tmp/sg.all