Skip to content

Instantly share code, notes, and snippets.

View onuryilmaz's full-sized avatar
🎯
Kubernetes

Onur Yılmaz onuryilmaz

🎯
Kubernetes
View GitHub Profile
@onuryilmaz
onuryilmaz / test.js
Last active May 7, 2020 13:03
test.js
'use strict';
const express = require('express');
const { Appsignal } = require('@appsignal/nodejs');
// Constants
const PORT = 8080;
const HOST = '0.0.0.0';
@onuryilmaz
onuryilmaz / question.txt
Created April 2, 2018 09:38
Python Questions
Question:
You are required to write a program to sort the (name, age, height) tuples by ascending order where name is string, age and height are numbers. The tuples are input by console. The sort criteria is:
1: Sort based on name;
2: Then sort based on age;
3: Then sort by score.
The priority is that name > age > score.
If the following tuples are given as input to the program:
Tom,19,80
John,20,90
Jony,17,91
@onuryilmaz
onuryilmaz / ingress example
Last active October 8, 2017 17:45
Run a Domain with Ingress
kubectl create -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/examples/deployment/default-backend.yaml
kubectl create -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/examples/deployment/nginx-ingress-controller.yaml
kubectl run ingress-pod --image=nginx --port 80
kubectl expose deployment ingress-pod --port=80 --target-port=80 --type=NodePort
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: ingress-service
@onuryilmaz
onuryilmaz / kubeadm-install-offline.md
Last active January 11, 2024 09:21 — forked from jgsqware/kubeadm-install-offline.md
Offline Kubeadm install
> curl -H "Origin: http://example.com" \
> -H "Access-Control-Request-Method: POST" \
> -H "Access-Control-Request-Headers: X-Requested-With" \
> -X OPTIONS --verbose \
> https://api.keyvalue.xyz
* Rebuilt URL to: https://api.keyvalue.xyz/
* Trying 104.31.80.22...
* TCP_NODELAY set
* Connected to api.keyvalue.xyz (104.31.80.22) port 443 (#0)
* TLS 1.2 connection using TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
#define $(i, f) \
({ int _temp = 0; \
int _size = sizeof(i) / sizeof(typeof((*i))); \
do { \
(lambda(void, (typeof((*i)) _ ) {f;} ))( *(i+_temp) ); \
} while( ++_temp < _size ); \
});
# Developer ilanı
if (education.related("Computer Science") && knowledge.computerScience.level == high) {
applyJob("Developer")
}
# Guardian of Excellence
if(reasoning.level == "Spock")
applyJob("Guardian of Excellence")
@onuryilmaz
onuryilmaz / ReplaceTurkishChars.java
Last active December 14, 2023 10:47
Replace Turkish Characters
public static String clearTurkishChars(String str) {
String ret = str;
char[] turkishChars = new char[] {0x131, 0x130, 0xFC, 0xDC, 0xF6, 0xD6, 0x15F, 0x15E, 0xE7, 0xC7, 0x11F, 0x11E};
char[] englishChars = new char[] {'i', 'I', 'u', 'U', 'o', 'O', 's', 'S', 'c', 'C', 'g', 'G'};
for (int i = 0; i < turkishChars.length; i++) {
ret = ret.replaceAll(new String(new char[]{turkishChars[i]}), new String(new char[]{englishChars[i]}));
}
return ret;
}