Unzip oldwebsitedata.tar.gz into this directory so that you end with ./mnt/mysql-snapshot-2015-03-31/data
Then run:
docker-compose run mysql bash
Once inside the container run:
| # Minor modification to https://github.com/motherduckdb/metabase_duckdb_driver?tab=readme-ov-file#docker | |
| FROM openjdk:21-buster | |
| ENV MB_VERSION=v0.55.5 | |
| ENV MB_PLUGINS_DIR=/home/plugins/ | |
| ADD https://downloads.metabase.com/${MB_VERSION}/metabase.jar /home | |
| ADD https://github.com/motherduckdb/metabase_duckdb_driver/releases/download/0.3.1/duckdb.metabase-driver.jar /home/plugins/ | |
| RUN chmod 744 /home/plugins/duckdb.metabase-driver.jar |
| git clean -d -x -f -n |
| # Python to return the IAM details of an access key | |
| import boto3 | |
| client = boto3.client('sts', aws_access_key_id="ACCESS_KEY_ID", aws_secret_access_key="SECRET") | |
| client.get_caller_identity() | |
| => {'UserId': '...', 'Account': '...', 'Arn': 'arn:aws:iam::...:user/...', 'ResponseMetadata': {'RequestId': '...', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': '...', 'content-type': 'text/xml', 'content-length': '409', 'date': '...'}, 'RetryAttempts': 0}} |
| docker run -it --rm -v /dir/to/code:/app python:3.9 bash |
| # Creates multiple files from one geojson file | |
| require 'json' | |
| file = File.read('data.geojson') | |
| data_hash = JSON.parse(file) | |
| data_hash['features'].each do |feature| | |
| file_name = feature['properties']['OBJECTID'] | |
| File.open("#{file_name}.geojson", 'w') do |f| | |
| f.write(feature.to_json) | |
| end |
| import tweepy | |
| import os | |
| API_KEY = os.getenv('API_KEY') | |
| API_SECRET = os.getenv('API_SECRET') | |
| auth = tweepy.AppAuthHandler(API_KEY, API_SECRET) | |
| api = tweepy.API(auth, wait_on_rate_limit=True) | |
| items = tweepy.Cursor(api.user_timeline, screen_name='NPATweets', count=200).items(3200) |
| version: '3' | |
| services: | |
| app: | |
| build: . | |
| image: app | |
| depends_on: | |
| - db | |
| environment: | |
| - DATABASE_URL=postgresql://db:db@pgbouncer/db |
| 'use strict'; | |
| exports.handler = (event, context, callback) => { | |
| var response = { | |
| "statusCode": 302, | |
| "headers": { | |
| "location": "https://new-domain.tld" | |
| }, | |
| "body": "{}", | |
| "isBase64Encoded": false |
| const url = 'https://host.test/path/here.filetype?query=string&more=params#anchor'; | |
| let newUrl = new URL(url); | |
| let params = new URLSearchParams(newUrl.search); | |
| params.set('query', `${params.get('query')}-changed`); | |
| params.delete('more'); | |
| params.set('new', 'param'); | |
| newUrl.search = params; |