What this will cover
- Host a static website at S3
- Redirect
www.website.com
towebsite.com
- Website can be an SPA (requiring all requests to return
index.html
) - Free AWS SSL certs
- Deployment with CDN invalidation
def get_or_create(session, model, defaults=None, **kwargs): | |
""" | |
Get or create a model instance while preserving integrity. | |
""" | |
try: | |
return session.query(model).filter_by(**kwargs).one(), False | |
except NoResultFound: | |
if defaults is not None: | |
kwargs.update(defaults) |
aws> ec2 describe-vpcs | |
aws> ec2 create-vpc --cidr-block 10.0.0.0/16 | |
aws> ec2 create-tags --resources vpc-f0bff594 --tags Key=Name,Value=sample-vpc | |
aws> ec2 describe-vpcs | |
aws> ec2 describe-internet-gateways | |
aws> ec2 create-internet-gateway | |
aws> ec2 create-tags --resources igw-6992410d --tags Key=Name,Value=sample-vpc-igw | |
aws> ec2 attach-internet-gateway --vpc-id vpc-f0bff594 --internet-gateway-id igw-6992410d | |
aws> ec2 describe-internet-gateways | |
aws> ec2 describe-subnets --query 'Subnets[?VpcId==`vpc-f0bff594`]' |
{ | |
"Records": [ | |
{ | |
"EventSource":"aws:sns", | |
"EventVersion":"1.0", | |
"EventSubscriptionArn":"arn:aws:sns:us-west-2:xxxx:xxxx", | |
"Sns": { | |
"Type":"Notification", | |
"MessageId":"88B1B251-2E92-4FC3-BFAA-E3BBD0BAB10A", | |
"TopicArn":"arn:aws:sns:us-west-2:881222951025:survey-tool-ses-delivery", |
console.log('Loading function'); | |
const https = require('https'); | |
const url = require('url'); | |
// to get the slack hook url, go into slack admin and create a new "Incoming Webhook" integration | |
const slack_url = 'https://hooks.slack.com/services/...'; | |
const slack_req_opts = url.parse(slack_url); | |
slack_req_opts.method = 'POST'; | |
slack_req_opts.headers = {'Content-Type': 'application/json'}; |
#!/bin/sh | |
## | |
## Bash install script for mongo 3.2 for Ubuntu 15.04, because of | |
## the replacement of upstart with systemd | |
## | |
## - AUTHOR: Alexandru Budurovici <https://w0rldart.com> | |
## - VERSION: 1.0 | |
## |
#!/bin/bash | |
if [ $# -ne 2 ]; then | |
echo "Usage: $0 file partSizeInMb"; | |
exit 0; | |
fi | |
file=$1 | |
if [ ! -f "$file" ]; then |
// Based on Glacier's example: http://docs.aws.amazon.com/AWSJavaScriptSDK/guide/examples.html#Amazon_Glacier__Multi-part_Upload | |
var fs = require('fs'); | |
var AWS = require('aws-sdk'); | |
AWS.config.loadFromPath('./aws-config.json'); | |
var s3 = new AWS.S3(); | |
// File | |
var fileName = '5.pdf'; | |
var filePath = './' + fileName; | |
var fileKey = fileName; |
@版本 2.0.0
譯注:此翻譯版,主要給不能流利的讀英文的人看,相關專有名詞還是保留原文。翻譯不好地方請協助pull request.
此repository包含了一些前端開發的面試問題,來審查一個有潛力的面試者。這並不是建議你對同一個面試者問上所有的問 (那會花費好幾小時)。從列表中挑幾個題目,應該就夠幫助你審查面試者是否擁有你需要的技能。
Rebecca Murphey 的 Baseline For Front-End Developers 也是一篇很棒且值得讀的文章在你開始面試之前。
rds-modify-db-parameter-group {param-group-name} \ | |
--parameters="name=character_set_server, value=utf8, method=pending-reboot" \ | |
--parameters="name=collation_server, value=utf8_general_ci, method=pending-reboot" \ | |
--parameters="name=tmp_table_size, value={DBInstanceClassMemory/16}, method=pending-reboot" \ | |
--parameters="name=max_heap_table_size, value={DBInstanceClassMemory/16}, method=pending-reboot" \ | |
--parameters="name=query_cache_type, value=1, method=pending-reboot" \ | |
--parameters="name=query_cache_size, value=131072, method=pending-reboot" \ | |
--parameters="name=table_open_cache, value=2500, method=pending-reboot" \ | |
--parameters="name=join_buffer_size, value={DBInstanceClassMemory/64}, method=pending-reboot" \ | |
--parameters="name=thread_cache_size, value={DBInstanceClassMemory/12582880}, method=pending-reboot" \ |