When hosting our web applications, we often have one public IP
address (i.e., an IP address visible to the outside world)
using which we want to host multiple web apps. For example, one
may wants to host three different web apps respectively for
example1.com
, example2.com
, and example1.com/images
on
the same machine using a single IP address.
How can we do that? Well, the good news is Internet browsers
ffmpeg -i "Apache Sqoop Tutorial Part 1.mp4" -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate1.ts
ffmpeg -i "Apache Sqoop Tutorial Part 2.mp4" -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate2.ts
ffmpeg -i "Apache Sqoop Tutorial Part 3.mp4" -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate3.ts
ffmpeg -i "Apache Sqoop Tutorial Part 4.mp4" -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate4.ts
ffmpeg -i "concat:intermediate1.ts|intermediate2.ts|intermediate3.ts|intermediate4.ts" -c copy -bsf:a aac_adtstoasc "Apache Sqoop Tutorial.mp4"
Requests are handled by flask
, a bunch of urls are inserted in the object store (redis
)
and arguments are put on the queue (redis
again) for workers to consume. More workers
would mean more items processed in parallel.
Other possible implementations:
multiprocessing
module for consuming all cpus.multiprocessing.managers.SyncManager
for distributing task to other machines.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DIR=. | |
VERSION=12 | |
echo "Downloading headers for version ${VERSION}..." | |
mkdir -p "${DIR}/CL-${VERSION}" | |
cd "${DIR}/CL-${VERSION}" | |
wget https://raw.githubusercontent.com/KhronosGroup/OpenCL-Headers/opencl${VERSION}/opencl.h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <ctime> | |
class Timer | |
{ | |
public: | |
Timer() { clock_gettime(CLOCK_REALTIME, &beg_); } | |
double elapsed() { | |
clock_gettime(CLOCK_REALTIME, &end_); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo sh -c "echo 'deb http://security.ubuntu.com/ubuntu utopic-security main' >> /etc/apt/sources.list" | |
sudo apt-get -y update | |
sudo apt-get -y install build-essential libncurses-dev fakeroot kernel-package | |
sudo apt-get -y install linux-source | |
sudo apt-get -y install linux-image-3.16.0-43-generic linux-headers-3.16.0-43 linux-source-3.16.0 | |
cd /usr/src |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Install and compile Caffe on NVIDIA Jetson TK1 Development Kit | |
sudo add-apt-repository universe | |
sudo apt-get update | |
sudo apt-get install libprotobuf-dev protobuf-compiler gfortran \ | |
libboost-dev cmake libleveldb-dev libsnappy-dev \ | |
libboost-thread-dev libboost-system-dev \ | |
libatlas-base-dev libhdf5-serial-dev libgflags-dev \ | |
libgoogle-glog-dev liblmdb-dev -y |