Skip to content

Instantly share code, notes, and snippets.

View gpetrousov's full-sized avatar

Ioannis Petrousov gpetrousov

View GitHub Profile
@gpetrousov
gpetrousov / README.md
Created October 6, 2023 09:43 — forked from satomacoto/README.md
Install pyenv and conda

Install pyenv

$ brew update
$ brew install pyenv

Check available versions and install

@gpetrousov
gpetrousov / lazy-loading-lambda.py
Last active November 8, 2019 14:26
Lazy loading in Python Lambda when reading from S3
""" The name of the S3 bucket and object is contained inside the event that triggered the Lambda """
def lambda_handler(event, context):
# Define client
s3 = boto3.client('s3')
# Get the bucket name
source_bucket_name = event['Records'][0]['s3']['bucket']['name']
# Get the object name
@gpetrousov
gpetrousov / terraform_crash.log
Created December 5, 2018 14:15
Terraform crash on vdc dnat config
2018/12/05 15:05:22 [TRACE] root: eval: *terraform.EvalApply
2018/12/05 15:05:22 [DEBUG] apply: vcd_dnat.ssh: executing Apply
2018-12-05T15:05:22.115+0100 [DEBUG] plugin.terraform-provider-vcd_v1.0.0_x4: 2018/12/05 15:05:22 [DEBUG] Waiting for state to become: [success]
2018-12-05T15:05:23.096+0100 [DEBUG] plugin.terraform-provider-vcd_v1.0.0_x4: 2018/12/05 15:05:23 [TRACE] Waiting 500ms before next try
2018-12-05T15:05:23.388+0100 [DEBUG] plugin.terraform-provider-vcd_v1.0.0_x4: 2018/12/05 15:05:23 [DEBUG] Waiting for state to become: [success]
2018-12-05T15:05:23.391+0100 [DEBUG] plugin.terraform-provider-vcd_v1.0.0_x4: panic: runtime error: invalid memory address or nil pointer dereference
2018-12-05T15:05:23.391+0100 [DEBUG] plugin.terraform-provider-vcd_v1.0.0_x4: [signal SIGSEGV: segmentation violation code=0x1 addr=0x38 pc=0x15a71f0]
2018-12-05T15:05:23.391+0100 [DEBUG] plugin.terraform-provider-vcd_v1.0.0_x4:
2018-12-05T15:05:23.391+0100 [DEBUG] plugin.terraform-provider-vcd_v1.0.0_x4: goroutine 50 [
@gpetrousov
gpetrousov / terraform_vcd.tf
Created December 5, 2018 14:13
Terraform config for using vCloud
provider "vcd" {
user = "${var.vcd_user}"
password = "${var.vcd_pass}"
org = "${var.vcd_org}"
url = "${var.vcd_url}"
vdc = "${var.vcd_vdc}"
max_retry_timeout = "${var.vcd_max_retry_timeout}"
allow_unverified_ssl = "${var.vcd_allow_unverified_ssl}"
}
@gpetrousov
gpetrousov / uninstall_dcos
Last active June 5, 2018 09:38
Uninstall DCOS cluster
# Deprovision a DCOS cluster
# https://docs.mesosphere.com/1.7/administration/installing/oss/custom/uninstall/
# This script will remove all directories associated with DCOS.
# Execute this script on the Master and Agent boxes to get rid of any DCOS installations.
# After that, you will be able to initiate a new DCOS installation from the dcos_install.sh script.
# 05-06-2018
# Ioannis Petrousov
# petrousov@gmail.com