Skip to content

Instantly share code, notes, and snippets.

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

Levent Divilioglu bzdgn

🏠
Working from home
View GitHub Profile
@bzdgn
bzdgn / Dockerfile
Last active April 22, 2024 07:51
Nginx Conf as Reverse Proxy for Keycloak
FROM nginx:latest
# Remove the default nginx configuration file
RUN rm /etc/nginx/conf.d/default.conf
# Copy a new configuration file from the current directory
COPY nginx.conf /etc/nginx/conf.d/
# Expose ports
EXPOSE 9600
@bzdgn
bzdgn / repoSearch.java
Created May 29, 2020 14:03
Github Repository Search Command With JBang
//usr/bin/env jbang "$0" "$@" ; exit $?
//DEPS info.picocli:picocli:4.2.0
import picocli.CommandLine;
import picocli.CommandLine.Command;
import picocli.CommandLine.Parameters;
import java.util.concurrent.Callable;
import java.io.InputStreamReader;
@bzdgn
bzdgn / Resolver.py
Created February 20, 2018 14:37
Simple Host Name Resolver Example In Python
import socket
class Resolver:
def __init__(self):
self._cache = {}
def __call__(self, host):
if host not in self._cache:
self._cache[host] = socket.gethostbyname(host)
return self._cache[host]
def listCache(self):
@bzdgn
bzdgn / RandomPickDemo.java
Created April 27, 2017 09:30
Generate A Random Subset Array From An Array
package ds._001.intro;
import java.util.concurrent.ThreadLocalRandom;
public class RandomPickDemo {
public static void main(String[] args) {
// Original Array
int[] intArray = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
@bzdgn
bzdgn / print_dir.c
Last active February 21, 2017 06:57
Prints The Working Directory Contents With Inode Number, File Type number and File Name
#include <stdio.h>
#include <dirent.h>
#include <sys/types.h>
printInfo(struct dirent *info)
{
if(info == NULL) {
return;
}
@bzdgn
bzdgn / custom_stat.c
Created February 20, 2017 21:06
Custom Stat Printing The Parameters Of A File (Code is not mine, check out Chris Brown's System Programming lessons)
#include <stdio.h>
#include <sys/stat.h>
#include <stdlib.h>
#include <time.h>
int main(int argc, char * argv[])
{
struct stat sb;
char *filetype[] = {
@bzdgn
bzdgn / showmodes.c
Created February 20, 2017 19:43
Show Modes Of A Linux File
#include <stdio.h>
#include <sys/stat.h>
#include <stdlib.h>
int main(int argc, char* argv[])
{
if(argc != 2) {
printf("usage: %s <filename>\n", argv[0]);
exit(1);
}
@bzdgn
bzdgn / 3dface.html
Last active April 29, 2017 09:34
3D Face Model Rotation Example
<!DOCTYPE html>
<html>
<head>
<title>3d Rotation Face Example</title>
<style>
body {
margin: 0px;
padding: 0px;
}
</style>
@bzdgn
bzdgn / 3drotationdemo.html
Last active September 7, 2022 22:06
3d Rotation On XYZ-Axis Example With HTML5 and JavaScript
<!DOCTYPE html>
<html>
<head>
<title>3d Rotation On XYZ-Axis Example</title>
<style>
body {
margin: 0px;
padding: 0px;
}
</style>
@bzdgn
bzdgn / 3drotationdemo.html
Created January 16, 2017 20:20
3d Rotation On Z-Axis Example With HTML5 and JavaScript
<!DOCTYPE html>
<html>
<head>
<title>3d Rotation On Z-Axis Example</title>
<style>
body {
margin: 0px;
padding: 0px;
}
</style>