Skip to content

Instantly share code, notes, and snippets.

View vlaskinvlad's full-sized avatar

Vlad Vlaskin vlaskinvlad

  • Facebook
  • Berlin
View GitHub Profile
def create_page_video(_env, image_path):
"""
src doc: https://developers.facebook.com/docs/video-api/guides/publishing/
```
from dataclasses import dataclass
import requests
@dataclass
class Env:
@vlaskinvlad
vlaskinvlad / kubectl_notes
Last active February 13, 2019 16:37
Kubernetes Let'sencrypt certs
gke: `gcloud container clusters get-credentials locarta-private-0 --zone europe-west3-a --project collekt-1184`
aws: ``
@vlaskinvlad
vlaskinvlad / kubernetes_states.md
Last active November 12, 2018 14:05
Kubernetes Lesson #2
  1. Create Kubernetus cluster

gcloud container clusters create --zone europe-west3-a <cluster_name>

  1. Create namespace if necessary k create namespace test

  2. Persistent Volume resource:

kind: PersistentVolume
@vlaskinvlad
vlaskinvlad / comparison.md
Last active October 19, 2018 10:42
spark comparison

config

%%configure -f 
{
 "jars": [
 ],
 "name":"remotesparkmagic-vlad",
 "numExecutors": 10,
 "executorMemory": "1g",
 "driverMemory": "3g", 
@vlaskinvlad
vlaskinvlad / fix_livy.sh
Last active October 26, 2018 11:09
Fix livy setup on dataproc cluster
sudo su - livy
#1 go to livy dir
cd /usr/local/lib/livy/conf
#2 make nontemplate configuration
cp livy.conf.template livy.conf
#3
# In the config enable master and deployments
@vlaskinvlad
vlaskinvlad / 28.0.3_aidl.md
Last active January 3, 2020 17:32
Jenkins setup and non-forgets

The problem

/opt/android-sdk-linux/build-tools/28.0.3/aidl: 
error while loading shared libraries: libc++.so: 
cannot open shared object file: No such file or directory

Solution

Uinstall and reinstall build-tools via sdk-manager

@vlaskinvlad
vlaskinvlad / mf.py
Created July 26, 2018 06:35
3 points averaging
import patsy as pt
def add_shifts_features(_df, col, shift=1):
dd = _df.copy()
future = dd[col].shift(-shift)
past = dd[col].shift(shift)
dd["%s_f%d" % (col, shift)] = future
dd["%s_p%d" % (col, shift)] = past
return dd
@vlaskinvlad
vlaskinvlad / vpn_revoke_certificate.sh
Created August 21, 2017 13:11
vpn revoke certificate
# Connect to Docker running your open vpn
docker exec -it <container_id> /bin/bash
export CERT_NAME="prod-somebody@somedomain"
cd /etc/openvpn/
easyrsa revoke ${CERT_NAME}
#that command will generate pki/crl.pem file with updates
easyrsa gen-crl
cp -f pki/crl.pem ./
@vlaskinvlad
vlaskinvlad / bash_json.sh
Created June 15, 2017 09:34
Bash Tricks #bash #sh #json
# Extract uid from json's conained in the file payload.json
# sudo apt-get install jshon
while read -r p; do echo $p | jshon -e uid; done < payload.json > uids.txt
vars_files:
- "vault_vars/{{ inventory_dir | basename }}/docker_registry.yml"