resolv.conf是resolver类库使用的配置文件,每当一个程序需要通过域名来访问internet上面的其它主机时,需要利用该类库将域名转换成对应的IP,然后才可进行访问.

resolv.conf文件的配置选项不多,从man文档中看了半天,不理解domain和search使用来干嘛的。这里做个解释,防止以后忘了(环境:ubuntu12.04):

nameserver x.x.x.x该选项用来制定DNS服务器的,可以配置多个nameserver指定多个DNS。

domain mydomain.com这个用来指定本地的域名,在没有设置search的情况下,search默认为domain的值。这个值可以随便配,目前在我看来,domain除了当search的默认值外,没有其它用途。也就说一旦配置search,那domain就没用了。

search google.com baidu.com该选项可以用来指定多个域名,中间用空格或tab键隔开。它是干嘛的呢?

如:在没有配置该选项时,执行
#ping  new
sping: unknown host news

配置search google.com baidu.com后,再执行

#ping news
PING news.google.com (74.125.128.101) 56(84) bytes of data.
64 bytes from hg-in-f101.1e100.net (74.125.128.101): icmp_req=1 ttl=47 time=78.9 ms
64 bytes from hg-in-f101.1e100.net (74.125.128.101): icmp_req=2 ttl=47 time=63.6 ms

它就去ping news.google.com了。原来当访问的域名不能被DNS解析时,resolver会将该域名加上search指定的参数,重新请求DNS,直到被正确解析或试完search指定的列表为止。

由于news不能被DNS解析,所以去尝试news.google.com,被正常解析。如果没有被解析还会去尝试news.baidu.com。

来自:http://www.ttlsa.com/linux/resolv-conf-desc/



实践如下:


google 在前:
#ping news
PING news.google.com (172.217.24.14) 56(84) bytes of data.

baidu在前:
ping news          
PING news.n.shifen.com (202.108.23.82) 56(84) bytes of data.
64 bytes from 202.108.23.82 (202.108.23.82): icmp_seq=1 ttl=55 time=1.97 ms
64 bytes from 202.108.23.82 (202.108.23.82): icmp_seq=2 ttl=55 time=2.01 ms
64 bytes from 202.108.23.82 (202.108.23.82): icmp_seq=3 ttl=55 time=1.99 ms



下载地址:
http://client.arraynetworks.com.cn:8080/zh/troubleshooting
点击上述链接,下载合适的版本:
https://support.arraynetworks.net/prx/000/http/supportportal.arraynetworks.net/downloads/motionpro/Linux/Fedora/1.1.1/MotionPro_Linux_RedHat_x86-64_1.1.1.sh

安装
sudo ./MotionPro_Linux_Ubuntu_x86-64_1.2.1.sh


https://blog.csdn.net/yitengtongweishi/article/details/86378026

实践如下:
wget https://support.arraynetworks.net/prx/000/http/supportportal.arraynetworks.net/downloads/motionpro/Linux/Fedora/1.1.1/MotionPro_Linux_RedHat_x86-64_1.1.1.sh

[root@mainboard_kvmops_10_10_0_103 src]# chmod +x MotionPro_Linux_RedHat_x86-64_1.1.1.sh
[root@mainboard_kvmops_10_10_0_103 src]# ./MotionPro_Linux_RedHat_x86-64_1.1.1.sh
Verifying archive integrity...  100%   All good.
Uncompressing MotionPro Setup  100%  
installing vpnd...
starting vpnd...
installing MotionPro...
creating desktop shortcut for MotionPro...
install MotionPro successfully.
在centos数秒启动页面,按e,进入编辑模式

找到2步中的ro,修改成:rw init=/sysroot/bin/sh,然后按ctrl+x重启

执行chroot /sysroot获取root权限,使用vi /etc/fstab编辑fstab配置文件

来自:https://blog.csdn.net/laotoumo/article/details/82746131
一)AWK增加列分割符号:
| awk -v 'OFS=:' '{print $1,$1,$1}'


二)增加一列相同的值,如何用awk在每行最后添加字段:
awk '{print $0, 新字段}'  文件名
https://zhidao.baidu.com/question/2121603287620619987.html






Linux increase ip_local_port_range TCP port range using sysctl.conf
Finally, edit /etc/sysctl.conf file, to make changes to /proc filesystem permanently i.e. append the following line to your /etc/sysctl.conf file:
# increase system IP port limits
net.ipv4.ip_local_port_range = 1024 65535

