Skip to content

Instantly share code, notes, and snippets.

View pjperez's full-sized avatar
🐙
I may be slow to respond.

Pedro Perez pjperez

🐙
I may be slow to respond.
View GitHub Profile
@pjperez
pjperez / ciphers.sh
Last active February 15, 2023 16:00
#!/usr/bin/env bash
# OpenSSL requires the port number.
SERVER=$1:443
# Delay after each test
DELAY=0
# Ciphers to test
ciphers=$(openssl ciphers 'ALL:eNULL' | sed -e 's/:/ /g')
# Some nice colours :)
#!/usr/bin/python
import sys
from bs4 import BeautifulSoup
import requests
import re
import json
try:
url = sys.argv[1]
string = sys.argv[2]
@pjperez
pjperez / whois.ps1
Created December 5, 2014 14:59
PowerShell Whois Client
Param(
[string]$request
)
$uri = "http://whois.datasnitch.co.uk/$request"
$r = Invoke-WebRequest -Uri $uri
$r.Content
@pjperez
pjperez / RoutePrint.ps1
Last active August 29, 2015 14:22
Print all the effective routing tables in an Azure subscription
<#
.Synopsis
Print all your VMs' effective route tables.
Author: Pedro Perez <pedro.perez@microsoft.com>
.DESCRIPTION
This quick and dirty script will run through your subscription and query the routing table for every VM. The information is printed on screen.
.EXAMPLE
.\RoutePrint.ps1
There are no parameters. You'll be potentially asked to authenticate against Azure with your Azure admin account and to select a subscription if you have more than one.
#>
Write-Output "PowerShell Timer trigger function executed at:$(get-date)";
$uri = "https://bing.com"
$poorsodnumber = "+44........"
if ((Invoke-WebRequest -Uri $uri -UseBasicParsing).StatusCode -eq 200) { write-output "$uri is UP" } else
{
Write-Output "$uri is DOWN. Sending SMS."
# Pull in Twilio account info, previously set as environment variables
$sid = $env:TWILIO_ACCOUNT_SID
@pjperez
pjperez / puncher.go
Last active June 23, 2018 13:14
UDP hole puncher PoC
package main
import (
"fmt"
"net"
"strconv"
"time"
)
//ServerIP defines the IP and port of the other peer
package main
import (
"flag"
"fmt"
"log"
"net"
"os"
"os/exec"
"runtime"