Skip to content

Instantly share code, notes, and snippets.

tail -f logfile.log | grep ERROR | while read msg; do psql -c "INSERT INTO error_stream (msg) VALUES ($msg)"; done
tail -f logfile.log | \
grep ERROR | while read msg; do psql -c "INSERT INTO error_stream (msg) VALUES ($msg)"; done`
CREATE CONTINUOUS VIEW errors_1m AS
SELECT COUNT(*) FROM error_stream
WHERE (arrival_timestamp > clock_timestamp() - interval '5 minutes');
tail -f logfile.log | \
grep ERROR | while read msg; do psql -c "INSERT INTO error_stream (msg) VALUES ($msg)"; done
CREATE CONTINUOUS VIEW errors_1m AS
SELECT COUNT(*) FROM error_stream
WHERE (arrival_timestamp > clock_timestamp() - interval '1 minute');
#!/bin/bash
wget https://github.com/nanomsg/nanomsg/archive/1.0.0.tar.gz && \
tar -xvf 1.0.0.tar.gz && \
cd nanomsg-1.0.0 && \
mkdir build && \
cd build && \
cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DNN_STATIC_LIB=1 -DCMAKE_POSITION_INDEPENDENT_CODE=1 && \
cmake --build . && \
sudo cmake --build . --target install && \
@derekjn
derekjn / install_zmq.sh
Created November 16, 2016 19:44
Install ZeroMQ 4.2.0
#!/bin/bash
wget https://github.com/zeromq/libzmq/releases/download/v4.2.0/zeromq-4.2.0.tar.gz && \
tar -xvf zeromq-4.2.0.tar.gz && \
cd zeromq-4.2.0/ && \
./autogen.sh && \
./configure --enable-static --prefix=/usr && \
make && \
sudo make install && \
sudo ldconfig
#!/bin/bash
# pkg-config may not be necessary to install on all systems
sudo apt-get install -y wget libtool autoconf automake pkg-config
wget https://github.com/zeromq/libzmq/releases/download/v4.2.5/zeromq-4.2.5.tar.gz && \
tar -xvf zeromq-4.2.5.tar.gz && \
cd zeromq-4.2.5/ && \
./autogen.sh && \
./configure CPPFLAGS=-DPIC CFLAGS=-fPIC CXXFLAGS=-fPIC LDFLAGS=-fPIC --prefix=/usr && \
{
"type": "excalidraw",
"version": 2,
"source": "https://excalidraw.com",
"elements": [
{
"id": "eMqGPZZ8EoG_afMmJdntC",
"type": "rectangle",
"x": 413.4942932128906,
"y": 157.18307495117188,