Created
February 20, 2012 20:14
-
-
Save sourcerebels/1871137 to your computer and use it in GitHub Desktop.
Download all Phrack Magazine Issues
This file contains hidden or 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
| #!/bin/sh | |
| for i in {1..67} | |
| do | |
| FILE="phrack${i}.tar.gz" | |
| wget http://phrack.org/archives/tgz/${FILE} | |
| tar xvzf ${FILE} | |
| rm ${FILE} | |
| done |
for i in 'seq 1 69` worked for me
That sequence expression is Bash-specific, so you should rather use "#!/bin/bash" as the shebang.
Or alternatively, you could use this as well:
#!/bin/bash
i=1; while wget -O- http://phrack.org/archives/tgz/phrack$((i++)).tar.gz | tar zvx; do :; done
Also, there have been two new releases since then. Check them out!
I updated it to get the latest issue number and check if directory exists before making it.
#!/bin/bash
LATEST=$(lynx --source http://phrack.org/archives/tgz/|grep -oP '(?<=phrack)[0-9]{2}'|sort -n|tail -1)
for (( i=1; i<=LATEST; i++ ))
do
FILE="phrack${i}.tar.gz"
wget http://phrack.org/archives/tgz/${FILE}
if [ ! -d phrack${i} ]; then
mkdir -p phrack${i};
fi
tar xvzf ${FILE} -C ./phrack${i}/
rm ${FILE}
done
No need to remember issue numbers at all:
wget -r -nH --no-parent --reject="index.html*" -e robots=off http://www.phrack.org/archives/tgz/
I slightly modified @shekkbuilder script to concatenate the issues into single txt files and then convert those into PDF files. Nice if you have something like a reader tablet and you want to read them on it like what I am doing.
(P.S I am using libreoffice since I already had it installed but I believe there are countless other utilities for conversion out there)
#!/bin/bash
LATEST=$(lynx --source http://phrack.org/archives/tgz/|grep -oP '(?<=phrack)[0-9]{2}'|sort -n|tail -1)
for (( i=1; i<=LATEST; i++ ))
do
FILE="phrack${i}.tar.gz"
wget http://phrack.org/archives/tgz/${FILE}
if [ ! -d phrack${i} ]; then
mkdir -p phrack${i};
fi
tar xvzf ${FILE} -C ./phrack${i}/
rm ${FILE}
done
for (( i=1; i<=LATEST; i++ ))
do
cat ./phrack${i}/*.txt >> ./phrack${i}/phrack${i}.txt
libreoffice --convert-to "pdf" ./phrack${i}/phrack${i}.txt
done
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Simple but helpful script.. thanks man