Skip to content

Instantly share code, notes, and snippets.

View etheleon's full-sized avatar
🎯
Focusing

etheleon etheleon

🎯
Focusing
View GitHub Profile
@ricardolsmendes
ricardolsmendes / datacatalog-search-tag-templates-project.py
Last active September 18, 2022 15:55
Data Catalog, Python: retrieve all Tag Templates for a Given project through catalog search
from google.cloud import datacatalog
# TODO Developer: set the project id.
project_id = YOUR-PROJECT-ID
client = datacatalog.DataCatalogClient.from_service_account_file(key_file_location)
# Search tag templates for a given project.
# WARNING: search semantics may not return an exaustive list,
# but is the only option currently available.
def search_tag_templates_for_project(project_id):
@JohannesNE
JohannesNE / pin-bigquery-project.md
Last active June 12, 2021 15:46
How to pin a bigquery dataset shared with you in the new UI
@dice89
dice89 / gist:3fb51ea09957264e4f7703da82ae6b0d
Last active September 11, 2020 08:53
Create Service Account
gcloud projects create <your>-dl --enable-cloud-apis
gcloud config set project <your>-dl
gcloud services enable compute.googleapis.com
gcloud iam service-accounts create gcp-terraform-dl --display-name gcp-terraform-dl
gcloud projects add-iam-policy-binding <your>-dl \
--member='serviceAccount:gcp-terraform-dl@ <your>-dl.iam.gserviceaccount.com' --role='roles/owner'
gcloud iam service-accounts keys create 'credentials.json' --iam-account='gcp-terraform-dl@<your>-dl.iam.gserviceaccount.com'
import os
import pycurl
from tqdm import tqdm
downloader = pycurl.Curl()
def sanitize(c):
c.setopt(pycurl.UNRESTRICTED_AUTH, False)
@Tschrock
Tschrock / ponysay_motd.md
Last active December 5, 2019 21:28
A ponysay MOTD for Ubuntu 16.04

A ponysay MOTD for Ubuntu 16.04

Screenshot

  1. Install ponysay: (You may have to sudo apt install software-properties-common first)
    • sudo add-apt-repository ppa:vincent-c/ponysay
    • sudo apt-get update
    • sudo apt-get install ponysay
@so0k
so0k / kubectl.md
Last active April 25, 2024 12:40
Playing with kubectl output

Kubectl output options

Let's look at some basic kubectl output options.

Our intention is to list nodes (with their AWS InstanceId) and Pods (sorted by node).

We can start with:

kubectl get no
@cerisier
cerisier / install-py3-dataproc.sh
Last active July 2, 2021 21:56
Dataproc initialization action script for installing python3
#!/bin/bash
# from https://gist.githubusercontent.com/nehalecky/9258c01fb2077f51545a/raw/789f08141dc681cf1ad5da05455c2cd01d1649e8/install-py3-dataproc.sh
apt-get -y install python3
echo "export PYSPARK_PYTHON=python3" | tee -a /etc/profile.d/spark_config.sh /etc/*bashrc /usr/lib/spark/conf/spark-env.sh
echo "Adding PYTHONHASHSEED=0 to profiles and spark-defaults.conf..."
echo "export PYTHONHASHSEED=0" | tee -a /etc/profile.d/spark_config.sh /etc/*bashrc /usr/lib/spark/conf/spark-env.sh
echo "spark.executorEnv.PYTHONHASHSEED=0" >> /etc/spark/conf/spark-defaults.conf
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
if __name__ == '__main__':
parser = argparse.ArgumentParser(description="""
I never freaking remember argparse syntax and the docs are so all over the place
that I need this for an example.
@parmentf
parmentf / GitCommitEmoji.md
Last active June 14, 2024 14:09
Git Commit message Emoji