Skip to content

Instantly share code, notes, and snippets.

View asumawang's full-sized avatar

Anwar Sumawang asumawang

  • Trend Micro
  • Australia
View GitHub Profile
@kylemanna
kylemanna / falcon-zipfile-stream.py
Created May 16, 2020 00:08
Falcon + zipfile streaming proof of concept v2
#!/usr/bin/env python3
#
# Falcon + zipfile streaming content using os.pipe() to minimize RAM usage to a
# pipes worth of data.
#
# This test program generated a nearly 500 MB zip file with various compression
# arguments supported by the python3 standard library.
#
# Usage for debug webserver:
# $ ./app.py
@sahil1
sahil1 / airflow_dag_test.py
Last active June 17, 2020 18:51
Airflow Sample DAG with ECS Operator
from airflow import DAG
from airflow.operators.python_operator import PythonOperator
from airflow.contrib.operators.ecs_operator import ECSOperator
import os
from datetime import datetime, timedelta
import boto3
import json
from config import *
default_args = {
@npearce
npearce / install-docker.md
Last active August 10, 2025 11:20
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
@bee-san
bee-san / timsort.py
Last active August 15, 2021 10:28
An Python implementation of Timsort
# based off of this code https://gist.github.com/nandajavarma/a3a6b62f34e74ec4c31674934327bbd3
# Brandon Skerritt
# https://skerritt.tech
def binary_search(the_array, item, start, end):
if start == end:
if the_array[start] > item:
return start
else:
return start + 1
@martinwicke
martinwicke / automobile.ipynb
Last active January 9, 2022 08:14
Estimator demo using Automobile dataset
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@teasherm
teasherm / s3_multipart_upload.py
Last active March 4, 2025 21:55
boto3 S3 Multipart Upload
import argparse
import os
import boto3
class S3MultipartUpload(object):
# AWS throws EntityTooSmall error for parts smaller than 5 MB
PART_MINIMUM = int(5e6)
@Technowise
Technowise / play-framework-init.d-script
Created January 4, 2017 13:07
Play Framework init.d script - Run play application as service in Linux, so that you do not have to do a lot of manual stuff
#!/bin/bash
#To use this script:
#1) Save this file with name of your app in /etc/init.d folder.
#2) Update the APP_NAME to the name of your application in build.sbt.
#3) Update the APP_PATH of the application to the path where you extracted your dist version/snapshot.
#4) Update the value of PORT to the port you would like your application to run on.
#5) Add this script as service using update-rc.d. (Example: sudo update-rc.d your-app defaults).
#
APP_NAME="your-app-name"

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

@twang2218
twang2218 / create-swarm-mode-cluster.sh
Last active March 25, 2024 13:55
Script to create a swarm mode cluster which introduced in Docker 1.12
#!/bin/bash
Size=3
if [ -z "${DOCKER_MACHINE_DRIVER}" ]; then
DOCKER_MACHINE_DRIVER=virtualbox
fi
# REGISTRY_MIRROR_OPTS="--engine-registry-mirror https://jxus37ac.mirror.aliyuncs.com"
# INSECURE_OPTS="--engine-insecure-registry 192.168.99.0/24"
@techgaun
techgaun / influxdb-amazon-linux.md
Last active February 13, 2020 11:21
InfluxDB on Amazon Linux

Last updated: 2017-03-22 : Update to 1.2.2

The following assumes you're executing as a root user

Pre-install

yum update
yum install -y git
mkdir -p /opt/influx/{wal,data,ssl}