Skip to content

Instantly share code, notes, and snippets.

@jonbakerfish
jonbakerfish / loop_aria2.sh
Last active August 14, 2024 20:08
aria2 downloads a list of files, loop until all file are finished
#!/bin/bash
aria2c -j5 -i list.txt -c --save-session out.txt
has_error=`wc -l < out.txt`
while [ $has_error -gt 0 ]
do
echo "still has $has_error errors, rerun aria2 to download ..."
aria2c -j5 -i list.txt -c --save-session out.txt
has_error=`wc -l < out.txt`
sleep 10
@dmitrinesterenko
dmitrinesterenko / osx_terminal_logger.sh
Created November 9, 2014 03:24
Log everything you do in osx terminal
#!/bin/bash
# logger.sh
# Log everything you do in Terminal.
#* Formatted date & time string.
FORMATTED_DATE=`/bin/date "+%Y-%m-%d%H%M%S"`
#* Archive the previous file
/bin/cp -f ~/Terminal.log ~/Terminal.log{,.&#36;FORMATTED_DATE.txt}