Skip to content

Instantly share code, notes, and snippets.

@HiCraigChen
HiCraigChen / app.py
Last active September 20, 2019 04:43
pdftotext python code
from chalice import Chalice
import os
app = Chalice(app_name='pdftotext')
@app.route('/')
def index():
# Get a sample pdf file
os.system("curl https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf -o /tmp/file.pdf")
@HiCraigChen
HiCraigChen / Get package files.sh
Created September 19, 2019 04:10
Get package files
# Install two utilities to download and extract .rpm files
yum install yum-utils rpmdevtools
# Download .rpm files
yumdownloader <package_name>
# Extract files from .rpm
rpmdev-extract *.rpm
@HiCraigChen
HiCraigChen / copy files from docker.sh
Last active September 19, 2019 04:00
copy files from docker
# Open another terminal to find your running container id
docker ps
# CONTAINER ID IMAGE COMMAND...
#<CONTAINER ID> py36lambda "bash" ...
# Copy the files from container to local
docker cp <CONTAINER_ID>:/path/to/file/in/docker /path/to/local/directory