Skip to content

Instantly share code, notes, and snippets.

Avatar

Maryna Shabalina marinakr

View GitHub Profile
@marinakr
marinakr / redis_import_csv.txt
Created Sep 12, 2019 — forked from arsperger/redis_import_csv.txt
import csv file into redis with a single command
View redis_import_csv.txt
cat data.csv | awk -F',' '{print " SET \""$1"\" \""$2"\" \n"}' | redis-cli --pipe
@marinakr
marinakr / redis_import_csv.txt
Created Sep 12, 2019 — forked from arsperger/redis_import_csv.txt
import csv file into redis with a single command
View redis_import_csv.txt
cat data.csv | awk -F',' '{print " SET \""$1"\" \""$2"\" \n"}' | redis-cli --pipe
View elixir-crud-protobuff.txt
mix phx.new --umbrella --database postgres --no-webpack --no-ecto --no-html --binary-id to_do
cd apps/to_do
mix phx.gen.schema ToDo.Item items title:string description:text status:text owner:uuid
mix ecto.gen.repo -r ToDo.Repo
mix ecto.create
mix ecto.migrate
cd ../
mix new protobuf
@marinakr
marinakr / split-pem.sh
Last active Jun 4, 2019 — forked from gnanet/split-pem.sh
Split combined PEM file the smart way (tested on debian, requires openssl)
View split-pem.sh
#!/bin/bash
CERT_NAME=cert_
META=.meta
#openssl pkcs7 -in ~/Downloads/PB2019.p7b -inform DER -print_certs -out chain.pem
if [ $1 ]
then
if [ -f $1 ]
then
View sql partitions + tablespaces
alter table declarations rename to declarations_old;
/*Drop triggers*/
drop trigger on_declaration_insert ON public.declarations_old;
drop trigger on_declaration_update ON public.declarations_old;
/*Drop all indexes*/
drop index declarations_declaration_number_index;
drop index declarations_declaration_request_id_index;
drop index declarations_employee_id_status_index;
@marinakr
marinakr / Kafka SASL_PLAINTEXT auth configure
Created Feb 15, 2019
How to start kafka broker with sasl_plaintext auth
View Kafka SASL_PLAINTEXT auth configure
Support SASL_PLAIN auth for kafka broker
Kafka broker can be configure like
`/usr/local/etc/kafka/server.properties`:
```
listeners=SASL_PLAINTEXT://localhost:9093
advertised.listeners=SASL_PLAINTEXT://localhost:9093
security.inter.broker.protocol=SASL_PLAINTEXT
sasl.mechanism.inter.broker.protocol=PLAIN
@marinakr
marinakr / phoenix_to_umbrella
Last active Jan 25, 2019 — forked from emilsoman/phoenix_to_umbrella
How to move an existing phoenix app under an umbrella app
View phoenix_to_umbrella
How to convert existing phoenix app to an umbrella app.
https://elixir-lang.slack.com/archives/phoenix/p1472921051000134
chrismccord [10:14 PM]
@alanpeabody yes, it's straightforward
[10:14]
1) mix new my_umbrella --umbrella
You can’t perform that action at this time.