Linux磁盘分区UUID的获取及其UUID的作用

方法一
[root@Z ~]# ll /dev/disk/by-uuid/
总用量 0
lrwxrwxrwx 1 root root 11 5月 29 11:47 3179fc99-518e-44c9-94d9-6ea0d2ed7992 -> ../../xvdb1
lrwxrwxrwx 1 root root 11 3月 23 17:18 887b0b9e-449b-414e-a11d-cd94093e3fe1 -> ../../xvda1

方法二
[root@Z tmp]# blkid /dev/xvdb1
/dev/xvdb1: UUID=”3179fc99-518e-44c9-94d9-6ea0d2ed7992″ TYPE=”ext4″

Linux UUID的作用及意义

原因1:它是真正的唯一标志符
UUID为系统中的存储设备提供唯一的标识字符串,不管这个设备是什么类型的。如果你在系统中添加了新的存储设备如硬盘,很可能会造成一些麻烦,比如说启动的时候因为找不到设备而失败,而使用UUID则不会有这样的问题。

原因2:设备名并非总是不变的
自动分配的设备名称并非总是一致的,它们依赖于启动时内核加载模块的顺序。如果你在插入了USB盘时启动了系统,而下次启动时又把它拔掉了,就有可能导致设备名分配不一致。
系统组的同事在机房换硬盘时就深有体会了

其它参数:

ls -l /dev/disk/by-id

ls -l /dev/disk/by-label

ls -l /dev/disk/by-path

ls -l /dev/disk/by-uuid

Installing VirtualBox in Kali Linux Host

Installing VirtualBox in Kali Linux Host

如果你也是一个喜欢折腾安全的人 那应该也是听说过 kali的,现在基于debian 还不错,不过却在virtualbox安装时,让哥浪费了好几天的时间,还差点放弃了,还好 g到一个不错的博客

首先 下载
https://www.virtualbox.org/wiki/Linux_Downloads
因为基于debian 所以 选择 Debian 7.0 (“Wheezy”) i386 | AMD64

安装完 开心的启动时 却是不开心的结果显示 Recompiling VirtualBox kernel moudles … failede!

进行内核头文件更新的,依然报错, 只有用官方的源才行哦 如下 (中科大kali源 这个应该也行,不过我还没试过呢)
sudo apt-get install dkms
vi /etc/apt/sources.list
#这个时候吧官方的软件源添加上上去,并把原来的软件源注释掉
#官方的软件源如下

deb http://http.kali.org/kali kali main non-free contrib
deb-src http://http.kali.org/kali kali main non-free contrib

## Security updates
deb http://security.kali.org/kali-security kali/updates main contrib non-free

apt-get update && apt-get upgrade -y
apt-get install linux-headers-$(uname -r) -y
sudo /etc/init.d/vboxdrv setup

#阿里云kali源 good
deb http://mirrors.aliyun.com/kali kali main non-free contrib
deb-src http://mirrors.aliyun.com/kali kali main non-free contrib
deb http://mirrors.aliyun.com/kali-security kali/updates main contrib non-free

#中科大kali源
deb http://mirrors.ustc.edu.cn/kali kali main non-free contrib
deb-src http://mirrors.ustc.edu.cn/kali kali main non-free contrib
deb http://mirrors.ustc.edu.cn/kali-security kali/updates main contrib non-free

apt-get update

用debian的源好像不完全好,就像上次的vbox事件一下 ,so
virtualbox Installing VirtualBox in Kali Linux 不太成功呀
https://forums.kali.org/showthread.php?1021-installing-VitualBox-in-kali-linux-host

http://skytina.blog.51cto.com/6834539/1388748
http://blog.csdn.net/mxyjz/article/details/22589019

安装 lua

zypper install readline-devel

curl -R -O http://www.lua.org/ftp/lua-5.2.3.tar.gz
tar zxf lua-5.2.3.tar.gz && cd lua-5.2.3
make linux test
make linux
make install

http://www.cnblogs.com/wenjiashe521/archive/2012/09/10/2678467.html

tp link 如何去掉地址租期

最近虚拟机老是ip在变 搞得哥老是要先登录pc看虚报机ip 麻烦 ,醒来就是懒才dhcp的 怎么地址租期这么短呢 于是只好

将你想要去掉地址租期的IP设为静态地址,租期就变成永久了

