Skip to main content

Posts

Showing posts from July 29, 2018

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 TUTORIAL #4: IF STATEMENTS

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

BASH SCRIPTING TUTORIAL #3: USER INPUT

User prompting can be done in at least a couple of different ways in bash. User prompting is useful when you are drafting a project or an important scripting job for someone else to use to successfully complete a task. When collecting user input, the input is placed in a variable(see last article) and then the value of the variable is implied when the variable is called later in the script. Multiple variables can be specified in the read line, this will allow for more than one answer to the script’s question. Some examples of situations where this would be useful would be when your client needs to sort and review large text files or spreadsheets by the information in the files. Linux has commands for sifting through and sorting data, but to appy it in a script, the script has to know what files to look through and what to do with said information. Another useful example is when creating a simple bash cli game to pass time at work when you should really be doing something bu

SNAP PACKAGES IN LINUX

When installing a snap package in Linux, Ubuntu users have snapd, a snap daemon, already installed into their system. This means that as of 18.04.x you can now install snap packages as sudo snap packagename. Snaps make it easy to install a package with all of its current and up-to-date dependencies. Snaps run in containerised sandboxes so security is a priority and malware packages can’t actively change the system without user approval. Previously, a Linux user was tortured by broken packages or unmet dependencies. This is quickly becoming a thing of the past. With so much support for the new package management system, users of all distros and desktop environments can take part in having the latest and greatest software at their disposal. Even Windows is getting interested in this marvel of the modern age of computing. Manjaro and Arch users may not yet automatically have snapd installed, to ensure that it is installed on your system using pacman, type sudo pacman -S

BASH SCRIPTING TUTORIAL #2: DECLARING VARIABLES

When writing scripts, it is often important to use and declare variables. Declaring variables is super easy. There are multiple ways to declare them, but they each work the same way. One way that I often employ is to prompt users for their input, place said input in a variable, and then use the variable to tell the script what the user wants. By this method, I am using the variable as a wrapper for something else. Variables are great for projects in coding where you really don’t know what the output of the variable will be, but you know what you want the variable to do. Other commands can be used as value for variables and declaring a word or a number as a variable and giving it value allows the echo command to print that value to the screen when typing echo $variable. A good example of declaring and calling a variable would be opening a terminal and typing var1=$(cat filename | grep “RandomPattern”) then typing echo $var1. Typing echo with the variable name will result in

NEW CCLEANER PACKS FEATURES TO COLLECT DATA AND CONTINUOUSLY MONITOR COMPUTER IN BACKGROUND; REDUCES PRIVACY SETTINGS

I spoke last year about a Ccleaner vulnerability that allowed a backdoor into a user’s system. By the time all the news had been fully broken, a new version had been released to patch any inconvenient holes in the software, further reassuring user security. That alone gave Ccleaner a bad image, however, it didn’t stop there. Version 5.45 appears to also be causing concern for its users by way of data collection with no clear opt-out. What’s more, in the past you were able to shut off monitoring, however it seems that that is no longer applicable. I also mentioned some alternatives that I often use, These included Bleachbit and Glary Utilities. I have tried others, but I recommend these. Ccleaner was acquired by Avast back as of version 5.33. Avast used to be my antivirus vendor of choice, yet as of late, my favor for them has waned. Avast Antivirus now includes similar data collection and while you can turn it off, it seems morally questionable at best. Piriform and Avast should

WRITING SUCCESSFUL BASH SCRIPTS TUTORIAL #1 :INTRO

When performing command line tasks or (CLI) jobs in Linux, it can become tedious when there is a lot to do, for instance, working as an administrator for a small/medium/large company. Automation is very helpful when parsing large files or running multiple commands at once more than one time a day. Scripts are basically text documents that run a series of commands in succession of one another. Think of it as writing for a play. Scripts use the #! sign at the top, this is known as a shabang. The shabang alerts Bash that the following text document is a script and should be ran as a succession of lines as such. The environment comes after the shabang like so: #!/bin/env/ replacing env with the environment the script is to be read from. Most Bash ran scripts have the environment of shell. Python and Ruby use their own environments respectively. Bash and Shell are not the same things. Bash or Bourne Again Shell handles lots of commands very differently to regular shell. Sh