Half-size check with regular expression

Half-size check with regular expression
Represent other than half-width characters in [^…] part.

$value = "こんにちは";

echo preg_match('/^[^ -~。-°\x00-\x1f\t]+$/u', $value);

[vagrant@localhost tests]$ ls
index.php
[vagrant@localhost tests]$ php -S 192.168.35.10:8000
PHP 7.1.21 Development Server started at Fri Feb 8 20:56:23 2019
Listening on http://192.168.35.10:8000
Document root is /home/vagrant/local/app/tests
Press Ctrl-C to quit.
[Fri Feb 8 20:56:31 2019] PHP Warning: preg_match(): Compilation failed: range out of order in character class at offset 11 in /home/vagrant/local/app/tests/index.php on line 5

なに? 修正します。

$value = "123";

if (preg_match('/^[^ -~。-゚\x00-\x1f\t]+$/u', $value)){
	echo "yes";
} else {
	echo "半角です";
}

/u
→ UTF-8 character code

OK

MWB file, WorkBench

What is the .mwb file, which is found at entity-relation.
It seems that there are many cases to make using SQL development tool / ER diagram tool such as “MySQL Workbench” or “A5ER” when using database ER diagram.

Roll back git remote repository

Those that pushed to the remote repository can not be rewound to the past state, or other members may start working. (It is possible to use supplementary git reset)
Roll back by executing the following command and pushing the processing opposite to the pushed contents.

git revert <commit id>
git revert bd912e1

When if it is merged, execute the command.

git revert-m 1 <commit_ID>
git revert-m 1 bd912e1

Linux “sed” command

Replace the character string / output the replaced line

[vagrant@localhost tests]$ ls
baio.txt

baio.txt

2019 年 MM 月 DD 日に発表いたしました、再生細胞薬「SBXXX」の慢性期脳梗塞を対象にした
米国でのフェーズ N 臨床試験の解析結果について、患者さんからの声をたくさんお寄せ
いただいております。改めて私より、今後についてお伝えさせていただきたいと思います。

To replace the character string, use “s” command and specify “s/beforeReplacment/afterReplacement”

[vagrant@localhost tests]$ cat baio.txt
2019 年 MM 月 DD 日に発表いたしました、再生細胞薬「SBXXX」の慢性期脳梗塞を対象にした
米国でのフェーズ N 臨床試験の解析結果について、患者さんからの声をたくさんお寄せ
いただいております。改めて私より、今後についてお伝えさせていただきたいと思います。

[vagrant@localhost tests]$ cat baio.txt | sed s/患者/株主/
2019 年 MM 月 DD 日に発表いたしました、再生細胞薬「SBXXX」の慢性期脳梗塞を対象にした
米国でのフェーズ N 臨床試験の解析結果について、株主さんからの声をたくさんお寄せ
いただいております。改めて私より、今後についてお伝えさせていただきたいと思います。

AWS health check

Health check function checks whether the load balancer and the target server are connected. It check every certain time whether we can see the website via load balancer.

For AWS, it is judged whether it can access the health check URL set on the console screen. It is OK if the HTTP status 200 is returned from the URL. If inadvertent 404 comes back, even if you access the URL set by the load balancer, the the site will not displayed.

It seems that it becomes OutOfService somewhat when restarting the EC2 instance in the state attached to the ELB. Also, as it is said that 200 should be returned by health check, if you do not do BASIC certification naturally, it will be OutOfService. 401 error comes back. If you are using ELB and need to make Basic authentication, only URLs for health checks must be in a state where authentication is ineffective.

SLA (Service Level Agreement)

SLA stands for Service Level Agreement, which means agreement service level, service quality assurance, etc. on the level of service(definitions, ranges, contents, achievement targets, etc.) tied between providers and their users it will be. This is an indication of how much quality can be guaranteed to the contractor by the service provider.

SLAs are often used mainly for communication service, cloud services, rental servers, etc. We define guarantee items such as definition of service, communication speed, upper limit of usage stop time, etc. When the quality of service falls below the guaranteed value of SLA, reduction of usage fee etc will be done.

In many cases, this reduction is often limited to the usage fee, and it does not include lost profits etc. that the service could not be used properly. In principle, the specified item can be quantitatively measured, and the upper limit, the lower limit, the average, etc. are expressed numerically, and the measurement method etc. are also defined at the same time.

As a user, it is an index to measure the availability and stability of the service, so it is a good idea to check it when selecting a service. Although the SLA values presented by each company vary, it can be seen that there are large differences when looking at “stop time”.

Windows10 VPN connection

With VPN connection, you can connect securely via the company’s network or the Internet(when working in a public place like a coffee shop).

Before connecting to VPN, it is necessary to prepare a VPN profile on the PC. You can create a VPN profile yourself or set up a workplace account to get a VPN profile from your company.

On the add VPN connection screen, do the following:
Under VPN Provider, select Windows(built-in). In the Connection name box, enter the friendly name of the VPN connection profile(for example, your VPN). This is the name of the VPN connection search for when connecting. In the server name and address box, type the VPN server address.
Under [VPN type], select the type of VPN connection to be created. You need to know the type of VPN connection used by user computer or VPN service. In the type of sign-in information, select the type of sign-in information (credential information) to use. It will be a user name and password, a one-time password, a certificate, or a smart card if you connect to VPN at work. Enter a user name and password in each box(optional).

VPN Connection

VPN is a virtual private network built using public lines. It is a technology that allows you to share data and information using a VPN device such as a router with VPN function even if you are a remote location. The merit of VPN is that it costs less than leased line. Especially for Internet VPN it is inexpensive because it uses normal internet line contract.

VPN is a network technology that has been in use since the 2000s, with the background of the development of IT technology and virtualization technology in the background. Besides low-cost merits, data communication is also secured for safety, so more enterprises are introducing it.

Mechanism and features of VPN connection using the Internet
To establish a VPN connection between business offices located in geographically remote places, connect a LAN by installing a VPN dedicated router at both offices. This creates a virtual leased line via the Internet and allows you to access data on each other’s servers even if you are at a remote place. Because it becomes like connected to a common LAN, even you are away, you can share files and the work the same way.

Google Translation Toolbar settings

There are times when I am dealing with multiple languages at work, and when want to translate all at once to turn on pop of “このページを翻訳しますか?”.

Open google chrome setting screen.

Next will look at the detailed setting.

Check the section “Use translation tools on pages other than my mother tongue”.

As offshore development increases, opportunities to use translation tools increase.