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

LINUX SPRING CLEANING PT1(SOFTWARE)

Spring is almost upon us again. With spring comes the usual yearly cleaning that just gets so deep that it doesn’t happen any other time of year. The same thing should go for your computer. Over the year we’ve tested new software, saved copious amounts of web cache, stored various amounts of pictures and other files to the hard disk, on our Linux machines, we probably only booted our computers once anyway and so there are countless numbers of kernels and other system packages that maybe haven’t been applied. There is also the developer’s computer that may have all these extra files laying around from where he tried to solve a specific problem in a program and had to try various scenarios to get around it… No? Must be me then. All these things may or may not be needed now and so it’s a good idea to clear those out of the way to make room for new ones. In this, I stress the idea of making occasional home directory backups as well as a few of the commands that I use to clean my system, this is part 1, part 2 will deal more with cleaning inside the case. If you’re squeemish, that one may not be for you.

STEP 1
This step is quite simple.You first need to backup any data you don’t want to risk losing. This includes family photos, beats, personal documents and pretty much anything found in your home folder. To create a backup of your home directory just run the following:

sudo rsync -aAXv –delete –exclude={“/home/*/.cache”,”/home/*/.thumbnails”,”/home/*/.local/share/Trash”} ~/$USER/ path to backup directory

This should back up everything except the cache folder, the thumbnails folder and the trash folder. Pretty straight forward and then you’re done.

STEP 2
When cleaning your system, it’s important to start with the cached data and thumbnails that are not important to the system at all. The .cache folder is usually found in the home directory. This could account for upwards of 1 to 50 gigs depending on when you actually cleaned it out last. To clean this debris, we use the following commands:

sudo rm -r ~/$USER/.cache/*
sudo rm -r ~/$USER/.thumbnails/*

This will clean most of the junk data that we no longer need by itself. This does not clean browser history or cookies, if you want to clean those stay tuned. Next step will take care of the trash folder that is also located in the home directory.

STEP 3
Cleaning trash files is another important step, sometimes we can have trash that’s over a year old because we forget to clean it and the system never says anything, often it goes unnoticed. Often times when we “delete” a file, it gets placed there anyway. Removing this could save you a boatload of space. To clean this we use the following command:

sudo rm -r ~/.local/share/Trash/*

This will clean all relevant data in your home’s trash disposal. This is a great way to free up some potential gigs, but that’s not all, we have a few other steps on the way.

STEP 4
In this step, we try to clean out package cache. This is one of the biggest places to retain data and grow to enormous sizes. This is the cache that stores older versions of software. Most packages get built in the /tmp directory so we will clean there next. In this step we go over possible solutions for both Ubuntu-based and Arch-based distributions. This is dependent upon your current package management solution. To clean this area we use the following commands:

Ubuntu:
sudo apt-get autoremove
sudo apt-get autoclean
sudo apt-get clean


While this next one has multiple options, we will give you and example of each.
Manjaro/Antergos/Arch:
sudo pacman -rvk3
#This removes all but the latest three versions
sudo pacman -Sc
#This removes all but the latest version
sudo pacman -Scc
#This removes all versions

I have scripts that will handle this for you, but it’s important to learn which ones to use and when. For the most part, in Arch you probably only want to leave the latest three versions as this allows you to revert back later, but this isn’t always practical as package cache can take a lot of disk space, so when you are spring cleaning, I recommend using the second option. But this is still up to you.

STEP 5
When you’re cleaning the package cache anyway, it’s also important to clear orphaned packages. These are packages that are no longer connected to any dependencies and are usually no longer needed. These can add up if you’ve never cleaned them before. Ubuntu has a separate application you can install to do this, I will go over that here, Manjaro’s package manager can do that for you if you run a certain command. The easiest way to do this in Ubuntu would be to install gtkorphan which my scripts will include in the install list shortly. To do this in Manjaro and any distribution relying on pamac simply run the following:

sudo pacman -Rs --noconfirm $(pacman -Qqdt)

That is that!

STEP 6
This is the final step on this list, this will scan for broken symlinks and what I call shadow files in the home directory. These files and soft links are almost never needed. To do this run the following commands:

find -xtype l -delete

find $HOME -type f -name "*~" -print -exec rm {} \;

Stay tuned for part 2 of this cleanup tutorial, this concludes part 1.


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