This file contains 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
run_ecs_task(){ | |
COMMAND="$1" | |
ClUSTER="$2" | |
TASKDEF="$3" | |
TASK_INFO=$(aws ecs run-task \ | |
--region ap-southeast-2 \ | |
--cluster "$CLUSTER" \ | |
--task-definition "$TASKDEF" \ | |
--overrides '{"containerOverrides": [{"name": "'"$CONTAINERNAME"'", "command": ["sh", "-c", "'"$COMMAND"'"]}]}') | |
TASK_ARN=$(echo "$TASK_INFO" | jq --raw-output ".tasks[0].taskArn") |
This file contains 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
from ftplib import FTP | |
import os | |
with FTP('FTP_HOSTNAME') as ftp: | |
ftp.login('FTP_USERNAME', 'FTP_PASS') | |
ftp.cwd('[DIRECTORYNAME_IN_FTP_SERVER]') # navigate to desired directory in ftp server | |
filenames = ftp.nlst() # gives you a list of of files in the current directory | |
localfilepath = os.path.join('path','to','local','filename') # filename with complete path to where you would like to download the file | |
with open(localfilepath, 'wb') as local_file: | |
ftp.retrbinary('RETR [SOURCE_FILE_NAME]', local_file.write) # replace [SOURCE_FILE_NAME] with name of the file in ftp server that you want to download |
This file contains 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
<?php | |
/* | |
* Creates a VERSION file if not exists in current directory. | |
* Version should be in the format. {Major.Minor.Patch} | |
* Patch has a suffix -dev for non release version | |
* Usage: | |
* php bumpversion.php [options] | |
* options: | |
* --version [part] (required) |
This file contains 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
""" | |
Install the following requirements into your virtual environemnt | |
`pip install click redis` | |
Usage: | |
To load data into redis | |
python redis_dump.py load [filepath] | |
To dump data into redis | |
python redis_dump.py dump [filepath] --search '*txt' |