Skip to content

Instantly share code, notes, and snippets.

View dbrtly's full-sized avatar

Daniel Bartley dbrtly

View GitHub Profile
@eyeseast
eyeseast / python.md
Last active May 25, 2025 08:27
How to set up Python in 2022

I have an updated version of this on my blog here: https://chrisamico.com/blog/2023-01-14/python-setup/.

Python

This is my recommended Python setup, as of Fall 2022. The Python landscape can be a confusing mess of overlapping tools that sometimes don't work well together. This is an effort to standardize our approach and environments.

Tools and helpful links:

  • Python docs: https://docs.python.org/3/
  • Python Standard Library:  - Start here when you're trying to solve a specific problem
@omidmt
omidmt / vscode-container-dataflow.docker
Created January 14, 2021 02:45
VSCode Python DevContainer Docker + Dataflow (beam + gcloud)
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.154.2/containers/python-3/.devcontainer/base.Dockerfile
# [Choice] Python version: 3, 3.9, 3.8, 3.7, 3.6
ARG VARIANT="3"
FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT}
# [Option] Install Node.js
ARG INSTALL_NODE="true"
ARG NODE_VERSION="lts/*"
RUN if [ "${INSTALL_NODE}" = "true" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi
#!/bin/sh
# This creates a GKE Cluster
# - Will wait for any deletion to complete on a cluster with the same name before creating
# - Will wait for completion before continuing
# - If the script is run concurrently multiple times, only one cluster will be created, all instances will wait for availability
# Requires GCP Cloud SDK
# Installs retry https://github.com/kadwanev/retry
export GKE_PROJECT=$1
@jomido
jomido / gcloud-script-box.sh
Created October 13, 2017 14:52
Idempotent Gcloud Compute Create
#!/bin/bash
# BEGIN SANITY BOX------------------------------------------
set -e # immediately exit if any command fails |
set -u # immediately fail on undefined variables |
set -o pipefail # show error of last failed command |
IFS=$'\n\t' # control what word splitting means |
# END SANITY BOX--------------------------------------------
# delete
@Integralist
Integralist / Check TLS version using by Python.py
Created September 4, 2017 15:13
[Check TLS version using by Python] #python #tls #ssl
# Python 3.5.2-slim
import json
from tornado.httpclient import HTTPClient
response = HTTPClient().fetch("https://www.howsmyssl.com/a/check").body.decode()
data = json.loads(response)
tls_version = data["tls_version"]
print(tls_version)" # TLS 1.2