Skip to content

Instantly share code, notes, and snippets.

View sedkis's full-sized avatar
🌴
Working Remotely

Sedky Haider sedkis

🌴
Working Remotely
View GitHub Profile
@sedkis
sedkis / gist:df682fda62c9bd4a1e91326bfe2ed7cf
Last active August 24, 2023 15:33
Install docker on AL2
sudo yum -y install docker git; \
 sudo service docker start; \
 sudo usermod -a -G docker ec2-user; \
 sudo chkconfig docker on; \
 sudo curl -L --fail https://raw.githubusercontent.com/linuxserver/docker-docker-compose/master/run.sh -o /usr/local/bin/docker-compose; \
 sudo chmod +x /usr/local/bin/docker-compose; \
 sudo reboot;

Here is a quick and dirty cmd that I threw together.

@sedkis
sedkis / install-docker.md
Created May 27, 2022 18:27 — forked from npearce/install-docker.md
Amazon Linux 2 - install docker & docker-compose using 'sudo amazon-linux-extras' command

UPDATE (March 2020, thanks @ic): I don't know the exact AMI version but yum install docker now works on the latest Amazon Linux 2. The instructions below may still be relevant depending on the vintage AMI you are using.

Amazon changed the install in Linux 2. One no-longer using 'yum' See: https://aws.amazon.com/amazon-linux-2/release-notes/

Docker CE Install

sudo amazon-linux-extras install docker
sudo service docker start
{
"swagger":"2.0",
"info":{
"description":"Social Media API",
"version":"1.0.0",
"title":"Social Media API"
},
"host":"34.148.19.142:8080",
"tags":[
{
@sedkis
sedkis / swagger
Last active April 7, 2022 21:16
Edge Gateway Swagger
swagger: '2.0'
info:
title: httpbin.org
description: API Management facade for a very handy and free online HTTP tool.
version: '1.0'
host: adverse-leash-gw.aws-use1.cloud-ara.tyk.io/httpbin
schemes:
- http
- https
paths:
@sedkis
sedkis / tyk-bootstrap.sh
Last active October 5, 2022 19:38
Tyk Portal Bootstrap
TOKEN=1bfa65c26a66487157941e23c0ed5a6e # User API Key / Token
ORG=622ba349eaf9c2000181a507 # Dashboard Org ID
CNAME=tyk-portal.localhost:3000 # Portal CNAME you wish to set
DASH_URL=http://localhost:3000 # This can be an IP, a hostname, etc, but Port is necessary if non-standard
# Create Portal.
curl -X POST $DASH_URL/api/portal/configuration \
--header "Authorization: $TOKEN" \
--data "{}"
@sedkis
sedkis / httpbin.yaml
Created March 22, 2022 16:21
Httpbin Complete Deployment - Tyk Operator
apiVersion: tyk.tyk.io/v1alpha1
kind: ApiDefinition
metadata:
name: httpbin
spec:
name: httpbin
use_keyless: true
protocol: http
active: true
do_not_track: false
@sedkis
sedkis / apollo-1
Created March 9, 2022 15:44
apollo-vs-tyk-stitching
Summary:
Total: 10.0702 secs
Slowest: 0.2772 secs
Fastest: 0.0246 secs
Average: 0.0763 secs
Requests/sec: 652.1213
Total data: 97283538 bytes
Size/request: 14814 bytes
@sedkis
sedkis / README.md
Last active January 24, 2022 09:39
Create Aggregate Analytics Filter Using Tags

Use Case

Say you want to capture analytics across a user's API lifecycle, for all their API usage, etc.

This is easily achieved using [Analytics Tags][0].

Step 1

Determine what is the "unique" user ID you want to aggregate requests by.

@sedkis
sedkis / apidef.json
Created September 29, 2021 18:52
UDG Social Media for Tyk v3.2+
{
"id": "6107fd00c957f10001ce7b7d",
"name": "GraphQL posts v2",
"slug": "graphql-posts-v2",
"listen_port": 0,
"protocol": "",
"enable_proxy_protocol": false,
"api_id": "c3ce4a87d0eb472761fbf565af80a634",
"org_id": "5e9d9544a1dcd60001d0ed20",
"use_keyless": true,
package main
import (
"encoding/base64"
"net/http"
"github.com/TykTechnologies/tyk/ctx"
)
func SetSessionPublicKeyVerifier(rw http.ResponseWriter, r *http.Request) {