Skip to content

Instantly share code, notes, and snippets.

View ozgurgul's full-sized avatar

Ozgur Gul ozgurgul

  • London, England
View GitHub Profile
@ozgurgul
ozgurgul / update-golang.md
Last active September 19, 2022 18:12 — forked from nikhita/update-golang.md
How to update the Go version

How to update the Go version

System: Debian/Ubuntu/Fedora. Might work for others as well.

1. Uninstall the exisiting version

As mentioned here, to update a go version you will first need to uninstall the original version.

To uninstall, delete the /usr/local/go directory by:

JDBC Connection URLs for 22 Databases

Source

PostgresSQL JDBC connection URL

jdbc:postgresql:template1
org.postgresql.Driver

MySQL JDBC connection URL

@ozgurgul
ozgurgul / cmder_split.md
Created August 17, 2022 15:06 — forked from jtferns/cmder_split.md
Create simple 4-way split of Cmder for windows cmd prompting...

Setup

  1. Launch Cmder
  • step1
  1. Right-click on the console tab
  2. Select New Console... to launch the ConEmu console create dialog
  • step2
  1. In the New Console Split section, select the To right radio option click the Start button
  • step3
  1. Congrats, you now have a half-n-half or 50-50 horizontal split!

Join Linux to Active Directory (RHEL/CentOS)

Below is what an admin would do manually. You will need to adjust the variables to work for you, obviously. These steps are similar in debian based Linux distributions, but with a twist. I didn't document that here, as I didn't see the need. They are relatively minor changes.

  1. Export some variables that we'll need.
### Set your domain
export adauth_domain=YOURDOMAIN.LAB
@ozgurgul
ozgurgul / centos7_sssd_configurations_for_onelogin_vldap.md
Created June 1, 2021 14:33
CentOS7 SSSD Configurations for OneLogin VLDAP(Virtual LDAP)
@ozgurgul
ozgurgul / README.md
Created June 1, 2021 14:24 — forked from seanorama/README.md
sssd

SSSD Configuration

What I use for Hortonworks HDP (Hadoop) systems, but should work for anyone.

Some configurations are tuned for Active Directory without relying on 'sssd-ad' such that the hosts don't need to join the domain.

Install requirements

sudo yum install sssd sssd-ldap sssd-krb5 sssd-tools authconfig \
  oddjob oddjob-mkhomedir openldap-clients cyrus-sasl-gssapi \
@ozgurgul
ozgurgul / cloudwatch.tf
Created March 25, 2021 23:21 — forked from picadoh/cloudwatch.tf
EC2 Instance Scheduling (Stop/Start) with Terraform
### Cloudwatch Events ###
# Event rule: Runs at 8pm during working days
resource "aws_cloudwatch_event_rule" "start_instances_event_rule" {
name = "start_instances_event_rule"
description = "Starts stopped EC2 instances"
schedule_expression = "cron(0 8 ? * MON-FRI *)"
depends_on = ["aws_lambda_function.ec2_start_scheduler_lambda"]
}
# Runs at 8am during working days
@ozgurgul
ozgurgul / postgres_dba_queries_and_commands.sql
Last active February 24, 2021 14:01 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL DBA Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@ozgurgul
ozgurgul / Makefile
Created February 9, 2021 01:04 — forked from mpneuried/Makefile
Simple Makefile to build, run, tag and publish a docker containier to AWS-ECR
# import config.
# You can change the default config with `make cnf="config_special.env" build`
cnf ?= config.env
include $(cnf)
export $(shell sed 's/=.*//' $(cnf))
# import deploy config
# You can change the default deploy config with `make cnf="deploy_special.env" release`
dpl ?= deploy.env
include $(dpl)
@ozgurgul
ozgurgul / Makefile
Created February 9, 2021 00:07 — forked from peterwwillis/Makefile
Makefile samples that I have found useful
# This Makefile allows you to pass arguments to 'make', and have those get passed into commands for a target.
# This also shows how to automatically generate a help menu using specially annotated comments on targets.
#
# Usage:
# - make help
# List of available targets:
#
# help List all available targets (default)
# jenkins-cluster Run terraformctl on the aws-jenkins-cluster root module
# cognito-userpool Run terraformctl for the cognito user pool