来自:https://www.cyberciti.biz/tips/linux-increase-outgoing-network-sockets-range.html
今天自己已开始做在虚拟机上做实验,增加了一个磁盘sdb1,而且也增加了自动挂载的功能/etc/fstab里增加了记录。后来自己把这个磁盘给删除了,再次重新启动服务器的时候,系统启动不了了。

系统提示:

按提示 输入 root的密码,进入以Repair filesystem 为提示符的界面。

vi /etc/fstab后 提示,只读,也就是没权限修改。


解决方案如下:

于是输入 mount -o remount,rw /      

逗号前面无空格(切记),而且一定要有/这个
表示重新挂载为读写模式。

 

这个时候再 vi /etc/fstab 发现已经可以修改了,修改完毕,重启,正常。
---------------------
原文:https://blog.csdn.net/waterxcfg304/article/details/49766467
help [-s] [pattern]
              显示关于内建命令的有用的信息。如果指定了  pattern  (模式),  help  给出关于所有匹配  pattern  的命令的详细帮助;否则所有内建命令的帮助和   shell
              控制结构将被打印出来。 选项 -s 限制信息显示为简短的用法概要。 返回 0,除非没有匹配 pattern 的命令。

在shell中,通过awk,sed,expr 等都可以实现,字符串上述操作。下面我们进行性能比较。

