OS

ランダム値取得

OS

Ubuntu (16)--0以上100未満の数値 awk 'BEGIN{ srand('"$RANDOM"'); print int(rand() * 100) }' while true;doawk 'BEGIN{ srand('"$RANDOM"'); print int(rand() * 100) }'done --10文字cat /dev/urandom | base64 | fold -w 10 | head -n 1 while true;do…

チーミング

OS

Ubuntu (16) https://help.ubuntu.com/community/UbuntuBonding ※nmtuiのteamingは動作しない NetworkManagerを使用している場合、NetworkManagerを停止し、既存のネットワーク設定はすべてinterfacesファイルに記載しておく systemctl stop NetworkManagers…

ロードバランサ

OS

Ubuntu (16)--LVS+Keepalived https://www.server-world.info/query?os=Ubuntu_16.04&p=lvs&f=1 LVS Server #1 mmm151 Ubuntu16LVS Server #2 mmm135 Ubuntu16バックエンドWebサーバ#1 mmm051 CnetOS7バックエンドWebサーバ#2 mmm052 CnetOS7 VRRP VIP=192.…

SMTP

OS

Ubuntu (16) apt -y install postfix ※No configurationを選択 vim /etc/postfix/main.cf myhostname = mmm151.example.commydomain = example.commyorigin = $myhostnameinet_interfaces = allmydestination = $myhostname, localhost.$mydomain, localhost…

DNS

OS

Ubuntu (16)apt install bind9 vim /etc/bind/named.conf.options --キャッシュサーバ設定 // forwarders { // 0.0.0.0; // };↓ forwarders { 8.8.8.8; }; named-checkconf systemctl enable bind9systemctl restart bind9systemctl status bind9 dig @local…

iSCSI

OS

Ubuntu (16)--iSCSIターゲット https://www.server-world.info/query?os=Ubuntu_16.04&p=iscsi&f=1 apt updateapt -y install targetclitargetcli下記のように設定 /> lso- / ..................................................................... [...] …

Docker

OS

Ubuntu (16)https://qiita.com/uutarou10/items/f9483aad5153957fc6dc apt purge docker docker-engine docker.ioapt updateapt install apt-transport-https ca-certificates curl software-properties-common curl -fsSL https://download.docker.com/linu…

パッケージダウンロード

OS

Ubuntu (16)https://qiita.com/koara-local/items/054d78cfb20592e67042 apt --download-only install nfs-common ls /var/cache/apt/archives dpkg -i nfs-common_1%3a1.2.8-9ubuntu12.2_amd64.deb (18) apt --download-only install dump ls /var/cache/ap…

システムリストア

OS

Ubuntu http://tobysoft.net/wiki/index.php?Ubuntu%2F%A5%B7%A5%B9%A5%C6%A5%E0%A4%CE%A5%D0%A5%C3%A5%AF%A5%A2%A5%C3%A5%D7#we363fd2 (16)rm -rf / --no-preserve-root -- OSインストールメディアでTry Ubuntuを選択 nmtui apt updateapt install nfs-comm…

システムバックアップ

OS

Ubuntu (16)https://haik.oi21.net/index.php?backuphttp://tobysoft.net/wiki/index.php?Ubuntu%2F%A5%B7%A5%B9%A5%C6%A5%E0%A4%CE%A5%D0%A5%C3%A5%AF%A5%A2%A5%C3%A5%D7#we363fd2 使用イメージ:ubuntu-16.04.3-desktop-amd64.iso 前提:バックアップ保存…

FTP

OS

Ubuntu (16)https://www.server-world.info/query?os=Ubuntu_16.04&p=ftp&f=1http://tomoprog.hatenablog.com/entry/2016/03/02/010729http://blog.livedoor.jp/devslife-other/archives/1313420.html userdel -r testuseruseradd -s /bin/bash -d /home/tes…

Samba

OS

Ubuntu (16)https://www.hiroom2.com/2016/05/11/ubuntu-16-04%E3%81%ABsamba%E3%82%92%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB%E3%81%97%E3%81%A6windows-10%E3%81%A8%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E5%85%B1%E6%9C%89%E3%81%99%E3%…

NFS

OS

Ubuntu (16)https://www.hiroom2.com/2016/05/07/ubuntu-16-04%E3%81%ABnfs%E3%82%B5%E3%83%BC%E3%83%90%E3%82%92%E7%AB%8B%E3%81%A1%E4%B8%8A%E3%81%92%E3%82%8B/https://hogem.hatenablog.com/entry/2015/07/25/230000 apt -y install nfs-kernel-server n…

Jupyter Notebook

OS

Ubuntu (16)https://qiita.com/taka4sato/items/2c3397ff34c440044978https://www.digitalocean.com/community/tutorials/how-to-set-up-jupyter-notebook-with-python-3-on-debian-9https://qiita.com/kenhira/items/8b2907e5ad7560f385c4https://blog.amed…

Python3

OS

Ubuntu (16) python3 -VPython 3.6.8デフォルトでインストールされている模様 (18) python3 -VPython 3.5.2デフォルトでインストールされている模様 Debian (9)python3 -VPython 3.5.3デフォルトでインストールされている模様 CentOS (7) https://qiita.com/…

