2019年7月31日 星期三

ssh 不產生亦不確認 know_hosts

ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no

2019年7月30日 星期二

Debian 9 安裝 Proxmox 5.x

echo "deb http://download.proxmox.com/debian/pve stretch pve-no-subscription" > /etc/apt/sources.list.d/pve-no-subscription.list mv /etc/apt/trusted.gpg.d/proxmox-ve-release-5.x.gpg /etc/apt/trusted.gpg.d/proxmox-ve-release-5.x.gpg.$(date +%s) wget http://download.proxmox.com/debian/proxmox-ve-release-5.x.gpg -O /etc/apt/trusted.gpg.d/proxmox-ve-release-5.x.gpg chmod +r /etc/apt/trusted.gpg.d/proxmox-ve-release-5.x.gpg apt-get update apt-get upgrade proxmox-ve

2019年7月27日 星期六

Debian 10 安裝 Proxmox 6.x

wget http://download.proxmox.com/debian/proxmox-ve-release-6.x.gpg -O /etc/apt/trusted.gpg.d/proxmox-ve-release-6.x.gpg

echo "deb http://download.proxmox.com/debian/pve buster pve-no-subscription" | sudo tee /etc/apt/sources.list.d/pve-install-repo.list

apt update
apt dist-upgrade

echo "deb http://download.proxmox.com/debian/ceph-nautilus buster main" | sudo tee /etc/apt/sources.list.d/ceph.list

apt install proxmox-ve postfix open-iscsi

2019年7月19日 星期五

proxmox 升級 glusterfs 6.x

wget -O - https://download.gluster.org/pub/gluster/glusterfs/6/rsa.pub | apt-key add -

echo deb [arch=amd64] https://download.gluster.org/pub/gluster/glusterfs/6/LATEST/Debian/stretch/amd64/apt stretch main > /etc/apt/sources.list.d/gluster.list

apt-get install glusterfs-client=6.4-1
apt-get install glusterfs-server=6.4-1


相關指令
apt-cache showpkg 查詢版本
apt-get install pkgname=version

proxmox 掛載 qcow2

modprobe nbd
qemu-nbd -c /dev/nbd0 ./vm-disk.qcow2
qemu-nbd -d /dev/nbd0

CentOS 7 + PHP 7 +sqlite

使用 pdo 即可

yum install php-pdo

CentOS7 64bit 安裝 sqlite3

wget https://www.sqlite.org/2019/sqlite-tools-linux-x86-3290000.zip

執行時若出現以下訊息
./sqlite3: /lib/ld-linux.so.2: bad ELF interpreter:
./sqlite3: error while loading shared libraries: libz.so.1:

安裝以下套件
yum -y install glibc.i686
yum install zlib.i686

CentOS 7 install nginx


rpm -ivh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
或  yum install epel-release -y;yum update -y

yum install nginx -y

修改設定檔 /etc/nginx/conf.d/default.conf
server {
    listen 80;
#    server_name a.b.c;

    location / {
        proxy_pass http://192.168.10.9:5000;

        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $http_host;
        proxy_set_header X-NginX-Proxy true;
    }

    location /a {
        proxy_pass http://192.168.10.101/a;

        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $http_host;
        proxy_set_header X-NginX-Proxy true;

        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto;
        proxy_max_temp_file_size 0;
    }

    location /b {
        proxy_pass http://192.168.10.101/b;

        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $http_host;
        proxy_set_header X-NginX-Proxy true;

        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto;
        proxy_max_temp_file_size 0;
    }
}

systemctl enable nginx

systemctl start nginx

相關指令
nginx -t
nginx -s reload

2019年7月3日 星期三

WinPE 啟動時自動執行 command

dism /mount-wim /wimfile:e:\winpe_amd64\media\sources\boot.wim /index:1 /mountdir:e:\winpe_amd64\mount
修改 Windows\system32\Startnet.cmd

dism /unmount-wim  /mountdir:e:\winpe_amd64\mount /commit

makewinpemedia /iso e:\winpe_amd64 e:\winpe_amd64.iso



掛載指令
Dism /mount-image /imagefile:c:\winpe_amd64\media\sources\boot.wim /index:1 /mountdir:C:\winpe_amd64\mount

Dism /Cleanup-Wim

建立 iso
MakeWinPEMedia /ISO C:\WinPE_amd64 C:\WinPE_amd64\WinPE_amd64.iso

建立 usb 開機
MakeWinPEMedia /UFD C:\WinPE_amd64 P: