Skip to content

Instantly share code, notes, and snippets.

@veve90
veve90 / aws-websockets-api-gw-mock.yaml
Created February 12, 2021 10:27 — forked from maatthc/aws-websockets-api-gw-mock.yaml
Basic WebSocket mock in AWS ApiGateway using CloudFormation in AWS
AWSTemplateFormatVersion: '2010-09-09'
Description: |
AWS CloudFormation template for Mock WebSocket API Gateway. When deploying this stack please remember to check the option:
- I acknowledge that AWS CloudFormation might create IAM resources.
This template can help you to solve issues like:
- CloudWatch Logs role ARN must be set in account settings to enable logging
- Execution failed due to configuration error: statusCode should be an integer which defined in request template
- This custom domain name cannot map to WEBSOCKET protocol APIs
- Error during WebSocket handshake: Unexpected response code: 500
@veve90
veve90 / curl-upload-file.sh
Created February 11, 2021 21:36 — forked from henriquemenezes/curl-upload-file.sh
Using CURL to Upload Files
# curl - Raw upload
curl -X PUT -T image.png https://example.com/upload
# curl - Content-Type: multipart/form-data
curl -F name=logo -F file=@image.png https://example.org/upload
# curl - POST presigned URL (S3)
@veve90
veve90 / apigateway-proxy-cloudformation-template.yaml
Created February 10, 2021 19:46 — forked from Pelirrojo/apigateway-proxy-cloudformation-template.yaml
A Cloudformation Script to deploy an API Gateway Proxy
# LICENSE https://creativecommons.org/licenses/by-nc-sa/3.0/
# https://cjohansen.no/aws-apigw-proxy-cloudformation/
AWSTemplateFormatVersion: 2010-09-09
Description: An API that proxies requests to another HTTP endpoint
Resources:
Api:
Type: 'AWS::ApiGateway::RestApi'
Properties:
@veve90
veve90 / postgres10
Last active March 17, 2019 19:57
postgres outils
-- active queries
SELECT datname, pid, state, query, age(clock_timestamp(), query_start) AS age
FROM pg_stat_activity order by age;
-- waiting activities
SELECT * FROM pg_stat_activity WHERE wait_event IS NOT NULL AND backend_type = 'client backend';
-- need vacuum ?
-- https://severalnines.com/blog/why-postgresql-running-slow-tips-tricks-get-source
@veve90
veve90 / docker-compose-drupal-postgres.yml
Created February 1, 2019 19:54 — forked from stevewithington/docker-compose-drupal-postgres.yml
Drupal with Postgres Docker Compose File
version: '2'
# Note: use the database service name `db` in the Host IP Address field ...
# Or, `docker container inspect {postgrescontainerid}` to obtain the IP Address needed for completing the Drupal setup screen.
services:
# Postgres
db:
image: postgres:9.6.5-alpine
restart: always
@veve90
veve90 / README.md
Created February 1, 2019 19:53 — forked from denji/README.md
Simple Sentry docker-compose.yml
  1. Download docker-compose.yml to dir named sentry
  2. Change SENTRY_SECRET_KEY to random 32 char string
  3. Run docker-compose up -d
  4. Run docker-compose exec sentry sentry upgrade to setup database and create admin user
  5. (Optional) Run docker-compose exec sentry pip install sentry-slack if you want slack plugin, it can be done later
  6. Run docker-compose restart sentry
  7. Sentry is now running on public port 9000
@veve90
veve90 / gist:3a963f2b4fcc594b0778783cdb130c15
Created February 1, 2019 19:51 — forked from gblok/gist:ec48dcdea14d1d0f27e843efa80d90fe
Creating postgresql container via docker-compose
create folder
1)
mkdir docker-compose-pg
cd docker-compose-pg
2)
vi docker-compose.yml
insert this text:
"
Temps Cycle cuve; 10;50
Temps Cycle P40; 10;60
Temps Cycle P5; 10;40
@veve90
veve90 / MQTT
Created October 14, 2018 13:13
#Queue
https://www.rabbitmq.com/mqtt.html
#Boket MQTT
Mosquitto MQTT Broker
# Check elements in queue
MQTT Lens (chrome plugin)
@veve90
veve90 / TICK-rasbperryPI
Last active October 14, 2018 16:14
TICK-rasbperryPI
### SOURCES #######################################################################"""
# https://www.influxdata.com/blog/running-the-tick-stack-on-a-raspberry-pi/
# https://makemypi.wordpress.com/2018/02/19/iot-with-influxdb-telegraph-and-grafana-on-the-raspberry-pi-3/
# https://thingsmatic.com/2017/03/02/influxdb-and-grafana-for-sensor-time-series/
# https://github.com/opendata-stuttgart/mqtt-stack/blob/master/howto_setup_tick_stack.md
# https://gist.github.com/fragolinux/c9b0025f831d1c9edcdf049d920d34ad
## https://bentek.fr/influxdb-grafana-raspberry-pi/
## http://ticksurraspberrypi3.blogspot.com/
## https://www.influxdata.com/integration/mqtt-monitoring/
## https://github.com/fg2it/grafana-on-raspberry