Skip to content

Commit

Permalink
Add small utils
Browse files Browse the repository at this point in the history
  • Loading branch information
danifbento committed Dec 23, 2020
1 parent 716eb57 commit 6606abb
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
38 changes: 38 additions & 0 deletions utils/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash

VERSIONS=(1.14.2 1.16.1 1.18.0 1.19.6)

for VERSION in "${VERSIONS[@]}"
do

cd utils/
URL=https://nginx.org/download/nginx-${VERSION}.tar.gz

whereis wget > /dev/null 2>&1

if [ $? -ne 0 ]; then
echo "Missing wget"
exit 1
fi

wget $URL
rm -rf ../vendor
mkdir -p ../vendor
mv nginx-$VERSION.tar.gz ../vendor/
cd ../vendor/
tar -xvzf nginx-$VERSION.tar.gz
cd nginx-$VERSION
./configure --add-module=../.. --prefix=/usr/local/nginx
make && sudo make install
cd ../../
sudo cp nginx.conf /usr/local/nginx/conf/nginx.conf

sudo /usr/local/nginx/sbin/nginx -t

if [ $? -ne 0 ]; then
echo "Problems with version $VERSION"
exit 1
fi

sudo rm -rf /usr/local/nginx
done
14 changes: 14 additions & 0 deletions utils/sub_client.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import zmq

context = zmq.Context()
socket = context.socket(zmq.SUB)
socket.bind("tcp://*:5556")

socket.subscribe("/topic")

i = 0

while True:
message = socket.recv()
print i, message
i = i + 1

0 comments on commit 6606abb

Please sign in to comment.