Skip to content

Instantly share code, notes, and snippets.

View buger's full-sized avatar
🏠
Working from home

Leonid Bugaev buger

🏠
Working from home
View GitHub Profile
@buger
buger / read.md
Last active March 7, 2024 09:05
API Gateway guide to SOAP

API Gateway guide to SOAP

SOAP is a big and painful topic when it comes to API gateway support. And the reason is that the SOAP protocol itself has a very flexible declarative XML format, and its specifications are unfortunately really vague and leave a lot of things open for interpretation.

In this document, we will try to cover all possible ways how you can integrate SOAP with Tyk API Gateway, from simple pass through to calling WSDL services.

Introduction to SOAP format

A SOAP message is a XML document which is used to transmit your data, and can look as simple as:

Date Open High Low Close AdjClose Volume
2014-07-08 574.501099 576.358887 563.039124 567.967041 567.967041 1914700
2014-07-09 568.454346 573.566223 566.262390 572.929749 572.929749 1119800
2014-07-10 562.815369 573.436951 561.920288 567.976929 567.976929 1360400
2014-07-11 568.782532 577.673645 568.295227 576.012756 576.012756 1626200
2014-07-14 579.414063 582.009827 574.869080 581.671631 581.671631 1859100
2014-07-15 582.536926 582.601563 573.407104 581.582153 581.582153 1627500
2014-07-16 584.784546 585.182373 579.016235 579.473755 579.473755 1400900
2014-07-17 576.360840 577.812866 565.500549 570.592590 570.592590 3024800
2014-07-18 589.757202 593.536438 578.817322 591.825806 591.825806 4025100
@buger
buger / README.md
Last active September 27, 2017 08:36
Rcapd go lang implementation

Record to file:

rcapd --input-raw "<interface>" --input-raw-engine "pcap" --input-raw-bpf "tcp" --output-file network.pcap

Forward traffic from 1 machine to another:

rcapd --input-raw "<interface>" --input-raw-engine "pcap" --input-raw-bpf "tcp" --output-tcp <ip>:<port>
### Keybase proof
I hereby claim:
* I am buger on github.
* I am buger (https://keybase.io/buger) on keybase.
* I have a public key ASCzaCxRkFIlUa2aRgKqemADKX7wtZTSNs2XhdbMZ4PlLgo
To claim this, I am signing this object:
@buger
buger / readme.md
Created February 5, 2017 13:35
buger/jsonparser failing test case

Fails to get following data: jsonparser.Get(data, " Name","Pid","Photo")

@buger
buger / report
Created January 24, 2017 11:34
Sphinx 1.5.2 error report
Step 17/30 : RUN pip3 install grpcio
---> Running in b6d303f4091c
Downloading/unpacking grpcio
Running setup.py (path:/tmp/pip_build_root/grpcio/setup.py) egg_info for package grpcio
Installed /tmp/pip_build_root/grpcio/sphinx_rtd_theme-0.1.10_alpha-py3.4.egg
Searching for sphinx>=1.3
Reading https://pypi.python.org/simple/sphinx/
Best match: Sphinx 1.5.2
Downloading https://pypi.python.org/packages/e3/87/e271f7f0d498c7fdaec009c27955401d18ef357c0d468e1eb2be36bdc68c/Sphinx-1.5.2.tar.gz#md5=8a3068cd5dda49622b7eb5132d616e19

Contributor License Agreement

The following terms are used throughout this agreement:

  • You - the person or legal entity including its affiliates asked to accept this agreement. An affiliate is any entity that controls or is controlled by the legal entity, or is under common control with it.
  • Project - is an umbrella term that refers to any and all Tyk Technologies open source projects.
  • Contribution - any type of work that is submitted to a Project, including any modifications or additions to existing work.
  • Submitted - conveyed to a Project via a pull request, commit, issue, or any form of electronic, written, or verbal communication with Tyk Technologies, contributors or maintainers.

1. Grant of Copyright License.

@buger
buger / examples.md
Last active December 13, 2016 06:27
OssMetrics SQL access

We use latest unmodified Postgres (9.5.4), here is SQL documentation https://www.postgresql.org/docs/current/static/

Example of connecting to our database using psql command, with credentials which you should receive in email:

# After running it will ask your for the password. 
# For scripting purpose you may set password using PGPASSWORD environment variable as well.
psql -h ossmetrics.com -U <user>

You have access to events_ex table, each row represents single event happening in your repository

@buger
buger / time_tracker.sh
Last active July 26, 2017 21:13
Bash time tracker
active_time() {
# Query display logs
logs=$(/usr/bin/pmset -g log | grep 'Display is turned')
# By default Mac turn off monitor after 15 minutes
timeout=900
# Read logs line by line
# Line format: 2016-07-12 07:50:02 +0300 Notification Display is turned on
echo "$logs" | while IFS= read -r line; do
d=$(echo $line | cut -c 1-19); # extract full date
@buger
buger / atomic_counter.bash
Last active August 26, 2021 18:21
Bash atomic counter
# See http://wiki.bash-hackers.org/howto/mutex for more details
lock() {
if mkdir $1 &> /dev/null; then
return 0
else
r=$(($2 + 0))
# timeout after 5 retries
if [ "$r" -gt "5" ]; then
echo "Lock failed:" $1