Skip to content

Instantly share code, notes, and snippets.

View ozgurgul's full-sized avatar

Ozgur Gul ozgurgul

  • London, England
View GitHub Profile
pm.sendRequest({
url: 'https://login.microsoftonline.com/' + pm.environment.get("tenantId") + '/oauth2/token',
method: 'POST',
header: 'Content-Type: application/x-www-form-urlencoded',
body: {
mode: 'urlencoded',
urlencoded: [
{key: "grant_type", value: "client_credentials", disabled: false},
{key: "client_id", value: pm.environment.get("clientId"), disabled: false},
{key: "client_secret", value: pm.environment.get("clientSecret"), disabled: false},
@ozgurgul
ozgurgul / awesome-python-sorted-by-stars-2019-05-13.md
Created December 1, 2020 11:02 — forked from 5ay3h/awesome-python-sorted-by-stars-2019-05-13.md
awesome-python-sorted-by-stars-2019-05-13.md
@ozgurgul
ozgurgul / postgres-cheatsheet.md
Created January 6, 2021 15:18 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@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
@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 / 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 / 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 / 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 \