Skip to content

Instantly share code, notes, and snippets.

@hamzamu
hamzamu / curl.md
Created June 14, 2020 09:35 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@hamzamu
hamzamu / imap-search
Created June 13, 2020 13:11 — forked from martinrusev/imap-search
IMAP Search criteria
@hamzamu
hamzamu / examples.md
Created April 26, 2020 11:09 — forked from ErisDS/examples.md
Ghost Filter Query examples

Filter Queries - Example Use Cases

Here are a few example use cases, these use cases combine filter with other parameters to make useful API queries. The syntax for any of this may change between now, implementation, and release - they're meant as illustrative examples :)

Fetch 3 posts with tags which match 'photo' or 'video' and aren't the post with id 5.

api.posts.browse({filter: "tags:[photo, video] + id:-5", limit="3"});

GET /api/posts?filter=tags%3A%5Bphoto%2Cvideo%5D%2Bid%3A-5&limit=3

@hamzamu
hamzamu / addvhost.sh
Created April 22, 2020 22:37 — forked from runbrun/addvhost.sh
bash script to create nginx virtual hosts
#!/usr/bin/env bash
#
# Nginx - new server block
# http://rosehosting.com
read -p "Enter username : " username
read -p "Enter domain name : " domain
# Functions
ok() { echo -e '\e[32m'$domain'\e[m'; } # Green
die() { echo -e '\e[1;31m'$domain'\e[m'; exit 1; }
@hamzamu
hamzamu / client.js
Created April 20, 2020 18:56
Meteor- browser console stats snippet
getStats = function () {
Meteor.call('getStats', null, (err, data) => {
if (data) {
App.setSetting({
stats: data
})
}
})
return "Getting Statistics"
}
@hamzamu
hamzamu / stream_to_youtube.sh
Created March 23, 2020 11:14 — forked from olasd/stream_to_youtube.sh
Stream video to youtube via ffmpeg
#! /bin/bash
#
# Diffusion youtube avec ffmpeg
# Configurer youtube avec une résolution 720p. La vidéo n'est pas scalée.
VBR="2500k" # Bitrate de la vidéo en sortie
FPS="30" # FPS de la vidéo en sortie
QUAL="medium" # Preset de qualité FFMPEG
YOUTUBE_URL="rtmp://a.rtmp.youtube.com/live2" # URL de base RTMP youtube
@hamzamu
hamzamu / .block
Created March 19, 2020 11:18 — forked from mbostock/.block
Swiss Cantons
license: gpl-3.0
@hamzamu
hamzamu / countryblock.sh
Created March 18, 2020 08:44 — forked from mombrea/countryblock.sh
Block a list of IP ranges using IPSet and IPTables
#!/bin/bash
#Script to process ip ranges to ban using IPSet and IPTables
ipset create countryblock hash:net
while read line; do ipset add countryblock $line; done < blocklist.txt
iptables -I INPUT -m set --match-set countryblock src -j DROP
@hamzamu
hamzamu / server.sh
Created March 16, 2020 18:08
Meteor deployment script
#!/bin/bash
#============================
#
#
# Meteor Deployment Script
#
# Require Installtion of pm2
#
#============================
Project_name=
@hamzamu
hamzamu / map.swiss.js
Created March 16, 2020 14:55
Map D3 JSON
// http://bl.ocks.org/herrstucki/4327678
var width = 960,
height = 500;
var path = d3.geo.path()
.projection(null);
var svg = d3.select("body").append("svg")
.attr("width", width)
.attr("height", height);
d3.json("/swiss/ch.json", function (error, ch) {