Skip to content

Instantly share code, notes, and snippets.

View thesp0nge's full-sized avatar
🏡
Working from home

Paolo Perego thesp0nge

🏡
Working from home
View GitHub Profile

Keybase proof

I hereby claim:

  • I am thesp0nge on github.
  • I am thesp0nge (https://keybase.io/thesp0nge) on keybase.
  • I have a public key whose fingerprint is 4F09 1703 F509 4A4E FAD5 8E62 5B49 6AC6 6ECE B8BB

To claim this, I am signing this object:

@thesp0nge
thesp0nge / snmp_walk.rb
Created May 13, 2014 09:25
Sample to gather stats using SNMP (process list is valid only for Sun Solaris operating System)
#!/usr/bin/ruby
require 'snmp'
require 'ipaddress'
include SNMP
# ARGV[0] is an IP address or a network in CIDR notation
raise "Missing IP address or network" if ARGV[0].nil?
@list = IPAddress.parse(ARGV[0])
@thesp0nge
thesp0nge / securepass_api_ping_example.rb
Last active January 4, 2016 16:29
SecurePass API ping example
require 'net/http'
require 'net/https'
require 'json'
ENDPOINT = "https://beta.secure-pass.net/api/v1/ping"
APP_ID = "your_id"
APP_SECRET = "your_secret"
uri = URI.parse(ENDPOINT)
https = Net::HTTP.new(uri.host,uri.port)
@thesp0nge
thesp0nge / banfa.c
Last active January 4, 2016 02:39
Is a functional bug a security issue?
#include <stdio.h>
#include <stdlib.h>
void do_something_with_it(char *c) {
strncpy(c, "antani", 4095);
return;
}
int main(int argc, char **argv) {
@thesp0nge
thesp0nge / .gitignore
Last active May 12, 2022 16:15
A skelethon for a web crawler for the Codesake suite
*.db
*.swp
@thesp0nge
thesp0nge / scream_and_shout.rb
Created July 11, 2013 09:20
Scream and shout ruby one liner when you can't make too much noise
ruby -e "100.times do print 'A' end; puts 'RGH'" > /dev/null
@thesp0nge
thesp0nge / gist:3691759
Created September 10, 2012 16:03 — forked from emboss/gist:2791400
Simple TLS server with client renegotiation disabled
require 'openssl'
require 'socket'
KEY = OpenSSL::PKey::RSA.new <<-_end_of_pem_
-----BEGIN RSA PRIVATE KEY-----
MIICXgIBAAKBgQDLwsSw1ECnPtT+PkOgHhcGA71nwC2/nL85VBGnRqDxOqjVh7Cx
aKPERYHsk4BPCkE3brtThPWc9kjHEQQ7uf9Y1rbCz0layNqHyywQEVLFmp1cpIt/
Q3geLv8ZD9pihowKJDyMDiN6ArYUmZczvW4976MU3+l54E6lF/JfFEU5hwIDAQAB
AoGBAKSl/MQarye1yOysqX6P8fDFQt68VvtXkNmlSiKOGuzyho0M+UVSFcs6k1L0
maDE25AMZUiGzuWHyaU55d7RXDgeskDMakD1v6ZejYtxJkSXbETOTLDwUWTn618T
@thesp0nge
thesp0nge / github.js
Created August 2, 2012 14:39
My own octopress github.js file with random repository fetch
var github = (function(){
function render(target, repos){
var i = 0, fragment = '', t = $(target)[0];
for(i = 0; i < repos.length; i++) {
fragment += '<li><a href="'+repos[i].html_url+'">'+repos[i].name+'</a><p>'+repos[i].description+'</p></li>';
t.innerHTML = fragment;
}
}
return {
@thesp0nge
thesp0nge / .gitignore
Created June 15, 2012 08:42
This gist is just for demo purpose for a talk I gave at Italian RubyDay in Milan, June 15 2012
*.swp
@thesp0nge
thesp0nge / palco.rb
Created March 26, 2012 15:11
This rspec doesn't help too much in debugging what's going wrong in Palco::Base. There are too few stories with too much matchers contained. Let's use KISS to break it down.
# Public: the base palco skelethon builder.
#
# Ideally it will never called directly but it will be subclassed by
# Palco::Extension and Palco::Application
#
# Examples:
#
# base = Palco::Base.new('a_test', [{:name=>'README', :file=>true}, {:name=>'lib', :file=>false}])
# base.generate