登录你的841N管理界面,DHCP服务器-静态地址分配-添加新条目

填入你的要分配的IP,和该IP的设备的MAC地址,保存即可

如下

ifconfig 得到
HWaddr C8:0A:A9:B0:18:9B 但是记得要改一下格式

MAC地址: C8-0A-A9-B0-18-9B
IP地址:192.168.1.97

点击保存

CentOS6 挂载光盘安装图形界面

mkdir /mnt/cdrom
mount -o loop x2.iso /mnt/iso2
mount /dev/cdrom /mnt/cdrom
cd /etc/yum.repos.d/
vim CentOS-Media.repo

#添加如下内容
file:///mnt/cdrom

yum --disablerepo=* --enablerepo=c6-media groupinstall "Desktop"
yum --disablerepo=* --enablerepo=c6-media groupinstall "X Window System"
yum --disablerepo=* --enablerepo=c6-media groupinstall "Chinese Support"

Enable GNOME

Since the server was previously running on CLI mode, we need to change the initialization process for the machine to boot up in GUI mode.

Open /etc/inittab using a text editor and change following line:

id:3:initdefault:
To:

id:5:initdefault:

1.首先进行光盘的挂载,注意光盘挂载时不会自动建立目录的,所以需要自己建立目录
2、更改本地源地址
cd /etc/yum.repos.d/ #可以看见CentOS-Base.repo和CentOS-Media.repo文件
注意:
CentOS-Base.repo记录着网络上的yum源的地址和路径信息等
CentOS-Media.repo记录着可以从本地作为yum源的介质和路径

不过我安装后好像启动不了

不错的参考 在 ali 看到的 http://help.aliyun.com/view/11108189_13438669.html?spm=5176.7224913.1997283765.4.QwFhG7

http://tycool.blog.51cto.com/696627/627416
http://www.idevelopment.info/data/Unix/Linux/LINUX_AddGNOMEToCentOSMinimalInstall.shtml

wget –with-ssl was given, but GNUTLS is not available.

configure: error: –with-ssl was given, but GNUTLS is not available.
曾经安装 wget 的时候也是因为这个原因进行不下去的,不过后来还是解决了。这次重装系统后再次卡在这里,所以干脆写篇东西纪录一下,以免到时候又要花时间去找。解决办法也很简单,在 ./configure 加一句参数就可以了,整个安装步骤如下:

./configure –with-ssl=openssl
make
sudo make install
据说老版本的 wget 原先是默认支持的,新版本反而改了,这有点让人蛋疼啊。不过就算说明了原因偶这个程序盲也无法理解,表示压力很大。

Debian、Ubuntu 常见开发环境安装

Debian、Ubuntu 常见开发环境安装
# 基本开发工具及内核头文件
aptitude install -R build-essential autoconf automake fakeroot \
kernel-package linux-headers-2.6-amd64

# 基本开发工具文档
aptitude install -R binutils-doc cpp-doc gcc-doc make-doc diffutils-doc \
autoconf-doc m4-doc

# 系统调用和 C/C++ 库文档
aptitude install -R manpages-dev manpages-posix-dev linux-doc-2.6 \
glibc-doc glibc-doc-reference libstdc++6-4.4-doc

# deb 包制作维护工具及文档
aptitude install -R dh-make devscripts fakeroot lintian pbuilder cowdancer \
debian-policy developers-reference

# 调试器
aptitude install -R gdb gdb-doc cgdb

# 版本控制
aptitude install -R cvs subversion subversion-tools git git-doc

# Xorg
aptitude install -R xorg-dev

# Qt
aptitude install -R libqt4-dev libqt4-opengl-dev qt4-dev-tools qt4-designer \
qt4-doc qt4-demos

# boost
aptitude install -R libboost1.42-all-dev libboost1.42-doc

# Java
aptitude install -R openjdk-6-jdk openjdk-6-doc openjdk-6-demo

# Python
aptitude install -R python-dev python-doc python-examples

