Skip to main content

Blocklist-Update.sh

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

BASH SCRIPTS: HOW TO USE THEM, HOW TO WRITE THEM, A ND HOW TO MAKE THEM EXECUTABLE. WHAT BASH CAN DO AND MORE.

Bash scripts are miniature programs that you can whip up in under 10 minutes, usually in Notepad. In Windows, you can easily access the system’s components underneath the desktop via batch files. This same concept is also alive in Linux. Linux is heavily built around the terminal, however, unlike it’s predecessor, Unix, great strides have been made to make each new distribution, “User-Friendly”. Bash is one of many programming languages which converts human-readable text into machine language, a way to talk to the system. Each key that you press has a reference to either a 1 or 0. Many keys might access both in a pattern. Binary is questionably the backbone behind even the universe itself, but that’s something else entirely. What I wanted to do here today is go over some of Bash’s usefulness and where you can get some setup scripts which will make it easier to learn the syntax and set up your systems while you’re at it. Bash scripts, like any other program, are loaded from the disk into memory, where they are read and processed by the CPU(Brain of computer). The CPU tells the other components to perform the functions requested by the scripts. When you restart the computer, the scripts and all programs are removed from their cache in memory until you use them again.


  1. WRITING THE SCRIPTS.
    Writing the scripts is rather easy, just open a simple text editor and add #! at the top. This is known as the Shbang! It is a symbol which tells the system to use bash to read the input from the user and interpret it in a way that the system can read it. It does this so fast it’s blinding. Sometimes when you run multiple things in a script, the system can’t keep up. In such cases you’d add a pause. A script can be written to perform system maintenance tasks as well as just to accept user input and print a friendly message on the screen. An example would be this, say you wanted to run updates for an ubuntu system, you would type this in a terminal every day by hand, or you would make a script to do it at a certain time every day. Sudo apt-get update && sudo apt-get -y dist-upgrade… That’s a handful, but a script makes it as easy as typing a single command such as this: sudo ./update.sh…

  2. MARK SCRIPTS EXECUTABLE
    To mark scripts executable is as simple as typing chmod +x NameOfScript.sh in terminal. However, you have many options with this command, to change the permissions of a file or folder, chmod can be used to change a permission set from 775 to 777 etc just by typing the number after chmod, but chmod +x will make any script executable, so it’s advisable to only use chmod +x.

  3. LAUNCHING SCRIPTS
    Launching scripts can be done in a terminal like this: ./NameOfScript.sh, or sudo ./NameOfScript.sh if the script changes system settings. Obviously, system admin scripts are more complicated than writing your name into a program and having it print it to the screen.

  4. GRADUATING ON TO OTHER LANGUAGES
    After having graduated in writing bash scripts, you’ll enjoy writing them so much that you will want to learn new programming languages. There are some much more difficult languages out there, from bash, I’d suggest learning python and basic C maybe fiddle with Html/CSS These are easy languages for beginners and they can easily be referenced on the internet. Learning a new language can be really rewarding, just stick with it, some suggest 30 minutes a day. Have fun!

If you’re looking for a place to start, I have prepared many scripts for the maintenance and setup of multiple distributions within the Linux world. Most of these commands and scripts can be replaced inside of Windows for writing Batch files. The link to the scripts below:



With these scripts, you can setup Arch(based)/Ubuntu(based) systems in under an hour. The others are for maintenancing or “tuning up” the distribution quickly so that you can get back to whatever it was that you were doing. There is also a hosts file updating script that tries to replace some basic functionality of the Hostsman program for Windows. It takes sources and pulls them down to your home folder then compiles them together while removing duplicated lines. Sysinfo.sh looks up system information. The “Jameshostslist” is just an extension for the hosts file and the hosts updater assumes it is in your home folder automatically. There may be more coming to these scripts and more soon. These scripts work as is, but I have not tested everything over multiple systems, however, to the best of my knowledge they should work for you. I will be continuing work on them at a later time.

Comments

Popular posts from this blog

NOSCRIPT CONFIGURATION FOR PALE MOON SPECIFICALLY

I wrote an article before about making Pale Moon more private. I covered a few of the settings and back end changes I make each time I install it. I mentioned Noscript, but I didn’t give any details about how I set it up. First though, you have to get the version already marked for your version of “Firefox” or in this case, Pale Moon. If you went to https://addons.palemoon.org/addon/noscript/ you would probably find the Pale Moon addons page devoted to the newest possible Noscript being marked specifically for Pale Moon. Other versions may work, but these are hybrid addons and the closer we get to Noscript 10, the less I trust it to work with Pale Moon specifically. I just opt to stick with 5.0.6. There have been people asking about what happens when Maone, the developer stops supporting the hybrid versions of Noscript, “Will it work with Pale Moon?” Why yes it will. Noscript blocks scripts, that’s its main function and it will do that as long as Java script exists on a page.

SSD PARTITION ALIGNMENT

I was searching for more information regarding SSDs last night as that is what I now use, I found an interesting little tip that most users will never have to worry about, but people using Arch Linux, Manjaro or Windows that was cloned from another drive may want to consider checking this. The Partition manager within Linux normally takes good care to ensure that you have some free space to be used by the SSD in the event that a cell becomes worn out or corrupted. Also, Linux generally ensures that a proper amount of unallocated drive space is set aside preceeding the partition. However, on my own image of Manjaro, I discovered that this was not the case. The partition was “out of alignment”. To fix this situation, I found an article on  Lifehacker that went into instructional detail about how to solve this from a live environment or an image of Gparted . Gparted is a separate live environment of Linux that is based on Debian and uses Gparted as the main tool to manage par

PALE MOON PRIVACY SETUP

I did a review of Pale Moon back when 27.6.2 came out in linux. I had mostly great things to say about the browser then and my feelings towards it have not changed. Pale Moon is a very useful tool for scowering the net. It has privacy at its core with a few implementations made by Moonchild, the lead developer, built in. I also mentioned the point that Pale Moon has a canvas poisoning feature in the backend, however, I wasn’t very clear about how to turn it on. I thought in this tutorial, I’d show with a series of screen shots, some of the useful settings and preferences that I change to make Pale Moon a bit more private. I also thought I’d take this time to rant a little more about some of the not so savory issues with Firefox which have recently come under scrutiny by various people in the the Linux world. First order of business, if you haven’t heard, Mozilla recently added an extension into their browser which gave people ads. That’s right, they were ads for a specific t