2020-08-01から1ヶ月間の記事一覧

WordPress

OS

Ubuntu (18)https://qiita.com/cherubim1111/items/265cfbbe91adb44562d5 Apache: 2.4.29PHP: 7.2.24MariaDB: 10.1.44WordPress: 5.1.6 apt -y updateapt -y install apache2 systemctl enable apache2systemctl start apache2 apt -y install php7.2 php7.2…

OSプロセス確認

DB

MySQL (5.6) マルチスレッドモデル Oracle (12cR1) 前提:Oracleマルチプロセス/マルチスレッド機能が無効 select s.username,s.process,s.program,p.spid,p.programfrom v$session s, v$process pwhere s.paddr = p.addr; PostgreSQL (9.4) select * from p…

VSCode

OS

Ubuntu (20)https://qiita.com/yoshiyasu1111/items/e21a77ed68b52cb5f7c8 snap install --classic codesnap list -- 一般ユーザで実行code --versioncode Debian (10)http://nao-yu-ki-pc.blogspot.com/2019/09/debian-visual-studio-code.html apt install…

RubyでHello World

OS

Ubuntu (20)https://techacademy.jp/magazine/19901 apt install ruby-fullruby --version vim hello.rbprint "Hello World!\n" ruby hello.rb --vim web.rb require 'webrick' op = { BindAddress: "192.168.137.167", Port: 8080, DocumentRoot: "." }s = …

PythonでHello World

OS

Ubuntu (20)https://qiita.com/okhrn/items/4d3c74563154f191ba16 apt install python3 python -V vim hello.pyprint("Hello World!") python hello.py -- python -m http.server 8080-- vim web.py #!/usr/bin/env python3import http.serverimport sockets…

JavaでHello World

OS

Ubuntu (20)https://qiita.com/terappy/items/537c069923144a9d9755https://eng-entrance.com/java-hello-worldhttps://www.net.t-labs.tu-berlin.de/teaching/computer_networking/02.08.htm apt install openjdk-8-jdkjava -versionjavac -version vim hel…

PerlでHello World

OS

Ubuntu (20)https://qz.tsugumi.org/Perl_IO_Socket_INET.htmlhttps://www.geekpage.jp/programming/perl-network/simple-http-serv.php perl -v vim hello.pl#! /usr/bin/perlprint "Hello World!\n" perl hello.pl --vim web.pl #!/usr/bin/perl use IO::S…

GoでHello World

OS

Ubuntu (20)https://qiita.com/nsd24/items/7ca62a054ec09c799e1bhttps://qiita.com/notchi/items/5f76b2f77cff39eca4d8http://pineplanter.moo.jp/non-it-salaryman/2017/06/26/webserver-on-golang/ apt install golanggo version mkdir -p /usr/local/gov…

Node.jsでHello World

OS

Ubuntu (20)http://www.tohoho-web.com/ex/nodejs.html apt updateapt install nodejsapt install npmupdate-alternatives --install /usr/bin/node node /usr/bin/nodejs 10 node --version vim hello.js console.log("Hello world!"); node hello.js vim w…

結果を返さないselect

DB

MySQL (5.6)select sleep(1);do sleep(1); Oracle 調べた限りなし PostgreSQL (9.4) ※PL/pgSQLでのみ使用可 DO $$DECLAREBEGIN select pg_sleep(1);END$$; DO $$DECLAREBEGIN perform pg_sleep(1);END$$; SQL Server 調べた限りなし

超音波距離センサを使用した物体変位の通知

(1)構成概要Wio LTE(超音波距離センサ)→SORACOM Funk→AWS Lambda(Python3.8)→ Line Notify (2)使用するハードウェアWio LTE JP VersionGrove - 超音波距離センサーGrove - ブザーSORACOM IoT SIM plan-DAnker PowerCore 10000 (3)使用するサービスSORACOM Fu…

ユーザアカウントのロック

DB

MySQL (5.7) select user,host, account_locked from mysql.user; alter user user10 account lock;alter user user10 account unlock; Oracle (12cR1) select username,account_status from dba_users order by username; alter user user10 account lock;a…

ゼロ除算

DB

MySQL (5.6)select 1/0; →★エラーとならずNULLが返る Oracle (12cR1) select 1/0 from dual; →ORA-01476: 除数がゼロです PostgreSQL (9.4)select 1/0; →ERROR: division by zero SQL Server (2014)select 1/0; →0 除算エラーが発生しました。

NULLの表示

DB

MySQL (5.6) drop table tab1;create table tab1(col1 int,col2 varchar(10));insert into tab1(col1,col2) values(1,'');insert into tab1(col1,col2) values(2,'NULL');insert into tab1(col1) values(3);select * from tab1; デフォルトでヌルの場合はNUL…

各種ユーザ作成

DB

ログインできないユーザ user10ディクショナリ参照だけできるユーザ user20データ参照だけできるユーザ user30データ追加だけできるユーザ user40テーブル作成だけできるユーザ user50スーパーユーザ user60 MySQL (5.6) mysql -u root -proot drop user 'us…

スロークエリの出力対象

DB

MySQL (5.6) -- 確認事項実行中のSQL、ロック待ちのSQL、ファンクション内部のSQL、エラーSQLがスロークエリに出力されるか -- テスト準備vim /etc/my.cnfslow_query_log=1slow_query_log_file="/var/lib/mysql/mmm050-slow.log"long_query_time=0 sudo syst…

PLのselect intoの挙動

DB

MySQL (5.6) -- 確認事項データが0件、2件の場合のPLでのselect intoの挙動 -- テストデータ準備 drop table tab1;create table tab1(col1 int);insert into tab1 values(1);insert into tab1 values(2);insert into tab1 values(2); select * from tab1; --…

AWS CLI(S3)

AWS

バケットの作成 aws s3 mb s3://mybucket ファイルのコピーaws s3 cp /root/a.txt s3://mybucket aws s3 cp /root/testdir s3://mybucket \--recursive aws s3 cp /root/b.txt s3://mybucket \--storage-class STANDARD aws s3 cp /root/c.txt s3://mybucket…

AWS CLI(EC2)

AWS

セキュリティグループの作成aws ec2 create-security-group \--description Mysg01 \--group-name Mysg01 \--vpc-id vpc-04ffe9cc84548ab04 セキュリティグループの一覧aws ec2 describe-security-groupsaws ec2 describe-security-groups | jq -r '.Securit…

AWS CLI(VPC)

AWS

VPCの作成aws ec2 create-vpc \--cidr-block 172.16.0.0/16 \--instance-tenancy default ※同時に下記も作成されるルートテーブルDHCPオプションセット VPCの一覧aws ec2 describe-vpcsaws ec2 describe-vpcs | jq -r '.Vpcs.VpcId' VPCの削除aws ec2 delete…

WAL暗号化

DB

MySQL (8.0.18) https://www.s-style.co.jp/blog/2019/03/3771/ MySQL 8.0.14でバイナリログファイルとリレーログファイルが暗号化対応 --検証のためにバイナリログのフォーマットをSTATEMENTに変更vim /etc/my.cnfbinlog_format=STATEMENT systemctl restar…

データファイル確認

DB

MySQL (8.0.18) select * from information_schema.innodb_tables;select * from information_schema.innodb_datafiles;select * from information_schema.files; select t1.name,t2.pathfrom information_schema.innodb_tables t1inner join information_sc…