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
-- show running queries (pre 9.2) | |
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
FROM pg_stat_activity | |
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- show running queries (9.2) | |
SELECT pid, age(clock_timestamp(), query_start), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
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
ubuntu@ip-10-0-71-156:~$ sudo strace -p 12226 -s 100000 | |
strace: Process 12226 attached | |
clock_gettime(CLOCK_MONOTONIC, {3470082, 635553931}) = 0 | |
epoll_wait(5, [], 1023, 1017) = 0 | |
epoll_ctl(5, EPOLL_CTL_DEL, 8, 0x7ffd504c4f90) = -1 ENOENT (No such file or directory) | |
epoll_ctl(5, EPOLL_CTL_DEL, 16, 0x7ffd504c4f90) = -1 ENOENT (No such file or directory) | |
epoll_ctl(5, EPOLL_CTL_DEL, 12, 0x7ffd504c4f90) = -1 ENOENT (No such file or directory) | |
epoll_ctl(5, EPOLL_CTL_DEL, 20, 0x7ffd504c4f90) = -1 ENOENT (No such file or directory) | |
epoll_ctl(5, EPOLL_CTL_ADD, 35, {EPOLLIN|EPOLLERR|EPOLLHUP, {u32=35, u64=2191421232157556771}}) = -1 EEXIST (File exists) | |
epoll_ctl(5, EPOLL_CTL_ADD, 28, {EPOLLIN|EPOLLERR|EPOLLHUP, {u32=28, u64=2191421232157556764}}) = -1 EEXIST (File exists) |
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
-- show running queries (pre 9.2) | |
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
FROM pg_stat_activity | |
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- show running queries (9.2) | |
SELECT pid, age(clock_timestamp(), query_start), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
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
pipeline: | |
test_postgres: | |
image: postgres:9.5 | |
commands: | |
- until psql -U dbuser -d dbname -h postgres -c "select 1" > /dev/null 2>&1; do sleep 5; done | |
- psql -U dbuser -d dbname -h postgres -c "SELECT current_date;" | |
test: | |
image: python:3.6.4-slim | |
environment: | |
- DATABASE_DRIVER=postgres |
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
version: '2' | |
services: | |
drone-server: | |
image: drone/drone:1.0.0-rc.5 | |
ports: | |
- 80:80 | |
- 443:443 | |
volumes: |
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
from flask import Flask, request, jsonify | |
import RPi.GPIO as GPIO | |
app = Flask(__name__) | |
BLUE = 12 | |
RED = 13 | |
GREEN = 18 | |
base_response = { | |
'speech':"Abra Ka Dabra,{color} LED glowing", |
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
cmake_minimum_required (VERSION 2.6) | |
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../agent/CMake;${CMAKE_MODULE_PATH}") | |
set(CMAKE_BUILD_TYPE DEBUG) | |
set(CMAKE_FIND_FRAMEWORK NEVER FORCE) | |
set(CMAKE_FIND_APPBUNDLE NEVER) | |
set(GCOV_COMPILE_FLAGS "-fprofile-arcs -ftest-coverage") | |
set(GCOV_LINK_FLAGS "-lgcov") |
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
cmake_minimum_required (VERSION 2.6) | |
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../agent/CMake;${CMAKE_MODULE_PATH}") | |
set(CMAKE_BUILD_TYPE DEBUG) | |
set(CMAKE_FIND_FRAMEWORK NEVER FORCE) | |
set(CMAKE_FIND_APPBUNDLE NEVER) | |
if(WIN32) | |
set(LibXML2_INCLUDE_DIRS ../win32/libxml2-2.9/include ) |