RAID

OS

Ubuntu (16)https://qiita.com/sugimount/items/7d7267c9ff82b0da0126 1GBのディスクを2個接続 fdisk -l parted /dev/sdb unit GBmklabel gptmkpart primary ext4 0% 100%set 1 raid onp parted /dev/sdc unit GBmklabel gptmkpart primary ext4 0% 100%set …

パッケージリポジトリ

OS

Ubuntu (16)https://mag.osdn.jp/14/01/17/090000/3https://superuser.com/questions/1331936/how-can-i-get-past-a-repository-is-not-signed-message-when-attempting-to-upgr 前提:Apacheが起動していること cd /var/www/htmlmkdir testcd test cp /root…

パッケージ名取得

OS

Ubuntu http://za.toypark.in/html/2009/12-07.html (16)--指定したファイル名を含むパッケージを検索dpkg --search telnet --指定した文字列でパッケージを検索apt-cache search telnet (18)--指定したファイル名を含むパッケージを検索dpkg --search telne…

パッケージ作成

OS

Ubuntu (16)https://eng-entrance.com/linux-package-deb-createhttp://pman0214.github.io/blog/debian-package.html mkdir testcd test apt install build-essentialapt install devscriptsapt install cdbs mkdir testdpkg-samplecd testdpkg-sample echo…

パッケージ一覧

OS

Ubuntu (16)dpkg -l (18)dpkg -l Debian (9)dpkg -l CentOS (7) rpm -qa Windows Server (2012R2) http://rukifiel.net/ms-dos-001/https://soma-engineering.com/coding/powershell/export-windowsfeature-csv/2018/07/17/ reg query "HKEY_LOCAL_MACHINE\S…

ディスクIOベンチマーク

OS

Ubuntu https://thr3a.hatenablog.com/entry/20180804/1533378243 (16)apt install fio vim /tmp/fio.txt [global]ioengine=libaioiodepth=1size=1gdirect=1runtime=60directory=${TARGET}stonewall [Seq-Read]bs=1mrw=read [Seq-Write]bs=1mrw=write [Rand-…

Memcached

OS

Ubuntu (16)https://xn--o9j8h1c9hb5756dt0ua226amc1a.com/?p=3073 --インストール apt install memcachedapt show memcached systemctl enable memcachedsystemctl restart memcachedsystemctl status memcached --動作確認 telnet 127.0.0.1 11211 set key…

Redis

OS

Ubuntu (16)https://weblabo.oscasierra.net/redis-ubuntu1604-install-apt/https://qiita.com/wind-up-bird/items/f2d41d08e86789322c71 --インストール apt show redis-serverapt install redis-serverredis-cli --versionredis-server --version systemct…

MongoDB

OS

Ubuntu (16)https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/https://qiita.com/gabby-gred/items/8b250eca4b1a3c8207aa --インストール wget -qO - https://www.mongodb.org/static/pgp/server-4.2.asc | sudo apt-key add -echo "deb…

Apache

OS

Ubuntu (16)https://chee-s.net/ubuntu16-04%E3%81%ABapache2%E3%82%92%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB%E3%83%BB%E8%A8%AD%E5%AE%9A%E3%81%99%E3%82%8B apt updateapt install apache2 apache2 -v systemctl enable apache2systemct…

メモリ負荷

OS

Ubuntu (16)https://qiita.com/hana_shin/items/b1d8cd559d1a326f4d42 apt install stress stress -m 1 --vm-bytes 134217728 --vm-hang 0 -q & (18) apt install stress stress -m 1 --vm-bytes 134217728 --vm-hang 0 -q & Debian (9)apt install stress s…

CPU負荷

OS

Ubuntu (16) https://communities.vmware.com/message/753930?tstart=0 vim cpubusy.pl #!/usr/bin/perl use Time::HiRes 'usleep'; $goal = 2000;$sleep = 10;while (TRUE) { for ($i=0; $i<=$goal; $i++) { $x = 0.000001; $y = sin($x); $y = $y + 0.0000…

時刻同期

OS

Ubuntu https://sicklylife.hatenablog.com/entry/2016/02/03/201557 (16)timedatectl status vim /etc/systemd/timesyncd.conf #NTP=↓NTP=ntp.nict.jp systemctl restart systemd-timesyncdsystemctl status systemd-timesyncd -l (18) timedatectl status …

ルーティング

OS

Ubuntu (16)https://qiita.com/kooohei/items/b0931ae210911cc52adc route vim /etc/network/if-up.d/static-routes #!/bin/sh/sbin/route add -net 10.1.1.0 gw 192.168.137.145 netmask 255.255.255.0 dev ens160 chmod +x /etc/network/if-up.d/static-ro…

プロセスkill

OS

Ubuntu (16)kill -9 5719(18)kill -9 4020 Debian (9)kill -9 3512 3518 CentOS (7)kill -9 7461 Windows Server (2012R2) tasklisttasklist /v taskkill /pid 3804