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;

5G

Currently, the 4th generation LTE is the mainstream, but if 5G is realized, it will be possible to transmit about 10 times faster than LTE. In addtion, devices that can be connected simultaneously are 100 times faster than LTE, and the delay is about 1/10 of LTE.

5G is linked with new radio technology “5G NR(New Radio)” and advanced LTE to form a network, and can handle a wide frequency band.

With the spread of AI, IoT, etc., communication traffic is expected to increase further in the future, and it is expected that the realization of 5G will cope with the increased amount of information.

centOS iptables and firewalld

firewalld can not be used with iptables.
By default, firewalld is enabled, so disabled firewalld if using iptables, you must install iptables-service and enable iptables.

If you want to configure easily to work with external services with api, firewalld.

If you want to configure easy + to work with external service with api, firewalld.

If you want to do complex things, it is better to use iptables.

[vagrant@localhost ~]$ cat /etc/redhat-release
CentOS release 6.10 (Final)

[vagrant@localhost ~]$ sudo /etc/rc.d/init.d/iptables status
iptables: ファイアウォールが稼働していません。

Linux command systemctl

NAME
       systemctl - Control the systemd system and service manager

SYNOPSIS
       systemctl [OPTIONS...] COMMAND [NAME...]

DESCRIPTION
       systemctl may be used to introspect and control the state of the "systemd" system and service manager. Please refer to systemd(1) for an introduction into the basic concepts
       and functionality this tool manages.

service start: systemctl start ${unit}
service stop: systemctl stop ${unit}
service restart: systemctl restart ${unit}
service reload: systemctl reload ${unit}
service status display: systemctl status ${unit}
service auto start: systemctl enable ${unit}
reject service auto start: sytemctl disable ${unit}
confirm service auto start: system is-enabled ${unit}
service list display: system list-unit-files –type=service
reload setting file: systemctl daemon-reload

[vagrant@localhost ~]$ ls /etc/init.d/
auditd iptables messagebus ntpdate rsyslog
blk-availability jenkins mysqld postfix sandbox
crond kdump netconsole rdisc saslauthd
elasticsearch kibana netfs rdma single
functions killall network restorecond sshd
halt lsyncd nfs rpcbind udev-post
htcacheclean lvm2-lvmetad nfs-rdma rpcgssd vboxadd
httpd lvm2-monitor nfslock rpcidmapd vboxadd-service
ip6tables mdmonitor ntpd rpcsvcgssd vboxadd-x11

[vagrant@localhost ~]$ sudo /etc/init.d/elasticsearch
使い方: /etc/init.d/elasticsearch {start|stop|status|restart|condrestart|try-restart|reload|force-reload}

[vagrant@localhost ~]$ sudo /etc/init.d/elasticsearch start
elasticsearch を起動中: OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x00000000e5f30000, 437059584, 0) failed; error=’Not enough space’ (errno=12)
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 437059584 bytes for committing reserved memory.
# An error report file with more information is saved as:
# /var/log/elasticsearch/hs_err_pid10362.log
[失敗]

vi elasticsearch.yml

[vagrant@localhost ~]$ sudo ls /etc/elasticsearch
elasticsearch.keystore jvm.options role_mapping.yml users
elasticsearch.yml log4j2.properties roles.yml users_roles
[vagrant@localhost ~]$ sudo cat /etc/elasticsearch/elasticsearch.yml
# ======================== Elasticsearch Configuration =========================
#
# NOTE: Elasticsearch comes with reasonable defaults for most settings.
# Before you set out to tweak and tune the configuration, make sure you
# understand what are you trying to accomplish and the consequences.
#
# The primary way of configuring a node is via this file. This template lists
# the most important settings you may want to configure for a production cluster.
#
# Please consult the documentation for further information on configuration options:
# https://www.elastic.co/guide/en/elasticsearch/reference/index.html
#
# ———————————- Cluster ———————————–
#
# Use a descriptive name for your cluster:
#
#cluster.name: my-application
#
# ———————————— Node ————————————
#
# Use a descriptive name for the node:
#
#node.name: node-1
#
# Add custom attributes to the node:
#
#node.attr.rack: r1
#
# ———————————– Paths ————————————
#
# Path to directory where to store the data (separate multiple locations by comma):
#
path.data: /var/lib/elasticsearch
#
# Path to log files:
#
path.logs: /var/log/elasticsearch
#
# ———————————– Memory ———————————–
#
# Lock the memory on startup:
#
#bootstrap.memory_lock: true
#
# Make sure that the heap size is set to about half the memory available
# on the system and that the owner of the process is allowed to use this
# limit.
#
# Elasticsearch performs poorly when the system is swapping the memory.
#
# ———————————- Network ———————————–
#
# Set the bind address to a specific IP (IPv4 or IPv6):
#
#network.host: 192.168.0.1
#
# Set a custom port for HTTP:
#
#http.port: 9200
#
# For more information, consult the network module documentation.
#
# ——————————— Discovery ———————————-
#
# Pass an initial list of hosts to perform discovery when this node is started:
# The default list of hosts is [“127.0.0.1”, “[::1]”]
#
#discovery.seed_hosts: [“host1”, “host2”]
#
# Bootstrap the cluster using an initial set of master-eligible nodes:
#
#cluster.initial_master_nodes: [“node-1”, “node-2”]
#
# For more information, consult the discovery and cluster formation module documentation.
#
# ———————————- Gateway ———————————–
#
# Block initial recovery after a full cluster restart until N nodes are started:
#
#gateway.recover_after_nodes: 3
#
# For more information, consult the gateway module documentation.
#
# ———————————- Various ———————————–
#
# Require explicit names when deleting indices:
#
#action.destructive_requires_name: true

