This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
def magic_pot(start=1, end=1000): | |
while True: | |
stop = (yield random.randint(start, end)) | |
if stop is True: | |
print("magicpot stopped") | |
break |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:snmp.start() | |
:crypto.start() | |
:snmpm.register_user('v3_default_user', :snmpm_user_default, nil, []) | |
# http://snmpsim.sourceforge.net/public-snmp-simulator.html | |
# snmpget -v 3 -u "usr-md5-aes" -a MD5 -x AES -X "privkey1" -A "authkey1" -l authPriv demo.snmplabs.com 1.3.6.1.2.1.1.1.0 | |
engine_id = "80004fb805636c6f75644dab22cc" |> Base.decode16!(case: :mixed) |> :binary.bin_to_list | |
user_name = 'usr-md5-aes' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:snmpm.start() | |
:snmpm.register_user('v3_default_user', :snmpm_user_default, nil, []) | |
# Public SNMP simulator - http://snmpsim.sourceforge.net/public-snmp-simulator.html | |
engine_id = "80004fb805636c6f75644dab22cc" |> Base.decode16!(case: :mixed) |> :binary.bin_to_list | |
user_name = 'usr-md5-none' | |
password = 'authkey1' | |
auth_key = :snmp.passwd2localized_key(:md5, password, engine_id) | |
ip_address = {104,236,166,95} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib, urllib2, cookielib | |
URL = 'http://dummyurl.com' | |
cj = cookielib.CookieJar() | |
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj)) | |
login_data = urllib.urlencode({ "password":"12345678", "email":"xyz@gmail.com" }) | |
resp = opener.open(URL, login_data) | |
print resp.headers | |
print resp.read() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
require 'redis' | |
require 'securerandom' | |
require 'benchmark' | |
HOST = ENV['HOST'] || 'localhost' | |
PORT = ENV['PORT'] || '60812' | |
DB = 0 | |
LIST_SIZE_PER_PROCESS=300000 | |
NO_OF_PROCESS=5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Intention to dump from live redis. Use rdb-tools to dump from a file. | |
# To know the usage run: >> ruby redis_debug.rb | |
require 'redis' # needs redis gem to work | |
require 'csv' | |
class RedisDebug | |
DEFAULT_OPTS = { redis: {host: 'localhost', port: '6379', db: 0, timeout: 100}, | |
batch_size: 2000, |