更新: | 2021-05-23 |
---|---|
作者: | @voluntas |
バージョン: | 2021.1 |
URL: | https://voluntas.github.io/ |
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
# sets mtime and atime of files to the latest commit time in git | |
# | |
# This is useful for serving static content (managed by git) | |
# from a cluster of identically configured HTTP servers. HTTP | |
# clients and content delivery networks can get consistent | |
# Last-Modified headers no matter which HTTP server in the |
This is how you would create a livable FreeBSD instance on EC2 by hand. The smart thing to do is to automate most of these actions. But I do it this way so you can see and understand all the different techniques. I want to create FreeBSD instances in EC2 and I want some of the management benefits that come from native AWS technologies like CloudWatch. It can be done, but it takes a bit of extra work because FreeBSD isn't Linux, and AWS doesn't directly support FreeBSD.
Before we go far, we will want some things setup in AWS IAM and VPC. I assume you have already created a VPC, decided what network numbers you're going to use, created a subnet and so on. If you haven't done those basic things, you need to go do them. I also assume you've created an ssh key and uploaded it to your AWS account.
#!/usr/bin/env python | |
# vim: set fileencoding=utf8 : | |
``` | |
$ pip install -U boto3 retrying | |
$ export AWS_DEFAULT_PROFILE=test | |
$ cat foo.sql | |
select count(*) | |
from bar | |
$ python athena.py foo.sql | |
$ ls -1 |
#!/usr/bin/python | |
# Copyright 2014 Amazon.com, Inc. or its affiliates. All Rights Reserved. | |
# | |
# Licensed under the Amazon Software License (the "License"). You may not use | |
# this file except in compliance with the License. A copy of the License is | |
# located at http://aws.amazon.com/asl/ or in the "license" file accompanying | |
# this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR | |
# CONDITIONS OF ANY KIND, either express or implied. See the License for the specific | |
# language governing permissions and limitations under the License. |
#!/bin/bash | |
# prints latest, stable, HVM, EBS GP2 backed AMIs for major OSs | |
# amazon, redhat 309956199498, ubuntu 099720109477, freebsd 118940168514, CentOS marketplace code | |
REDHAT=309956199498 | |
UBUNTU=099720109477 | |
FREEBSD=118940168514 | |
MICROSOFT=801119661308 | |
REGION=${REGION:-"us-east-1"} |
#! /bin/sh | |
getIden=$(echo $("$PROGDIR"../pushbullet-bash/pushbullet pushes recent) | grep -o -E '([A-Za-z0-9]{22})') | |
#iden表示 | |
#echo $getIden | |
if [ -z $getIden ]; then | |
#testコマンドオプション-z:文字列長が0ならば真 | |
echo "not pushes receved" | |
else |
EDITOR=tee sudo -E bash -c '( echo "[Service]" ; echo "ExecStart=" ; echo "ExecStart=/usr/bin/dockerd -H fd:// -H tcp://0.0.0.0:2375" ) | systemctl edit docker.service' |