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 / npm-install-all.sh
Created November 7, 2022 07:11 — forked from julienroubieu/npm-install-all.sh
Run npm install in all subdirectories
find . -maxdepth 1 -type d \( ! -name . \) -exec bash -c "cd '{}' && npm install" \;
@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 / pg.sh
Created June 13, 2022 13:34 — forked from jbloetz/pg.sh
strong password generator script
#!/bin/bash
export LC_ALL=C
cat /dev/urandom | tr -cd [:graph:] | head -c ${1:-16}
echo
@rasata
rasata / tig.sh
Created May 24, 2022 07:57 — forked from phillhocking/tig.sh
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 / server.rb
Created May 9, 2022 21:24 — forked from 73696e65/server.rb
Autocomplete Password Stealing PoC (FF & Chrome)
#!/usr/bin/env ruby
require 'rubygems'
require 'thin'
require 'rack'
require 'sinatra'
# python -m SimpleHTTPServer
# ruby ./server
# http://127.0.0.1:4000/?lang='><script>alert()</script>
#!/bin/bash
# Clone all github.com repositories for a specified user.
if [ $# -eq 0 ]
then
echo "Usage: $0 <user_name> "
exit;
fi
@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