Skip to content

Instantly share code, notes, and snippets.

View mijndert's full-sized avatar
💻
Remote

Mijndert mijndert

💻
Remote
View GitHub Profile
UPDATE wp_options SET option_value = replace(option_value, 'http://www.example.com', 'https://www.example.com') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'http://www.example.com','https://www.example.com');
UPDATE wp_posts SET post_content = replace(post_content, 'http://www.example.com', 'https://www.example.com');
UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://www.example.com','https://www.example.com');
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}'