Skip to content

Instantly share code, notes, and snippets.

View gurcankavakci's full-sized avatar

Gürcan Kavakçı gurcankavakci

View GitHub Profile
@gurcankavakci
gurcankavakci / docker-compose.yml
Created August 25, 2023 06:55
PostgreSQL docker-compose.yml
version: "3.5"
services:
postgres:
container_name: postgres
image: postgres:14.1-alpine
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=123456
ports:
- '5432:5432'
@gurcankavakci
gurcankavakci / docker-compose.yml
Created August 25, 2023 06:53
Rabbitmq docker-compose.yml
version: "3.5"
services:
rabbitmq:
container_name: "rabbitmq"
image: rabbitmq:3.8-management-alpine
environment:
- RABBITMQ_DEFAULT_USER=guest
- RABBITMQ_DEFAULT_PASS=guest
ports:

Problem

I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).

Solution

Use ssh keys and define host aliases in ssh config file (each alias for an account).

How to?

  1. Generate ssh key pairs for accounts and add them to GitHub accounts.
@gurcankavakci
gurcankavakci / forecasting_metrics.py
Created September 30, 2020 21:29 — forked from bshishov/forecasting_metrics.py
Python Numpy functions for most common forecasting metrics
import numpy as np
EPSILON = 1e-10
def _error(actual: np.ndarray, predicted: np.ndarray):
""" Simple error """
return actual - predicted
@gurcankavakci
gurcankavakci / JenkinsSlaveCleaner.groovy
Created October 2, 2017 12:10
Groovy script for cleaning up ghost workspaces left on slaves after a job has been deleted. Must be run strictly on the master instance.
import hudson.FilePath;
// Initialize dryRun parameter to TRUE if not given as script parameter
dryRun = false;
if( dryRun == true ) {
println "** Execute a dryRun - no files will ever be deleted **";
}
// shortcut to Jenkins instance