Skip to content

Instantly share code, notes, and snippets.

View djs-basil-sys's full-sized avatar

Daniel Szemiako djs-basil-sys

  • Basil Systems, Inc.
  • Brooklyn, NY
View GitHub Profile
# Make sure the source index is actually open
POST /source_index/_open
# Put the source index in read-only mode
PUT /source_index/_settings
{
"settings": {
"index.blocks.write": "true"
}
}
@achinta
achinta / pyspark_fill.py
Last active July 4, 2024 10:18
Forward Fill in Pyspark
import pyspark.sql.functions as F
from pyspark.sql import Window
df = spark.createDataFrame([
('d1',None),
('d2',10),
('d3',None),
('d4',30),
('d5',None),
('d6',None),
@npearce
npearce / install-docker.md
Last active September 5, 2024 17:58
Amazon Linux 2 - install docker & docker-compose using 'sudo amazon-linux-extras' command

UPDATE (March 2020, thanks @ic): I don't know the exact AMI version but yum install docker now works on the latest Amazon Linux 2. The instructions below may still be relevant depending on the vintage AMI you are using.

Amazon changed the install in Linux 2. One no-longer using 'yum' See: https://aws.amazon.com/amazon-linux-2/release-notes/

Docker CE Install

sudo amazon-linux-extras install docker
sudo service docker start
@mrthomaskim
mrthomaskim / install-Python-AmazonLinux-20171023.log
Created June 13, 2018 20:44
Amazon Linux AMI, pyenv, virtualenv, Python, ... Hello, World!
### prerequisites
sudo yum groupinstall "Development Tools"
git --version
gcc --version
bash --version
python --version # (system)
sudo yum install -y openssl-devel readline-devel zlib-devel
sudo yum update
### install `pyenv`
@gleicon
gleicon / list_objects_google_storage_boto3.py
Last active October 11, 2023 14:27
How to use boto3 with google cloud storage and python to emulate s3 access.
from boto3.session import Session
from botocore.client import Config
from botocore.handlers import set_list_objects_encoding_type_url
import boto3
ACCESS_KEY = "xx"
SECRET_KEY = "yy"
boto3.set_stream_logger('')