[chengmo@localhost ~]$ test='c:/windows/boot.ini'                      
[chengmo@localhost ~]$ time for i in $(seq 10000);do a=${#test};done;          

real    0m0.173s
user    0m0.139s
sys     0m0.004s

[chengmo@localhost ~]$ time for i in $(seq 10000);do a=$(expr length $test);done;      

real    0m9.734s
user    0m1.628s



速度相差上百倍,调用外部命令处理,与内置操作符性能相差非常大。在shell编程中,尽量用内置操作符或者函数完成。使用awk,sed类似会出现这样结果。


time for i in $(seq 10000);do a=${#test};done;  

real    0m0.751s
user    0m0.747s
sys     0m0.004s

time for i in $(seq 10000);do a=$(expr length $test);done;      

real    0m13.291s
user    0m4.898s
sys     0m9.004s

$type echo
echo is a shell builtin
$type expr
expr is /usr/bin/expr


来自:http://www.cnblogs.com/chengmo/archive/2010/10/02/1841355.html
#echo {{6379..6387},6389,6399}
6379 6380 6381 6382 6383 6384 6385 6386 6387 6389 6399

#for i in {{6379..6387},6389,6399}; do echo $i;
> done
6379
6380
6381
6382
6383
6384
6385
6386
6387
6389
6399


echo $(cd "$(dirname /tmp/error.txt)";pwd)
/tmp



array=(a b c d)
echo $array
a b c d

echo ${#array[@]}
4

a=5
((a++))
echo $a
6

b=3
((a=$a+$b))
echo $a   #6+3=9

$for((i=0;i<5;i++))
> do
> echo $i;
> done
0
1
2
3
4

$echo  $(seq -w 001 2 10)
001 003 005 007 009
换行:
echo  "$(seq -w 001 2 10)"    
001
003
005
007
009


$echo -e -n  "$(seq -w 001 2 10)"
001
003
005
007
009

${var:num1:num2},num1是位置,num2是长度。表示从$var字符串的第$num1个位置开始提取长度为$num2的子串。不能为负数。
echo ${tag:2:2}
a5

tag=baa506fbd77d78ad3cfb912a50a4eac99c0d19c1
tag=${tag:0:8}
echo $tag
baa506fb

取字符串长度:
echo ${#tag}
8


# ls {ex1,ex2}.sh
ex1.sh ex2.sh
# ls {ex{1..3},ex4}.sh   #{1...100} 中间仨个点                    # echo {{1..3},9,20}
ex1.sh ex2.sh ex3.sh ex4.sh
# ls {ex[1-3],ex4}.sh  #注意:是逗号
ex1.sh ex2.sh ex3.sh ex4.sh



echo $0
-bash

echo <FILE> $0=FILE


(1)${a} 变量a的值, 在不引起歧义的情况下可以省略大括号。

(2)$(cmd) 命令替换,和`cmd`效果相同,结果为shell命令cmd的输,过某些Shell版本不支持$()形式的命令替换, 如tcsh。

(3)$((expression)) 和`exprexpression`效果相同, 计算数学表达式exp的数值, 其中exp只要符合C语言的运算规则即可, 甚至三目运算符和逻辑表达式都可以计算。
阅读全文
gitk --all
--all
Show all branches.

gitk --max-count=100 --all -- Makefile  #查看Makefile 100条内容
Show at most 100 changes made to the file Makefile. Instead of only looking for changes in the current branch look in all branches.
实践:gitk --max-count=100 --all -- dns\ 运维手册.md

实践:
gitk --since="2 weeks ago" -- dns\ 运维手册.md  #显示dns\ 运维手册.md两周内的改动

gitk v2.6.12.. include/scsi drivers/scsi   #显示在自从版本v2.6.12后这两个子目录的改动
Show the changes since version v2.6.12 that changed any file in the include/scsi or drivers/scsi subdirectories
实践:
gitk 3667109.. .   #查看版本号3667109当前目录的改动

来自:https://git-scm.com/docs/gitk/1.6.1



一、mac系统安装gitk
gitk是git的一个bin工具,如果git不包含gitk只能说明当前使用的git版本过老。

因此我们只需要安装最新的git就可以了。安装git方法如下:

首先安装brew,方便安装git

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
然后更新软件源并安装git

brew update
brew install git
查看git版本

git --version  # 我安装之后git version 2.18.0
安装完成后执行type命令检查git路径

type -a git
如果结果路径包含/usr/local/bin/git则安装成功,此时只需在项目目录下输入gitk命令就可以启动gitk了。

但是默认情况下gitk显示很模糊,网上查了之后发现是由于mac自带的Wish软件版本很老,没有对retina屏幕做适配导致的,因此需要做优化。

二、系统优化,开启Wish高分辨率适配
git在Mac下其实早就适配了高分辨率了,其patch链接如下:

https://gist.githubusercontent.com/cynthia/5f2355a87c2f15d96dbe/raw/6727e73a007b0efabf55dd065e588467ffccc016/wish_app_info_plist.patch

开启高分辨率适配步骤如下:

1、重启系统,在黑屏界面的时候按住command + r直至出现进度条,进入系统recovery模式

2、在recovery模式中选择简体中文进入桌面,在最顶层的工具栏中找到“实用工具” -> “终端”,启动命令行终端

3、执行以下命令关闭系统保护,详细了解OS X的rootless

csrutil disable
4、重启正常进入系统,修改系统配置文件(如果没有上面的csrutil disable,是无法修改/System目录内的任何内容的)

sudo vim /System/Library/Frameworks/Tk.framework/Versions/Current/Resources/Wish.app/Contents/Info.plist
这个/System/Library/Frameworks/Tk.framework/Versions/Current/Resources/Wish.app/Contents/Info.plist在recovery模式下是找不到的

然后在这个文件内容中增加以下两行配置:

        <key>NSHighResolutionCapable</key>
        <true/>
增加位置如下图



然后更新Wish.app配置

sudo touch /System/Library/Frameworks/Tk.framework/Versions/Current/Resources/Wish.app
5、再次重启,黑屏时按下command+r直到出现进度条,重新进入recovery模式

6、进入recovery模式桌面后,执行“实用工具”->“终端”启动命令行终端

7、执行命令开启系统文件保护

csrutil enable
8、重启系统,正常进入系统,gitk就OK了。

来自:https://www.cnblogs.com/snowater/p/9286122.html
一直使用alt+c,alt+v来复制粘贴,挺不方便的,就试了试修改快捷键,果然可以。下来分享给大家,很简单,会的同学就飘过吧~~,有其他方法的顺便也回复下吧
第一步,系统偏好设置,选择键盘
第一步
第二步,选择》添加应用程序快捷键


第三步,点击小加号
第二步,第三步
第四步,在菜单标题里输入快捷键名称

第五步,在键盘快捷键里,直接按“CTRL+C”。
同理,可以将复制,粘贴,剪切,全选都添加进去(不过撤销貌似不行,知道的回复下吧:)
第四步,第五步
第六步,enjoy

结论:
其实可以用修饰键来搞定
不过我现在都习惯了。

来自:http://bbs.pcbeta.com/viewthread-1040611-1-1.html
centos下判断是否开启ipv6及关闭ipv6的方式
已有 392 次阅读  2012-01-31 17:14   标签:  ipv6

      linux默认是开启ipv6的,但是很多网络服务还不支持ipv6,开启了ipv6反而会影响服务器的网络性能。可以考虑关闭ipv6功能
在Linux下首先确认IPv6是否已经被启用,可以从三个方面确定。

1.使用ifconfig查看自己的IP地址是否含有IPv6地址。
eth0 Link encap:Ethernet HWaddr 00:0A:E4:FE:6F:E1
inet addr:172.28.245.104 Bcast:172.28.245.127 Mask:255.255.255.128
inet6 addr: fe80::20a:e4ff:fefe:6fe1/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:96998 errors:0 dropped:0 overruns:0 frame:0
TX packets:69963 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:113588678 (108.3 MiB) TX bytes:8894978 (8.4 MiB)
Interrupt:20

2.查看服务监听的IP中是否有IPv6格式的地址。(netstat -tuln)
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 127.0.0.1:8000 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN
udp 0 0 172.28.245.104:61440 0.0.0.0:*
udp 0 0 0.0.0.0:32823 0.0.0.0:*
udp 0 0 0.0.0.0:32824 0.0.0.0:*
udp 0 0 0.0.0.0:68 0.0.0.0:*

3.使用lsmod|grep  ipv6查看ipv6的模块是否被加载。
ipv6 245989 12

关闭IPV6的方式:
当确定IPv6已经开启后就可以按照下面的方法将其关闭
1.使用vi编辑器,打开/etc/modprobe.conf
2.在文档中加入如下的两条:
alias net-pf-10 off
alias ipv6 off
保存退出,并且重新启动系统。
重启之后可以使用上面的三种方法去验证IPv6支持是否已经被关闭。

IPv6是默认支持的,所以当你要重新开起IPv6支持时,将/etc/modprobe.conf中的两条指令注释掉就可以了。
======================================================================

http://www.111cn.net/sys/CentOS/50864.htm



http://www.linuxso.com/linuxrumen/17201.html

http://blog.csdn.net/suplxj/article/details/7773423

方法一:

CentOS 6 默认安装后,IPv6是自动开启的,但是现在IPv6还没有普及基本用不到这个功能,建议关闭IPv6模块。下面介绍一下关闭方法。

说明:蓝色=命令名称

      浅绿=命令参数

      浅蓝=选项

      紫色=目录

      系统环境:CentOS  6.2  i686

1、查看系统是否开启ipv6

a)通过网卡属性查看

命令:ifconfig

注释:有 “inet6 addr:。。。。。。。“ 的表示开启了ipv6功能

b)通过内核模块加载信息查看

命令:lsmod | grep ipv6

2、ipv6关闭方法

在/etc/modprobe.d/dist.conf结尾添加

alias net-pf-10 off
alias ipv6 off
可用vi等编辑器,也可以通过命令:
cat <<EOF>>/etc/modprobe.d/dist.conf
alias net-pf-10 off
alias ipv6 off
EOF

写改完毕重启电脑。

来自:http://www.cnblogs.com/taosim/articles/3152516.html
jackXiang@jackXsMacBook-Pro  ~/ops   master ●  brew cask install rdm
Updating Homebrew...
Error: Cask 'rdm' is unavailable: No Cask with this name exists. Did you mean one of these?
avibrazil-rdm                         keyboard-maestro                      safeincloud-password-manager          wordmark
avibrazil-rdm                         keyboard-maestro                      safeincloud-password-manager          wordmark
keeper-password-manager               orelord-mongodb                       watchguard-mobile-vpn-with-ssl
keeper-password-manager               orelord-mongodb                       watchguard-mobile-vpn-with-ssl

可以在这里下载dmg:
链接:https://pan.baidu.com/s/1IPAgiaEByU0zA8fIov930w 密码:4pwi
安装之后的节目,输入连接名,地址,以及端口号就行了,点击下面的test connection测试连接

来自:https://blog.csdn.net/qq_41140741/article/details/86593955
现象:bogon:tmp root# mkdir -p /home/xiangdong    
mkdir: /home/xiangdong: Operation not supported

目的:fFileZilla SFTP同步Linux上的家目录到Mac上。

解决办法:
sudo vim /etc/auto_master
/home                   auto_home       -nobrowse,hidefromfinder #加上#号
bogon:tmp root# sudo automount
bogon:tmp root# mkdir -p /home/xiangdong      #重启automount后就能成功创建。


Hmmm, trying to create a directory under '/home' on a Mac?

Well, Apple doesn't want you to (with good reason, automounter owns this dir, which makes it easier to do NFS mounts and such) so you shouldn't muck with it but if you really just 'have to do it', here is how you can.

Basically: Edit /etc/auto_master and remove or comment out the line that starts with "/home".

example:
sudo vim /etc/auto_master

before:

# Automounter master map
+auto_master            # Use directory service
/net                    -hosts          -nobrowse,hidefromfinder,nosuid
/home                   auto_home       -nobrowse,hidefromfinder
/Network/Servers        -fstab
/-                      -static
after:

# Automounter master map
+auto_master            # Use directory service
/net                    -hosts          -nobrowse,hidefromfinder,nosuid
#/home                   auto_home       -nobrowse,hidefromfinder
/Network/Servers        -fstab
/-                      -static
to have the change take effect without a reboot:
sudo automount

mkdir /home/test
ls -l /home/
total 0
drwxr-xr-x 3 root admin 102 Aug 10 11:33 test

NOTE: I wouldn't do anything 'important' with this directory as it's easy to forget you altered this and an upgrade will plow over this directory, removing all data. (this dir is also not included in any Time Machine backups.


来自:https://blog.csdn.net/lychao89/article/details/53667068
背景:Inode在Mac下锁屏时间长后,网络断开了,如果中午吃饭后,再回来,就断开了,出现:
2019-02-22 09:36:26 Connecting to the network...
2019-02-22 09:36:31 Beginning authentication... [xiangdong]
2019-02-22 09:36:36 You have passed the identity authentication
2019-02-22 09:36:37 Obtaining IP address...
2019-02-22 09:36:44 Current IP address is  172.20.232.65
2019-02-22 09:36:49 Start security check session...
2019-02-22 09:36:49 Security check is passed.
2019-02-22 13:00:37 Disconnecting from the network...
2019-02-22 13:00:38 disconnect for time limit
2019-02-22 13:00:43 Connection failed.

------------------------------------------------------------------------------------------------------------------
在使用TeamViewer时,mac会自动休眠导致网络断开链接无法远程的问题。
尝试了一些方法,以下方法效果显著,特此记录。

第一步:

要设定锁定输入密码的设置,进入‘系统偏好设置’‘安全性与隐私’,将选项‘进入睡眠或开始屏幕保护程序后’打勾,选‘立即’。

第二步:

到‘launchpad’中的‘其他’文件夹打开‘Automator’,或者直接到spotlight中输入定位过去(就是拿火箭筒的小机器人)


第三步:

接下来,会弹出一个窗口,选‘新建文稿’,在弹出窗口中的‘文稿类型’选择‘服务’。


第四步:

首先可以到搜索框中输‘屏幕’,所有和屏幕有关的项目就都出来了,包括我想要的‘启动屏幕保护程序’,选中拖动到右面的框里,记住,要把“‘服务’收到”这项改为‘没有输入’,然后到菜单‘文件’中选择‘存储’,输个服务的名称,比如‘屏保’。


第五步:

到‘系统偏好设置’‘键盘’‘快捷键’‘服务’ 中,找到刚刚那个服务‘屏保’,添加快捷键,最好不要和其他的冲突 。


参考地址:http://blog.csdn.net/wo2niliye/article/details/52440012
原文:https://blog.csdn.net/zww1984774346/article/details/79303563
YUM出现问题:
  File "/usr/lib/python2.7/site-packages/urlgrabber/grabber.py", line 1723, in _do_grab
    self._do_perform()
  File "/usr/lib/python2.7/site-packages/urlgrabber/grabber.py", line 1517, in _do_perform
    raise KeyboardInterrupt
KeyboardInterrupt

阅读全文
实践发现:苹果自带了,到8,9,得自己在键盘快捷键上面勾选。AddTime:2022-08-19 10:10

Mac系统可以新建多个桌面,我习惯开三个桌面,第一个桌面放浏览器、QQ等娱乐窗口,第二个窗口开Xcode等编程工具(不编程用Mac干啥,是吧),第三个窗口放一些笔记啊,工具什么的。

一般切换的时候,可能都知道Ctrl+ 左右方向键来切换,如果开多个桌面的话,就得连续切过来,当然,还可以打开MIssion Control来切换,可是都有点麻烦。

其实Mac可以直接用Ctrl + 数字来切换桌面的,步骤如下:
https://blog.csdn.net/win_ann/article/details/37579871

1.首先你要有多个桌面(好像是废话)。

2.打开系统偏好设置- 键盘- Mission Control(如图所示)
点击在新窗口中浏览此图片


3.有多个桌面就会出现最下面的快捷键,勾上就可以了



这样,就可以用Ctrl+ 数字键快速切换桌面了(快捷键个数随着桌面的个数增加)

来自:https://www.cnblogs.com/Formulate0303/p/15905686.html
分页: 6/40 第一页 上页 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 下页 最后页 [ 显示模式: 摘要 | 列表 ]