tail -f /dev/null

If you haven't had any obstacles lately, you're not challenging. be the worst.

PandasでセットしたdataframeからPostgreSQLへデータ投入したい

とてもかんたんでした。 environment mac OS Mojave 10.14.2 psql (PostgreSQL) 11.1 pg_ctl (PostgreSQL) 11.1 PostgreSQL 11.1 lxml 4.3.1 html5lib 1.0.1 beautifulsoup4 4.7.1 SQLAlchemy 1.2.18 pandas 0.24.1 pandasとは Python用データ分析library。 …

IAM: 任意のgroupに所属していないuserを抽出して所属させる

aws

Lambdaでてきとうに試しただけなので勘弁してください。 lambda_function.py #!/usr/bin/env python # -*- coding: utf-8 -*- import json import boto3 import traceback import logging from test import TestAttachRole from aws_iam import Iam from log…

Djangoのviewをレンダリングしてみたい

Djangoのおべんきょう。 startup page. Install pip install Django Environment django-admin --version 2.2.2 Feature Djangoの特徴は以下の通り。 機能拡張が豊富。 以下、標準装備。 user auth 管理サイト機能 cache機能 多言語翻訳機能 migrationが容易…

PostgresへTCP監視するとエラーログに"incomplete startup packet"が出力される

Zabbixの監視等でPostgres:5432へTCP/IP接続を行うと、エラーログに以下の通り吐かれる。 これは、Postgresサーバへトラフィック送信無しで接続・切断した為。 2018-01-25 14:58:42 UTC:10.0.11.11(46111):[unknown]@[unknown]:[7151]:LOG: connection recei…

dein.vimの設定

vim

Premise neovim が既にインストールされ、利用可能であること。 .vim .vimrc ではなく .config init.vim を利用していること。 Setting Example init.vim "dein Scripts----------------------------- if &compatible set nocompatible endif let s:dein_dir…

Windows: TCP connection過多によるsocket通信が出来ない場合の対応

障害例 frontend, (clientからのrequestを受けるweb server等が乗っているserver), backend(forntend serverから渡ってきたdataを処理して返すDB等) serverの両者間における通信でTCP connectionが過剰となり,clientがエラーを経験した. clientの体験として…

PostgreSQL: Updateで大量の行を処理時にWAF Archiver停止、DB停止した為PITRしたい

事象 WALのarchive commandが停止, 続いてDBも停止した。 挙動の確認はPostgreSQL9.6。 # 出力されたerror. could not write to file "pg_xlog/xlogtmp.111111" No space left on device 原因 Updateで大量の行を処理(既存データのクレンジング)しようとした…

📝 Gitの設定周りやコマンド

git

Environment git version 2.20.1 (Apple Git-117) user setting git config --global user.name "xxx" git config --global user.email "xxx@xxx.com" # confirm settings git config --list # Detect changes in capitalization git config core.ignorecase…

Python data collectionとbuilt-in

Pythonのおべんきょう。 Python String object format() method (formatter) 値を文字列へformatする。 replacement field (置換フィールド) はformat() methodに渡す引数を示すindexである。 format文字列を使用する場合、 波括弧をplaceholderの指定に使用…

PostgreSQL: process, memory周り整理

Env PostgreSQL 9.6 client, server間の接続〜問い合わせ処理 PostgreSQLへuser/passでのrequestを受信し、pg_hba.confで接続可否を判断 (認証処理) 認証成功 backend process生成 clientがserverとの接続を確立 client側で発行したqueryがpostgres process…

treeで頻繁に使うoption

環境 Mac OSX 10.14.4 tree v1.8.0 (c) 1996 - 2018 特定のディレクトリ(ファイル)を除外し、それ以外のファイルを返す -I matchしたfile, directoryを除外。 a dot fileを含む。 Q ファイル名をquote。 R 最大directory levelまで達したら結果を返す。 t 最…

Python: /regexp?/ (正規表現)

Pythonのおべんきょう re module re.sub は正規表現パターンで引数に渡された文字列を置換する。 re.sub(<pattern>, <置換後の文字列>, <置換対象の文字列>, [置換回数]) >>> import re >>> test_str = '123 ABC DEF ABCDEF' >>> re.sub('^123', '123 456', test_str)</pattern>…

Python: objectとtype(型)について

Pythonのobjectとtype(型)について整理した。 適切なデータ構造を選択したい。 type class mutable(not hashable) immutable(hashable) iterable sequence list ○ ○ sequence tuple ○ ○ special sequence string(※1) ○ ○ range range ○ ○ mapping dict ○ ○ s…

AWS EC2 basic provisioning

aws

EC2 basic provisioning Install yum packages Change character set / Timezone Set NTP Update hostname # Update yum packages. yum update # Only security package. yum update --security # Install commands for fault investigation. yum install tr…

MySQL basic setting

Create user # Add user. CREATE USER '<user>'@'<from_domain(ipaddress)>' IDENTIFIED BY "<password>"; FLUSH PRIVILEGES; GRANT ALL ON <db>.* to <user>@'%' IDENTIFIED BY '<user>'; SET PASSWORD FOR '<user>'@'%' = PASSWORD('<user>'); # For Admin user GRANT ALL PRIVILEGES ON *.* to admin@localhost IDENTIFI…</user></user></user></user></db></password></from_domain(ipaddress)></user>