Skip to content

Instantly share code, notes, and snippets.

@ketankr9
Last active August 23, 2018 14:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ketankr9/c198170725df4d2627a21ef7c900a3b9 to your computer and use it in GitHub Desktop.
Save ketankr9/c198170725df4d2627a21ef7c900a3b9 to your computer and use it in GitHub Desktop.
* know your public ip: ~$ `curl ipecho.net/plain; echo`
~$ `curl icanhazip.com`
* get headers only
curl -sI http://167.99.226.14:8000/tshirt.jpg
* split files and download: `https://www.maketecheasier.com/split-download-large-file-curl/`
curl --range 0-100000 -o song.mp3.part1 http://url/song.mp3
curl --range 100001- -o song.mp3.part2 http://url/song.mp3 #till end, remaining
#join file
cat song.mp3.part? > song.mp3
#transfer files over ssh to amazon aws ec2
scp -i /ketankr9privatekey.pem path_to_current.tar.gz ubuntu@ec2-54-213-242-7.us-west-2.compute.amazonaws.com:~/file_dir
#scrap JavaScript driven dynamic webpage
>>> import dryscrape
>>> from bs4 import BeautifulSoup
>>> session = dryscrape.Session()
>>> session.visit(my_url)
>>> response = session.body()
>>> soup = BeautifulSoup(response)
>>> soup.find(id="intro-text")
<p id="intro-text">Yay! Supports javascript</p>
source="http://stackoverflow.com/questions/8049520/web-scraping-javascript-page-with-python"
#get netbios name
>>>nmap -sU -p 137,5353 --script nbstat,dns-service-discovery $targets
*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment