2020-01-01から1年間の記事一覧

複文

DB

MySQL (8.0.21) select 1;select 1; →実行可能 Oracle (19c) select 1 from dual;select 1 from dual; →ORA-00933: SQLコマンドが正しく終了されていません。 PostgreSQL (13) select 1;select 1; →実行可能 SQL Server (2019)select 1;select 1; →実行可能

サスペンド

OS

Ubuntu (18)https://qiita.com/Hypnam/items/1c8fdf05f5478188d96f ①実機で確認 systemctl suspend →サスペンドとWOL復帰どちらも可能 ②ESXiで確認 systemctl suspend →サスペンドはできるがWOLで復帰しない、コンソールクリックでも復帰できない Debian (9)…

ROWID

DB

MySQL 調べた限りなし Oracle (19) drop table tab1 purge;create table tab1(col1 int);insert into tab1 values(1);insert into tab1 values(2);commit; select rowid,col1 from tab1; select col1,rowid, DBMS_ROWID.ROWID_RELATIVE_FNO(rowid) from tab1…

先行読み取り

DB

実際の読み込みが発生する前にデータファイルからメモリにデータを読み込む機能 MySQL 機能あり( InnoDB バッファープールのプリフェッチ (先読み) ) Oracle 機能あり( Pre-Warming機能 ) PostgreSQL 調べた限り機能なし SQL Server 機能あり( read-ahead re…

varcharの文字数とバイト数

DB

MySQL (8.0.21) drop table tab1; create table tab1(col1 int, col2 varchar(3)); insert into tab1 values(1,'a');insert into tab1 values(2,'ab');insert into tab1 values(3,'abc');insert into tab1 values(4,'abcd');insert into tab1 values(11,'あ'…

updateでのselect権限必要性

DB

MySQL (8.0.21) -- テストテーブル作成drop table tab1;create table tab1(col1 int);alter table tab1 add constraint tab1pk primary key(col1); insert into tab1 values(1);select * from tab1; -- テストユーザ作成drop user 'user1'@'%';create user '…

パスワードポリシー

DB

MySQL (8.0.21)https://tokyo-engineer.com/mysql8-password-root/#ihttps://dev.mysql.com/doc/refman/8.0/en/validate-password-options-variables.html ※デフォルトで有効 SHOW VARIABLES LIKE 'validate_password.%'; +--------------------------------…

アーカイブログサイズ調査

DB

MySQL (8.0.21) -- テストテーブル作成drop table tab1;drop table tab2; create table tab1(col1 numeric(10,0),col2 numeric(10,0),col3 numeric(10,0),col4 numeric(10,0),col5 numeric(10,0),col6 varchar(30),col7 varchar(30),col8 varchar(30),col9 v…

月末月初テスト用シェル

systemctl stop chronydsystemctl status chronyd vim change_time.sh #!/bin/bash MONTH01=20210301INTERVAL=7200 while true;do MONTH01=`date --date "${MONTH01} 1 month" '+%Y%m01'` SET_TIME=`date --date "${MONTH01} -1 day" '+%Y/%m/%d 23:00:00'` …

{Aurora}カスタムエンドポイントの使用

AWS

カスタムエンドポイントの作成 aws rds create-db-cluster-endpoint \--db-cluster-identifier mycluster01 \--db-cluster-endpoint-identifier myep01 \--endpoint-type ANY \--static-members mydb01 mydb02 \--tags Key=Name,Value=myep01 カスタムエンド…

AWS CLI(RDS)

AWS

サブネットグループの作成aws rds create-db-subnet-group \--db-subnet-group-name mysubnetgroup \--db-subnet-group-description mysubnetgroup \--subnet-ids '["subnet-12345678901234567","subnet-12345678901234567"]' サブネットグループの一覧aws r…

AWS CLI(Cost Explorer)

AWS

https://qiita.com/shinsaka/items/c368c403935549b4401bhttps://dev.classmethod.jp/articles/road-to-jq-master-apprentice/ ※1リクエスト当たり0.01ドル課金されるコスト合計aws ce get-cost-and-usage \--time-period Start=2020-08-01,End=2020-09-01 \…

アセンブラでHello World

OS

Ubuntu (20)http://hironemu.hatenablog.com/entry/20090210/1234279094 apt install nasmnasm --version vim hello.asm section .textglobal _start msg db 'Hello world!', 0x0Amsglen equ $ - msg _start: mov ecx, msg mov edx, msglen mov eax, 4 mov e…

CでHello World

OS

Ubuntu (20)http://yamada.daiji.ro/blog/?p=1044 apt install build-essential gcc --version vim hello.c #include <stdio.h> int main(void){ printf("Hello World!\n"); return 0;} gcc -o hello hello.c./hello --vim web.c #include <stdio.h>#include <string.h>#include <sys/types.h>#include <sys/socket.h></sys/socket.h></sys/types.h></string.h></stdio.h></stdio.h>…

PHPでHello World

OS

Ubuntu (20) apt install php7.4-cliphp -v vim hello.php php hello.php --vim web.php php -S 192.168.137.167:8080 web.php Debian (10) apt install php7.3-cliphp -v vim hello.php php hello.php --vim web.php

ロック行のスキップ

DB

MySQL (8.0.21) drop table tab1;create table tab1(col1 int,col2 int,col3 varchar(10) ); create index ind11 on tab1(col1); insert into tab1 values(1,100,'off');insert into tab1 values(2,100,'off');insert into tab1 values(3,100,'off');select …

オーナの変更

DB

MySQL (8.0.21) オーナの概念なし Oracle (12cR1) オーナの概念なし PostgreSQL (9.4) オーナーの概念あり -- 所有権を指定してデータベース作成create database db10 owner = user10; -- 所有権を指定してスキーマ作成create schema schema10 authorization…

タイムゾーン設定

DB

MySQL (8.0.21)https://qiita.com/tailak/items/63dce2dd7dfe049b038ehttps://dev.mysql.com/doc/refman/8.0/en/time-zone-support.html vim /etc/my.cnfdefault-time-zone='+00:00' select @@time_zone;show variables like '%time_zone%'; select now(); ※…

シーケンス現在値確認

DB

MySQL (8.0.21) drop table tab1; create table tab1 (col1 int auto_increment,primary key (col1)); insert into tab1 values();select * from tab1; analyze table tab1; select auto_increment from information_schema.tables where table_schema = 'te…

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…