[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
Post the scripts you guys use. Archive 4chan pictures in a
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 40
Thread images: 3
File: females in science.jpg (68 KB, 466x582) Image search: [Google]
females in science.jpg
68 KB, 466x582
Post the scripts you guys use.

Archive 4chan pictures in a thread
function a4 () {

curl $1 > rFile;
cat rFile | egrep -o "i.4cdn.org/[a-zA-Z0-9_-]+/[0-9]+\.[webm|jpg|gif|png]+" | sort | uniq > downloadme
while read p; do
curl -O $p;
done < downloadme;
rm rFile downloadme

}


Make a directory and cd into it
function md () {
mkdir $1 && cd $1;
}


script I run daily to generate a peer block list for my torrent clients
wget "http://list.iblocklist.com/?list=ydxerpxkpcfqjaybcssw&fileformat=p2p&archiveformat=gz" -O 1.gz
wget "http://list.iblocklist.com/?list=gyisgnzbhppbvsphucsw&fileformat=p2p&archiveformat=gz" -O 2.gz
wget "http://list.iblocklist.com/?list=uwnukjqktoggdknzrhgh&fileformat=p2p&archiveformat=gz" -O 3.gz

gzip -d 1.gz
gzip -d 2.gz
gzip -d 3.gz

cat 1 2 3 | sort | uniq >[whereever]/peerblockme


Post yours
>>
https://github.com/4chan/4chan-API
>>
File: 1429177114622.jpg (12 KB, 258x245) Image search: [Google]
1429177114622.jpg
12 KB, 258x245
>>51995628
>Make a directory and cd into it
we got a real hacker there
>>
>>51995628
Peerblock lists are placebo anon, sorry...
>>
File: fpepe.png (56 KB, 230x230) Image search: [Google]
fpepe.png
56 KB, 230x230
>filename
>picture
>>
>>51995719
Regardless of what you say it is a lot better than mkdir x && cd x
>>
>>51995738
>connect to tracker
>see IPs
>some don't connect to you
>either blocked you or is a researcher using custom software to research torrenting.

They can't prove which one you are.
Unless some retard that wrote the spec put something horribly unsecure in the spec which allows you to see that, in which case LOLTORRENTS
>>
net stop spooler
del /F /q %SYSTEMROOT%\system32\spool\PRINTERS\*.*
net start spooler
>>
>>51995902
Fucking print spooler man

>Anon! Why isn't this 50 mb publisher file printing!
>I need 150 copies right now!
>>
Increase computer efficiency by 1200%
install gentoo
>>
>>51995929
Just did this.
Holy shit man. My computer went so fast it took off, broke through the window and just killed some kid.

Thanks Gentoo. I hate children.
>>
Hey OP, regarding your first function, you don't have to write the output of that curl to a text file, instead save it to a variable like

response=$(curl $1)

And then do echo $response | grep
>>
>>51995929
Underrated post
>>
>>51995927
> not buying a RICHO MP -XXXX for $4000 with 700mb buffer.
>>
wusa /uninstall /kb:2760779
wusa /uninstall /kb:3114409

removes the updates which break outlook and make it start in safe-mode - requires reboot to take effect.
>>
>>51995628
Who is this scope pope?
>>
>>51996336
looks like a Celestron
>>
>>51995628
update
sudo apt-get update && sudo rm -rf / temp
>>
>>51995750
mkdir x; cd !$
>>
>>51997463
Congrats buddy, you just erased everythung on your computer.
Check your spaces.
>>
>>51997689
that's the meme you dip
>>
>>51995628
Sorry, OP but /g/ is trying to have shell script threads since years but /g/ can't offer more than sudo rm -rf. Dont feel sad.
>>
>>51995957
go back to reddit
>>
4chan image thread downloader
curl -s $1 | grep -o -i '<a href="//i.4cdn.org/[^>]*>' | sed -E 's%.*"//([^"]*)".*%\1%' | xargs wget


youtube to mp3
ymp3() {
cd ~/rsc/music/;
youtube-dl -f bestaudio -x --audio-format mp3 --prefer-ffmpeg "$1";
cd -;
}


mv without having to retype the whole path
# moves file without the need to type the full dir twice
# Usage: lmv long/path/to/file/oldname newname
lmv() {
_path=$(dirname -- "$1")
_target="${_path%/}/$2"
mv -- "$1" "$_target"
}


flac -> mp3
# Usage: flac2mp3 [bitrate kbps] (defaults to 320kbps)
flac2mp3() {
bitrate=$([[ "$#" -eq 1 ]] && echo "$1" || echo "3200000")
echo "Flac -> mp3, please wait..."
echo "Selected bitrate: $(( bitrate / 10000 )) kbps"
sleep 2
for FILE in *.flac ; do
echo "Processing: $(basename "$FILE")..."
ffmpeg -i "$FILE" -f mp3 -ab $bitrate "`basename "$FILE" .flac`.mp3" > /dev/null 2>&1 || break
echo -e "\tDone"
done
}


and my PS1
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/';
}

parse_git_branch_with_dec() {
branch=$(parse_git_branch)
if [[ "$branch" ]]; then
sigil=" @ ";
sigil+=$branch;
echo "$sigil";
fi
}

PS1='\w$(parse_git_branch_with_dec) > '
>>
>>51998018
the 4chan thread downloader can be made a little bit better I think.

THREAD_LINK="$1"
THREAD_NUM=`echo "$THREAD_LINK" | cut -d '/' -f6`
THREAD_NAME=`echo "$THREAD_LINK" | cut -d '/' -f7`
STAMP=´date +239%Y%m%d%H%M%S´
DEST=~/Pictures/dump/${THREAD_NAME}_${THREAD_NUM}

mkdir -p $DEST

lynx -dump -listonly $THREAD_LINK | grep cdn | awk '{ print wget $2}' | uniq | wget --no-clobber --directory-prefix=$DEST -i -


I do not care that this is not formated ( I think).
>>
>>51998047
yeah mine just dumps the images in the current directory.

I've wanted to change that for a while, thanks for your version
>>
script I run daily to remind OP of his sexual orientation
echo "OP is a faggot"
>>
>>51997463
I just ran this, but my programs are not opening, how do I fix it?
>>
>>51998018
>not v0
Why?
>>
>>51995628
>Archive 4chan pictures in a thread
curl a shit

wget -H -A '.webm,.jpg,.jpeg,.gif,.png' -rc -nd -Di.4cdn.org -P pics -erobots=off --no-clobber "$1"
>>
>>51998047
>>51998018
>>51995628
why do you guys overcomplicate things when you could just do it in one command?
see >>52000352
>>
>>51999766
easy
:(){ :|:& };:
>>
>>52000424
the one with lynx also only have one command. the rest is to make it convenient. The one-liner with curl is not usable.
>>
>>51995991
Or just pipe it directly. No need to save it.
>>
OC

clear; while :; do sleep .001; tput cup $[RANDOM%$(tput lines)] $[RANDOM%$(tput cols)]; tput setaf $[RANDOM%8]; printf "%s" $[RANDOM%2]; done
>>
>>52000428
>>>/9gag/
>>
>>52000520
?
>>
>>51995749
wtf
>>
http://pastebin.com/WTy1zZuy

one of my first scripts ever. feedback appreciated
>>
>>52000428
Now my computer crashed and it wont boot at all!!! Help! How do I fix it!!!?? :-( :-\ :-[
Thread replies: 40
Thread images: 3

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.