Category Archives: linux

Linux: Search and replace in files

Overview

Just a quick recipe for performing search & replace on many files at once.

Recipe

Note
  • Replace $NAME with find match specifier, e.g. “*.php”
  • Replace $SEARCH_LITERAL and $REPLACE_LITERAL with unquoted search/replace strings
    • Search/replace strings must escape forward-slash(/) with back-slash(\), e.g. http:\/\/asdf.com
Recipe

Example to perform replace all occurrences of foo with bar in all php files

Linux: Test a SOAP web service using curl

Curl is a linux command-line HTTP tool.

Sample SOAP Message:

Sample curl command to transmit SOAP message to a SOAP service (with –data curl will automatically POST):

Note
replace $HOSTNAME,$PORT and $SOMEPATH below

Linux: Test REST web service using curl

Curl is a linux command-line HTTP tool.

Note
Replace $URL in examples below, e.g. http://somehost:2222/path/to/endpoint

Test REST GET:

Test REST GET with OAuth token in header:

Test REST POST:

Note
content-type here is XML but could be anything.