Skip to content

Instantly share code, notes, and snippets.

View szeitlin's full-sized avatar

Sam Zeitlin szeitlin

View GitHub Profile
@ryanpedersen42
ryanpedersen42 / config.yml
Last active May 8, 2024 13:00
Path filtering example
version: 2.1
setup: true
orbs:
path-filtering: circleci/path-filtering@0.0.2
workflows:
setup-workflow:
jobs:
@vncsna
vncsna / bash_strict_mode.md
Created June 6, 2021 01:59 — forked from mohanpedala/bash_strict_mode.md
set -e, -u, -o, -x pipefail explanation

set -e, -u, -o, -x pipefail

The set lines

  • These lines deliberately cause your script to fail. Wait, what? Believe me, this is a good thing.
  • With these settings, certain common errors will cause the script to immediately fail, explicitly and loudly. Otherwise, you can get hidden bugs that are discovered only when they blow up in production.
  • set -euxo pipefail is short for:
set -e
set -u
@thsutton
thsutton / log4j4py.py
Created January 11, 2021 00:41
Forward Python logging module to Spark log4j
import logging
import time
from contextlib import AbstractContextManager
from logging import Handler, LogRecord
from typing import Any, List, Optional
from pyspark.sql import SparkSession
logging.basicConfig(level=logging.INFO)
@cartershanklin
cartershanklin / data_flow_tutorial_ex1.py
Last active March 6, 2024 12:15
OCI Data Flow Tutorial Example 1 using the Python SDK
#!/usr/bin/env python
# This script executes Example 1 of the OCI Data Flow Tutorial
# https://docs.cloud.oracle.com/en-us/iaas/data-flow/data-flow-tutorial/tutorial/dfs_tut_etl_java.htm#etl_with_java
import argparse
import oci
import sys
import time
@cartershanklin
cartershanklin / data_flow_tutorial_ex1.sh
Last active March 6, 2024 12:15
OCI Data Flow Tutorial Example 1 using the OCI CLI
#!/usr/bin/env bash
# Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
#
# This script executes Example 1 of the Data Flow Tutorial
# https://docs.cloud.oracle.com/en-us/iaas/data-flow/data-flow-tutorial/tutorial/dfs_tut_etl_java.htm#etl_with_java
#
# For more help with specific Data Flow commands, see:
# oci data-flow -h
#
@CarlosDomingues
CarlosDomingues / python-poetry-cheatsheet.md
Last active May 19, 2024 05:20
Python Poetry Cheatsheet

Create a new project

poetry new <project-name>

Add a new lib

poetry add <library>

Remove a lib

# Install clusterdock.
pip3 install clusterdock
# Clone the Apache Kafka topology for clusterdock.
git clone https://github.com/clusterdock/topology_apache_kafka.git
# Start Apache Kafka (defaults to node-1.cluster, node-2.cluster, node-3.cluster)
clusterdock -v start topology_apache_kafka --brokers node-1 node-2 node-3 --kafka-version 1.0.0
# Start StreamSets Data Collector on the same cluster network.
@paulochf
paulochf / s3fs_profile.py
Created March 24, 2018 00:03
Use python s3fs to connect to AWS using specific profile (already in ~/.aws/)
from s3fs.core import S3FileSystem
s3 = S3FileSystem(anon=False, profile_name="your-profile-name")
print(s3.ls("s3://your-bucket/some-folder"))
@ruanbekker
ruanbekker / cheatsheet-elasticsearch.md
Last active April 24, 2024 00:11
Elasticsearch Cheatsheet : Example API usage of using Elasticsearch with curl