Skip to content

Instantly share code, notes, and snippets.

user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
upstream ykb {
server webserver3;
FROM ykb-base:alpine-java
WORKDIR /product-api
COPY ./target/product-api.jar .
CMD ["java","-jar","product-api.jar"]
EXPOSE 8080
##RUN apk update && apk add openjdk8-jre-base
@utkumalkocoglu
utkumalkocoglu / docker_commands.txt
Created February 19, 2020 13:21
docker commans examples
docker run --name loadbalancer -p 82:80-v C:\\Users\bilginc_user\nginx.conf:/etc/nginx/nginx.conf -d nginx --dışardan nginx configi verir veya direk etc nginx içine girerek config editlenebilir
docker run --name webserver-nginx -p 81:80 -d nginx
docker run --name webserver2 --publish 81:80 -d httpd
docker run --name webserver1 --publish 80:80 -d httpd
docker rm -f id
__author__ = 'Utku'
import re, sys
def file_parser(fnm):
data = open(fnm).read()
dosya = re.findall(r'<[/]*\w+[^>]*>', data)
dosya = [i for i in dosya if i[-2]!='/']
dosya = [str.replace("<", "") for str in dosya]
dosya = [str.replace(">", "") for str in dosya]
private void button2_Click(object sender, EventArgs e)
{
Excel.Application xlApp;
Excel.Workbook xlWorkBook;
Excel.Worksheet xlWorkSheet;
object misValue = System.Reflection.Missing.Value;
Int16 i, j;
@utkumalkocoglu
utkumalkocoglu / admin.java
Created April 29, 2016 06:30
Hibernate insert
SessionFactory factory=new Configuration().configure().buildSessionFactory();
Session session=factory.openSession();
Admin admin=new Admin();
admin.setIsim("Utku Malkocoglu");
admin.setK_adi("utku");
admin.setSifre("utku6161");
session.beginTransaction();
session.save(admin);
session.getTransaction().commit();
session.close();
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
#include <sys/wait.h>
#include <sys/types.h>
#define BUFFSIZE 1024
#define BUFFER_PART 128
@utkumalkocoglu
utkumalkocoglu / gray.py
Created October 12, 2015 16:21
Gray code
def int2bin(sayi):
if sayi:
binary = []
while sayi:
sayi,kalan = divmod(sayi, 2)
binary.insert(0, kalan)
return binary
else: return [0]
def grayconverter():
@utkumalkocoglu
utkumalkocoglu / index.jsp
Created July 14, 2015 13:57
JSP İLE ÜYE KAYDI
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import javax.swing.JOptionPane;
import org.apache.log4j.Logger;
import org.apache.tomcat.dbcp.dbcp.BasicDataSource;
public class DatabaseConnection {