Centos7 安装遨游浏览器

由于chrome 无法正常更新,firefox 有时候经常假死,在linux 平台上使用浏览器,一直很麻烦

不过偶然间发现,遨游浏览器居然有linux版本

官网有RPM包下载:
http://www.maxthon.cn/

下载完后进行安装,出现错误:

[root@localhost Downloads]# rpm -ivh maxthon-browser-stable-1.0.5.3-1.x86_64.rpm 
警告:maxthon-browser-stable-1.0.5.3-1.x86_64.rpm: 头V4 RSA/SHA1 Signature, 密钥 ID f8d030ec: NOKEY
错误:依赖检测失败:
	libgtkhotkey.so.1()(64bit) 被 maxthon-browser-stable-1.0.5.3-1.x86_64 需要

按照提示缺少libgtkhotkey.so.1()(64bit)
网上百度到,可以从这个地址进行下载:
http://rpm.pbone.net/index.php3/stat/3/srodzaj/1/search/libgtkhotkey.so.1%28%29%2864bit%29

但是仔细看了,里面没有针对的centos的版本,不过在下面的这个文章中
http://blog.csdn.net/enjosun/article/details/42078721

作者安装的是libgtkhotkey-0.2.1-9.fc19.x86_64.rpm

于是依样画葫芦

下载后进行安装:

[root@localhost Downloads]# rpm -ivh libgtkhotkey-0.2.1-9.fc19.x86_64.rpm 
警告:libgtkhotkey-0.2.1-9.fc19.x86_64.rpm: 头V3 RSA/SHA256 Signature, 密钥 ID fb4b18e6: NOKEY
准备中...                          ################################# [100%]
正在升级/安装...
   1:libgtkhotkey-0.2.1-9.fc19        ################################# [100%]

安装完成后,尝试再次安装遨游浏览器:

[root@localhost Downloads]# rpm -ivh maxthon-browser-stable-1.0.5.3-1.x86_64.rpm 
警告:maxthon-browser-stable-1.0.5.3-1.x86_64.rpm: 头V4 RSA/SHA1 Signature, 密钥 ID f8d030ec: NOKEY
准备中...                          ################################# [100%]
正在升级/安装...
   1:maxthon-browser-stable-1.0.5.3-1 ################################# [100%]
nohup: 把输出追加到"nohup.out"

安装完成,启动遨游~

===================================================================================================

在桌面上设置快捷方式:

root@localhost maxthon]# cp /opt/maxthon/maxthon.desktop /home/terry/Desktop/

					

Centos7 计划任务

我们有时候需要服务器自动更新或者定时间运行某个程序或或者脚本

需要用到crontabs

1. 可以先查看一下当前机器上是否已经安装了crontabs

[root@localhost ~]# rpm -qa| grep crontabs
crontabs-1.11-6.20121102git.el7.noarch

2.如果没有需要利用yum 进行安装

[root@localhost ~]# yum install crontabs

3.启动服务
#启动

/bin/systemctl restart crond.service
[root@localhost terry]# systemctl status crond.service 
● crond.service - Command Scheduler
   Loaded: loaded (/usr/lib/systemd/system/crond.service; enabled; vendor preset: enabled)
   Active: active (running) since Wed 2016-07-13 21:12:05 CST; 55min ago
 Main PID: 1456 (crond)
   CGroup: /system.slice/crond.service
           └─1456 /usr/sbin/crond -n

