Skip to content

Instantly share code, notes, and snippets.

View mijndert's full-sized avatar
💻
Remote

Mijndert mijndert

💻
Remote
View GitHub Profile
1. Create and start an EC2 instance with the same OS (+version)
2. Create a snapshot of the original root volume
3. Create a new volume from the snapshot (source)
4. Create a new larger/smaller volume (target)
5. Connect the source as xvdf
6. Connect the target as xvdg
Run these commands:
e2fsck -f /dev/xvdf1
@mijndert
mijndert / set-aws-credentials.sh
Last active May 3, 2020 14:07
simple script to read credentials from ~/.aws/credentials and export it into your env vars
#!/usr/bin/env bash
echo "Enter the account for which you want to export credentials and [enter]"
read account
export AWS_ACCESS_KEY_ID=$(aws configure get $account.aws_access_key_id)
export AWS_SECRET_ACCESS_KEY=$(aws configure get $account.aws_secret_access_key)
export AWS_REGION=$(aws configure get $account.region)
import http.server
import socketserver
from urllib.parse import urlparse
from urllib.parse import parse_qs
PORT = 9001
class r(http.server.SimpleHTTPRequestHandler):
def do_GET(self):
self.send_response(200)
ip route list | grep default | grep -E 'dev (\w+)' -o | awk '{print $2}'