公告版位

目前分類:Linux (140)

瀏覽方式: 標題列表 簡短摘要
We will change as follows,
-------------------------------------------------------------------------
deb cdrom:[Debian GNU/Linux 8.2.0 _Jessie_ - Official amd64 DVD Binary-1 20150906-11:13]/ jessie contrib main

# deb http://security.debian.org/ jessie/updates main contrib
# deb-src http://security.debian.org/ jessie/updates main contrib

# jessie-updates, previously known as 'volatile'
# A network mirror was not selected during install. The following entries
# are provided as examples, but you should amend them as appropriate
# for your mirror of choice.
#
# deb http://ftp.debian.org/debian/ jessie-updates main contrib
# deb-src http://ftp.debian.org/debian/ jessie-updates main contrib
-------------------------------------------------------------------------

dreamtails 發表在 痞客邦 留言(0) 人氣()

# vim /var/lib/dhcpd/dhcpd.leases

dreamtails 發表在 痞客邦 留言(0) 人氣()

How to get physical mac address, when other pepole rename your mac address on CentOS.

# cat /var/log/dmesg | grep eth

dreamtails 發表在 痞客邦 留言(0) 人氣()

1) Install packages
# yum install -y kvm libvirt qemu-kvm virt-manager

2)
# chkconfig libvirtd on
# service libvirtd restart

dreamtails 發表在 痞客邦 留言(0) 人氣()

Environment: All users are Read-Only on vsFTPd

[root@localhost ~]# vim /etc/vsftpd/vsftpd.conf
-----------------------------------------------------------
......
# Uncomment this to enable any form of FTP write command.
write_enable=NO
......
-----------------------------------------------------------


We have create an account "CloudUser", and CloudUser must Read-Write on vsFTPd of user home directory.

dreamtails 發表在 痞客邦 留言(0) 人氣()

(1) We use a example "ping" in the background, and the command (Using "nohup") is below,

# nohup ping www.google.com &

or

# nohup ping www.google.com >> output.log &

dreamtails 發表在 痞客邦 留言(0) 人氣()

1. Create a new account "Cloud-user"
# adduser Cloud-user

2. Add "Cloud-user" into sudo(sudoers) list.
# usermod -a -G sudo Cloud-user

dreamtails 發表在 痞客邦 留言(0) 人氣()

今天假設我們先安裝SSH的Daemon:
# sudo apt-get install openssh-server

安裝sysv-rc-conf package, 用來設定Daemon開機與關機時, Service的啟動與閉關:
# sudo apt-get install sysv-rc-conf

設定在所有Run Level開機時皆自動開啟SSH Daemon:
# sudo update-rc.d -f ssh defaults

設定在所有Run Level開機時皆不開啟SSH Daemon:
# sudo update-rc.d -f ssh remove

設定只在Run Level 2~5自動啟動SSH Daemon, 而開機啟動順位為80 (數值愈大愈晚啟動):
# sudo update-rc.d ssh start 80 2 3 4 5

設定在Run Level 0, 1, 6時自動關閉SSH Daemon, 而關閉順位為20 (數值愈小愈早關閉):
# sudo update-rc.d ssh stop 20 0 1 6

dreamtails 發表在 痞客邦 留言(0) 人氣()

1. Upload images (raw or qcow2) into OpenStack Controller by using key-pair.
example:
# scp -i <key-pair path> CentOS7.qcow2 root@<Controller IP>:~/

OR

# scp -i <key-pair path> CentOS7.raw root@<Controller IP>:~/

 

2. Login OpenStack Controller by using key-pair.
example:# ssh -i <key-pair path> root@<Controller IP>

3. Upload images into OpenStack Glance,

For QCOW2 image:
# glance image-create --name=<Image Display Name> \
    --disk-format=qcow2 --is-public true \
    --container-format=bare \
    --min-disk <DISK_GB> \
    --min-ram <DISK_RAM> \
    --file ~/CentOS7.qcow2 \
    --progress

dreamtails 發表在 痞客邦 留言(0) 人氣()

1. Convert an image from QCOW2 to RAW
# qemu-img convert -f qcow2 -O raw \
    ~/CentOS-7-x86_64.qcow2 \
    ~/CentOS-7-x86_64.raw

2. Convert an image from RAW to QCOW2
# qemu-img convert -f raw -O qcow2 \
    ~/CentOS-7-x86_64.raw \
    ~/CentOS-7-x86_64.qcow2

