Skip to content

Instantly share code, notes, and snippets.

View AndreiD's full-sized avatar
🦄
🐦

Dan Ξ AndreiD

🦄
🐦
  • in front of a screen
View GitHub Profile
@AndreiD
AndreiD / kafka_min.sh
Last active February 14, 2020 16:52
kafka_bootstrap_min_resources
sudo apt-get update; sudo apt-get -y upgrade
sudo apt install -y software-properties-common
sudo apt install -y curl net-tools nethogs htop unzip tree
sudo apt-get install -y default-jre
sudo apt-get install -y zookeeperd
sudo systemctl enable zookeeper
cd /tmp
wget https://www-eu.apache.org/dist/kafka/2.4.0/kafka_2.13-2.4.0.tgz
@AndreiD
AndreiD / hashicorp_vault_tutorial1.sh
Last active February 14, 2020 10:50
hashicorp_vault_tutorial
curl --header "X-Vault-Token: $VAULT_ROOT_TOKEN" \
--request POST \
--data '{"plaintext": "Sm9uLFNub3csNDExMSAxMTExIDExMTEgMTExMSxyZXN0YXVyYW50LCwxODkyMDMwOTAzCg=="}' \
http://127.0.0.1:8200/v1/transit/encrypt/transactions | jq
@AndreiD
AndreiD / pub_sub_python.py
Created January 31, 2020 15:28
google_pub_sub_python
import json
import logging
import os
import apache_beam as beam
from apache_beam.options.pipeline_options import PipelineOptions, StandardOptions
from google.cloud import pubsub_v1
# imports the credential file
path_service_account = "read_stream_key.json"
@AndreiD
AndreiD / inactive-users
Created January 30, 2020 17:45
proposal to kick out inactive users
I propose to kick users out from the DAO that didn't wrote at least 1 word on the chat channels until now
@AndreiD
AndreiD / mediumx
Created December 18, 2019 21:15
mediumx
export default {
state: () => ({
loading: false
}),
mutations: {
SET_DATA(state, { id, data }) {
state[id] = data;
}
}
};
@AndreiD
AndreiD / vault-cheatsheet.md
Created November 21, 2019 19:41
hashicorp_vault_cheatsheet

Databases

vault secrets enable database

vault write database/config/my-mysql-database
plugin_name=mysql-database-plugin
connection_url="{{username}}:{{password}}@tcp(127.0.0.1:3306)/"
allowed_roles="my-role"
username="root"
password="root-password-here"

@AndreiD
AndreiD / keybase.md
Created September 13, 2019 13:07
keybase.md

Keybase proof

I hereby claim:

  • I am AndreiD on github.
  • I am andyx (https://keybase.io/andyx) on keybase.
  • I have a public key whose fingerprint is BC8A 622D 8389 31E2 8783 FCDE 3FA1 A644 AA75 5128

To claim this, I am signing this object:

@AndreiD
AndreiD / go_upload_to_cloud.go
Last active August 21, 2019 11:33
upload /download to firebase google and to AWS S3 golang
//---------- Firestore -------------
// ********* UPLOAD *******
configStorage := &firebase.Config{
StorageBucket: "xxxxxxxxxxxxxxxxx.appspot.com",
}
opt := option.WithCredentialsFile("./config/serviceAccountKey.json")
app, err := firebase.NewApp(context.Background(), configStorage, opt)
if err != nil {
log.Error(err)
@AndreiD
AndreiD / easy_crypto_html_form.html
Created July 29, 2019 13:07
easycrypto_html_form.html
<form action="https://api.easycrypto.in/charge_form" method="POST">
<input type="hidden" name="title" value="Nice Watch #1" />
<input type="hidden" name="description" value="a nice looking watch..." />
<input type="hidden" name="metadata" value="optional metadata here" />
<input type="hidden" name="local_price" value="245" />
<input type="hidden" name="local_currency" value="USD" />
<input type="hidden" name="merchant_id" value="YOUR_MERCHANT_ID" />
<input type="hidden" name="redirect_url" value="https://www.your_website.com/sucess_url" />
<input type="submit" name="submit" value="PAY WITH CRYPTO" class="buttonSubmit" />
</form>
@AndreiD
AndreiD / my_docker_cheetsheet.md
Last active June 1, 2019 12:58
My Docker Cheatsheet

Usefull

clear everything with docker

purge_docker.sh

docker system prune -a
docker images purge
docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)