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
$PlivoCredentials = Import-CliXml -Path plivo.key | |
$PlivoJson = @{'src' = '<source>'; 'dst' = '<destination"'; 'text' = '<text'} | ConvertTo-Json | |
$PlivoUri = "https://api.plivo.com/v1/Account/<Key>/Message/" | |
Invoke-WebRequest -Method Post | |
-Uri $PlivoUri | |
-Body $PlivoJson | |
-Credential $PlivoCredentials | |
-ContentType "application/json" |
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
#1/usr/bin/python | |
from subprocess import call, check_output | |
import re | |
import cStringIO | |
regex = '\s*(\d*)\s(.*)' | |
ip = check_output('/bin/netstat -ntu | awk \'{print $5}\' | cut -d: -f1 | sort | uniq -c | sort -n', shell = True) | |
time = str(check_output('date')) |
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 requests | |
requests.packages.urllib3.disable_warnings() # To disable ugly warnings | |
url = 'http://bit.ly/1vIaXHA' | |
def show_redirects(url): # Recursive Function | |
r = requests.get(url, verify = False, allow_redirects = False) | |
if r.status_code == 301: # If url redirects, print the destination url and follow it. | |
print 'redirecting to ', r.headers['location'], '...' | |
show_redirects(r.headers['location']) | |
show_redirects(url) |