Jul 13 21:12:05 localhost.localdomain systemd[1]: Started Command Scheduler.
Jul 13 21:12:05 localhost.localdomain systemd[1]: Starting Command Scheduler...
Jul 13 21:12:05 localhost.localdomain crond[1456]: (CRON) INFO (RANDOM_DELAY ...
Jul 13 21:12:05 localhost.localdomain crond[1456]: (CRON) INFO (running with ...
Hint: Some lines were ellipsized, use -l to show in full.

#重新载入配置

/bin/systemctl reload  crond.service

#查看crontab服务状态

/bin/systemctl status  crond.service

4.查看计划任务。基本命令行参数建议使用crontab –help查看

#查看当前用户计划任务

crontab -l
[root@localhost ~]# crontab -l
no crontab for root

#查看userx用户的计划任务

crontab -u userx -l
[root@localhost ~]# crontab -u terry -l
no crontab for terry
[root@localhost ~]#

5.查看日志

tail -f /var/log/cron

6./etc/crontab文件里面存放系统计划任务,/var/spool/cron/目录里面按用户存放计划任务。

7./etc/crontab配置

SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root

# For details see man 4 crontabs

# Example of job definition:
# .---------------- minute (0 - 59)
# |  .------------- hour (0 - 23)
# |  |  .---------- day of month (1 - 31)
# |  |  |  .------- month (1 - 12) OR jan,feb,mar,apr ...
# |  |  |  |  .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# |  |  |  |  |
# *  *  *  *  * user-name  command to be executed

下面添加具体任务
举例(来自网络):

30 21 * * * /usr/local/etc/rc.d/apache restart  #每晚的21:30 重启apache 

45 4 1,10,22 * * /usr/local/etc/rc.d/apache restart  #每月1、10、22日的4 : 45重启apache 

10 1 * * 6,0 /usr/local/etc/rc.d/apache restart #每周六、周日的1 : 10重启apache  

0,30 18-23 * * * /usr/local/etc/rc.d/apache restart  #每天18 : 00至23 : 00之间每隔30分钟重启apache  

0 23 * * 6 /usr/local/etc/rc.d/apache restart  #每星期六的11 : 00 pm重启apache

* 23-7/1 * * * /usr/local/etc/rc.d/apache restart  #晚上11点到早上7点之间,每隔一小时重启  apache

* */1 * * * /usr/local/etc/rc.d/apache restart  #每一小时重启apache   

0 11 4 * mon-wed /usr/local/etc/rc.d/apache restart #每月的4号与每周一到周三的11点重启apache   

0 4 1 jan * /usr/local/etc/rc.d/apache restart  #一月一号的4点重启apache  

*/30 * * * * /usr/sbin/ntpdate 210.72.145.44  #每半小时同步一下时间 

Centos 7 支持NTFS文件系统

我们知道默认大部分linux是不支持NTFS

如果有需要,我们需要安装ntfs-3g 来让系统支持ntfs

centos 默认的源中是没有nfts-3g的,需要额外加载

1. 添加源,这里用的是阿里云的源

[root@localhost terry]# wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo

2.更新

yum -y update

3.安装ntfs-3g

[root@localhost terry]# yum -y install ntfs-3g

4.然后mount 就可以使用了

mongodb启动不了:child process failed, exited with error number 100

1. 发现公司的一个数据服务器,mongodb 无法qidong

运行 service mongod start 出现如下错误

[root@CNSHAS-JD05 mongo]# service mongod start
Starting mongod: about to fork child process, waiting until server is ready for connections.
forked process: 2484
all output going to: /var/log/mongo/mongod.log
ERROR: child process failed, exited with error number 100
                                                           [FAILED] 

2. 删除了 /var/lib/mongo/mongod.lock后,尝试启动,依旧无法启动

[root@CNSHAS-JD05 lib]# service mongod start
Starting mongod: about to fork child process, waiting until server is ready for connections.
forked process: 2336
all output going to: /var/log/mongo/mongod.log
ERROR: child process failed, exited with error number 45
                                                           [FAILED] 

3. 以repair 模式启动

mongod -f /etc/mongod.conf --repair

/etc/mongod.conf 是mongo的配置文件

[root@CNSHAS-JD05 mongo]# mongod -f /etc/mongod.conf --repair
about to fork child process, waiting until server is ready for connections.
forked process: 2515
all output going to: /var/log/mongo/mongod.log
child process started successfully, parent exiting

其实此处可以看到运行状态已经是start状态

4. 然后使用命令

mongod -f /etc/mongod.conf

再次启动一次

[root@CNSHAS-JD05 mongo]# mongod -f /etc/mongod.conf
about to fork child process, waiting until server is ready for connections.
forked process: 2527
all output going to: /var/log/mongo/mongod.log
child process started successfully, parent exiting

5. 然后查看mongo的运行情况

[root@CNSHAS-JD05 mongo]# ps -ef|grep mongo*
root      2527     1  0 17:34 ?        00:00:00 mongod -f /etc/mongod.conf
root      2549  1985  0 17:35 pts/0    00:00:00 grep mongo*

6. 此次出错的参考日志:

***** SERVER RESTARTED *****


Wed Jul 13 17:13:02.739 versionArrayTest passed
Wed Jul 13 17:13:02.741 shardKeyTest passed
Wed Jul 13 17:13:02.741 isInRangeTest passed
Wed Jul 13 17:13:02.741 shardObjTest passed
Wed Jul 13 17:13:02.742 BackgroundJob starting: DataFileSync
Wed Jul 13 17:13:02.754 [initandlisten] MongoDB starting : pid=2248 port=27017 dbpath=/var/lib/mongo 64-bit host=CNSHAS-JD05
Wed Jul 13 17:13:02.754 [initandlisten] db version v2.4.8
Wed Jul 13 17:13:02.754 [initandlisten] git version: a350fc38922fbda2cec8d5dd842237b904eafc14
Wed Jul 13 17:13:02.754 [initandlisten] build info: Linux ip-10-2-29-40 2.6.21.7-2.ec2.v1.2.fc8xen #1 SMP Fri Nov 20 17:48:28 EST 2009 x86_64 BOOST_LIB_VERSION=1_49
Wed Jul 13 17:13:02.754 [initandlisten] allocator: tcmalloc
Wed Jul 13 17:13:02.754 [initandlisten] options: { config: "/etc/mongod.conf", dbpath: "/var/lib/mongo", fork: "true", journal: true, logappend: "true", logpath: "/var/log/mongo/mongod.log", pidfilepath: "/var/run/mongodb/mongod.pid", verbose: "true" }
Wed Jul 13 17:13:02.786 [initandlisten] User Assertion: 10309:Unable to create/open lock file: /var/lib/mongo/mongod.lock errno:13 Permission denied Is a mongod instance already running?
Wed Jul 13 17:13:02.842 [initandlisten] exception in initAndListen: 10309 Unable to create/open lock file: /var/lib/mongo/mongod.lock errno:13 Permission denied Is a mongod instance already running?, terminating
Wed Jul 13 17:13:02.843 dbexit: 
Wed Jul 13 17:13:02.843 [initandlisten] shutdown: going to close listening sockets...
Wed Jul 13 17:13:02.843 [initandlisten] shutdown: going to flush diaglog...
Wed Jul 13 17:13:02.843 [initandlisten] shutdown: going to close sockets...
Wed Jul 13 17:13:02.843 [initandlisten] shutdown: waiting for fs preallocator...
Wed Jul 13 17:13:02.843 [initandlisten] shutdown: lock for final commit...
Wed Jul 13 17:13:02.843 [initandlisten] shutdown: final commit...
Wed Jul 13 17:13:02.843 [initandlisten] shutdown: closing all files...
Wed Jul 13 17:13:02.843 [initandlisten] closeAllFiles() finished
Wed Jul 13 17:13:02.843 [initandlisten] shutdown: removing fs lock...
Wed Jul 13 17:13:02.843 [initandlisten] couldn't remove fs lock errno:9 Bad file descriptor
Wed Jul 13 17:13:02.843 dbexit: really exiting now


***** SERVER RESTARTED *****


Wed Jul 13 17:13:55.434 versionArrayTest passed
Wed Jul 13 17:13:55.435 BackgroundJob starting: DataFileSync
Wed Jul 13 17:13:55.436 shardKeyTest passed
Wed Jul 13 17:13:55.436 isInRangeTest passed
Wed Jul 13 17:13:55.436 shardObjTest passed
Wed Jul 13 17:13:55.447 [initandlisten] MongoDB starting : pid=2274 port=27017 dbpath=/var/lib/mongo 64-bit host=CNSHAS-JD05
Wed Jul 13 17:13:55.448 [initandlisten] db version v2.4.8
Wed Jul 13 17:13:55.448 [initandlisten] git version: a350fc38922fbda2cec8d5dd842237b904eafc14
Wed Jul 13 17:13:55.448 [initandlisten] build info: Linux ip-10-2-29-40 2.6.21.7-2.ec2.v1.2.fc8xen #1 SMP Fri Nov 20 17:48:28 EST 2009 x86_64 BOOST_LIB_VERSION=1_49
Wed Jul 13 17:13:55.448 [initandlisten] allocator: tcmalloc
Wed Jul 13 17:13:55.448 [initandlisten] options: { config: "/etc/mongod.conf", dbpath: "/var/lib/mongo", fork: "true", journal: true, logappend: "true", logpath: "/var/log/mongo/mongod.log", pidfilepath: "/var/run/mongodb/mongod.pid", verbose: "true" }
Wed Jul 13 17:13:55.459 [initandlisten] flushing directory /var/lib/mongo
Wed Jul 13 17:13:55.470 [initandlisten] journal dir=/var/lib/mongo/journal
Wed Jul 13 17:13:55.470 [initandlisten] recover : no journal files present, no recovery needed
Wed Jul 13 17:13:55.470 [initandlisten] flushing directory /var/lib/mongo/journal
Wed Jul 13 17:13:55.537 [initandlisten] flushing directory /var/lib/mongo/journal
Wed Jul 13 17:13:55.544 [initandlisten] flushing directory /var/lib/mongo/journal
Wed Jul 13 17:13:55.550 [initandlisten] opening db:  local
Wed Jul 13 17:13:55.551 [initandlisten] couldn't open /var/lib/mongo/local.ns errno:13 Permission denied
Wed Jul 13 17:13:55.551 [initandlisten] error couldn't open file /var/lib/mongo/local.ns terminating
Wed Jul 13 17:13:55.551 dbexit: 
Wed Jul 13 17:13:55.551 [initandlisten] shutdown: going to close listening sockets...
Wed Jul 13 17:13:55.551 [initandlisten] shutdown: going to flush diaglog...
Wed Jul 13 17:13:55.551 [initandlisten] shutdown: going to close sockets...
Wed Jul 13 17:13:55.551 [initandlisten] shutdown: waiting for fs preallocator...
Wed Jul 13 17:13:55.551 [initandlisten] shutdown: lock for final commit...
Wed Jul 13 17:13:55.551 [initandlisten] shutdown: final commit...
Wed Jul 13 17:13:55.551 [initandlisten] shutdown: closing all files...
Wed Jul 13 17:13:55.551 [initandlisten] closeAllFiles() finished
Wed Jul 13 17:13:55.551 [initandlisten] journalCleanup...
Wed Jul 13 17:13:55.551 [initandlisten] removeJournalFiles
Wed Jul 13 17:13:55.551 [initandlisten] flushing directory /var/lib/mongo/journal
Wed Jul 13 17:13:55.553 [initandlisten] removeJournalFiles end
Wed Jul 13 17:13:55.553 [initandlisten] shutdown: removing fs lock...
Wed Jul 13 17:13:55.553 dbexit: really exiting now


***** SERVER RESTARTED *****


Wed Jul 13 17:14:32.073 versionArrayTest passed
Wed Jul 13 17:14:32.075 shardKeyTest passed
Wed Jul 13 17:14:32.075 isInRangeTest passed
Wed Jul 13 17:14:32.075 shardObjTest passed
Wed Jul 13 17:14:32.076 BackgroundJob starting: DataFileSync
Wed Jul 13 17:14:32.087 [initandlisten] MongoDB starting : pid=2298 port=27017 dbpath=/var/lib/mongo 64-bit host=CNSHAS-JD05
Wed Jul 13 17:14:32.087 [initandlisten] db version v2.4.8
Wed Jul 13 17:14:32.087 [initandlisten] git version: a350fc38922fbda2cec8d5dd842237b904eafc14
Wed Jul 13 17:14:32.087 [initandlisten] build info: Linux ip-10-2-29-40 2.6.21.7-2.ec2.v1.2.fc8xen #1 SMP Fri Nov 20 17:48:28 EST 2009 x86_64 BOOST_LIB_VERSION=1_49
Wed Jul 13 17:14:32.087 [initandlisten] allocator: tcmalloc
Wed Jul 13 17:14:32.087 [initandlisten] options: { config: "/etc/mongod.conf", dbpath: "/var/lib/mongo", fork: "true", journal: true, logappend: "true", logpath: "/var/log/mongo/mongod.log", pidfilepath: "/var/run/mongodb/mongod.pid", verbose: "true" }
Wed Jul 13 17:14:32.090 [initandlisten] flushing directory /var/lib/mongo
Wed Jul 13 17:14:32.094 [initandlisten] journal dir=/var/lib/mongo/journal
Wed Jul 13 17:14:32.094 [initandlisten] recover : no journal files present, no recovery needed
Wed Jul 13 17:14:32.095 [initandlisten] flushing directory /var/lib/mongo/journal
Wed Jul 13 17:14:32.178 [initandlisten] flushing directory /var/lib/mongo/journal
Wed Jul 13 17:14:32.186 [initandlisten] flushing directory /var/lib/mongo/journal
Wed Jul 13 17:14:32.192 [initandlisten] opening db:  local
Wed Jul 13 17:14:32.192 [initandlisten] couldn't open /var/lib/mongo/local.ns errno:13 Permission denied
Wed Jul 13 17:14:32.192 [initandlisten] error couldn't open file /var/lib/mongo/local.ns terminating
Wed Jul 13 17:14:32.192 dbexit: 
Wed Jul 13 17:14:32.192 [initandlisten] shutdown: going to close listening sockets...
Wed Jul 13 17:14:32.192 [initandlisten] shutdown: going to flush diaglog...
Wed Jul 13 17:14:32.192 [initandlisten] shutdown: going to close sockets...
Wed Jul 13 17:14:32.192 [initandlisten] shutdown: waiting for fs preallocator...
Wed Jul 13 17:14:32.193 [initandlisten] shutdown: lock for final commit...
Wed Jul 13 17:14:32.193 [initandlisten] shutdown: final commit...
Wed Jul 13 17:14:32.193 [initandlisten] shutdown: closing all files...
Wed Jul 13 17:14:32.193 [initandlisten] closeAllFiles() finished
Wed Jul 13 17:14:32.193 [initandlisten] journalCleanup...
Wed Jul 13 17:14:32.193 [initandlisten] removeJournalFiles
Wed Jul 13 17:14:32.193 [initandlisten] flushing directory /var/lib/mongo/journal
Wed Jul 13 17:14:32.194 [initandlisten] removeJournalFiles end
Wed Jul 13 17:14:32.194 [initandlisten] shutdown: removing fs lock...
Wed Jul 13 17:14:32.194 dbexit: really exiting now

参考文章:
http://www.dataguru.cn/thread-107361-1-1.html

Windows 7 优先使用无线网卡

windows7 无线网卡连接外网,网线连接内网

 

默认机器会走有线路

 

需要进行修改

  1. 进入无线网卡设置,选择IPv4的设置
    Wireless Setup-1

 

 

 

 

 

 

 

 

 

 

 

 
 

2. 在一般选项卡中选择高级

 
Wireless Setup-2

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

3. 在IP 设置中,修改路由的优先级,确保无线网卡的优先级高于有线的

 
Wireless

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

4. 然后进入cmd ,利用

route print

;查看路由表,确认默认网卡的优先级

 

 

 

 

 

 

 

ssh 免密码登陆

1. linux Server 运行下面命令:

ssh-keygen -t rsa -P ''

例如:

[root@vcentos .ssh]# ssh-keygen -t rsa -P ''
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa): 
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
21:d8:b7:0c:1b:09:02:9b:50:b3:35:55:59:9a:31:bf root@vcentos.vlinux
The key's randomart image is:
+--[ RSA 2048]----+
|oo+ +...+o.      |
|.o = = ..*       |
|o . . * = .      |
|       B o .     |
|      . S E      |
|                 |
|                 |
|                 |
|                 |
+-----------------+

2. 在Server 上查看 .ssh/目录

[root@vcentos .ssh]# ll
total 16
-rw-------. 1 root root  402 Jul  8 10:03 authorized_keys
-rw-------. 1 root root 1675 Jul  8 10:04 id_rsa
-rw-r--r--. 1 root root  401 Jul  8 10:04 id_rsa.pub
-rw-r--r--. 1 root root  396 Jul  1 14:56 known_hosts

3. 将公钥id_rsa.pub,拷贝到client 上,并且把id_rsa.pub添加到客户机.ssh/authorzied_keys文件里

cat id_rsa.pub >> .ssh/authorized_keys

4.更改authorized_keys的权限为600

chmod 600 .ssh/authorized_keys

5. 然后尝试从client上登陆server

[root@vcentos ~]# ssh 192.168.95.22
The authenticity of host '192.168.95.22 (192.168.95.22)' can't be established.
ECDSA key fingerprint is 49:e8:67:50:33:0f:cc:2c:26:a3:aa:6b:7d:ed:24:59.
Are you sure you want to continue connecting (yes/no)? 

输入yes

只有第一次才需要进去确认。

ssh登陆centos服务器显示当前服务器磁盘容量

在linux服务器中,磁盘的容量状态不如windows那么直观显眼,除了做监控报警外,磁盘不够的时候很难及时知道

 

简单的修改下配置文件可以做到每次登陆服务器自动显示磁盘情况

 

[root@vcentos ~]# vim /root/.bash_profile

 

再结尾处添加

echo '=========================================================='
cat /etc/redhat-release
echo '=========================================================='
df -lh

然后保存后重新登陆ssh