VPC NAT gateway

You can use Network Address Translation(NAT) gateways to allow instances from your private subnet to connect to the Internet and other AWS services, but not from the Internet to initiate connections with these instances.

It is “public subnet” that is set so that 0.0.0.0/0 (communication to the default gateway) flows to the internet gateway in Route tables is “private subnet”.

Since 0.0.0.0/0 flows to igw-xxxxxx (Internet gateway), subnet for which this route table is set is a public subnet.

Typical port numbers and protocols

– TCP 20: FTP
– TCP 21: FTP
– TCP 22: SSH
– TCP 23: Telnet
– TCP 25: SMTP
– UDP 53: DNS
– UDP 67: DHCP(server)
– UDP 68: DHCP(client)
– TCP 80: HTTP
– TCP 110: POP3
– UDP 123: NTP
– TCP 443: HTTPS
– WELL KNOWN PORT NUMBER 0-1023

When connecting to MySQL from the command line, you can specify the port number to connect to.
Use the -P option to specify a port number.
When port number specification is omitted (connected to default port number 3306)
[vagrant@localhost ~]$ mysql -u root -p
Enter password:

When specifying port number explicitly

[vagrant@localhost ~]$ mysql -u root -p -P 3306
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 13
Server version: 5.6.44 MySQL Community Server (GPL)

Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

mysql> Ctrl-C — exit!
Aborted

AWS firewall manager

AWS Firewall Manager is a security management service that makes it easy to configure and manage AWS WAF rules centrally across multiple customers’ accounts and applications. With the Firewall Manager, you can easily roll out the AWS WAF rules for the Application Load Balancer and Amazon CloudFront distributions across many AWS Organizations accounts. In addition, every time a new application is created, Firewall Manager makes it easy for new applications and resources to meet compliance with common security rules from day one. Now that you have a consistent set of firewall rules across the Application Load Balancer and Amazon CloudFront infrastructure, hierarchically build firewall rules, create security policies, and get single service to apply them.


1. Name web ACL
2. Create condition
– IP match condition
– String match condition, bad bot user agent
– SQL injection match condition, sqli checks
3. Create rules
4. Review and create

HA(high availability)

HA refers to high availability, and to minimize the frequency and time that functions and services provided by the system are stopped or interrupted. Also, a system (HA) or a system configuration(HA configuration) in which such measures are taken may be simply referred to as HA.
In a narrow sense, multiple computers are bundled and operated in an integrated manner, and clustering technology that makes them behave as if they are one computer prevents the whole from stopping even if one stops. It refers to the state(HA cluster).

In a broad sense, it includes all techniques such as redundancy and multiplexing (duplexing) of equipment and systems, data replication and automatic switching, and a hot standby configuration and cold standby configuration in which two systems of the same system are prepared in some cases, HA may be promoted using database replication and the like (and their combination).

RGL

RGL is a package in which functions for performing three-dimensional plotting are condensed. Three-dimensional plots can be created, and the plotted figures can be moved with the mouse, and enlargement / reduction can be performed.

Here is an example of the instructions from installing the package to displaying example. After plotting, you can rotate the figure by moving the mouse while holding the figure with the left click, or zoom in and out of the figure by turning the mouse wheel.

install.packages("rgl")
library(rgl)
open3d()
example(rgl.surface)
for(i in 1:360) rgl.viewpoint(i, 1/4)

Holacracy

The term “holacracy” refers to social technology or organizational governance management to maintain a self-propelled organization by distributing authority and making decisions throughout the organization rather than making decisions through traditional top-down hierarchies. It is defined as the method.

LWP::Protocol::https

my $url = "https://xxx.yyy.jp";
my $request = HTTP::Request->new(GET => $url);
my $ua = LWP::UserAgent->new;
my $res = $ua->request($request);
my $resutl = $res->content;

There is no problem with HTTP pages, but it fails with HTTPS.

cpan istall LWP::Protocol::https
Cpanm Crypt::SSLeay

openssl-devel

Files needed to develop applications that use OpenSSL

OpenSSL is a toolkit to support cryptography. The openssl-devel package contains the static libraries and header files needed to develop applications that support various encryption algorithms and protocols.

yum list installed | grep ${package}

yum update “software”
→ update software

yum remove “software”
-> Uninstall software

yum list installed
-> display a list of already installed

yum list installed | grep “software name”
-> display the version name of the specified software

yum list
-> display a list of installable software

yum list updates
-> this is a list of installed software that requires update

[vagrant@localhost ~]$ yum list installed
読み込んだプラグイン:fastestmirror
Repository nodesource is listed more than once in the configuration
Repository nodesource-source is listed more than once in the configuration
Loading mirror speeds from cached hostfile
* base: ty1.mirror.newmediaexpress.com
* extras: ty1.mirror.newmediaexpress.com
* remi-safe: ftp.riken.jp
* updates: ty1.mirror.newmediaexpress.com

[vagrant@localhost ~]$ rpm -qa | grep openssl
openssl-devel-1.0.1e-57.el6.x86_64
openssl-1.0.1e-57.el6.x86_64

[vagrant@localhost ~]$ yum list installed | grep openssl
openssl.x86_64 1.0.1e-57.el6 @base
openssl-devel.x86_64 1.0.1e-57.el6 @base

Net-Amazon-S3-0.86

Net::Amazon::S3 – Use the Amazon S3 – Simple Storage Service
Version 0.86

This module provides a Perlish interface to Amazon S3. From the developer blurb: “Amazon S3 is storage for Internet. It is designed to make web-scale computing easier for developers. Amazon S3 provides a simple web service interface that can be used to store and retrieve any amount of data, at any time, from anywhere on the web. It gives any developer access to the same highly scalable, reliable, fast, inexpensive data storage infrastructure that Amazon uses to run its own global network of web sites. The service aims to maximize benefits of scale and to pass those benefits on to developers”

use Net::Amazon::S3;
my $aws_access_key = 'fill me in';
my $aws_screte_access_key = 'fill me in too';

my $s3 = Net::Amazon::S3->new(
{
	aws_access_key_id => $aws_access_key_id,
	aws_secret_access_key => $aws_secret_access_key,
	use_iam_role => 1,
	retry => 1
}
);

my $response = $s3->buckets;
my $bucket( @{ $response->{buckets}})
	or die $s3->err . ": " . $s3->errstr;

$bucket = $s3->bucket($bucketname);

$bucket->add_key_filename('1.JPG', 'DSC06256.JPG',
	{ content_type => 'image/jpeg',},
) or die $s3->err . ": " . $s3->errstr;