如下命令

grep -rnw '/path/to/somewhere/' -e "pattern"

-r 或者 -R 为递归查找, -n 是行号 -w 为要求全匹配. -l (小写L) 参数可以只列出文件名.

除此以外, –exclude 或者 –include 参数可以提供更有效的查找。比如:

grep --include=\*.{c,h} -rnw '/path/to/somewhere/' -e "pattern"

这个可以查找扩展名为.c或者.h的文件. –exclude的用法也类似:

grep --exclude=*.o -rnw '/path/to/somewhere/' -e "pattern"

上面这行命令在搜索中会排除扩展名为.0的文件。和包含/不包含文件一样,目录也可以使用 –exclude-dir 和 –include-dir 参数。 比如下面列出怎么使用 –exclude-dir:

grep --exclude-dir={dir1,dir2,*.dst} -rnw '/path/to/somewhere/' -e "pattern"

如果单是遍历查找文件的话可以用

find . -name '*.xml'

如果想遍历删除某种类型的文件的话,可以用

 find . -name '*.xml' -type f -delete

很多喜欢Win7,Win8的朋友正在经受着整天提示升级Win10的骚扰。就是不升,怎么着~哈哈

那怎样去掉这个恼人的提示呢?

卸载KB3035583,然后选择忽略此更新。

Done

If you are using a wired connection on your PC or using a USB connection with your 3G or 4G LTE dongle, you can share this connection to other devices. This means you can connect other smartphones, tablets and even laptops to this connection by creating aportable wireless hotspot on Windows 10. There is no direct UI to create the hotspot, but you can easily do it using few commands.

In this article, we will show you how to get started in creating a wireless hotspot in Windows 10.

To get started, right click on the Windows start button and click Command prompt (admin). This will open the command prompt in administrator mode.

Now type the following command;

netsh wlan set hostednetwork mode=allow ssid=AdHoc key=password

In the above command, you can add your own value for SSID and enter your key. Now press enter.

Now to start the network, type the below command;

netsh wlan start hostednetwork

Now that ad-hoc connection is created with passkey, you need to share the existing connection.

Once the hosted network is enabled, you can see MyWiFi connection listed in the network and sharing center. Now the network needs an internet connection and for this, you need to share the existing active Internet connection. Right click on your existing internet connection and select properties.

Now select the Sharing tab in properties. Check the box against “Allow other network users to connect through this computer’s internet connection”. Then select the newly created Wi-fi connection from the drop down list. Now save the details and close the properties.

Now you can see Internet available on the new hotspot connection created.

In case you want to stop the hosted network, use this command;

netsh wlan stop hostednetwork

If you find this method difficult, you can probably use tools like Virtual Hotspot,Connectify or mHotspot.

Ref: http://www.nirmaltv.com/2015/08/18/how-to-create-a-wi-fi-hotspot-in-windows-10/

发动机灯亮了,经检查是引擎在冷车启动的时候有哑火现象。

网上研究了一下,决定添加Sea Foam试试,说可以非常有效的清除积碳。驾驶时是有改善,但是还是没能解决冷车哑火问题。去Dealer处检测说是进气门积碳,需要打开引擎盖手工清理,报价$1xxx。当然就果断让他去S。出来找了个修理厂说是可能点火线圈和火花塞老化了,要求换。好吧,换!但是…问题依旧!老板没辙,说可以试一试44k,说比Sea Foam好。好吧,试就试吧。结果呢,灯还亮!无言… 网上搜了搜,找了一家比较靠谱的专修德国车的地方,检测以后说可以试一试大众的厂家添加剂G 001 780 M3,说积碳问题大部分车在用了这个以后就可以解决。好吧!加吧~ 但是结果还是一样,灯照常亮!没法,只有打开发动机盖看了。打开的结果:进气门积碳很少,但是燃油喷嘴堵塞严重(图一)。只有更换~ 经这个维修点的经验人士介绍,带T的发动机时间长了基本都有这个问题,BMW的还更严重些。[流汗][流汗][流汗] 折腾啊!
image

