Download files using requests
library.
Method 1:
import requests
def download_file(url: str)->str:
local_filename = url.split('/')[-1]
# 注意传入参数 stream=True
#!/bin/bash | |
############################################### | |
# To use: | |
# wget https://raw.github.com/gist/4411254 | |
# chmod 777 github-ubuntu.sh | |
# ./github-ubuntu.sh | |
############################################### | |
[email protected] | |
GIT_USER=qinjie |
``` | |
sudo amazon-linux-extras install postgresql10 | |
``` | |
Use it to connec to Redshift database | |
``` | |
psql -h <endpoint> -p <port> -d <databasename> -U <userid> | |
``` |
#!/bin/sh | |
sudo yum install -y https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm | |
sudo yum install -y mysql-community-client |
#!/bin/bash | |
if [ -z "$1" ]; then | |
echo "waiting for the following arguments: username + max-page-number" | |
exit 1 | |
else | |
name=$1 | |
fi | |
if [ -z "$2" ]; then |
Download files using requests
library.
Method 1:
import requests
def download_file(url: str)->str:
local_filename = url.split('/')[-1]
# 注意传入参数 stream=True
This is a Cheat Sheet for interacting with the Mongo Shell ( mongo on your command line). This is for MongoDB Community Edition.
Mongo Manual can help you with getting started using the Shell.
FAQ for MongoDB Fundamentals and other FAQs can be found in the side-bar after visiting that link.
To copy a file from container to host:
docker cp <containerId>:/file/path/within/container /host/path/target
The best resource for learning Google Script is the official documentation available at developers.google.com. Here are other places that will help you get up to speed.
#!/usr/bin/python | |
import os | |
import sys | |
import boto3 | |
# get an access token, local (from) directory, and S3 (to) directory | |
# from the command-line | |
local_directory, bucket, destination = sys.argv[1:4] |