Set IP where ElasticSearch is installed
#network.host: 192.168.0.1
→ 192.168.35.10

#http.port: 9200
→ http.port: 8000

[vagrant@localhost ~]$ sudo service elasticsearch restart
elasticsearch を停止中: [失敗]
elasticsearch を起動中: OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
[ OK ]

install selenium

[vagrant@localhost ~]$ python3
Python 3.5.2 (default, Jul 28 2018, 11:25:01)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-23)] on linux
Type “help”, “copyright”, “credits” or “license” for more information.
>>>

[vagrant@localhost ~]$ pip install selenium
Requirement already satisfied: selenium in ./.pyenv/versions/3.5.2/lib/python3.5/site-packages (3.13.0)
You are using pip version 18.0, however version 19.1.1 is available.
You should consider upgrading via the ‘pip install –upgrade pip’ command.

from selenium import webdriver
from selenium.webdriver.chrome.options import options

options = Options()

options.add_argument('--headless')
options.add_argument('--no-sandbox')

driver = webdriver.Chrome(executable_path='/path/to/chromedriver',chrome_options=options)

driver.get('https://yahoo.co.jp')
print(driver.title)

Canvas

<!DOCTYPE html>
<html>
	<head>
		<title>canvas tutorial</title>
		<style>
			#canvas {
				background: #666;
			}
		</style>
	</head>
	<body>
		<canvas id="canvas" width="640" height="480"></canvas>
		<script>
			var canvas = document.getElementById("canvas");
		</script>
	</body>
</html>

<!DOCTYPE html>
<html>
	<head>
		<title>canvas tutorial</title>
		<style>
			#canvas {
				background: #666;
			}
		</style>
	</head>
	<body>
		<canvas id="canvas" width="640" height="480"></canvas>
		<script>
			var canvas = document.getElementById("canvas");
			function onDown(e){
				console.log("down");
			}
			function onUp(e){
				console.log("up");
			}
			function onClick(e){
				console.log("click");
			}
			function onOver(e){
				console.log("mouseover");
			}
			function onOut(){
				console.log("mouseout");
			}

			canvas.addEventListener('mousedown', onDown, false);
			canvas.addEventListener('mouseup', onUp, false);
			canvas.addEventListener('click', onClick, false);
			canvas.addEventListener('mouseover', onOver, false);
			canvas.addEventListener('mouseout', onOut, false);
		</script>
	</body>
</html>

Install ChromeDriver and Fonts

Prepare for install
yum -y install libX11 GConf2 fontconfig
[root@localhost test]# wget https://chromedriver.storage.googleapis.com/73.0.3683.68/chromedriver_linux64.zip
–2019-05-24 09:20:33– https://chromedriver.storage.googleapis.com/73.0.3683.68/chromedriver_linux64.zip
chromedriver.storage.googleapis.com をDNSに問いあわせています… 216.58.197.208, 2404:6800:4004:80e::2010
chromedriver.storage.googleapis.com|216.58.197.208|:443 に接続しています… 接続しました。
HTTP による接続要求を送信しました、応答を待っています… 200 OK
長さ: 5008482 (4.8M) [application/zip]
`chromedriver_linux64.zip’ に保存中

100%[======================================>] 5,008,482 1.67M/s 時間 2.9s

2019-05-24 09:20:36 (1.67 MB/s) – `chromedriver_linux64.zip’ へ保存完了 [5008482/5008482]

[root@localhost test]# ls
chromeTest.js chromedriver_linux64.zip index.php node_modules selenium-test
[root@localhost test]# unzip chromedriver_linux64.zip
Archive: chromedriver_linux64.zip
inflating: chromedriver
[root@localhost test]# mv chromedriver /usr/local/bin/
[root@localhost test]# chmod 755 /usr/local/bin/chromedriver