This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # ignore comments and empty lines | |
| sed '/^#/d;/^\s/d;s/: /=/g' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| src = open('source.csv', 'r') | |
| dest = open('dest.csv', 'a+') | |
| # 2 arrays to represent CUCM phone records | |
| cucm10 = src.readline().rstrip().split(',') | |
| cucm11 = dest.readline().rstrip().split(',') #map(lambda s: s.rstrip(), | |
| # fields that were added in CUCM 11 | |
| new = set(cucm11) - set(cucm10) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| reg add «HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System» /v «EnableLinkedConnections» /t REG_DWORD /d 0x00000001 /f |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| REG ADD "HKCU\SOFTWARE\Microsoft\Command Processor" /v AutoRun /t REG_SZ /d "CD /D C:\Path\To\Folder" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @echo off | |
| :: enable delayed expansion to set variable values inside for-loop | |
| :: usual %VAR% syntax won't work, use !VAR! instead | |
| setlocal EnableDelayedExpansion | |
| for %%A in (%*) do ( | |
| set _PARAM=%%A | |
| set _PREFIX=!_PARAM:~0,3! | |
| if /i !_PREFIX!==SearchString ( | |
| set LIST_VAR=!LIST_VAR! !_PARAM! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sed '1,/string/ s/string/replacement/' file |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sed 's/SOMETHING="[^"]*"/SOMETHING="XXX"/g' file1 > file2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| taskkill /F /IM SomeExecutable.exe |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| defaults write com.apple.finder CreateDesktop -bool false | true | |
| killall Finder |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| System.out.println("Request params:"); | |
| java.util.Enumeration paramNames = request.getAttributeNames(); | |
| while (paramNames.hasMoreElements()) { | |
| java.lang.String name = (java.lang.String) paramNames.nextElement(); | |
| java.lang.Object values = request.getAttribute(name); | |
| System.out.println("\t" + name + ": " + values); | |
| } | |
| return false; |
NewerOlder