Skip to content

Instantly share code, notes, and snippets.

Chris Herdt cherdt

Block or report user

Report or block cherdt

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@cherdt
cherdt / zeep_latlong_request.py
Created Sep 29, 2019
A SOAP request example using Python's zeep library
View zeep_latlong_request.py
# 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):")
@cherdt
cherdt / soap_number_conversion.py
Last active Oct 10, 2019
Example SOAP 1.2 Request
View soap_number_conversion.py
# 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
@cherdt
cherdt / excel-to-sheets-copy-paste-data.csv
Created May 20, 2019
This data, when copied from Excel to Google Sheets, merges cells the 2nd and 3rd columns when the 3rd column is empty
View excel-to-sheets-copy-paste-data.csv
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
@cherdt
cherdt / bot.yaml
Last active Feb 23, 2019
a simple chatbot definition
View bot.yaml
---
- name: Greetings Bot
- match: intro
replies:
- i'm just learning to be a chatbot. try saying 'hello'
- match: hello|hi|yo
replies:
- howdy
- hi
- salutations
@cherdt
cherdt / pairs.py
Created Jan 6, 2019
ELIZA NLTK pairs
View pairs.py
pairs = (
(
r'I need (.*)',
(
"Why do you need %1?",
"Would it really help you to get %1?",
"Are you sure you need %1?",
),
),
(
@cherdt
cherdt / oauth.py
Created Feb 5, 2018
get a twitter oauth token using the python birdy library
View oauth.py
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
@cherdt
cherdt / bro.service
Last active Jul 18, 2017 — forked from JustinAzoff/bro.service
Broctl systemd unit
View bro.service
[Unit]
Description=Bro
After=network.target
AssertPathExists=/var/log/bro_json
AssertPathExists=/var/spool/bro
AssertPathExists=/opt/bro/bin
[Service]
User=bro
Group=bro
@cherdt
cherdt / daysold.sh
Created May 19, 2017
A bash script that returns the age of a file (since last change) in days
View daysold.sh
#!/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
View keybase.md

Keybase proof

I hereby claim:

  • I am cherdt on github.
  • I am cherdt (https://keybase.io/cherdt) on keybase.
  • I have a public key ASB7nbJiNt48_CBeXNjuPaInDRoZjm_Aeup2NjmSwEQ3MAo

To claim this, I am signing this object:

@cherdt
cherdt / build-bash-redhat.sh
Last active Aug 29, 2015 — forked from href/build-bash-lenny.sh
A script to help automate updating BASH (download, patch, configure, compile, move binaries) on older RedHat systems that don't have yum support
View build-bash-redhat.sh
# inspired by http://askubuntu.com/a/528171
# (I disabled the gpg verifaction, it was causing errors)
# get bash 3.2 source
cd ~
# use your favorite/nearest mirror
MIRROR="http://gnu.mirrors.pair.com"
readonly MIRROR
wget ${MIRROR}/gnu/bash/bash-3.2.tar.gz
tar zxvf bash-3.2.tar.gz
You can’t perform that action at this time.