\copy (select column1, column2 from mytable) To '/tmp/dump.csv' With CSV DELIMITER ',' HEADER
View export-psql-to-csv-file.md
View nifi-test-el.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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') |
View get-all-table-properties-in-presto.md
SHOW CREATE TABLE tableName;
source: https://prestodb.io/docs/current/sql/show-create-table.html#examples
View use-git-profile-by-directory.md
~/.gitconfig:
[includeIf "gitdir:~/workspace/project1/**"]
path = .gitconfig.project1
[includeIf "gitdir:~/workspace/project2/**"]
path = .gitconfig.project2
~/.gitconfig.project1:
View delete-index-by-pattern-in-es.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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}") |
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
View delete-redis-keys-by-pattern.md
Removing keys that contain displayed
:
redis-cli --scan --pattern *displayed* | xargs redis-cli del
Source: https://rdbtools.com/blog/redis-delete-keys-matching-pattern-using-scan
View uniq-tekillestirme-yontemi.md
uniq
araci sadece komsu satirlari kullanarak tekillestirme yapar.
$ cat test.txt
a
a
a
b
b
c
View couchbase-partial-document-update.md
Couchbase'de bir dokumani kismi olarak guncellemek icin tum dokumani cekip, guncellemeyi yapip tekrar kaydediyoruz. Bunun yerine 4.5 ile gelen SubDocument yapisi kullanilabilir.
Kaynak: https://docs.couchbase.com/java-sdk/2.7/subdocument-operations.html
NewerOlder