Skip to content

Instantly share code, notes, and snippets.

View silvioq's full-sized avatar

Silvio silvioq

  • Argentina
  • 00:48 (UTC -03:00)
View GitHub Profile
#!/usr/local/bin/ruby
## This shows how to use the Server and Client classes together, without using Server to create a separate proxy server.
require 'rubygems'
require 'rami'
include Rami
def print_results(t)
if t.size > 0
t.each do |array|
$host = "localhost";
$port = 5038;
$user = "admin";
$secret = "mysecret";
$EOL = "\015\012";
$BLANK = $EOL x 2;
$queue = param('queue');
$remote = IO::Socket::INET->new(
Proto => 'tcp', # protocol
@silvioq
silvioq / m10gen
Last active December 12, 2015 03:08
#!/usr/bin/env perl
use strict;
use warnings;
sub process($);
sub usage(){
print "./m10gen pattern\n";
print " Where pattern is a number or 'X'.\n";
print " The script replaces each 'X' in the pattern for a digit and prints valid M10 numbers";
#!/usr/bin/perl
use SOAP::Lite +trace;
use Digest::SHA1 qw(sha1_hex);
use Digest::MD5 'md5_hex';
use Data::Dumper qw(Dumper);
use strict;
use warnings;
use MIME::Base64;
use JSON;
use Crypt::OpenSSL::RSA;
use Data::Dumper;
# openssl pkcs12 -in google-privatekey.p12 -nodes -out temp.pem
my $keystring = <<EOPK
Bag Attributes
friendlyName: privatekey
localKeyID: 54 69 6D 65 20 31 33 36 37 30 37 31 31 31 32 31 36 34
# vim: set cin sw=2:
use strict;
use Crypt::OpenSSL::RSA;
use Data::Dumper;
use LWP::UserAgent;
use XML::LibXML;
use HTTP::Request;
use FindBin;
package GoogleSpreadSheet;
use strict;
use warnings;
sub generarPerm($$$){
my $elem = shift;
my $actual = shift;
my $cant = shift;
my @ret = ();
my $used = {};
my $retGen = 0;
@silvioq
silvioq / lsprocs.c
Created December 22, 2013 23:52
This program reads /proc dir and returns process id and command The program emulates the console command ps -A -o pid,cmd To compile type gcc -c lsprocs.c && gcc lsprocs.o -o lsprocs
/*
This program reads /proc dir and returns process id and command
*/
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <dirent.h>
#include <string.h>
#!/usr/bin/env perl
# Requeriments
# MIME::Base64
# Authen::SASL
# Net::SIP
# MIME::Lite
# Net::SMTP
use strict;
use warnings;
use Net::SIP;