image

image

image

这段时间网站服务器都不稳定,不清楚是不是被Compromised了。

查了一下也没有查出来。系统里面也没什么可疑的东西。有时候重启正常,有时候重启了还是不行。

没办法,只有重做系统了。保持最小系统看看到底是什么问题。

强烈怀疑是ISPCONFIG导致,但是又找不到确凿的证据…

不过在重装系统以后终于可以放心的开始更新Blog了。哈哈

现在微软提供Windows10的免费升级了。但是如果需要彻底格式化重装系统的话,没Key怎么办?

哈哈,不多说了。碰到类似情况的话用这么这段代码就可以查看当前Windows的CDKEY了。

Option Explicit 

Dim objshell,path,DigitalID, Result 
Set objshell = CreateObject("WScript.Shell")
'Set registry key path
Path = "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\"
'Registry key value
DigitalID = objshell.RegRead(Path & "DigitalProductId")
Dim ProductName,ProductID,ProductKey,ProductData
'Get ProductName, ProductID, ProductKey
ProductName = "Product Name: " & objshell.RegRead(Path & "ProductName")
ProductID = "Product ID: " & objshell.RegRead(Path & "ProductID")
ProductKey = "Installed Key: " & ConvertToKey(DigitalID) 
ProductData = ProductName  & vbNewLine & ProductID  & vbNewLine & ProductKey
'Show messbox if save to a file 
If vbYes = MsgBox(ProductData  & vblf & vblf & "Save to a file?", vbYesNo + vbQuestion, "BackUp Windows Key Information") then
   Save ProductData 
End If



'Convert binary to chars
Function ConvertToKey(Key)
    Const KeyOffset = 52
    Dim isWin8, Maps, i, j, Current, KeyOutput, Last, keypart1, insert
    'Check if OS is Windows 8
    isWin8 = (Key(66) \ 6) And 1
    Key(66) = (Key(66) And &HF7) Or ((isWin8 And 2) * 4)
    i = 24
    Maps = "BCDFGHJKMPQRTVWXY2346789"
    Do
       	Current= 0
        j = 14
        Do
           Current = Current* 256
           Current = Key(j + KeyOffset) + Current
           Key(j + KeyOffset) = (Current \ 24)
           Current=Current Mod 24
            j = j -1
        Loop While j >= 0
        i = i -1
        KeyOutput = Mid(Maps,Current+ 1, 1) & KeyOutput
        Last = Current
    Loop While i >= 0 
    keypart1 = Mid(KeyOutput, 2, Last)
    insert = "N"
    KeyOutput = Replace(KeyOutput, keypart1, keypart1 & insert, 2, 1, 0)
    If Last = 0 Then KeyOutput = insert & KeyOutput
    ConvertToKey = Mid(KeyOutput, 1, 5) & "-" & Mid(KeyOutput, 6, 5) & "-" & Mid(KeyOutput, 11, 5) & "-" & Mid(KeyOutput, 16, 5) & "-" & Mid(KeyOutput, 21, 5)
   
    
End Function
'Save data to a file
Function Save(Data)
    Dim fso, fName, txt,objshell,UserName
    Set objshell = CreateObject("wscript.shell")
    'Get current user name 
    UserName = objshell.ExpandEnvironmentStrings("%UserName%") 
    'Create a text file on desktop 
    fName = "C:\Users\" & UserName & "\Desktop\WindowsKeyInfo.txt"
    Set fso = CreateObject("Scripting.FileSystemObject")
    Set txt = fso.CreateTextFile(fName)
    txt.Writeline Data
    txt.Close
End Function

复制下来以后另存为一个vbs文件,比如”BackupWindowsKey.vbs”。然后双击执行就可以看到序列号了。

Refer: http://winaero.com/blog/how-to-view-your-product-key-in-windows-10-windows-8-and-windows-7/

下载: backupwindowskey.zip