Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Batuhan Bayrakci baybatu

🏠
Working from home
View GitHub Profile
@baybatu
baybatu / export-psql-to-csv-file.md
Created Feb 16, 2022
export psql query result to csv file
View export-psql-to-csv-file.md
\copy (select column1, column2 from mytable) To '/tmp/dump.csv' With CSV DELIMITER ',' HEADER
@baybatu
baybatu / nifi-test-el.groovy
Created Sep 29, 2021
Nifi Expression Language Tester
View nifi-test-el.groovy
// usage: groovy nifi-test-el.groovy '${now():toNumber():minus(3999900000):format("yyyy-MM-dd HH:mm:ss", "GMT")}'
// source: https://community.cloudera.com/t5/Community-Articles/Testing-NiFi-Expression-Language-with-Groovy/ta-p/247208
@Grab(group='org.apache.nifi', module='nifi-expression-language', version='1.4.0')
import org.apache.nifi.attribute.expression.language.*
def cli = new CliBuilder(usage:'groovy testEL.groovy [options] [expressions]',
header:'Options:')
cli.help('print this message')
cli.D(args:2, valueSeparator:'=', argName:'attribute=value',
'set value for given attribute')
@baybatu
baybatu / use-git-profile-by-directory.md
Created Jun 30, 2021
Using git profiles by current directory
View use-git-profile-by-directory.md

~/.gitconfig:

[includeIf "gitdir:~/workspace/project1/**"]
    path = .gitconfig.project1
[includeIf "gitdir:~/workspace/project2/**"]
    path = .gitconfig.project2

~/.gitconfig.project1:

@baybatu
baybatu / delete-index-by-pattern-in-es.py
Created Jun 10, 2021
delete index by pattern in Elasticsearch with Python
View delete-index-by-pattern-in-es.py
# usage
# python delete-index-by-pattern-in-es.py http://ES_HOST:9200 my-es-index-*
# indexes matched with pattern you entered will be deleted
from elasticsearch import Elasticsearch
import sys
es_host = sys.argv[1]
index_pattern = sys.argv[2]
print(f"es_host:{es_host} ; index_pattern:{index_pattern}")
@baybatu
baybatu / use-local-pod-on-demo-project.md
Last active Apr 26, 2021
use local ios pod on a demo project
View use-local-pod-on-demo-project.md

harray-ios-sdk projesini local'deki demo bir ios projesinde kullanabilmek icin adimlar:

  • localde bi ios projesi olustur (orn: batuiostest)
  • Kullanacagin modulun (harray-ios-sdk) kaynak kodlarini bu projenin icine kopyala
  • Ana dizinde Podfile olustur (ruby kodu icerecek) ve sunu koy:
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'batuiostest' do
@baybatu
baybatu / delete-redis-keys-by-pattern.md
Last active Sep 17, 2021
Delete Redis keys by pattern
View delete-redis-keys-by-pattern.md
@baybatu
baybatu / zalenium-vs-selenium-grid-archs.md
Last active Apr 19, 2021
simple zalenium vs selenium grid (w/o docker) architecture comparison
View zalenium-vs-selenium-grid-archs.md

Following diagram depicts Jenkins as the test runner. Zalenium Hub spawns docker containers that each one include target browsers that we want to run our test on.

zalenium_arch

@baybatu
baybatu / uniq-tekillestirme-yontemi.md
Last active Apr 3, 2021
uniq aracinin sadece komsu satirlari tekillestirmesi / uniq tool makes only adjacent rows unique
View uniq-tekillestirme-yontemi.md

uniq araci sadece komsu satirlari kullanarak tekillestirme yapar.

$ cat test.txt
a
a
a
b
b
c
@baybatu
baybatu / couchbase-partial-document-update.md
Last active Apr 1, 2021
Couchbase kismi guncelleme / Partial document update in Couchbase
View couchbase-partial-document-update.md