Blocklist-Update.sh is a script that I wrote to manage blocklists from bluetack etc to be used in conjunction with Transmission torrent downloader in Linux/MacOS. The script can be taylored to work with Qbittorrent as well, but the placement of the blocklists means you'd have to redirect the blocklist to go somewhere locally manageable as Transmission uses its own blocklist directory in .config. I believe there are about 10 lists there now. It works well for my needs. It can be ran weekly using crontab in standard user profile. To download: blocklist-update.sh To download the others: Github
If statements are a low level form of conditional statements like
case and or while which add on to either really well and allow the
user or programmer to set up a project which can take user input and
or true/false statements and provide a service until something is no
longer valid or until all options have been established. If
statements are a simple way to decide between two options and
automatically pick the best option for the end-user. This makes
coding much easier and takes fewer lines than case statements. For
loops often utilise these statements as well. If statements are
closer to the fourth or fifth thing you will have to practice with
in a programming class and they are super easy to learn and
understand. If statements are renown because they can be used in
almost every language in some form or another. An example of an if
statement that tests a true/false scenario would be:
if [[ $? -eq 0 ]];
then
do something
else
do something else
fi
As you can see, the if statement begins in if and ends in fi. Case
statements begin in case and end in esac, however, case statements are a bit
more complex to set up and learn though so these will be covered at a
later time. If statements can become pretty complex in their own
right. Just look at this example:
echo “Enter your favorite color”
read color
if [[ $color == blue ]];
then
echo “Your favorite color is blue”
elif [[ $color == Red ]];
then
echo “What, are you a vampire?”
elif [[ $color == Yellow ]];
then
echo “That color looks like pee”
else
echo “You have entered an unknown color, please try again”
fi
This example demonstrates acceptance of user input as well as testing
different input until a strong conclusion has been reached or someone
got something wrong. Kind of like a programmable rock paper scissors
game, if statements can be easy but oh so beneficial. These are just
a couple of the many ways that if statements can be useful. In the
next tutorial I’m going to go over While loops.
Comments
Post a Comment