| Value | Color |
|---|---|
| \e[0;30m | Black |
| \e[0;31m | Red |
| \e[0;32m | Green |
| \e[0;33m | Yellow |
| \e[0;34m | Blue |
| \e[0;35m | Purple |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 'use strict'; | |
| exports.handler = (event, context, callback) => { | |
| // Get request and request headers | |
| const request = event.Records[0].cf.request; | |
| const headers = request.headers; | |
| // Configure authentication | |
| const authUser = 'user'; | |
| const authPass = 'pass'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import boto3 | |
| import click | |
| @click.command() | |
| @click.argument("bucket") | |
| @click.argument("key") | |
| @click.option("-e", "--expiration", default=3600, type=int, help="How long this presigned URL will live for") | |
| def presign_s3(bucket, key, expiration): | |
| """ Simple utility to generate presigned URL on S3 (Default 1 hour expiration) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| echo -e "-- Removing exited containers --\n" | |
| docker ps --all --quiet --filter="status=exited" | xargs --no-run-if-empty docker rm --volumes | |
| echo -e "\n\n-- Removing untagged images --\n" | |
| docker rmi --force $(docker images | awk '/^<none>/ { print $3 }') | |
| echo -e "\n\n-- Removing volume directories --\n" | |
| docker volume rm $(docker volume ls --quiet --filter="dangling=true") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ''' | |
| This script performs efficient concatenation of files stored in S3. Given a | |
| folder, output location, and optional suffix, all files with the given suffix | |
| will be concatenated into one file stored in the output location. | |
| Concatenation is performed within S3 when possible, falling back to local | |
| operations when necessary. | |
| Run `python combineS3Files.py -h` for more info. | |
| ''' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT id,state,command,time,left(replace(info,'\n','<lf>'),120) | |
| FROM information_schema.processlist | |
| WHERE command <> 'Sleep' | |
| AND info NOT LIKE '%PROCESSLIST%' | |
| ORDER BY time DESC LIMIT 50; |