[实践OK]Linux下多核CPU使用率查询情况。
Unix/LinuxC技术 jackx 2014-9-29 21:11
top使用_交互命令:
1、输入1可以看到CPU各个核的CPU负载(us,sy,id,wa等)
2、输入shift+p按CPU占用率排序
3、shift+m按内存占用率排序,
4 u然后输入用户名,查看指定用户的进程信息,shift+t按CPU用时排序,shift+n按PID排序
重点讲下第一条:
1、输入1可以看到CPU各个核的CPU负载
Cpu0 : 1.0%us, 3.0%sy, 0.0%ni, 96.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu1 : 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
这里对us,sy,ni,id,wa,hi,si,st进行分别说明:
us 列显示了用户模式下所花费 CPU 时间的百分比。
us的值比较高时,说明用户进程消耗的cpu时间多,但是如果长期大于50%,需要考虑优化用户的程序。
sy 列显示了内核进程所花费的cpu时间的百分比。
这里us + sy的参考值为80%,如果us+sy 大于 80%说明可能存在CPU不足。
ni 列显示了用户进程空间内改变过优先级的进程占用CPU百分比。
id 列显示了cpu处在空闲状态的时间百分比。
wa 列显示了IO等待所占用的CPU时间的百分比。
这里wa的参考值为30%,如果wa超过30%,说明IO等待严重,这可能是磁盘大量随机访问造成的,也可能磁盘或者磁盘访问控制器的带宽瓶颈造成的(主要是块操作)。 //这个wa和vmstat中的wa是相同含义
hi 硬件中断占用CPU
si 软件中断占用CPU
st 丢失时间占用CPU
在后台服务器开发中需要关注us,sy,id,wa等常用指标。
更多:http://blog.163.com/xychenbaihu@yeah/blog/static/1322296552012017105732762/
1、输入1可以看到CPU各个核的CPU负载(us,sy,id,wa等)
2、输入shift+p按CPU占用率排序
3、shift+m按内存占用率排序,
4 u然后输入用户名,查看指定用户的进程信息,shift+t按CPU用时排序,shift+n按PID排序
重点讲下第一条:
1、输入1可以看到CPU各个核的CPU负载
Cpu0 : 1.0%us, 3.0%sy, 0.0%ni, 96.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu1 : 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
这里对us,sy,ni,id,wa,hi,si,st进行分别说明:
us 列显示了用户模式下所花费 CPU 时间的百分比。
us的值比较高时,说明用户进程消耗的cpu时间多,但是如果长期大于50%,需要考虑优化用户的程序。
sy 列显示了内核进程所花费的cpu时间的百分比。
这里us + sy的参考值为80%,如果us+sy 大于 80%说明可能存在CPU不足。
ni 列显示了用户进程空间内改变过优先级的进程占用CPU百分比。
id 列显示了cpu处在空闲状态的时间百分比。
wa 列显示了IO等待所占用的CPU时间的百分比。
这里wa的参考值为30%,如果wa超过30%,说明IO等待严重,这可能是磁盘大量随机访问造成的,也可能磁盘或者磁盘访问控制器的带宽瓶颈造成的(主要是块操作)。 //这个wa和vmstat中的wa是相同含义
hi 硬件中断占用CPU
si 软件中断占用CPU
st 丢失时间占用CPU
在后台服务器开发中需要关注us,sy,id,wa等常用指标。
更多:http://blog.163.com/xychenbaihu@yeah/blog/static/1322296552012017105732762/
Linux rsync同步由手动到自动--如何杀死rsync的同步进程d。
Unix/LinuxC技术 jackx 2014-9-29 10:18
背景:对于大公司的同步,可能会采用zoomkeeper作肿裁加agent下发shell命令实现,而对于小公司,大都采用linux下有一个叫rsync这样的加上notice作同步。
如何杀死rsync的同步进程d:
阅读全文
如何杀死rsync的同步进程d:

