Skip to content

Instantly share code, notes, and snippets.

View irom77's full-sized avatar

Irek Romaniuk irom77

  • Self
  • United States
View GitHub Profile
@shadone
shadone / speedtest_tester.sh
Created February 6, 2016 23:03
Send speedtest.net results to influxdb
#!/bin/bash
INFLUXDB_HOST="localhost"
INFLUXDB_PORT="8086"
DATABASE="home"
[ -f /etc/default/speedtest_tester ] && . /etc/default/speedtest_tester
while [[ $# > 0 ]]; do
key="$1"
@irom77
irom77 / gist:7fe38236b661af8159aa
Created December 11, 2015 15:41 — forked from dberesford/gist:28876b39d26b02b7683a
Sample node.js leak detection using memwatch and heapdump
var http = require('http');
var util = require('util');
var heapdump = require('heapdump');
var memwatch = require('memwatch');
var server = http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
for (var i=0; i<1000; i++) {
server.on('request', function leakyfunc() {
@kotakanbe
kotakanbe / ipcalc.go
Created September 17, 2015 02:59
get all IP address from CIDR in golang
package main
import (
"net"
"os/exec"
"github.com/k0kubun/pp"
)
func Hosts(cidr string) ([]string, error) {
@irom77
irom77 / CiscoKeyGen.py
Last active August 29, 2015 14:24 — forked from paalfe/CiscoKeyGen.py
#! /usr/bin/python
print "\n*********************************************************************"
print "Cisco IOU License Generator - Kal 2011, python port of 2006 C version"
import os
import socket
import hashlib
import struct
# get the host id and host name to calculate the hostkey
hostid=os.popen("hostid").read().strip()
hostname = socket.gethostname()
@papertigers
papertigers / demo.js
Last active February 24, 2016 02:08
restify docker demo
var restify = require('restify');
function respond(req, res, next) {
res.send('hello ' + req.params.name + '\n');
next();
}
var server = restify.createServer();
server.get('/hello/:name', respond);
server.head('/hello/:name', respond);
@sourceperl
sourceperl / th_pinger.py
Last active April 12, 2024 18:56
Python script for do multi-threaded ping
#!/usr/bin/env python
# ping a list of host with threads for increase speed
# use standard linux /bin/ping utility
from threading import Thread
import subprocess
try:
import queue
except ImportError:
import Queue as queue
# This gist is compatible with Ansible 1.x .
# For Ansible 2.x , please check out:
# - https://gist.github.com/dmsimard/cd706de198c85a8255f6
# - https://github.com/n0ts/ansible-human_log
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#