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 <lua.h> | |
#include <lauxlib.h> | |
#define __USE_GNU | |
#include <dlfcn.h> | |
LUALIB_API int luaopen_my_module_core (lua_State *L) | |
{ | |
/* TODO - Windows version, DllMain, then GetModuleFileName */ | |
Dl_info dl_info; | |
dladdr((void *)luaopen_my_module_core, &dl_info); |
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
static ngx_int_t my_http_body_filter(ngx_http_request_t *r, ngx_chain_t *in) | |
{ | |
ngx_int_t rc; | |
ngx_uint_t last; | |
ngx_chain_t *cl; | |
ngx_http_request_t *sr; | |
ngx_str_t uri = SOME_INTERNAL_URI; | |
if (in == NULL || r->header_only ) { | |
return ngx_http_next_body_filter(r, in); |
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
{"type":"Feature","properties":{"name":"PJM"},"geometry":{"type":"Polygon","coordinates": | |
[[ | |
[-80.518598,41.978802], | |
[-80.332382,42.033571], | |
[-79.76278,42.269079], | |
[-79.76278,42.252649], | |
[-79.76278,42.252649], | |
[-79.76278,42.000709], | |
[-75.35932,42.000709], |
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
UInt32 Resource::GetDiskInfoEx(PVoid buffer, UInt32 bufferSize, LPDWORD bytesReturned) | |
{ | |
if (nullptr == buffer) | |
{ | |
LogEvent(LOG_ERROR, L"Resource::GetDiskInfoEx: null buffer error: 0x%x", ERROR_INVALID_PARAMETER); | |
return ERROR_INVALID_PARAMETER; | |
} | |
struct StorageValueList | |
{ |
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 openresty/openresty:alpine | |
COPY nginx.conf /usr/local/openresty/nginx/conf | |
COPY test.lua /usr/local/openresty/nginx/test.lua | |
COPY required.lua /usr/local/openresty/lualib/required.lua |
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
local function read_file(path) | |
local file = io_open(path, "rb") -- r read mode and b binary mode | |
if not file then return nil, "Cannot open file: " .. path end | |
local content = file:read "*a" -- *a or *all reads the whole file | |
file:close() | |
return content | |
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
require('dotenv').config() | |
var jwt = require('jsonwebtoken'); | |
var logger = require('morgan'); | |
let atob = require('atob'); | |
let btoa = require('btoa'); | |
let fs = require('fs-extra'); | |
let mcache = require('memory-cache'); | |
const client = require('node-rest-client').Client | |
let consolidation = {} | |
consolidation.token = "" |
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
worker_processes auto; | |
worker_rlimit_nofile 65535; | |
error_log /certs/error.log debug; | |
events { | |
worker_connections 15000; | |
multi_accept on; | |
use epoll; | |
} |