Skip to content

Instantly share code, notes, and snippets.

View kavehmz's full-sized avatar

Kaveh Mousavi Zamani kavehmz

  • Berlin
View GitHub Profile
@kavehmz
kavehmz / echo.yaml
Last active November 7, 2022 14:16
apiVersion: v1
kind: Namespace
metadata:
name: echoserver
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: echoserver
namespace: echoserver

Skill Test

Please submit your answer in the form of a private github gist.

We expect this task to take no more than 3 hours.

ETL process

Please create a process which can download a sample data set of data from the following location and append it in a database table.

https://data.cms.gov/provider-data/archived-data/doctors-clinicians

#include <stdio.h>
int main() {
char a[100];
int i=0;
for (int i = 0; i < 100; i++)
{
a[i]=0;
@kavehmz
kavehmz / init.sh
Last active September 23, 2019 08:22
#!/bin/bash
set -e
COMMAND="$@"
INIT_NAME=${INIT_NAME:-myapp}
HEALTH_PORT=${HEALTH_PORT:-8080}
HEALTH_PATH=${HEALTH_PATH:-ping}
HEALTH_PERIOD_SECONDS=${HEALTH_PERIOD_SECONDS:-1}
HEALTHY_INDICATOR=${HEALTHY_INDICATOR:-/tmp/ready}
APP_STOP_DELAY=${APP_STOP_DELAY:-5}
@kavehmz
kavehmz / gsutil-du.sh
Created July 5, 2018 09:45
get gstul du for all
gsutil du -h gs://*|egrep '/$'|egrep -v '(.*\/.*){5}'|egrep -v ' MiB| B| KiB'
#!/bin/bash
# This is a work-around for issue related to google patch 1.9.4-gke.1
# https://github.com/grafana/grafana-docker/issues/140
: "${GF_PATHS_CONFIG:=/etc/grafana/grafana.ini}"
: "${GF_PATHS_DATA:=/var/lib/grafana}"
: "${GF_PATHS_LOGS:=/var/log/grafana}"
: "${GF_PATHS_PLUGINS:=/var/lib/grafana/plugins}"
: "${GF_PATHS_PROVISIONING:=/etc/grafana/provisioning}"
#!/bin/bash
# Copyright 2015 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
heroku logs -a XXXX -n 10000 >> /tmp/logs.heroku
cat /tmp/logs.heroku |cut -d' ' -f 5|cut -d'"' -f 2|perl -e 'while ($a=<>) {chomp $a;$a=~ /event=([a-zA-Z_-]+)/;print "$1,$a\n"}' |sort -u -t, -k1,1 |cut -d, -f2
@kavehmz
kavehmz / init.sh
Last active February 25, 2018 10:38
sudo mount /dev/xvdf /mnt
sudo chown admin /mnt -R
if [ ! -d /mnt/go ]
then
cd /mnt
wget https://dl.google.com/go/go1.10.linux-amd64.tar.gz
tar --gzip -xf go1.10.linux-amd64.tar.gz
mkdir -p gopath
echo 'export GOPATH=/mnt/gopath' >> ~/.bashrc
echo 'export PATH=$PATH:/mnt/go/bin/:$GOPATH/bin' >> ~/.bashrc
@kavehmz
kavehmz / T
Created September 22, 2017 12:35
Adding lock mechanism to GCS remote backend by suing pubsub Topics.
Concept is imilar to how we create/delete lock file to acquirs/release lock.
We are using remote state-file in our team.We need this in our team to be able to work in a safer way. Our team is small but still this simple change can improve out ability to work together.
Code changes is small.
```hcl
terraform {