Bash 远程任意代码执行安全漏洞(最严重漏洞)
Unix/LinuxC技术 jackx 2014-9-27 18:34
背景:群里说到,没有注意,自己升级了下自己的vps服务器,后来公司要求也升级下线上服务器,才知事情严重,为过好国庆升级是必要 的,听说苹果系统说自己系统尽管也用这个bash,如果没有设置高级什么的,不存在此漏洞。
Bash 远程任意代码执行安全漏洞(最严重漏洞)
US-CERT 意识到 Bash 存在一个安全的漏洞,该漏洞直接影响基于 Unix 的系统(如 Linux、OS X 等)。该漏洞将导致远程攻击者在受影响的系统上执行任意代码。
US-CERT 建议用户和管理员重新检查这篇红帽的安全博客。更多的详情只能参考相应 Linux 发行商以获取相应补丁。
你可以使用如下命令来检查系统存在此漏洞:
env x='() { :;}; echo vulnerable' bash -c "echo this is a test"
受影响的系统包括:
CentOS
Debian
Redhat
Ubuntu
红帽系可通过更新 bash 并重启系统来解决这个问题:
# yum update bash
或者:
# yum update bash-4.1.2-15.el6_5.1
此举只是更新了 bash 包,还需要重启系统才能生效。
Ubuntu 用户可以通过如下命令打补丁,无需重启:
apt-get update
apt-get install bash
______________________________
[root@jackxiang ~]# rpm -qa|grep bash
bash-4.1.2-15.el6_5.1.x86_64
Bash 远程任意代码执行安全漏洞(最严重漏洞)
US-CERT 意识到 Bash 存在一个安全的漏洞,该漏洞直接影响基于 Unix 的系统(如 Linux、OS X 等)。该漏洞将导致远程攻击者在受影响的系统上执行任意代码。
US-CERT 建议用户和管理员重新检查这篇红帽的安全博客。更多的详情只能参考相应 Linux 发行商以获取相应补丁。
你可以使用如下命令来检查系统存在此漏洞:
env x='() { :;}; echo vulnerable' bash -c "echo this is a test"
受影响的系统包括:
CentOS
Debian
Redhat
Ubuntu
红帽系可通过更新 bash 并重启系统来解决这个问题:
# yum update bash
或者:
# yum update bash-4.1.2-15.el6_5.1
此举只是更新了 bash 包,还需要重启系统才能生效。
Ubuntu 用户可以通过如下命令打补丁,无需重启:
apt-get update
apt-get install bash
______________________________
[root@jackxiang ~]# rpm -qa|grep bash
bash-4.1.2-15.el6_5.1.x86_64
LINUX下如何查看内存品牌和速率啊?
Unix/LinuxC技术 jackx 2014-9-17 11:02
背景:想加个内存,Mysql服务器上的内存不够了,就算可以插(插槽都有,现在是4条4G内存,还有空闲八个槽。),不知道兼不兼容,否则不稳定的,不兼容的话,死的更惨,这个不一定了,停产了,就没有办法了。怎么办?得看内存的品牌及型号。
[root@jackxiang ~]# rpm -qa|grep dmidecode
dmidecode-2.11-2.el6.x86_64
[root@jackxiang ~]# dmidecode
查看服务器型号、序列号:
[root@jackxiang ~]# dmidecode|grep "System Information" -A9|egrep "Manufacturer|Product|Serial"
Manufacturer: VMware, Inc.
Product Name: VMware Virtual Platform
Serial Number: VMware-42 18 c8 32 77 c6 ec 16-3f 31 94 e9 d0 34 a6 ac
Linux 查看内存的插槽数,已经使用多少插槽.每条内存多大:
[root@jackxiang ~]# dmidecode|grep -A5 "Memory Device"|grep Size|grep -v Range
Size: 4096 MB
Size: 2048 MB
Size: No Module Installed
Size: No Module Installed
Linux 查看内存的频率:
[root@localhost htdocs]# dmidecode|grep -A16 "Memory Device"|grep 'Speed'
Speed: 667 MHz (1.5 ns)
Speed: 667 MHz (1.5 ns)
Speed: 667 MHz (1.5 ns)
Speed: 667 MHz (1.5 ns)
Speed: Unknown
在linux查看内存型号的命令:
dmidecode -t memory
查看主板型号:
dmidecode |grep -A16 "System Information$"
内存槽及内存条:
dmidecode |grep -A16 "Memory Device$"
硬盘:
fdisk -l
smartctl -a /dev/sda
网卡:
mii-tool
————————————————————————————————————————————————————
dmidecode|grep -P 'Maximum\s+Capacity' //最大支持几G内存
# cat /proc/cpuinfo //查看cpu个数与频率
# dmidecode |grep "Product Name" //查看服务器品牌和型号
# dmidecode|grep -P -A5 "Memory\s+Device"|grep Size|grep -v Range //总共几个插槽,已使用几个插槽
Size: 1024 MB //此插槽有1根1G内存
Size: 1024 MB //此插槽有1根1G内存
Size: 1024 MB //此插槽有1根1G内存
Size: 1024 MB //此插槽有1根1G内存
Size: No Module Installed //此插槽未使用
Size: No Module Installed //此插槽未使用
# dmidecode -t 17 //数字17是dmidecode的参数,本文最后有其他数字参数
dmidecode 2.7
SMBIOS 2.4 present.
Handle 0x0015, DMI type 17, 27 bytes.
Memory Device
Array Handle: 0x0013
Error Information Handle: Not Provided
Total Width: 72 bits
Data Width: 64 bits
Size: 2048 MB 【插槽1有1条2GB内存】
Form Factor: DIMM
Set: None
Locator: DIMM00
Bank Locator: BANK
Type: Other
Type Detail: Other
Speed: 667 MHz (1.5 ns)
Manufacturer:
Serial Number: BZACSKZ001
Asset Tag: RAM82
Part Number: MT9HTF6472FY-53EA2
Handle 0x0017, DMI type 17, 27 bytes.
Memory Device
Array Handle: 0x0013
Error Information Handle: Not Provided
Total Width: 72 bits
Data Width: 64 bits
Size: 2048 MB 【插槽2有1条2GB内存】
Form Factor: DIMM
Set: None
Locator: DIMM10
Bank Locator: BANK
Type: Other
Type Detail: Other
Speed: 667 MHz (1.5 ns)
Manufacturer:
Serial Number: BZACSKZ001
Asset Tag: RAM83
Part Number: MT9HTF6472FY-53EA2
Handle 0x0019, DMI type 17, 27 bytes.
Memory Device
Array Handle: 0x0013
Error Information Handle: Not Provided
Total Width: 72 bits
Data Width: 64 bits
Size: 2048 MB 【插槽3有1条2GB内存】
Form Factor: DIMM
Set: None
Locator: DIMM20
Bank Locator: BANK
Type: Other
Type Detail: Other
Speed: 667 MHz (1.5 ns)
Manufacturer:
Serial Number: BZACSKZ001
Asset Tag: RAM84
Part Number: MT9HTF6472FY-53EA2
Handle 0x001B, DMI type 17, 27 bytes.
Memory Device
Array Handle: 0x0013
Error Information Handle: Not Provided
Total Width: 72 bits
Data Width: 64 bits
Size: 2048 MB 【插槽4有1条2GB内存】
Form Factor: DIMM
Set: None
Locator: DIMM30
Bank Locator: BANK
Type: Other
Type Detail: Other
Speed: 667 MHz (1.5 ns)
Manufacturer:
Serial Number: BZACSKZ001
Asset Tag: RAM85
Part Number: MT9HTF6472FY-53EA2
实践来源:
http://www.jbxue.com/LINUXjishu/10053.html
http://www.linuxsir.org/bbs/thread309696.html
http://xclinux.diandian.com/post/2013-04-16/40049844350
[root@jackxiang ~]# rpm -qa|grep dmidecode
dmidecode-2.11-2.el6.x86_64
[root@jackxiang ~]# dmidecode
查看服务器型号、序列号:
[root@jackxiang ~]# dmidecode|grep "System Information" -A9|egrep "Manufacturer|Product|Serial"
Manufacturer: VMware, Inc.
Product Name: VMware Virtual Platform
Serial Number: VMware-42 18 c8 32 77 c6 ec 16-3f 31 94 e9 d0 34 a6 ac
Linux 查看内存的插槽数,已经使用多少插槽.每条内存多大:
[root@jackxiang ~]# dmidecode|grep -A5 "Memory Device"|grep Size|grep -v Range
Size: 4096 MB
Size: 2048 MB
Size: No Module Installed
Size: No Module Installed
Linux 查看内存的频率:
[root@localhost htdocs]# dmidecode|grep -A16 "Memory Device"|grep 'Speed'
Speed: 667 MHz (1.5 ns)
Speed: 667 MHz (1.5 ns)
Speed: 667 MHz (1.5 ns)
Speed: 667 MHz (1.5 ns)
Speed: Unknown
在linux查看内存型号的命令:
dmidecode -t memory
查看主板型号:
dmidecode |grep -A16 "System Information$"
内存槽及内存条:
dmidecode |grep -A16 "Memory Device$"
硬盘:
fdisk -l
smartctl -a /dev/sda
网卡:
mii-tool
————————————————————————————————————————————————————
dmidecode|grep -P 'Maximum\s+Capacity' //最大支持几G内存
# cat /proc/cpuinfo //查看cpu个数与频率
# dmidecode |grep "Product Name" //查看服务器品牌和型号
# dmidecode|grep -P -A5 "Memory\s+Device"|grep Size|grep -v Range //总共几个插槽,已使用几个插槽
Size: 1024 MB //此插槽有1根1G内存
Size: 1024 MB //此插槽有1根1G内存
Size: 1024 MB //此插槽有1根1G内存
Size: 1024 MB //此插槽有1根1G内存
Size: No Module Installed //此插槽未使用
Size: No Module Installed //此插槽未使用
# dmidecode -t 17 //数字17是dmidecode的参数,本文最后有其他数字参数
dmidecode 2.7
SMBIOS 2.4 present.
Handle 0x0015, DMI type 17, 27 bytes.
Memory Device
Array Handle: 0x0013
Error Information Handle: Not Provided
Total Width: 72 bits
Data Width: 64 bits
Size: 2048 MB 【插槽1有1条2GB内存】
Form Factor: DIMM
Set: None
Locator: DIMM00
Bank Locator: BANK
Type: Other
Type Detail: Other
Speed: 667 MHz (1.5 ns)
Manufacturer:
Serial Number: BZACSKZ001
Asset Tag: RAM82
Part Number: MT9HTF6472FY-53EA2
Handle 0x0017, DMI type 17, 27 bytes.
Memory Device
Array Handle: 0x0013
Error Information Handle: Not Provided
Total Width: 72 bits
Data Width: 64 bits
Size: 2048 MB 【插槽2有1条2GB内存】
Form Factor: DIMM
Set: None
Locator: DIMM10
Bank Locator: BANK
Type: Other
Type Detail: Other
Speed: 667 MHz (1.5 ns)
Manufacturer:
Serial Number: BZACSKZ001
Asset Tag: RAM83
Part Number: MT9HTF6472FY-53EA2
Handle 0x0019, DMI type 17, 27 bytes.
Memory Device
Array Handle: 0x0013
Error Information Handle: Not Provided
Total Width: 72 bits
Data Width: 64 bits
Size: 2048 MB 【插槽3有1条2GB内存】
Form Factor: DIMM
Set: None
Locator: DIMM20
Bank Locator: BANK
Type: Other
Type Detail: Other
Speed: 667 MHz (1.5 ns)
Manufacturer:
Serial Number: BZACSKZ001
Asset Tag: RAM84
Part Number: MT9HTF6472FY-53EA2
Handle 0x001B, DMI type 17, 27 bytes.
Memory Device
Array Handle: 0x0013
Error Information Handle: Not Provided
Total Width: 72 bits
Data Width: 64 bits
Size: 2048 MB 【插槽4有1条2GB内存】
Form Factor: DIMM
Set: None
Locator: DIMM30
Bank Locator: BANK
Type: Other
Type Detail: Other
Speed: 667 MHz (1.5 ns)
Manufacturer:
Serial Number: BZACSKZ001
Asset Tag: RAM85
Part Number: MT9HTF6472FY-53EA2
实践来源:
http://www.jbxue.com/LINUXjishu/10053.html
http://www.linuxsir.org/bbs/thread309696.html
http://xclinux.diandian.com/post/2013-04-16/40049844350
在Raspberry Pi上跑FreeBSD11,修改raspberry pi上安装的freebsd可用内存大小,定制Raspberry Pi网站。
Unix/LinuxC技术 jackx 2014-9-15 21:53
FreeBSD 在 RPi 2上的用户名和密码:
默认的密码是 freebsd/freebsd 和 root/root
FreeBSD系统中无线网络连接无线网卡:
http://www.111cn.net/sys/freebsd/59534.htm
本篇文章来源于 Linux公社网站(www.linuxidc.com) 原文链接:http://www.linuxidc.com/Linux/2015-12/126724.htm
FreeBSD 11-CURRENT on Raspberry Pi Apache 2.4/MySQL 5.6/PHP 5.6, 如何在树莓派 2B 上安装 FreeBSD及网络配置:
http://jackxiang.com/post/8455/
定制Raspberry Pi网站:
http://www.embest-tech.cn/pi-customization/
FreeBSD has supported Raspberry Pi since November 2012, and the current production version (FreeBSD 10) is available as a pre-built image which can be copied onto a memory card.
Download the latest image file from the official FreeBSD ARM page. This page has images for other ARM-based boards like the Beaglebone and the Pandaboard. You need to download an image for the “RPI-B”: for example “FreeBSD-10.0-RELEASE-arm-armv6-RPI-B-20140131-r260789.img.bz2”
摘自 : https://www.maketecheasier.com/freebsd-on-raspberry-pi/
DRAM: 944 MiB
WARNING: Caches not enabled
RPI 2 Model B
MMC: bcm2835_sdhci: 0
reading uboot.env
修改raspberry pi上安装的freebsd可用内存大小:
http://blog.sina.com.cn/s/blog_a0aacb430101mj69.html
background:Freebsd是真正的Unix血统的Os,其稳定性是顶级的,真正的坚如磐石。在树莓派下也有ARM版本了,最新稳定版本:
ftp://ftp6.freebsd.org/pub/FreeBSD/snapshots/arm/armv6/ISO-IMAGES/10.0//FreeBSD-10.0-STABLE-arm-armv6-RPI-B-20140822-r270340.img.bz2
CheckSum:
ftp://ftp6.freebsd.org/pub/FreeBSD/snapshots/arm/armv6/ISO-IMAGES/10.0/CHECKSUM.SHA256-10.0-STABLE-arm-armv6-RPI-B-20140822-r270340
三、FreeBSD 11 on Raspberri pi 2(树莓派 2 安装 FreeBSD 11) :
A note for my own installation.(树莓派 2 安装 FreeBSD 11)
I tried compiling the FreeBSD 11 by myself, but I found there are ready-to-use systems here.
1. Identify your SD card:
# df -h
you will see the result as
de>/dev/mmcblk0p1de> or de>/dev/sdb1de> or something is different from /sda.
2. Unmount the card
# umount de>/dev/mmcblk0p1de> or de>/dev/sdb1de>
3. Copy your image file to the card, (Very important! DO NOT add the partition number p1 or 1, just use the whole card de>mmcblk0 or sdbde>)
# dd bs=4M if=your-freebsd-rpi2-image.img of=/dev/de>mmcblk0de>
4. First boot
After the raspberry pi 2 is powered on, you need login using user name : root, you need also set the password
# passwd
5.Increase swap space
# dd if=/dev/zero of=/usr/swap0 bs=1m count=1024
# chmod 0600 /usr/swap0
# echo 'md99 none swap sw,file=/usr/swap0 0 0' >> /etc/fstab
# swapon -aq
*系统目前很卡,还是不建议安装。感觉Raspbian 还是最流畅的。
来自:http://rhuta.blog.163.com/blog/static/17757006220154129421478/
阅读全文
默认的密码是 freebsd/freebsd 和 root/root
FreeBSD系统中无线网络连接无线网卡:
http://www.111cn.net/sys/freebsd/59534.htm
本篇文章来源于 Linux公社网站(www.linuxidc.com) 原文链接:http://www.linuxidc.com/Linux/2015-12/126724.htm
FreeBSD 11-CURRENT on Raspberry Pi Apache 2.4/MySQL 5.6/PHP 5.6, 如何在树莓派 2B 上安装 FreeBSD及网络配置:
http://jackxiang.com/post/8455/
定制Raspberry Pi网站:
http://www.embest-tech.cn/pi-customization/
FreeBSD has supported Raspberry Pi since November 2012, and the current production version (FreeBSD 10) is available as a pre-built image which can be copied onto a memory card.
Download the latest image file from the official FreeBSD ARM page. This page has images for other ARM-based boards like the Beaglebone and the Pandaboard. You need to download an image for the “RPI-B”: for example “FreeBSD-10.0-RELEASE-arm-armv6-RPI-B-20140131-r260789.img.bz2”
摘自 : https://www.maketecheasier.com/freebsd-on-raspberry-pi/
DRAM: 944 MiB
WARNING: Caches not enabled
RPI 2 Model B
MMC: bcm2835_sdhci: 0
reading uboot.env
修改raspberry pi上安装的freebsd可用内存大小:
http://blog.sina.com.cn/s/blog_a0aacb430101mj69.html
background:Freebsd是真正的Unix血统的Os,其稳定性是顶级的,真正的坚如磐石。在树莓派下也有ARM版本了,最新稳定版本:
ftp://ftp6.freebsd.org/pub/FreeBSD/snapshots/arm/armv6/ISO-IMAGES/10.0//FreeBSD-10.0-STABLE-arm-armv6-RPI-B-20140822-r270340.img.bz2
CheckSum:
ftp://ftp6.freebsd.org/pub/FreeBSD/snapshots/arm/armv6/ISO-IMAGES/10.0/CHECKSUM.SHA256-10.0-STABLE-arm-armv6-RPI-B-20140822-r270340
三、FreeBSD 11 on Raspberri pi 2(树莓派 2 安装 FreeBSD 11) :
A note for my own installation.(树莓派 2 安装 FreeBSD 11)
I tried compiling the FreeBSD 11 by myself, but I found there are ready-to-use systems here.
1. Identify your SD card:
# df -h
you will see the result as
de>/dev/mmcblk0p1de> or de>/dev/sdb1de> or something is different from /sda.
2. Unmount the card
# umount de>/dev/mmcblk0p1de> or de>/dev/sdb1de>
3. Copy your image file to the card, (Very important! DO NOT add the partition number p1 or 1, just use the whole card de>mmcblk0 or sdbde>)
# dd bs=4M if=your-freebsd-rpi2-image.img of=/dev/de>mmcblk0de>
4. First boot
After the raspberry pi 2 is powered on, you need login using user name : root, you need also set the password
# passwd
5.Increase swap space
# dd if=/dev/zero of=/usr/swap0 bs=1m count=1024
# chmod 0600 /usr/swap0
# echo 'md99 none swap sw,file=/usr/swap0 0 0' >> /etc/fstab
# swapon -aq
*系统目前很卡,还是不建议安装。感觉Raspbian 还是最流畅的。
来自:http://rhuta.blog.163.com/blog/static/17757006220154129421478/

