Skip to content

Instantly share code, notes, and snippets.

View rasata's full-sized avatar
😉

Zo-Hasina Rasatavohary rasata

😉
  • Zonova
  • France
View GitHub Profile
@rasata
rasata / curl_post_json.md
Created December 6, 2022 15:03 — forked from ungoldman/curl_post_json.md
post a JSON file with curl

How do you POST a JSON file with curl??

You can post a json file with curl like so:

curl -X POST -H "Content-Type: application/json" -d @FILENAME DESTINATION

so for example:

@rasata
rasata / approle.sh
Created June 13, 2022 19:33 — forked from greenbrian/approle.sh
Vault CLI testing AppRole
#!/bin/bash
# start vault
VAULT_UI=true vault server -dev -dev-root-token-id=root -dev-listen-address=127.0.0.1:8200
# login as root - DO NOT DO THIS IN PRODUCTION
vault login root
# write some secrets
vault kv put secret/test color=blue number=eleventeen
@rasata
rasata / datadog_test.sh
Created March 3, 2022 18:26 — forked from skibum55/datadog_test.sh
datadog metric POST test
#!/bin/sh
# Make sure you replace the API and/or APP key below
# with the ones for your account
# from http://docs.datadoghq.com/api/?lang=console
currenttime=$(date +%s)
curl -X POST -H "Content-type: application/json" \
-d "{ \"series\" :
[{\"metric\":\"test.metric\",
\"points\":[[$currenttime, 20]],
@phillhocking
phillhocking / tig.sh
Last active May 24, 2022 07:57
Instantiate TIG stack on Ubuntu 20.04
sudo apt update ; sudo apt install -y build-essential net-tools curl git software-properties-common
wget https://dl.influxdata.com/telegraf/releases/telegraf_1.19.1-1_amd64.deb
sudo dpkg -i telegraf_1.19.1-1_amd64.deb
sudo systemctl enable --now telegraf
wget https://dl.influxdata.com/influxdb/releases/influxdb_1.8.6_amd64.deb
sudo dpkg -i influxdb_1.8.6_amd64.deb
sudo systemctl enable --now influxdb
influx -execute 'create database telegraf'
influx -execute "create user telegraf with password 'ExAmPl3PA55W0rD'"
influx -execute 'grant all on telegraf to telegraf'
@rasata
rasata / nginx-tuning.md
Created March 12, 2021 23:48 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

Moved to git repository: https://github.com/denji/nginx-tuning

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

@rasata
rasata / Caddyfile
Created February 2, 2020 20:24 — forked from abiosoft/Caddyfile
Caddy wordpress docker-compose
:80
root /usr/src/wordpress
gzip
fastcgi / wordpress:9000 php
rewrite {
if {path} not_match ^\/wp-admin
to {path} {path}/ /index.php?_url={uri}
}
log stdout
errors stderr
@rasata
rasata / installing-node-with-nvm.md
Created June 19, 2019 21:38 — forked from d2s/installing-node-with-nvm.md
Installing Node.js to Linux & macOS & WSL with nvm
@rasata
rasata / Dockerfile-es
Created August 14, 2018 10:15 — forked from wshayes/Dockerfile-es
Elasticsearch and Kibana using docker-compose (v3)
FROM docker.elastic.co/elasticsearch/elasticsearch:5.5.1
RUN \
mv /usr/share/elasticsearch/plugins/x-pack /usr/share/elasticsearch/plugins/.removing-x-pack && \
mv /usr/share/elasticsearch/plugins/.removing-x-pack /usr/share/elasticsearch/plugins/x-pack && \
/usr/share/elasticsearch/bin/elasticsearch-plugin remove x-pack
@ronaldaug
ronaldaug / finguard.js
Last active September 23, 2022 09:03
Generate unique ID for each browser or client. JS
/* ----------------------------------------
// call finguard() in your app // output will be something like this --> "0821orak0821539ds999.6933.0.76"
---------------------------------------- */
function finguard(){function r(r,e){return(e+9845+window.screen.width+r+window.screen.width).split("").reverse().join("")}var e={};(o=(a=navigator.userAgent.toLowerCase()).match(/msie ([\d.]+)/))?e.ie=o[1]:(o=a.match(/firefox\/([\d.]+)/))?e.firefox=o[1]:(o=a.match(/chrome\/([\d.]+)/))?e.chrome=o[1]:(o=a.match(/opera.([\d.]+)/))?e.opera=o[1]:(o=a.match(/version\/([\d.]+).*safari/))&&(e.safari=o[1]);var a,o;e={};return(o=(a=navigator.userAgent.toLowerCase()).match(/msie ([\d.]+)/))?e.ie=o[1]:(o=a.match(/firefox\/([\d.]+)/))?e.firefox=o[1]:(o=a.match(/chrome\/([\d.]+)/))?e.chrome=o[1]:(o=a.match(/opera.([\d.]+)/))?e.opera=o[1]:(o=a.match(/version\/([\d.]+).*safari/))&&(e.safari=o[1]),e.ie?r("itne",e.ie):e.firefox?r("fyfo",e.firefox):e.chrome?r("karo",e.chrome):e.opera?r("orpr",e.opera):e.safari?r("sfri",e.safari):"zefo4