Skip to content

Instantly share code, notes, and snippets.

View irom77's full-sized avatar

Irek Romaniuk irom77

  • Self
  • United States
View GitHub Profile
# to be able to import ldap run pip install python-ldap
import ldap
if __name__ == "__main__":
ldap_server="x.x.x.x"
username = "someuser"
password= "somepassword"
# the following is the user_dn format provided by the ldap server
user_dn = "uid="+username+",ou=someou,dc=somedc,dc=local"
@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()
@irom77
irom77 / static_server.js
Last active August 29, 2015 14:27 — forked from ryanflorence/static_server.js
Node.JS static file web server. Put it in your path to fire up servers in any directory, takes an optional port argument.
var http = require("http"),
url = require("url"),
path = require("path"),
fs = require("fs")
port = process.argv[2] || 8888;
http.createServer(function(request, response) {
var uri = url.parse(request.url).pathname
, filename = path.join(process.cwd(), uri);
@irom77
irom77 / redis-install.sh
Last active August 27, 2015 11:53 — forked from skyrocknroll/redis-install.sh
redis installation fedora redhat centos yum ami amazon
#!/bin/bash
# From here: http://www.codingsteps.com/install-redis-2-6-on-amazon-ec2-linux-ami-or-centos/
# Based on: https://github.com/saxenap/install-redis-amazon-linux-centos
# Thanks to https://raw.github.com/gist/2776679/b4f5f5ff85bddfa9e07664de4e8ccf0e115e7b83/install-redis.sh
# Uses redis-server init script from https://raw.github.com/saxenap/install-redis-amazon-linux-centos/master/redis-server
###############################################
# To use:
## wget https://raw.github.com/jorgerc/install-redis-amazon-linux-centos/master/redis-install-script.sh
## chmod 777 redis-install-script.sh
## ./redis-install-script.sh
@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() {
@irom77
irom77 / speedtest_tester.sh
Created March 27, 2016 22:10 — forked from shadone/speedtest_tester.sh
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 / TCP Check
Created December 8, 2016 00:42 — forked from ekoecho/TCP Check
package main
import (
"log"
"net"
)
func main() {
var status string
conn, err := net.Dial("tcp", "127.0.0.1:80")
@irom77
irom77 / ubuntu-lxc-server
Created July 25, 2017 15:10
Geth/ubuntu-lxc-server/v1.6.7-stable-ab5646c5/linux-amd64/go1.8.1
0xff5bb228c07deecffe6f895fa3980aae23c80cae
@irom77
irom77 / ubuntu-lxc-server
Created July 25, 2017 15:12
Geth/ubuntu-lxc-server/v1.6.7-stable-ab5646c5/linux-amd64/go1.8.1
0xff5bb228c07deecffe6f895fa3980aae23c80cae
@irom77
irom77 / th_pinger.py
Last active December 1, 2020 16:47 — forked from sourceperl/th_pinger.py
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
import Queue
import re
# some global vars