Skip to content

Instantly share code, notes, and snippets.

View nordineb's full-sized avatar

Nordine Ben Bachir nordineb

View GitHub Profile
@nordineb
nordineb / README.MD
Created September 13, 2022 14:37
Client Credentials

Client Credentials

curl --location \
--request POST 'https://myidp.mydomain.com/oauth/token' \
--header 'Content-Type: application/json'  \
-d '{"audience":"audience_I_need","grant_type":"client_credentials","client_id":"xxx","client_secret":"secret123"}'
@nordineb
nordineb / readme.MD
Last active July 14, 2022 19:31
HTTP2 with cURL
apiVersion: v1
kind: Service
metadata:
annotations:
networking.gke.io/load-balancer-type: "Internal"
name: echoheaders
labels:
app: echoheaders
spec:
type: LoadBalancer
@nordineb
nordineb / deploy
Last active June 8, 2022 14:10
deploy
apiVersion: apps/v1
kind: Deployment
metadata:
name: echo-deployment
spec:
replicas: 2
selector:
matchLabels:
app: echo-server
template:
@nordineb
nordineb / echoheaders.yaml
Last active June 3, 2022 07:10
echoheaders HTTP2 GKE ingress global load balancer
apiVersion: apps/v1
kind: Deployment
metadata:
name: echoheaders
spec:
replicas: 1
selector:
matchLabels:
app: echoheaders
template:
@nordineb
nordineb / readme.MD
Last active May 20, 2022 15:03
Gitpod:: Install MS marketplace extensions that are not yet available in Open VSX

While more and more extensions land in Open VSX on a daily basis, there still might be cases where you are missing a certain extension that exists in the MS marketplace.

On a real vscode instance, right click on an extension and choose Copy Extension ID

Example:

  • Cloud Code from Google has the extension id googlecloudtools.cloudcode
  • The publisher is googlecloudtools and the extention is cloudcode.

In Gitpod, download the VSIX file using cURL (adapt the values as needed)

@nordineb
nordineb / README.md
Created March 2, 2022 10:05
Access host from docker

Desc

docker.for.mac.host.internal, docker.for.mac.localhost, docker.for.mac.gateway.internal are deprecated, you must now use host.docker.internal, vm.docker.internal, and gateway.docker.internal

Testing

on the host:

nc -l 0.0.0.0 8899
@nordineb
nordineb / readme.MD
Created February 9, 2022 15:22
Vim for kubernetes

aliases

alias k=kubectl
alias kgp='k get po'
alias kdp='k delete po --force --grace-period=0'
alias kaf='k apply -f'
alias kdf='k delete -f'
alias kex='k explain'
alias ker='k explain --recursive'
@nordineb
nordineb / readme.MD
Created February 9, 2022 15:19
Google Cloud authentication using service accounts

You might want to use a service account to access google cloud. This is how

gcloud iam service-accounts create \
labgke --description="Temp access account to gke for lab purpose"  \
--display-name="tmp lab service account"  \

gcloud iam service-accounts list
@nordineb
nordineb / README.md
Last active August 16, 2022 08:50
Azure DevOps, ssh-rsa, openssh

I wasn't able to git fetch from Azure DevOps repos after upgrading openssh on my computer.

ssh -V
  OpenSSH_8.8p1, OpenSSL 1.1.1l  24 Aug 2021

Turns out that OpenSSL has now turned off ssh-rsa by default:

This release disables RSA signatures using the SHA-1 hash algorithm by default.

But Azure DevOps doesn't support anything else... Add the following to your config file to re-enable ssh-rsa for Azure DevOps: