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
| --- | |
| - name: Evasive Bot | |
| - match: intro | |
| replies: | |
| - i'm sysadmin chatbot. try asking 'why is there smoke coming out of rack 3?' | |
| - match: ".*[?]+" | |
| replies: | |
| - it's complicated. | |
| - match: "([^?]+)" | |
| replies: |
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
| // based on https://css-tricks.com/snippets/jquery/smooth-scrolling/ | |
| // Select all links with hashes | |
| $('a[href*="#"]') | |
| // Remove links that don't actually link to anything | |
| .not('[href="#"]') | |
| .not('[href="#0"]') | |
| .click(function(event) { | |
| // On-page links | |
| if ( | |
| location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') |
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
| # Example SOAP request using Python's zeep library | |
| # Send a ZIP code, return latitude and longitude coordinates | |
| from zeep import Client | |
| import xml.etree.ElementTree as xml | |
| client = Client('https://graphical.weather.gov/xml/DWMLgen/wsdl/ndfdXML.wsdl') | |
| result = client.service.LatLonListZipCode('55403') | |
| print("\n\nSOAP response (XML):") |
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
| # An example SOAP request | |
| # See https://www.dataaccess.com/webservicesserver/NumberConversion.wso | |
| # for other operations | |
| import requests | |
| url = 'https://www.dataaccess.com/webservicesserver/NumberConversion.wso' | |
| headers = {'content-type': 'application/soap+xml; charset=utf-8'} | |
| # Note that we name the XML namespace soap12 | |
| # We could name this anything we want, but it needs be consistent in the tags |
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
| Address | Name | OS | |
|---|---|---|---|
| 192.168.0.1 | alpha.example.com | ||
| 192.168.0.2 | beta.example.com | Debian Stretch | |
| 192.168.0.3 | gamma.example.com | CentOS 7 | |
| 192.168.0.4 | delta.example.com | ||
| 192.168.0.5 | epsilon.example.com | Windows 10 |
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
| --- | |
| - name: Greetings Bot | |
| - match: intro | |
| replies: | |
| - i'm just learning to be a chatbot. try saying 'hello' | |
| - match: greetings|hello|hi|hola|howdy|yo | |
| replies: | |
| - howdy | |
| - hi | |
| - salutations |
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
| pairs = ( | |
| ( | |
| r'I need (.*)', | |
| ( | |
| "Why do you need %1?", | |
| "Would it really help you to get %1?", | |
| "Are you sure you need %1?", | |
| ), | |
| ), | |
| ( |
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 birdy.twitter import UserClient | |
| CONSUMER_KEY = 'getthisfromappstwittercom' | |
| CONSUMER_SECRET = 'getthisfromappstwittercom' | |
| client = UserClient(CONSUMER_KEY, CONSUMER_SECRET) | |
| token = client.get_authorize_token() | |
| ACCESS_TOKEN = token.oauth_token |
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
| [Unit] | |
| Description=Bro | |
| After=network.target | |
| AssertPathExists=/var/log/bro_json | |
| AssertPathExists=/var/spool/bro | |
| AssertPathExists=/opt/bro/bin | |
| [Service] | |
| User=bro | |
| Group=bro |
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
| #!/bin/bash | |
| # confirm we received an argument | |
| if [ $# -lt 1 ] | |
| then | |
| echo "USAGE: bash daysold.sh <filename>" | |
| exit 1 | |
| fi | |
| # confirm the argument is a file |
NewerOlder