# Ada
aptitude install -R gnat gnat-doc gnat-gps gnat-gps-doc
ln -s /usr/share/gps/icons/32px/gps_32.png /usr/share/icons/hicolor/32×32/apps/gnat-gps.png
ln -s /usr/share/gps/icons/48px/gps_48.png /usr/share/icons/hicolor/48×48/apps/gnat-gps.png
update-icon-caches /usr/share/icons/hicolor/
cat > /usr/share/applications/gnat-gps.desktop << EOF [Desktop Entry] Name=GNAT-GPS Exec=gnat-gps Terminal=false Type=Application Icon=gnat-gps Categories=Development EOF # 数据库 aptitude install -R sqlite3 libsqlite3-dev sqlite3-doc vi ~/.sqliterc #{ PRAGMA foreign_keys = ON; #} # 代码格式化 aptitude install -R indent indent-doc xmlindent # 文档工具 aptitude install -R doxygen doxygen-gui doxygen-doc source-highlight \ graphviz graphviz-doc # IDE aptitude install -R qtcreator qtcreator-doc # http://www.codeblocks.org/ dpkg -i codeblocks_10.05-1_amd64.deb \ libcodeblocks0_10.05-1_amd64.deb \ codeblocks-common_10.05-1_all.deb \ codeblocks-contrib_10.05-1_amd64.deb \ codeblocks-contrib-common_10.05-1_all.deb \ libwxsmithlib0_10.05-1_amd64.deb \ codeblocks-doc-en_10.05-1_all.deb aptitude markauto libcodeblocks0 codeblocks-common codeblocks-contrib-common libwxsmithlib0 # 建模工具 # http://argouml.tigris.org/ tar xf ArgoUML-0.32.2.tar.gz -C /opt ln -s /opt/argouml-0.32.2/argouml.sh /usr/local/bin/argouml ln -s /opt/argouml-0.32.2/icon/argouml2.svg /usr/share/icons/hicolor/scalable/apps/argouml2.svg update-icon-caches /usr/share/icons/hicolor/ cat > /usr/share/applications/argouml.desktop << EOF [Desktop Entry] Name=ArgoUML Exec=/opt/argouml-0.32.2/argouml.sh Terminal=false Type=Application Icon=argouml2 Categories=Development EOF # 基本开发工具及内核头文件 aptitude install -R build-essential autoconf automake fakeroot \ kernel-package linux-headers-generic # 基本开发工具文档 aptitude install -R binutils-doc cpp-doc gcc-doc make-doc diffutils-doc \ autoconf-doc m4-doc # 系统调用和 C/C++ 库文档 aptitude install -R manpages-dev manpages-posix-dev linux-doc \ glibc-doc libstdc++6-4.6-doc # deb 包制作维护工具及文档 aptitude install -R dh-make devscripts fakeroot lintian pbuilder cowdancer \ debian-policy developers-reference # 调试器 aptitude install -R gdb gdb-doc cgdb # 版本控制 aptitude install -R cvs subversion subversion-tools git git-doc # Xorg aptitude install -R xorg-dev # Qt aptitude install -R libqt4-dev libqt4-opengl-dev qt4-dev-tools qt4-designer \ qt4-doc qt4-demos # boost aptitude install -R libboost1.42-all-dev libboost1.42-doc # Java aptitude install -R openjdk-6-jdk openjdk-6-doc openjdk-6-demo # Python aptitude install -R python-dev python-doc python-examples # 数据库 aptitude install -R sqlite3 libsqlite3-dev sqlite3-doc vi ~/.sqliterc #{ PRAGMA foreign_keys = ON; #} # 代码格式化 aptitude install -R indent indent-doc xmlindent # 文档工具 aptitude install -R doxygen doxygen-gui doxygen-doc source-highlight \ graphviz graphviz-doc # IDE aptitude install -R qtcreator qtcreator-doc codeblocks codeblocks-contrib # 建模工具 # http://argouml.tigris.org/ tar xf ArgoUML-0.32.2.tar.gz -C /opt ln -s /opt/argouml-0.32.2/argouml.sh /usr/local/bin/argouml ln -s /opt/argouml-0.32.2/icon/argouml2.svg /usr/share/icons/hicolor/scalable/apps/argouml2.svg update-icon-caches /usr/share/icons/hicolor/ cat > /usr/share/applications/argouml.desktop << EOF [Desktop Entry] Name=ArgoUML Exec=/opt/argouml-0.32.2/argouml.sh Terminal=false Type=Application Icon=argouml2 Categories=Development EOF #格式化 0.023 秒, 使用 GeSHi 1.0.8.4 from http://forum.ubuntu.org.cn/viewtopic.php?f=70&t=360583