Skip to content

Instantly share code, notes, and snippets.

View ddre54's full-sized avatar

David Rodas ddre54

View GitHub Profile
@sunapi386
sunapi386 / recover.md
Created February 7, 2018 19:58
How to recover locked out AWS EC2 ssh machine

One time I accidentally messed with the /etc/passwd and locked myself out of being able to SSH into the machine. Since this is a remote machine in AWS I had no way of doing what I'd normally do. Which is attaching a keyboard and monitor and fixing this manually.

To fix, use the AWS EC2 Management page to:

  • spin up a new instance of vanilla ubuntu EC2 (let's call it David)
  • shutdown the locked machine (let's call it Goliath)
  • unmount Goliath's volume
  • attach the volume to David

Then follow this guide: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-using-volumes.html

@Stanback
Stanback / nginx.conf
Last active June 14, 2024 10:21 — forked from michiel/cors-nginx.conf
Example Nginx configuration for adding cross-origin resource sharing (CORS) support to reverse proxied APIs
#
# CORS header support
#
# One way to use this is by placing it into a file called "cors_support"
# under your Nginx configuration directory and placing the following
# statement inside your **location** block(s):
#
# include cors_support;
#
# As of Nginx 1.7.5, add_header supports an "always" parameter which
@plentz
plentz / nginx.conf
Last active June 27, 2024 21:05
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048