Skip to content

Instantly share code, notes, and snippets.

View ozinal's full-sized avatar
:octocat:
Focusing

Bayram Ozinal ozinal

:octocat:
Focusing
View GitHub Profile
@ozinal
ozinal / rancher_aws_ecr_secret.md
Last active November 30, 2023 23:28 — forked from flybd5/rancher_aws_ecr_secret.md
Creating and updating AWS ECR docker-registry secrets in Rancher

The easiest way to create and update a docker-registry secret in Rancher 2.x for an AWS ECR repo is to set up a CRON job that uses the AWS CLI and Kubectl.

  • Log into the host machine where the cluster is running
  • Install AWS CLI and configure it to use an IAM role that can read the ECR credentials.
  • Test the CLI config using this command: aws ecr --region <your_ecr's_region> get-login-password
  • Install kubectl and configure it with the yaml for the cluster in which you want to define the secret
  • Create a shell script like this:
# Delete the secret if it already exists (there is no way to update it)
@ozinal
ozinal / BinarySearchTree.java
Created July 16, 2020 15:02
BinarySearchTree and Testing
package bst;
import java.util.LinkedList;
import java.util.List;
public class BinarySearchTree {
private Node root = null;
public boolean find(int id) {
@ozinal
ozinal / RequestAndResponseLoggingFilter.java
Created May 30, 2020 21:38
Spring Boot Request and Response Logging Interceptor
import lombok.extern.slf4j.Slf4j;
import lombok.val;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.web.filter.OncePerRequestFilter;
import org.springframework.web.util.ContentCachingRequestWrapper;
import org.springframework.web.util.ContentCachingResponseWrapper;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
/opt/mango/apache-tomcat-7.0.39/bin/catalina.sh run
Using CATALINA_OPTS:
>> -Xms512m
>> -Xmx1g
>> -Xmn400m
>> -Xss128m
>> -XX:+UseParallelGC
>> -XX:ParallelGCThreads=4
>> -XX:PermSize=128m
>> -XX:MaxPermSize=512m
@ozinal
ozinal / k8s-svc-annotations.md
Created August 31, 2019 17:34 — forked from mgoodness/k8s-svc-annotations.md
AWS ELB-related annotations for Kubernetes Services (as of v1.12.0)
  • service.beta.kubernetes.io/aws-load-balancer-access-log-emit-interval (in minutes)
  • service.beta.kubernetes.io/aws-load-balancer-access-log-enabled (true|false)
  • service.beta.kubernetes.io/aws-load-balancer-access-log-s3-bucket-name
  • service.beta.kubernetes.io/aws-load-balancer-access-log-s3-bucket-prefix
  • service.beta.kubernetes.io/aws-load-balancer-additional-resource-tags (comma-separated list of key=value)
  • service.beta.kubernetes.io/aws-load-balancer-backend-protocol (http|https|ssl|tcp)
  • service.beta.kubernetes.io/aws-load-balancer-connection-draining-enabled (true|false)
@ozinal
ozinal / centos_install_compass.sh
Created July 12, 2017 12:45 — forked from amites/centos_install_compass.sh
bash script to install sass/compass onto centos
#! /bin/bash
# Sass: http://sass-lang.com/
# Sass is a "smart" form of css, supporting nested targeting of html, variables and logic
# scss is a variant of sass using a syntax much closer to css
# Compass: http://compass-style.org/
# Compass is a sass framework containing a range of shortcuts for cross-browser css effects.
# rounded corners, transparency...
<?php
if(!defined('BASEPATH')) { header('Location: http://'. getenv('SERVER_NAME') .'/'); }
/**
* @package
* @author
**/
class xml extends Public_Controller {