Skip to content

Instantly share code, notes, and snippets.

View maurodelazeri's full-sized avatar
🎯
Focusing

Mauro Delazeri maurodelazeri

🎯
Focusing
View GitHub Profile
@maurodelazeri
maurodelazeri / reconnect-web3.js
Last active January 28, 2022 01:02
auto reconnect
var Web3 = require("web3");
const newProvider = () => new Web3.providers.WebsocketProvider('XXXXXXXXXXXXXXXX', {
reconnect: {
auto: true,
delay: 5000, // ms
maxAttempts: 5,
onTimeout: false,
},
})
#include <iostream>
#include <unordered_map>
#include <random>
#include <functional>
#include <iterator>
#include <sstream>
using namespace std;
enum entryType {
@maurodelazeri
maurodelazeri / CMakeLists.txt
Created January 21, 2020 16:00 — forked from physacco/CMakeLists.txt
MsgPack sample programs.
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.2)
PROJECT(msgpack_test)
SET(CMAKE_CXX_FLAGS_DEBUG "-g -std=c++11")
SET(EXECUTABLES test_vector test_stream test_class test_array test_map1 test_map2)
FOREACH(EXE ${EXECUTABLES})
ADD_EXECUTABLE(${EXE} "${EXE}.cpp")
TARGET_LINK_LIBRARIES(${EXE} msgpack)
Date,AAPL.Open,AAPL.High,AAPL.Low,AAPL.Close,AAPL.Volume
16:00:00,8661.14000,8685.48000,8650.21000,8664.49250,609.038360340
16:15:00,8662.81625,8666.63000,8641.93000,8653.16000,415.746520650
16:30:00,8657.98812,8657.98812,8640.54000,8649.29000,239.205368250
16:45:00,8653.63906,8663.43000,8645.65000,8653.73000,125.377533840
17:00:00,8653.68453,8663.16000,8647.94000,8655.19000,123.945221250
17:15:00,8654.43727,8658.07000,8631.59000,8643.87750,193.778230140
17:30:00,8649.15738,8649.15738,8633.66000,8640.44500,232.577297820
17:45:00,8644.80119,8650.00000,8630.65000,8639.50000,142.673794470
#!/bin/bash
RECIPIENT="mauro.delazeri@isprime.com";
DAYS=7;
apache2ctl -S | grep "port 443 namevhost" | awk '{print $4}' | while read line;do
TARGET=$line;
echo "checking if $TARGET expires in less than $DAYS days";
expirationdate=$(date -d "$(: | openssl s_client -connect $TARGET:443 -servername $TARGET 2>/dev/null \
| openssl x509 -text \
```
/etc/security/limits.conf
* soft nofile 1000000
* hard nofile 1000000
root soft nofile 1000000
root hard nofile 1000000
```
```
@maurodelazeri
maurodelazeri / errors.grpc_conf
Created March 13, 2019 19:54 — forked from nginx-gists/errors.grpc_conf
Deploying NGINX Plus as an API Gateway, Part 3: Publishing gRPC Services
# Standard HTTP-to-gRPC status code mappings
# Ref: https://github.com/grpc/grpc/blob/master/doc/http-grpc-status-mapping.md
#
error_page 400 = @grpc_internal;
error_page 401 = @grpc_unauthenticated;
error_page 403 = @grpc_permission_denied;
error_page 404 = @grpc_unimplemented;
error_page 429 = @grpc_unavailable;
error_page 502 = @grpc_unavailable;
error_page 503 = @grpc_unavailable;
# Ansible managed
global
# Remote syslog servers
log 10.0.102.102:514 local0
#log-send-hostname
daemon
chroot /var/lib/haproxy
group haproxy
maxconn 40000
@maurodelazeri
maurodelazeri / haproxy.cfg
Created February 26, 2019 00:10 — forked from wiredmax/haproxy.cfg
Sample HA-Proxy configuration for load balancing SockJS running on Node.JS servers.
global
maxconn 10000 # Total Max Connections. This is dependent on ulimit
nbproc 2
defaults
mode http
option redispatch
maxconn 2000
contimeout 5000
clitimeout 50000
echo "Stopping firewall and allowing everyone..."
iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
iptables -t mangle -F
iptables -t mangle -X
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT