Skip to content

Instantly share code, notes, and snippets.

@lmangani
lmangani / max_pps.sh
Last active August 29, 2016 21:59
BASH Script measuring PPS by BFP filter
#!/bin/bash
# USAGE: max_pps.sh eth0 'portrange 5060-5090' 2>&1 | tee -a output.log
if [ -z "$1" ]
then
echo "No capture interface supplied!"
fi
if [ -z "$2" ]
then
echo "No FILTER supplied!"
fi
@lmangani
lmangani / carina_client.env
Created August 12, 2016 20:41
Carina Docker (Client Fix)
export DOCKER_API_VERSION=1.22
#!/bin/bash
files=(./config/*)
while true; do
nodejs hepgen.js -c "${files[RANDOM % ${#files[@]}]}"
sleep 2
done
@lmangani
lmangani / elassandra.md
Last active January 14, 2018 16:16
Elassandra Example

Elassandra Cheat-Sheet

This guide requires Elassandra 5.5.0.9

Elassandra Example:

Try indexing a document on a non-existing index:

curl -XPUT 'http://localhost:9200/twitter/doc/1?pretty' -H 'Content-Type: application/json' -d '
{
@lmangani
lmangani / killhogs.sh
Last active January 22, 2018 00:39
Kill CPU hogs from CRON - a poor man's Monit
#!/bin/bash
# tries to kill process with highest CPU load
# (if it is part of a specified list of troublemakers)
MAXLOAD=5
TROUBLEMAKERS="chrome"
sleep 1 # wait a few seconds (just as a precaution)
@lmangani
lmangani / jitsi_analytics.js
Created January 27, 2019 11:43
JITSI Analytics Example
/* global ga */
(function(ctx) {
/**
*
*/
function Analytics(options) {
/* eslint-disable */
if (!options.googleAnalyticsTrackingId) {
@lmangani
lmangani / index.html
Created November 30, 2019 13:14
GunRTC One-to-One
<html>
<head>
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="css/style.css">
<script src="https://cdn.jsdelivr.net/npm/gun/gun.js"></script>
<script src="https://cdn.jsdelivr.net/npm/gun/lib/unset.js"></script>
<style>
video {
background-color: #ddd;
border-radius: 7px;
# Configuration for telegraf agent
[agent]
## Default data collection interval for all inputs
interval = "10s"
## Rounds collection interval to 'interval'
## ie, if interval="10s" then always collect on :00, :10, :20, etc.
round_interval = true
## Telegraf will send metrics to outputs in batches of at most
## metric_batch_size metrics.
@lmangani
lmangani / hyperswitch.js
Created December 30, 2020 17:02 — forked from maxymania/hyperswitch.js
NodeJS Hyperswarm utility.
/*
Copyright (C) 2019 Simon Schmidt
Usage of the works is permitted provided that this instrument is retained with
the works, so that any entity that uses the works is notified of this instrument.
DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY.
*/
const hyperswarm = require('hyperswarm');
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.