Skip to content

Instantly share code, notes, and snippets.

View lucamauri's full-sized avatar

Luca Mauri lucamauri

View GitHub Profile
@lucamauri
lucamauri / Query WHOIS
Created December 22, 2013 22:17
Query WHOIS databases for data on domain names
Public Class clsWhoIs
Public Enum registry
whois_arin_net = 0
whois_ripe_net = 1
whois_apnic_net = 2
End Enum
Function test(ByVal ipAddress As String, ByVal queryTo As registry) As String
Dim tcpc As New TcpClient()
Dim strDomain As String
Dim arrDomain As Byte()
@lucamauri
lucamauri / Text file manipulator
Created December 22, 2013 22:07
A collection of three simple class that allow you to read files from disk and from internet and write a stream back to a file. It is a simple task for a programmer, but it may comes in hand from time to time to have it ready-to-use.
Imports System.IO
Imports System.Text
Imports System.Net
Module modText
Function textFromInternet(ByVal address As String) As StringBuilder
Dim Request As WebRequest
Dim Response As WebResponse
Dim Reader As StreamReader
Dim Line As String
@lucamauri
lucamauri / Images from website
Created December 22, 2013 22:04
Check and download images from website
Imports System.Net
Imports System.IO
Module modImages
Function getimages() As Boolean
Dim prefixFull As String = "http://www.yoursite.com/images/"
Dim prefixShort As String = "http://www.yoursite.com"
Dim basePath As String = "c:\your path here"
Dim imgClient As WebClient
@lucamauri
lucamauri / MD4 Visual Basic .net
Created December 22, 2013 22:03
This class calculate MD4 checksum
'Copyright (c) 2000 Oren Novotny (osn@po.cwru.edu)
'Permission is granted to use this code for anything.
'Derived from the RSA Data Security, Inc. MD4 Message-Digest Algorithm.
'http://www.rsasecurity.com">RSA Data Security, Inc.</a> requires
'attribution for any work that is derived from the MD4 Message-Digest
'Algorithm; for details see <a href="http://www.roxen.com/rfc/rfc1320.html">
'RFC 1320</a>.
'This code is ported from Norbert Hranitzky's
'(norbert.hranitzky@mchp.siemens.de)
@lucamauri
lucamauri / CIN Calculator
Created December 22, 2013 21:56
This module compute the bank account checksum known as CIN
Module modCIN
Friend Const CINLetters As String = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-. "
Friend Const CINDigits As String = "0123456789"
Friend Const Divisor As Integer = 26
Friend CINEvenList As Integer() = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28}
Friend CINOddList As Integer() = {1, 0, 5, 7, 9, 13, 15, 17, 19, 21, 2, 4, 18, 20, 11, 3, 6, 8, 12, 14, 16, 10, 22, 25, 24, 23, 27, 28, 26}
Function CalcCIN(ByVal ABI As String, ByVal CAB As String, ByVal Account As String) As String
@lucamauri
lucamauri / WOL.net
Created December 22, 2013 21:49
A complete class implementing Wake On LAN feature in native .NET
Imports System.Net
Imports System.Net.Sockets
Imports System.Text
Public Class clsWOL
Const lenHeader As Integer = 6
Const lenMAC As Integer = 6
Const repMAC As Integer = 16
Dim mEndPoint As IPEndPoint