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 / 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]],
@rasata
rasata / jwtRS256.sh
Created July 3, 2021 21:52 — forked from Holger-Will/jwtRS256.sh
generate public private key pair (RSA RS256) for use with koa-jwt jasonwebtoken etc.
# generate private key
openssl genrsa -out private.pem 2048
# extatract public key from it
openssl rsa -in private.pem -pubout > public.pem
@rasata
rasata / finguard.js
Created July 3, 2021 16:20 — forked from ronaldaug/finguard.js
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
@rasata
rasata / GitCommitEmoji.md
Created April 1, 2021 14:00 — forked from parmentf/GitCommitEmoji.md
Git Commit message Emoji
@rasata
rasata / README.md
Created March 14, 2021 21:47 — forked from danielepolencic/README.md
Create 3 nodes Kubernetes cluster locally with Vagrant

3 Virtual Machines Kubernetes cluster

Dependencies

You should install VirtualBox and Vagrant before you start.

Creating the cluster

You should create a Vagrantfile in an empty directory with the following content:

@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 / vagrant-cheat-sheet.md
Created March 12, 2021 12:50 — forked from wpscholar/vagrant-cheat-sheet.md
Vagrant Cheat Sheet

Typing vagrant from the command line will display a list of all available commands.

Be sure that you are in the same directory as the Vagrantfile when running these commands!

Creating a VM

  • vagrant init -- Initialize Vagrant with a Vagrantfile and ./.vagrant directory, using no specified base image. Before you can do vagrant up, you'll need to specify a base image in the Vagrantfile.
  • vagrant init <boxpath> -- Initialize Vagrant with a specific box. To find a box, go to the public Vagrant box catalog. When you find one you like, just replace it's name with boxpath. For example, vagrant init ubuntu/trusty64.

Starting a VM

  • vagrant up -- starts vagrant environment (also provisions only on the FIRST vagrant up)
@rasata
rasata / jq-cheetsheet.md
Created January 18, 2021 01:06 — forked from olih/jq-cheetsheet.md
jq Cheet Sheet

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq

@rasata
rasata / ndupdet.sh
Created November 23, 2020 21:03 — forked from milkersarac/ndupdet.sh
Near duplicate detection and deletion script. This script uses another script findimagedupes.pl
#!/bin/bash
#This script iterates over files in a folder to find near duplicate images.
#Threshold for duplicacy is set to 80%.
#This script calls a perl script 'findimagedupes.pl', it is recommended to run
# the perl script first to see if it is working appropriately.
# $perl findimagedupes.pl image1.jpg image2.jpg
#This script deletes the duplicate files and creates 2 txt files after process.
# So be careful about your first run, take your back up files as needed. No kind of warranty is provided.
#
#author: @milkers 28.08.2013
@rasata
rasata / ftpupload.bat
Created June 4, 2020 18:29 — forked from jamesallman/ftpupload.bat
AS400 ftp multiple file upload DOS batch file example
@echo off
:
set IBMAS400=10.1.0.20
set USERNAME=username
set PASSWORD=password
set DESTLIB=QGPL
set DESTFILE=SYMBOL
set FTPCMD=Inventory.ftp
:
(