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
| import requests | |
| # Ignore warnings about self-signed certificates if using them | |
| import warnings | |
| warnings.filterwarnings('ignore', '', requests.packages.urllib3.exceptions.InsecureRequestWarning, '', 0) | |
| # Here is a helper function for editing notable events | |
| def updateNotableEvents(sessionKey, baseurl, comment, status=None, urgency=None, owner=None, eventIDs=None, searchID=None): | |
| """ | |
| Update some notable events. |
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
| def prune_sys_path(app_name): | |
| # Prune directories from other apps so that we don't step on each other with our imports (see http://lukemurphey.net/issues/1281) | |
| paths_to_remove = [] | |
| for path in sys.path: | |
| if ('/etc/apps/' in path and not ('/etc/apps/' + app_name) in path) or ('\\etc\\apps\\' in path and not ('\\etc\\apps\\' + app_name) in path): | |
| paths_to_remove.append(path) | |
| for path in paths_to_remove: | |
| sys.path.remove(path) | |
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
| <?xml version="1.0"?> | |
| <root> | |
| <item> | |
| <name>LKM Button 4 5 to Tab Back Forward</name> | |
| <identifier>private.my_button_4_5_to_tab_back_forward</identifier> | |
| <autogen> | |
| __KeyToKey__ | |
| PointingButton::BUTTON4, | |
| KeyCode::TAB, ModifierFlag::CONTROL_L | ModifierFlag::SHIFT_L | |
| </autogen> |
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
| from array import array | |
| from string import join | |
| from struct import pack, unpack | |
| _DECODE = lambda x, e: list(array('B', x.decode(e))) | |
| _ENCODE = lambda x, e: join([chr(i) for i in x], '').encode(e) | |
| HEX_TO_BYTES = lambda x: _DECODE(x, 'hex') | |
| TXT_TO_BYTES = lambda x: HEX_TO_BYTES(x.encode('hex')) | |
| BYTES_TO_HEX = lambda x: _ENCODE(x, 'hex') | |
| BYTES_TO_TXT = lambda x: BYTES_TO_HEX(x).decode('hex') |
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
| PS1="\n\[\033[0;32m\]\u\[\033[0m\] \[\033[0;36m\]\w\[\033[0m\]$ " |
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
| # Byte-compiled / optimized / DLL files | |
| __pycache__/ | |
| *.py[cod] | |
| *$py.class | |
| # OS generated files # | |
| ###################### | |
| .DS_Store | |
| .DS_Store? | |
| ._* |
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
| """ | |
| This script creates stash files for indexing data within Splunk. | |
| Here is a sample of using the StashNewWriter to write out data: | |
| from event_writer import StashNewWriter | |
| writer = StashNewWriter(index='summary', source_name='test_of_event_writer') | |
| writer.write_event({'message': 'here is an event'}) | |
| """ |
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
| """ | |
| This includes a helper class (named RestHandler) that makes implementing a custom REST handler in Splunk very easy. | |
| This is licensed under the Apache License Version 2.0 | |
| See https://www.apache.org/licenses/LICENSE-2.0.html | |
| To use this, you will need to: | |
| 1) Define a restmap.conf and declare the handler | |
| 2) Define the Python code of the REST handler |
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
| /* | |
| * This view is intended to be used as a base class for simpleXML setup views. This class is | |
| * intended to make creation of a setup view easier by: | |
| * | |
| * 1) Providing a mechanism for setting the app as configured so that users aren't redirected through setup again. | |
| * 2) Providing a means for permission checking so that you can ensure that the user has admin_all_objects | |
| * | |
| * To use this class, you will need to do the following: | |
| * | |
| * 1) Make your view class sub-class "SetupView" (the class providing in this file) |