Skip to content

Instantly share code, notes, and snippets.

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

ismail BASKIN ismailbaskin

🏠
Working from home
View GitHub Profile
@ismailbaskin
ismailbaskin / step0.Dockerfile
Created January 20, 2021 22:41
Node.js Dockerfile Evolution
FROM node:12
WORKDIR /usr/src/app
COPY . .
RUN npm install
RUN npm run build
CMD [ "npm", "start" ]
apiVersion: cert-manager.io/v1alpha2
kind: Certificate
metadata:
name: webhook-cert
namespace: default
spec:
dnsNames:
- your-svc.default.svc
- your-svc.default.svc.cluster.local
issuerRef:
#!/usr/bin/env bash
## This script create necessary firewall rule based on validating and mutating webhooks for private GKE clusters.
## Usage : ./add_gcp_fw.sh [YOUR_GKE_CLUSTER_NAME]
set -e
CLUSTER=$1
validationg_svcs=$(kubectl get validatingwebhookconfigurations -ojson | \
jq -c '.items[].webhooks[].clientConfig.service | del(.path) | select(. != null)')
@ismailbaskin
ismailbaskin / stopPolicy.js
Created December 8, 2018 21:06
Shutdown GCP VMs
const Compute = require('@google-cloud/compute');
const compute = new Compute();
exports.stopPolicy = async () => {
const [vms] = await compute.getVMs({
filter: `labels.stop-policy:workhour`
});
await Promise.all( vms.map(vm => vm.stop()) );
@ismailbaskin
ismailbaskin / deployment.yaml
Last active November 30, 2018 17:37
Container-native LB
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
run: neg-demo-app # Label for the Deployment
name: neg-demo-app # Name of Deployment
spec: # Deployment's specification
replicas: 16
minReadySeconds: 60 # Number of seconds to wait after a Pod is created and its status is Ready
selector:
@ismailbaskin
ismailbaskin / index.js
Created July 9, 2018 20:51
GCP Pub/Sub to Slack message Cloud Function
const https = require('https');
const url = require('url');
const slackWebhookURL = 'https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX'; // CHANGE ME PLZ!
exports.gceAudit = (event, callback) => {
const msg = JSON.parse(Buffer.from(event.data.data, 'base64').toString());
const slackRequest = https.request({
hostname: url.parse(slackWebhookURL).hostname,
method: 'POST',
@ismailbaskin
ismailbaskin / f5_cookie_decoder.js
Created February 12, 2018 20:29
F5 cookie decoder
@ismailbaskin
ismailbaskin / meltdown.js
Created January 6, 2018 14:57
Javascript Meltdown POC code. You can read Chrome passwords
[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]][([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]((![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]+(!![]+[])[+[]]+(![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.