dreamtails 發表在 痞客邦 留言(0) 人氣()

1. Create a user (msmuser) for LSI MSM login
# adduser --shell /usr/sbin/nologin --gid 0 --no-create-home msmuser

2. Due to Mirantis OpenStack default root can't login for using password, and only use key pair. For system security, we configure a account/password to SSH login only.
# vim /etc/ssh/sshd_config
--------------------------------
......
......
......
......
......
......
Match User msmuser
PasswordAuthentication yes
--------------------------------

dreamtails 發表在 痞客邦 留言(0) 人氣()

1. LSI MSM package.

2. Unzip .zip file, and then tar .tar.gz file.
# unzip XX.XX.XX.XX_Linux_MSM.zip
# tar zxvf MSM_linux_x64_installer-XX.XX.XX-XX.tar.gz

3. Install alien to covert .rpm, the reference is below,
How to install alien to convert .rpm on OpenStack (Ubuntu 12.04)

4. Going to MSM folder.# cd disk

5. Convert all .rpm files
# alien --scripts *.rpm

dreamtails 發表在 痞客邦 留言(0) 人氣()

1. Backup config
# mv /etc/apt/sources.list /etc/apt/bak.sources.list

2. You can generate sources.list config (Reference: http://repogen.simplylinux.ch/index.php)
# vim /etc/apt/sources.list
---------------------------------------------
###### Ubuntu Main Repos
deb http://tw.archive.ubuntu.com/ubuntu/ precise main restricted universe multiverse
deb-src http://tw.archive.ubuntu.com/ubuntu/ precise main restricted universe multiverse
---------------------------------------------

3. Configure DNS
# vim /etc/resolv.conf
---------------------------------------------
nameserver 8.8.8.8
---------------------------------------------

4. Install alien package
# apt-get update
# apt-get install alien

dreamtails 發表在 痞客邦 留言(0) 人氣()

設定系統時間:

1. 讀取系統目前時間:

# date

or

自訂格式化顯示
# date "+%Y/%m/%d %H:%M:%S"

dreamtails 發表在 痞客邦 留言(0) 人氣()

# find / -type f -size +10G -exec du -h {} \; 2>/dev/null | sort -n | tail -n 10 

/ 為由根目錄找起

-type f 為檔案

-size +10G 為大於10GB

du 為看檔案大小的指令

sort 為排序

tail -n 10 為找倒數10列顯示於螢幕上

dreamtails 發表在 痞客邦 留言(0) 人氣()

安裝必要的packages
# yum install ntp ntpdate ntp-doc

dreamtails 發表在 痞客邦 留言(0) 人氣()

Environment:

## Disk devices information.
[root@CentOS ~]# fdisk -l | grep "Disk /dev/sd"
----------------------------------------------------------
Disk /dev/sdb: 3999.7 GB, 3999688294400 bytes
Disk /dev/sdc: 3000.0 GB, 3000034656256 bytes
Disk /dev/sda: 1999.8 GB, 1999844147200 bytes
----------------------------------------------------------

## Only the /dev/sdb is PV.
[root@CentOS ~]# pvscan
----------------------------------------------------------
  PV /dev/sdb   VG vg001   lvm2 [3.64 TiB / 693.88 GiB free]
  Total: 1 [3.64 TiB] / in use: 1 [3.64 TiB] / in no VG: 0 [0   ]
----------------------------------------------------------

## OS has a VG (vg001) currently.
[root@CentOS ~]# vgscan
----------------------------------------------------------
  Reading all physical volumes.  This may take a while...
  Found volume group "vg001" using metadata type lvm2
----------------------------------------------------------

dreamtails 發表在 痞客邦 留言(0) 人氣()

1. 找出/tmp/dir目錄下的無效鏈結
# find /tmp/dir -type l ! -exec test -r {} \; -print

2. 找出目錄下的無效鏈結並刪除它
# find /tmp/dir -type l ! -exec test -r {} \; -print | xargs -n 1 unlink

dreamtails 發表在 痞客邦 留言(0) 人氣()

# yum install vsftpd ftp

dreamtails 發表在 痞客邦 留言(0) 人氣()

Install Virtual Machine Manager and KVM for ubuntu 14.04.02 below,

$ sudo apt-get install qemu-system qemu-kvm libvirt-bin ubuntu-vm-builder bridge-utils

$ sudo apt-get install virt-manager

$ sudo reboot

dreamtails 發表在 痞客邦 留言(0) 人氣()