Skip to content

Instantly share code, notes, and snippets.

View kutayzorlu's full-sized avatar
🎯
Focusing

CODER kutayzorlu

🎯
Focusing
View GitHub Profile
@kutayzorlu
kutayzorlu / leveldb.go
Created December 23, 2022 19:03 — forked from indraniel/leveldb.go
A simple example of using LevelDB in golang
package main
import (
"fmt"
"github.com/syndtr/goleveldb/leveldb"
"log"
)
func main() {
db, err := leveldb.OpenFile("/tmp/foo.db", nil)
@kutayzorlu
kutayzorlu / Compile apache 2.4 + php from source
Last active September 18, 2022 13:44 — forked from algotrader-dotcom/Compile apache 2.4 + php from source
Compile apache 2.4 + php from source
1. Requirements
yum install pcre*
yum install libxml*
yum install gdbm-devel
2. Download packages
apr-1.5.2.tar.gz
apr-util-1.5.2.tar.gz
@kutayzorlu
kutayzorlu / install-kubernetes-flannel-centos7.md
Created October 20, 2021 21:43 — forked from rkaramandi/install-kubernetes-flannel-centos7.md
Installing Kubernetes with the Flannel Network Plugin on CentOS 7

Install Prerequisites on ALL (Worker and Master) Nodes

Let's remove any old versions of Docker if they exist:

sudo yum remove docker \
                  docker-common \
                  docker-selinux \
                  docker-engine
@kutayzorlu
kutayzorlu / net.js
Created May 17, 2021 23:08 — forked from sid24rane/net.js
Simple TCP Client and Server in Node.js (Covering all useful Properties & Methods)
var net = require('net');
// creates the server
var server = net.createServer();
//emitted when server closes ...not emitted until all connections closes.
server.on('close',function(){
console.log('Server closed !');
});
@kutayzorlu
kutayzorlu / redis_cheatsheet.bash
Created July 12, 2020 00:02 — forked from LeCoupa/redis_cheatsheet.bash
Redis Cheatsheet - Basic Commands You Must Know --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
# Redis Cheatsheet
# All the commands you need to know
redis-server /path/redis.conf # start redis with the related configuration file
redis-cli # opens a redis prompt
# Strings.
@kutayzorlu
kutayzorlu / AESGCMUpdateAAD2.java
Created May 22, 2020 20:53 — forked from praseodym/AESGCMUpdateAAD2.java
JDK8 AES-GCM code example
import javax.crypto.*;
import javax.crypto.spec.GCMParameterSpec;
import java.nio.ByteBuffer;
import java.security.SecureRandom;
import java.util.Arrays;
public class AESGCMUpdateAAD2 {
// AES-GCM parameters
public static final int AES_KEY_SIZE = 128; // in bits
@kutayzorlu
kutayzorlu / FileLocking.java
Created May 12, 2020 12:01 — forked from syazawa/FileLocking.java
Example of inter-process and inter-thread file locking in Java
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.channels.FileLock;
// The class demonstrates how to get an exclusive file lock that prevents other threads and processes / JVMs from
// obtaining a lock on the same file. To do this, you need to synchronize a block on a file and acquire FileLock. See
// comments below for more details. Run this class in multiple JVMs and see each thread of each JVM acquires a lock in
// an orderly fasion.
public class FileLocking extends Thread
@kutayzorlu
kutayzorlu / basic-card.json
Created April 26, 2020 00:00 — forked from NicoSB/basic-card.json
Actions on Google Conversation API v2 - Sample Responses
{
"items": [
{
"simpleResponse": {
"textToSpeech":"This is the first simple response for a basic card"
}
},
{
"basicCard": {
"title":"Title: this is a title",
@kutayzorlu
kutayzorlu / actix_netty_vs_fastify.md
Created April 19, 2020 00:10 — forked from diegopacheco/actix_netty_vs_fastify.md
Actix(Rust) VS Netty(Java) VS Fastify(Nodejs)

Fastify did 6K RPS (Request per Second)
Netty did 23K RPS (Request Per Second)
Actix did 53K RPS (Request Per Second)

Actix 1ms latency
Netty 4ms latency
Fastify 14ms latency

npm install -g autocannon
@kutayzorlu
kutayzorlu / crc64.js
Created August 23, 2019 23:06
crc64.js
window["crc64"] = function (inputString) {
/**
* @see https://github.com/dcodeIO/long.js/
*/
/**
* Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as *signed* integers.
* See the from* functions below for more convenient ways of constructing Longs.
*
* @class A Long class for representing a 64 bit two's-complement integer value.
* @param {number} low The low (signed) 32 bits of the long