2021年3月20日土曜日

MySQL 利用

mysql 利用

mysql ダウンロード

mysql-8.0.23-winx64.zip

初期化

mysqld --initialize

or

mysqld -I

サービス登録

mysqld --install MYSQL80

mysqld --remove MYSQL80

サービス起動

NET START MYSQL80

初期パスワード下記のファイルにある

C:\mysql864\data\DESKTOP30c.err

[Note] [MY-010454] [Server] A temporary password is generated for root@localhost: !i0i1<%P_<hu

パスワード変更

SET PASSWORD = 'toor'

php.ini

extension=mysqli

extension=sqlite3

extension_dir = "ext"

MySQLの使い方

https://www.dbonline.jp/mysql/

%HOMEPATH%\\Desktop\php8\php -S 192.168.11.110:80 -t %HOMEPATH%\Desktop\eiloto

2021年3月19日金曜日

Windows での OpenSSH

Windows での OpenSSH

sshd.exe。リモートで管理されるシステム上で実行されている必要がある SSH サーバー コンポーネントです。

例 net start sshd

ssh.exe: ユーザーのローカル システム上で実行される SSH クライアント コンポーネントです

ssh-keygen.exe: SSH 用の認証キーを生成、管理、および変換します

ssh-agent.exe: 公開キーの認証に使用される秘密キーを格納します

ssh-add.exe: サーバーで許可される一覧に秘密キーを追加します

ssh-keyscan.exe: 複数のホストから公開 SSH ホスト キーを収集するのに役立ちます

sftp.exe: セキュア ファイル転送プロトコルを提供し、SSH 経由で実行されます

例 sftp pi@192.168.3.3

scp.exe: SSH で実行されるファイル コピー ユーティリティです

例 scp G20210318.mp4 pi@192.168.3.3:\var/www/html/qq/temp

例 >scp pi@192.168.3.3:\var\..\temp\G20210318.mp4 c:\users\nuc\desktop


end

2021年3月6日土曜日

phpでWebServerを動かす方法

php -S 192.168.11.113:8080 -t ../memo

 -S <addr>:<port> Run with built-in web server.

 -t <docroot>     Specify document root <docroot> for built-in web server.


PHP 8.0.2 (cli) (built: Feb  3 2021 18:36:40) ( ZTS Visual C++ 2019 x64 )

Copyright (c) The PHP Group

Zend Engine v4.0.2, Copyright (c) Zend Technologies

Google-code-prettify

Google-code-prettify

 <script src='https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js?skin=sunburst'/>


<pre class="prettyprint">

ここにコードを書く

</pre>


//

function T_Searchfom(arrayVal) {
    // arrayVal 指定した値が含まれるまで探し
    // clearInterval(W_T_Searchfom);
    const TAG = 'T_Searchfom->';
    let tempArr = arrayVal.concat();
    if (typeof (W_T_Searchfom) == 'number') {
        clearInterval(W_T_Searchfom);
    }
    W_T_Searchfom = setInterval(function () {
        let cont = 0;
        but[0].click();
        var temp = gnum();
        tempArr.forEach(function (e) {
            if (temp.indexOf(e) >= 0) {
                cont++;
            }
        })
        console.info(TAG, ' clearInterval(W_T_Searchfom)  ' + arrayVal.toString());
        if (cont == arrayVal.length) {
            clearInterval(W_T_Searchfom);
            console.info(TAG, temp);
            console.info(TAG, ' T_cpt2([' + temp + ',57,0])  ');
        }
    }, 200)
}
//


2021年3月3日水曜日

fetch() Ajax

// XMLHttpRequest()
function F_httprequest() {
    let req = new XMLHttpRequest();
    let url = '/' + CSVFile + '?key=' + Math.floor(Math.random() * (1 - 100) + 100);
    req.onreadystatechange = function () {
        if (req.readyState == 4 && req.status == 200) {
            let ajaxText = req.responseText;
            F_create_master(ajaxText);
            F_read_ajax(ajaxText);
        }
    }
    req.open("GET", url, true);
    req.send(null);
}

// fetch()
async function testFetch() {
    let pim = fetch('/' + CSVFile + '?key=' + Math.floor(Math.random() * (1 - 100) + 100));
    pim.then(function (msg) {
        msg.text().then(function (ajaxText) {
            console.log(TAGLine, 'step1');
            F_create_master(ajaxText);
            F_read_ajax(ajaxText);
        }).then(function () {
            console.log(TAGLine, 'step2');
        }).catch(function () {
            console.log(TAGLine, 'catch');
        })
    }).catch(function (e) {
        console.log(TAGLine, 'URLerror');
        console.log(e);
    })
}

// fetch() async await
async function testFetch() {
    let url = '/' + CSVFile + '?key=' + Math.floor(Math.random() * (1 - 100) + 100);
    let opt = {
        method: 'GET',
        headers: {
            // "Content-type": "application/x-www-form-urlencoded; charset=UTF-8",
        },
        // body: 'key=8080',
    };
    try {
        let pri = await fetch(url, opt);
        pri.headers.forEach(function (value, key) {
            console.log(key, value);
            // content - length 20949
            // content-type text/csv
            // date Fri, 05 Mar 2021 17:36:09 GMT
            // last-modified Fri, 05 Mar 2021 16:02:52 GMT
            // server SimpleHTTP/0.6 Python/3.9.0
        })
        let csvt = await pri.text();
        F_create_master(csvt);
        F_read_ajax(csvt);
    } catch (error) {
        console.log('error');
    }
}