Skip to content

Instantly share code, notes, and snippets.

View kapouer's full-sized avatar
💭
finalizing pageboard, next gen website editor

Jérémy Lal kapouer

💭
finalizing pageboard, next gen website editor
View GitHub Profile
@kapouer
kapouer / nftables.conf
Created February 2, 2022 13:22
nftables sample with parity load balancer, multiple servers ip
#!/usr/sbin/nft -f
flush ruleset
table inet filter {
chain input {
type filter hook input priority filter; policy drop;
iif "lo" accept
ct state established,related accept
tcp dport { 22, 44 } ct state new accept comment "ssh on default and inhouse ports"
table inet filter {
chain input {
type filter hook input priority filter; policy drop;
iif "lo" accept
ct state established,related accept
tcp dport { 22, 44 } ct state new accept comment "ssh on default and inhouse ports"
ip daddr 212.83.181.20 tcp dport { 80, 443, 7700-7706 } accept comment "ws4.nsocket.com"
ip6 nexthdr ipv6-icmp icmpv6 type { nd-router-advert, nd-neighbor-solicit, nd-neighbor-advert } accept comment "IPv6 connectivity"
}
const path = require('path');
const readFile = require('fs').promises.readFile;
const serveStatic = require('serve-static');
/* ES Modules path resolution for browsers */
/* uses fields in package.json (exports,module,jsnext:main,main) */
/* mount is the base path, and it needs a whitelist of modules names */
module.exports = async function(mount, whitelist = []) {
const node_path = path.join('.', 'node_modules');
const Path = require('path');
/* fix paths before nodejs-like es6 imports
* 'root' must be served by statics middleware
* 'mount' must be a path prefix to a folder e.g. /modules/
* To allow a node module 'abc' to be served through this,
* place a symlink from node_modules/abc to `${root}${mount}abc`
* (this is not automatic for security reasons)
*/
module.exports = function(root, mount) {
const objection = require('.');
const Model = objection.Model;
const expect = require('expect.js');
const knex = require('knex')({
connection: {
user: 'objection',
host: 'localhost',
database: 'objection_test'
},
client: 'postgres'
var objection = require('objection');
var ref = objection.ref;
var Model = objection.Model;
var QueryBuilder = objection.QueryBuilder;
var UpdateOperation = require(
require('path').join(
require.resolve('objection'),
'..',
'queryBuilder/operations/UpdateOperation'
#!/bin/sh
cd ../public
poFiles=../lang/*.po
destDir=langs
for poFile in ${poFiles}; do
lang=`basename -s .po ${poFile}`
rm -rf "${destDir}/${lang}"
Trace: EventTargetImpl { _eventListeners: { load: [ [Object] ] } }
at invokeInlineListeners (/home/dev/Software/github/node-webkitgtk/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:165:35)
at EventTargetImpl._dispatch (/home/dev/Software/github/node-webkitgtk/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:126:7)
at EventTargetImpl.dispatchEvent (/home/dev/Software/github/node-webkitgtk/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:91:17)
at Window.dispatchEvent (/home/dev/Software/github/node-webkitgtk/node_modules/jsdom/lib/jsdom/living/generated/EventTarget.js:71:35)
at Window.process.nextTick (/home/dev/Software/github/node-webkitgtk/node_modules/jsdom/lib/jsdom/browser/Window.js:433:14)
at _combinedTickCallback (internal/process/next_tick.js:67:7)
at process._tickCallback (internal/process/next_tick.js:98:9)
@kapouer
kapouer / withdebug.log
Created May 12, 2016 23:44
socket.io asan + debug log
2016-05-12_23:43:18.05670 ==18712==ERROR: AddressSanitizer: heap-use-after-free on address 0x60e00003b300 at pc 0x7fac70240e61 bp 0x7fff31f2fe40 sp 0x7fff31f2fe38
2016-05-12_23:43:18.05671 READ of size 8 at 0x60e00003b300 thread T0 (ws-production-0)
2016-05-12_23:43:18.08523 #0 0x7fac70240e60 in uWS::Socket::close(bool, unsigned short, char*, unsigned long) ../src/uWS.cpp:1142
2016-05-12_23:43:18.08527 #1 0x7fac70240b41 in uWS::Socket::close(bool, unsigned short, char*, unsigned long)::{lambda(uv_timer_s*)#3}::operator()(uv_timer_s*) const (/home/eda/src/uWebSockets/nodejs/dist/uws_linux_46.node+0x25b41)
2016-05-12_23:43:18.08528 #2 0x7fac70240b62 in uWS::Socket::close(bool, unsigned short, char*, unsigned long)::{lambda(uv_timer_s*)#3}::_FUN(uv_timer_s*) (/home/eda/src/uWebSockets/nodejs/dist/uws_linux_46.node+0x25b62)
2016-05-12_23:43:18.08529 #3 0x7fac85249617 (/usr/lib/x86_64-linux-gnu/libuv.so.1+0x16617)
2016-05-12_23:43:18.08584 #4 0x7fac8523da99 in uv_run (/usr/lib/x86_64-linux-gnu
@kapouer
kapouer / asan.log
Created May 12, 2016 20:56
Running a socket.io with uws
2016-05-12_20:54:15.00577 ==13742==ERROR: AddressSanitizer: heap-use-after-free on address 0x60e0000815a0 at pc 0x7f9e9eede790 bp 0x7ffe008f49c0 sp 0x7ffe008f49b8
2016-05-12_20:54:15.00577 READ of size 8 at 0x60e0000815a0 thread T0 (ws-production-0)
2016-05-12_20:54:15.03000 #0 0x7f9e9eede78f in uWS::Socket::close(bool, unsigned short, char*, unsigned long) (/home/eda/src/uWebSockets/nodejs/dist/uws_linux_46.node+0xa78f)
2016-05-12_20:54:15.03002 #1 0x7f9e9eedec76 (/home/eda/src/uWebSockets/nodejs/dist/uws_linux_46.node+0xac76)
2016-05-12_20:54:15.03003 #2 0x7f9eafbf3617 (/usr/lib/x86_64-linux-gnu/libuv.so.1+0x16617)
2016-05-12_20:54:15.03064 #3 0x7f9eafbe7a99 in uv_run (/usr/lib/x86_64-linux-gnu/libuv.so.1+0xaa99)
2016-05-12_20:54:15.03066 #4 0xaeb7df in node::Start(int, char**) (/usr/bin/nodejs+0xaeb7df)
2016-05-12_20:54:15.03067 #5 0x7f9eabe1060f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2060f)
2016-05-12_20:54:15.03068 #6 0x6459a8 in _start (/usr/bin/nodejs+0x64