Q: 我正在写一个unix server程序,不是daemon,经常需要在命令行上重启它,绝大多数时候工作正常,但是某些时候会报告"bind: address in use",于是重启失败。
A: Andrew Gierth
server程序总是应该在调用bind()之前设置SO_REUSEADDR套接字选项。至于TIME_WAIT状态,你无法避免,那是TCP协议的一部分。
阅读全文
A: Andrew Gierth
server程序总是应该在调用bind()之前设置SO_REUSEADDR套接字选项。至于TIME_WAIT状态,你无法避免,那是TCP协议的一部分。

这个相当于windows里的启动项
vi /etc/rc.d/rc.local
按i
然后把你的命令贴进去 ,一行一条命令
/bin/bash /usr/local/scripts/autoStartNginxEnterSSLKey.sh
然后按 esc
再 :wq 保存 注意前面有两点的冒号
下次重启的时候这个就会自动执行你添加的命令。
vi /usr/local/scripts/autoStartNginxEnterSSLKey.sh
./startNginx.sh
cat ./startNginx.sh
/usr/local/nginx/sbin/nginx
来自:http://zhidao.baidu.com/link?url=D7tZLZFqg7LODR60qIkvAeoSk-ocjBWgLppmxkHh_gSxH3AvOkZ_S9SxTj-C50espCswUiYZRK9F4JYi2nVC8K
vi /etc/rc.d/rc.local
按i
然后把你的命令贴进去 ,一行一条命令
/bin/bash /usr/local/scripts/autoStartNginxEnterSSLKey.sh
然后按 esc
再 :wq 保存 注意前面有两点的冒号
下次重启的时候这个就会自动执行你添加的命令。
vi /usr/local/scripts/autoStartNginxEnterSSLKey.sh
./startNginx.sh
cat ./startNginx.sh
/usr/local/nginx/sbin/nginx
来自:http://zhidao.baidu.com/link?url=D7tZLZFqg7LODR60qIkvAeoSk-ocjBWgLppmxkHh_gSxH3AvOkZ_S9SxTj-C50espCswUiYZRK9F4JYi2nVC8K
为什么Android手机总是越用越慢?
Unix/LinuxC技术 jackx 2014-8-26 22:02
在路由器后面,traceroute返回一系列*原因分析
Unix/LinuxC技术 jackx 2014-8-15 18:02
警告:隐式声明与内建函数'exit'不兼容解决方案
Unix/LinuxC技术 jackx 2014-7-31 16:56
最近一直在看《Linux程序设计(第3版)》,照着书上的代码原封不动地敲上去,编译后就出现了à警告:隐式声明与内建函数’exit’不兼容。
警告:隐式声明与内建函数‘exit’不兼容
原因其实很简单了,没有把stdlib.h包含进来,加上就没问题了。后来google搜索的时候发现网上很多人有这个问题,今天来记下这个问题的解决方案。
以此类推,编译后出现警告:隐式声明与内建函数’XXX’不兼容的问题所在都是因为没有包含相应的头文件,加上就OK!
来自:http://blog.csdn.net/monkey_d_meng/article/details/5565667
警告:隐式声明与内建函数‘exit’不兼容
原因其实很简单了,没有把stdlib.h包含进来,加上就没问题了。后来google搜索的时候发现网上很多人有这个问题,今天来记下这个问题的解决方案。
以此类推,编译后出现警告:隐式声明与内建函数’XXX’不兼容的问题所在都是因为没有包含相应的头文件,加上就OK!
来自:http://blog.csdn.net/monkey_d_meng/article/details/5565667
[实践OK]设置Linux 服务的开机启动顺序
Unix/LinuxC技术 jackx 2014-7-4 07:57
背景:有时在重启时出现nginx启动比sshd还快,导致加了ssh启动nginx要密码(后来去了),卡在那儿起不来,作为vps,打电话太麻烦了,于是否,能不定定个顺序,可能好一些。
我们知道,在Linux系统中,系统服务的启动脚本一般放在/etc/init.d目录下。不同的开机模式,则分别对应到/etc/rcx.d目录下。其实/etc/rcx.d上的文件,一般都是链接到/etc/init.d目录下的对应文件的。我们还知道,/etc/rcx.d下的文件名,是以S+数字或K+数字打头的,这里的S表示启动,K表示关闭,数值其后面的数值则表示服务启动或服务退出时的次序。那么,这些数值是怎样来的呢?是不是需要在/etc/rcx.d下去修改文件名呢?答案是否定的。那应该怎么做呢?
打开/etc/init.d下的脚本,查找类似下面的一句:
#chkconfig: 2345 64 36
这里的64,就是启动的顺序值,36则是退出的顺序值,如果需要改变顺序,就在这里改。然后执行下面的命令:
#chkconfig --del servicename
#chkconfig --add servicename
#chkconfig servicename on
servicename对应您的服务名称。
来自:http://blog.csdn.net/yetyongjin/article/details/7050068
实践如下:
vi /var/log/boot.log
Starting mcelog daemon
^[[60G[^[[0;32m OK ^[[0;39m]^MStarting php-fpm done
Starting nginx... done
Starting sshd: ^[[60G[^[[0;32m OK ^[[0;39m]^M
Starting xinetd: ^[[60G[^[[0;32m OK ^[[0;39m]^M
Starting MySQL^[[60G[^[[0;32m OK ^[[0;39m]^M
vi /etc/init.d/sshd
# chkconfig: 2345 55 25
vi /etc/init.d/nginx
# chkconfig: 2345 55 25
于是作下调整如下:
vi /etc/init.d/sshd
# chkconfig: 2345 5425
我们知道,在Linux系统中,系统服务的启动脚本一般放在/etc/init.d目录下。不同的开机模式,则分别对应到/etc/rcx.d目录下。其实/etc/rcx.d上的文件,一般都是链接到/etc/init.d目录下的对应文件的。我们还知道,/etc/rcx.d下的文件名,是以S+数字或K+数字打头的,这里的S表示启动,K表示关闭,数值其后面的数值则表示服务启动或服务退出时的次序。那么,这些数值是怎样来的呢?是不是需要在/etc/rcx.d下去修改文件名呢?答案是否定的。那应该怎么做呢?
打开/etc/init.d下的脚本,查找类似下面的一句:
#chkconfig: 2345 64 36
这里的64,就是启动的顺序值,36则是退出的顺序值,如果需要改变顺序,就在这里改。然后执行下面的命令:
#chkconfig --del servicename
#chkconfig --add servicename
#chkconfig servicename on
servicename对应您的服务名称。
来自:http://blog.csdn.net/yetyongjin/article/details/7050068
实践如下:
vi /var/log/boot.log
Starting mcelog daemon
^[[60G[^[[0;32m OK ^[[0;39m]^MStarting php-fpm done
Starting nginx... done
Starting sshd: ^[[60G[^[[0;32m OK ^[[0;39m]^M
Starting xinetd: ^[[60G[^[[0;32m OK ^[[0;39m]^M
Starting MySQL^[[60G[^[[0;32m OK ^[[0;39m]^M
vi /etc/init.d/sshd
# chkconfig: 2345 55 25
vi /etc/init.d/nginx
# chkconfig: 2345 55 25
于是作下调整如下:
vi /etc/init.d/sshd
# chkconfig: 2345 5425
linux在启动过程中都干了些什么,都有哪些程序被调用,是不是看系统的启动日志就可以?启动日志是哪个文件?
终端运行下就知道了
dmesg | less
启动的文件日志
less /var/log/boot.log
其他日至都在/var/log里
less /var/log/boot.log
less /var/log/dmesg
http://bbs.chinaunix.net/thread-2140832-1-1.html
终端运行下就知道了
dmesg | less
启动的文件日志
less /var/log/boot.log
其他日至都在/var/log里
less /var/log/boot.log
less /var/log/dmesg
http://bbs.chinaunix.net/thread-2140832-1-1.html
[实践OK]最小化安装centos7.4配置桌面图形,Centos7.4 安装 vnc并vnc实现开机启动,CentOS7.4xfc桌面运行VNC Server连接时只显示浏览器无桌面时的成功解决方案。解決Windows 7 的VNC connection reset by peer 10054錯誤,MacBook vnc使用方法。
Unix/LinuxC技术 jackx 2014-6-28 22:40
Centos7.7安装vncserver虚拟网络控制台:
查看图形界面,确认 XFCE 桌面环境是否正常工作,可以尝试以下命令启动 XFCE:
startxfce4
https://www.linuxprobe.com/centos7-virtual-network-console.html
sudo systemctl enable vncserver@:2
Created symlink from /etc/systemd/system/multi-user.target.wants/vncserver@:2.service to /etc/systemd/system/vncserver@:2.service.
server already running on display :1
/bin/startxfce4: X server already running on display :1
重启服务时这里可能会提示 A VNC server is already running as :1 [FAILED]的错误,解决方法见下。
vncserver -kill :1
Killing Xvnc process ID 3654,VNCServer使用方法
[root@localhost ~]# vncserver :1 启动:1
[root@localhost ~]# vncserver :2 启动:2
[root@localhost ~]# ps -ef|grep -i xvnc 查看已启动的server
[root@localhost ~]# vncserver -kill :1 杀死:1
解決Windows 7 的VNC connection reset by peer 10054錯誤:
當Windows 7 更新到某個程度,原本可以正常運作的VNC連接就會突然出現VNC connection reset by peer 10054錯誤,然後就無法用VNC Viewer連上這台Windows 7 電腦。 無論是使用哪種VNC Server,如TightVNC或RealVNC都無法修正此問題。
查Google之後,發現只有Windows 7會有這種「相容性」問題,其他版本的Windows就不會,因此,一個簡單的解決辦法就是將VNC的Server執行程式改成相容模式執行。以RealVNC Server為例,首先找到VNC Server程式的位置(通常是C:\Program Files\RealVNC\VNC4),右鍵點選Server程式(winvnc4.exe)->內容->相容性->勾選以相容模式執行這個程式,選擇不是Windows 7的其他選項。最後,到電腦管理中的「服務」,重新啟動VNC Server就可以連接了。
来自:http://eportfolio.lib.ksu.edu.tw/~T093000298/blog?node=000000209
解决vncserver卡死,报错connection reset by peer (10054)
在连接慢速网络环境到vncserver服务器的时候,经常动不动就失去响应。过一会而vncview提示连接被远程断开,解决的办法有2个:
1. vnc view option菜单,选择inputs, 勾选Rate-limit mouse move events,这样可以节省带宽,提升一些响应速度
2. Coloure Level 选择256色,不要用full color,最新版本的VncViewer,这个叫Picture Quality 选:Low,Download Url:https://www.realvnc.com/download/file/viewer.files/VNC-Viewer-6.17.1113-Windows-32bit.exe
以上两条一起用,上面颜色没看到,勾选Rate-limit mouse move events是可以的。
3.把VPC的分辨率调低一点:#vncserver :1 -geometry 1024x768
vncserver :1 -geometry 800x600 ,以上三条后,在公司 访问就Ok了,不再出现错误了,感觉还是带宽不够。
1)stop vnc server from linux terminal:
~/stopvncserver.sh
new Test port always 5902,like this is ok:
2)start vnc server from linux terminal:
~/startvncserver.sh
真实实践:
一)实践没有问题的脚本:
cat /home/irdcops/shell/vncsvr/startvncsvr.sh
cat /home/ops/shell/vncsvr/startvncsvr.sh
二)vnc的端口情况(如何修改linux里的VNC的默认端口5901):
三)Iptable得放开这个端口,否则连接不上:
总论详细文章Url:http://www.tuicool.com/articles/zQrQNz
四)出现空白桌面,啥也没有,只看到浏览器(没安装浏览器也就啥也没有),没有xfe桌面的情况解决,实践OK:
cat /root/.vnc/xstartup
五)出现VNC:1本来不存在,缺提示存在的情况:
vncserver :1 -geometry 1024x768
A VNC server is already running as :1
并不是真的在运行,其原因是vncconfig进程在,于是干死重来:
ps -ef|grep vnc
root 26027 1 0 10:23 pts/4 00:00:00 vncconfig -iconic
kill -9 26027
六)重启的SHell:
/home/irdcops/shell/vncsvr/startvncsvr.sh
/home/ops/shell/vncsvr/startvncsvr.sh
七)定时Cron:
/home/irdcops/shell/vncsvr/startvncsvrcron.sh
问题依旧,vi +168 /usr/bin/vncserver:
162 # Find display number.
163 if ((@ARGV > 0) && ($ARGV[0] =~ /^:(\d+)$/)) {
164 $displayNumber = $1;
165 shift(@ARGV);
166 if (!&CheckDisplayNumber($displayNumber)) {
167 warn "A VNC server is already running as :$displayNumber\n";
168 $displayNumber = &GetDisplayNumber();
169 }
170 } elsif ((@ARGV > 0) && ($ARGV[0] !~ /^-/) && ($ARGV[0] !~ /^\+/)) {
171 &Usage();
172 } else {
173 $displayNumber = &GetDisplayNumber();
174 }
来自:https://github.com/TigerVNC/tigervnc/issues/531
六)VNCView端:
1.安装xwindow system
#yum groupinstall "X Window System"
2.安装GNOME
#yum groupinstall "Desktop"
3.安装中文支持
#yum groupinstall chinese-support
4.修改启动级别为5
#vi /etc/inittab
改default 5
七)加入systemctl:
# cp /lib/systemd/system/vncserver@.service /etc/systemd/system/vncserver@:1.service
# vi /etc/systemd/system/vncserver@:1.service
systemctl daemon-reload
systemctl start vncserver@:1.service
systemctl enable vncserver@:1.service
八)tail -f /root/.vnc/levoo-bigdata_kafka-logstash_bj_rfls_10_10_0_100---解决失败!!!第二天解决成功@[实践OK]centos7 tigervnc 安装(非root用户的配置):https://jackxiang.com/post/10039/
\:1.log /var/log/messages出现:XIO: fatal IO error 11 (Resource temporarily unavailable) on X server ":1"
centos 黑屏
查看日志 ~/.vnc/localhost.localdomain:0.log
/home/cake/.vnc/xstartup: line 27: xsetroot: command not found
/home/cake/.vnc/xstartup: line 28: xterm: command not found
/home/cake/.vnc/xstartup: line 29: twm: command not found
XIO: fatal IO error 11 (Resource temporarily unavailable) on X server “:0″^M
after 141 requests (140 known processed) with 0 events remaining.^M
因为xsetroot/xterm/twm没有安装导致的。
CentOS7还不一样,得这样:https://github.com/plembo/onemoretech/wiki/20140824-twm-on-centos-7
实践如下:http://ftp.stu.edu.tw/Linux/CentOS/6/os/x86_64/Packages/xorg-x11-twm-1.0.3-5.1.el6.x86_64.rpm
rpm -ihv xorg-x11-twm-1.0.3-5.1.el6.x86_64.rpm
warning: xorg-x11-twm-1.0.3-5.1.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID c105b9de: NOKEY
Preparing... ################################# [100%]
Updating / installing...
1:xorg-x11-twm-1:1.0.3-5.1.el6 ################################# [100%]
yum install xsetroot -y
Package xorg-x11-server-utils-7.7-20.el7.x86_64 already installed and latest version
于是使用yum安装:
yum install xsetroot -y
yum install xterm -y
yum install twm -y
kill掉vncserver进程,然后重新启动。来自:http://blog.51cto.com/zhangguangjun/2047209
vncserver -kill :1
vncserver :1
yum remove xterm -y
yum remove twm -y
yum remove xsetroot -y
来自:http://javacxn.blog.163.com/blog/static/1832776420139269545905/
======================================================================
Centos 6.4 安装 vnc:
安装:vnc
sudo yum install tigervnc tigervnc-server
安完后先设置密码:
vncpasswd
启动:
vncserver :1
查看:
vncserver -list
杀死进程 :
vncserver -kill :1
远程连接:
用vnc软件,之后输入地址,如:mycclove.oicp.net:5901
119.10.6.23:5901
第二个屏则是:
119.10.6.23:2
1152x864
注意一点:需要在iptables中添加一条规则
-A INPUT -m state --state NEW -m tcp -p tcp --dport 5901 -j ACCEPT
========================
补充:
在windows下连接vnc有一个vncviewer软件,我在ubuntu中有现成的软件, 在CentOS中安装tigervnc后就出现了vncviewer的命令,就可以连接到服务器的vnc了。
连接之后黑屏:
把 用户下面的.vnc/目录下的xstartup添加777权限
来自:http://blog.sina.com.cn/s/blog_6c9d65a10101dyt0.html
设置VNC服务随系统启动自动加载
第一种方法:使用“ntsysv”命令启动图形化服务配置程序,在vncserver服务前加上星号,点击确定,配置完成。
第二种方法:使用“chkconfig”在命令行模式下进行操作,命令使用如下(预知chkconfig详细使用方法请自助式man一下)
[root@testdb ~]# chkconfig vncserver on
[root@testdb ~]# chkconfig --list vncserver
vncserver 0:off 1:off 2:on 3:on 4:on 5:on 6:off
摘自:http://blog.csdn.net/alvin969/article/details/6170884
附加:http://www.linuxidc.com/Linux/2012-11/73471.htm
1、which vncserver 得到VNC Server运行脚本所在位置。
RHEL5默认为:/usr/bin/vncserver
2、使用vi打开vncserver
vi /usr/bin/vncserver
3、查找到默认的分辨率:1024X768,然后进行修改。该行在注释结束的第一段参数部分。根据实际使用显示器的分辨率,修改该参数。
4、修改完vncserver后,重新执行vncserver时即以新的分辨率开始。
5、验证:ps -ef | grep vnc,可以看到所显示的分辨率参数为修改后的参数。
Mac自带VNC Client,MacBook vnc使用方法:
由于有需要远程VNC的需要,苦苦寻找一款Mac上比较好使的VNC Client,结果经人指点,发现原来MacOS自带了VNC Client,只是没有在Launchpad中显示罢了。使用command+space 调出Spotlight搜索键入screen Sharing.app即可。
来自:https://notes.wanghao.work/2016-11-24-Mac%E8%87%AA%E5%B8%A6VNC-Client.html
查看图形界面,确认 XFCE 桌面环境是否正常工作,可以尝试以下命令启动 XFCE:
startxfce4
https://www.linuxprobe.com/centos7-virtual-network-console.html
sudo systemctl enable vncserver@:2
Created symlink from /etc/systemd/system/multi-user.target.wants/vncserver@:2.service to /etc/systemd/system/vncserver@:2.service.
server already running on display :1
/bin/startxfce4: X server already running on display :1
重启服务时这里可能会提示 A VNC server is already running as :1 [FAILED]的错误,解决方法见下。
vncserver -kill :1
Killing Xvnc process ID 3654,VNCServer使用方法
[root@localhost ~]# vncserver :1 启动:1
[root@localhost ~]# vncserver :2 启动:2
[root@localhost ~]# ps -ef|grep -i xvnc 查看已启动的server
[root@localhost ~]# vncserver -kill :1 杀死:1
解決Windows 7 的VNC connection reset by peer 10054錯誤:
當Windows 7 更新到某個程度,原本可以正常運作的VNC連接就會突然出現VNC connection reset by peer 10054錯誤,然後就無法用VNC Viewer連上這台Windows 7 電腦。 無論是使用哪種VNC Server,如TightVNC或RealVNC都無法修正此問題。
查Google之後,發現只有Windows 7會有這種「相容性」問題,其他版本的Windows就不會,因此,一個簡單的解決辦法就是將VNC的Server執行程式改成相容模式執行。以RealVNC Server為例,首先找到VNC Server程式的位置(通常是C:\Program Files\RealVNC\VNC4),右鍵點選Server程式(winvnc4.exe)->內容->相容性->勾選以相容模式執行這個程式,選擇不是Windows 7的其他選項。最後,到電腦管理中的「服務」,重新啟動VNC Server就可以連接了。
来自:http://eportfolio.lib.ksu.edu.tw/~T093000298/blog?node=000000209
解决vncserver卡死,报错connection reset by peer (10054)
在连接慢速网络环境到vncserver服务器的时候,经常动不动就失去响应。过一会而vncview提示连接被远程断开,解决的办法有2个:
1. vnc view option菜单,选择inputs, 勾选Rate-limit mouse move events,这样可以节省带宽,提升一些响应速度
2. Coloure Level 选择256色,不要用full color,最新版本的VncViewer,这个叫Picture Quality 选:Low,Download Url:https://www.realvnc.com/download/file/viewer.files/VNC-Viewer-6.17.1113-Windows-32bit.exe
以上两条一起用,上面颜色没看到,勾选Rate-limit mouse move events是可以的。
3.把VPC的分辨率调低一点:#vncserver :1 -geometry 1024x768
vncserver :1 -geometry 800x600 ,以上三条后,在公司 访问就Ok了,不再出现错误了,感觉还是带宽不够。
1)stop vnc server from linux terminal:
~/stopvncserver.sh
new Test port always 5902,like this is ok:
2)start vnc server from linux terminal:
~/startvncserver.sh
真实实践:
一)实践没有问题的脚本:
cat /home/irdcops/shell/vncsvr/startvncsvr.sh
cat /home/ops/shell/vncsvr/startvncsvr.sh
二)vnc的端口情况(如何修改linux里的VNC的默认端口5901):
三)Iptable得放开这个端口,否则连接不上:
总论详细文章Url:http://www.tuicool.com/articles/zQrQNz
四)出现空白桌面,啥也没有,只看到浏览器(没安装浏览器也就啥也没有),没有xfe桌面的情况解决,实践OK:
cat /root/.vnc/xstartup
五)出现VNC:1本来不存在,缺提示存在的情况:
vncserver :1 -geometry 1024x768
A VNC server is already running as :1
并不是真的在运行,其原因是vncconfig进程在,于是干死重来:
ps -ef|grep vnc
root 26027 1 0 10:23 pts/4 00:00:00 vncconfig -iconic
kill -9 26027
六)重启的SHell:
/home/irdcops/shell/vncsvr/startvncsvr.sh
/home/ops/shell/vncsvr/startvncsvr.sh
七)定时Cron:
/home/irdcops/shell/vncsvr/startvncsvrcron.sh
问题依旧,vi +168 /usr/bin/vncserver:
162 # Find display number.
163 if ((@ARGV > 0) && ($ARGV[0] =~ /^:(\d+)$/)) {
164 $displayNumber = $1;
165 shift(@ARGV);
166 if (!&CheckDisplayNumber($displayNumber)) {
167 warn "A VNC server is already running as :$displayNumber\n";
168 $displayNumber = &GetDisplayNumber();
169 }
170 } elsif ((@ARGV > 0) && ($ARGV[0] !~ /^-/) && ($ARGV[0] !~ /^\+/)) {
171 &Usage();
172 } else {
173 $displayNumber = &GetDisplayNumber();
174 }
来自:https://github.com/TigerVNC/tigervnc/issues/531
六)VNCView端:
1.安装xwindow system
#yum groupinstall "X Window System"
2.安装GNOME
#yum groupinstall "Desktop"
3.安装中文支持
#yum groupinstall chinese-support
4.修改启动级别为5
#vi /etc/inittab
改default 5
七)加入systemctl:
# cp /lib/systemd/system/vncserver@.service /etc/systemd/system/vncserver@:1.service
# vi /etc/systemd/system/vncserver@:1.service
systemctl daemon-reload
systemctl start vncserver@:1.service
systemctl enable vncserver@:1.service
八)tail -f /root/.vnc/levoo-bigdata_kafka-logstash_bj_rfls_10_10_0_100---解决失败!!!第二天解决成功@[实践OK]centos7 tigervnc 安装(非root用户的配置):https://jackxiang.com/post/10039/
\:1.log /var/log/messages出现:XIO: fatal IO error 11 (Resource temporarily unavailable) on X server ":1"
centos 黑屏
查看日志 ~/.vnc/localhost.localdomain:0.log
/home/cake/.vnc/xstartup: line 27: xsetroot: command not found
/home/cake/.vnc/xstartup: line 28: xterm: command not found
/home/cake/.vnc/xstartup: line 29: twm: command not found
XIO: fatal IO error 11 (Resource temporarily unavailable) on X server “:0″^M
after 141 requests (140 known processed) with 0 events remaining.^M
因为xsetroot/xterm/twm没有安装导致的。
CentOS7还不一样,得这样:https://github.com/plembo/onemoretech/wiki/20140824-twm-on-centos-7
实践如下:http://ftp.stu.edu.tw/Linux/CentOS/6/os/x86_64/Packages/xorg-x11-twm-1.0.3-5.1.el6.x86_64.rpm
rpm -ihv xorg-x11-twm-1.0.3-5.1.el6.x86_64.rpm
warning: xorg-x11-twm-1.0.3-5.1.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID c105b9de: NOKEY
Preparing... ################################# [100%]
Updating / installing...
1:xorg-x11-twm-1:1.0.3-5.1.el6 ################################# [100%]
yum install xsetroot -y
Package xorg-x11-server-utils-7.7-20.el7.x86_64 already installed and latest version
于是使用yum安装:
yum install xsetroot -y
yum install xterm -y
yum install twm -y
kill掉vncserver进程,然后重新启动。来自:http://blog.51cto.com/zhangguangjun/2047209
vncserver -kill :1
vncserver :1
yum remove xterm -y
yum remove twm -y
yum remove xsetroot -y
来自:http://javacxn.blog.163.com/blog/static/1832776420139269545905/
======================================================================
Centos 6.4 安装 vnc:
安装:vnc
sudo yum install tigervnc tigervnc-server
安完后先设置密码:
vncpasswd
启动:
vncserver :1
查看:
vncserver -list
杀死进程 :
vncserver -kill :1
远程连接:
用vnc软件,之后输入地址,如:mycclove.oicp.net:5901
119.10.6.23:5901
第二个屏则是:
119.10.6.23:2
1152x864
注意一点:需要在iptables中添加一条规则
-A INPUT -m state --state NEW -m tcp -p tcp --dport 5901 -j ACCEPT
========================
补充:
在windows下连接vnc有一个vncviewer软件,我在ubuntu中有现成的软件, 在CentOS中安装tigervnc后就出现了vncviewer的命令,就可以连接到服务器的vnc了。
连接之后黑屏:
把 用户下面的.vnc/目录下的xstartup添加777权限
来自:http://blog.sina.com.cn/s/blog_6c9d65a10101dyt0.html
设置VNC服务随系统启动自动加载
第一种方法:使用“ntsysv”命令启动图形化服务配置程序,在vncserver服务前加上星号,点击确定,配置完成。
第二种方法:使用“chkconfig”在命令行模式下进行操作,命令使用如下(预知chkconfig详细使用方法请自助式man一下)
[root@testdb ~]# chkconfig vncserver on
[root@testdb ~]# chkconfig --list vncserver
vncserver 0:off 1:off 2:on 3:on 4:on 5:on 6:off
摘自:http://blog.csdn.net/alvin969/article/details/6170884
附加:http://www.linuxidc.com/Linux/2012-11/73471.htm
1、which vncserver 得到VNC Server运行脚本所在位置。
RHEL5默认为:/usr/bin/vncserver
2、使用vi打开vncserver
vi /usr/bin/vncserver
3、查找到默认的分辨率:1024X768,然后进行修改。该行在注释结束的第一段参数部分。根据实际使用显示器的分辨率,修改该参数。
4、修改完vncserver后,重新执行vncserver时即以新的分辨率开始。
5、验证:ps -ef | grep vnc,可以看到所显示的分辨率参数为修改后的参数。
Mac自带VNC Client,MacBook vnc使用方法:
由于有需要远程VNC的需要,苦苦寻找一款Mac上比较好使的VNC Client,结果经人指点,发现原来MacOS自带了VNC Client,只是没有在Launchpad中显示罢了。使用command+space 调出Spotlight搜索键入screen Sharing.app即可。
来自:https://notes.wanghao.work/2016-11-24-Mac%E8%87%AA%E5%B8%A6VNC-Client.html
使用charlesproxy分析iphone上的https请求
Unix/LinuxC技术 jackx 2014-6-26 16:59
来自姜源兄弟的博客:
http://blog.vetcafe.net/2013/12/
http://blog.vetcafe.net/2013/12/
FreeBSD 8.0下jail虚拟机完全实践
Unix/LinuxC技术 jackx 2014-6-26 10:10
由于 KVM 支持全虚拟,所以可以在上面安装各类操作系统,再加上它跟FreeBSD的jail一样,属于系统自带的,我们可以用其搭建属于自己的开发展测试环境。
阅读全文

Linux 与 BSD 有什么不同?
Unix/LinuxC技术 jackx 2014-6-18 23:06