Skip to content

Instantly share code, notes, and snippets.

View Selimcse98's full-sized avatar

Mohammad Selim Miah Selimcse98

View GitHub Profile
@tracend
tracend / aws_ec2_root.md
Created November 5, 2012 12:02
AWS EC2: Steps to enable root access with your local key - Inspired by: https://forums.aws.amazon.com/thread.jspa?threadID=86876

Note: replace {{server}} with your domain or ip

  • Login as the ec2-user
ssh -i key.pem ec2-user@{{server}}
  • Switch to administrator
sudo -i
@dsmrt
dsmrt / query-aws-logs-insights.bash
Last active June 28, 2024 20:40
Using AWS CLI to query CloudWatch Logs with Insights. Looking -30 mins to now.
# this script queries aws logs with insights filtering on ERROR
# explanation of start and end times
#--start-time = unix timestamp 30 mins in the past
#--end-time = unix timestamp now
QUERY_ID=$(aws logs start-query \
--profile $profile \
--log-group-name /aws/lambda/aap-event-consumer-dev \
--start-time `date -v-30M "+%s"` \