Category: Linux

Adding Speed Test and a Dark Theme to Pi-Hole Ad Blocker

Just keeping these notes here for anyone else that might find them useful.

First, install Pi-Hole as per regular.

Then, You’ll want to get the Dark Theme going with pi-hole.

  1. Open a terminal (or SSH if you’re remoting in) ( Ctrl + Alt + T )
  2. Type: cd /var/www/html/
  3. Type: sudo wget https://raw.githubusercontent.com/lkd70/PiHole-Dark/master/install.sh
  4. Type: sudo chmod +x install.sh
  5. Type: sudo ./install.sh
  6. Follow the onscreen instructions!

Then, verify it is working (you might have to clear cache) and that you see the dark theme.

Now you can install the Speed Test Module for Pi-Hole.

sudo apt install python-pip

sudo pip install speedtest-cli

sudo apt install sqlite3

#Configure correct timezone for graph *Need for graph to work correctly

sudo dpkg-reconfigure tzdata

#select your timezone

Find php version 

if it is 5.x

if it is 7.x

Restart Pi

You can try run it using

If Everything is ok, proceed to next step

Get the new set of admin Code from github ( New method  or try old one here)

 

Then do this to test your installation, and then reload the Pi-Hole interface.

You should be good to go! Let me know in the comments if you’re not.

SED lines to remove Bold customer pricing app from Shopify Theme

The Bold Customer Pricing app for Shopify is a little complex to remove.

You can follow the installation instructions in reverse for removal but you’ll probably also need these lines below to quickly find and replace the lines it has modified in your theme.

The other edits can’t really be automated with ease as each theme is different, but, these should remain the same.

If you’re on Mac, you’ll need to do this first in your terminal.

export LC_CTYPE=C 
export LANG=C

Then, go to the directory with your theme downloaded, probably using the themekit if you’re a regular developer, and execute these commands which will find and replace all instances of bold’s code.

find ./ -type f -exec sed -i -e 's/bold_price/product.price/g' {} \;
find ./ -type f -exec sed -i -e 's/bold_price_min/product.price_min/g' {} \;
find ./ -type f -exec sed -i -e 's/bold_price_max/product.price_max/g' {} \;
find ./ -type f -exec sed -i -e 's/bold_price_varies/product.price_varies/g' {} \;
find ./ -type f -exec sed -i -e 's/bold_compare_at_price/product.compare_at_price/g' {} \;
find ./ -type f -exec sed -i -e 's/bold_compare_at_price_min/product.compare_at_price_min/g' {} \;
find ./ -type f -exec sed -i -e 's/bold_compare_at_price_max/product.compare_at_price_max/g' {} \;
find ./ -type f -exec sed -i -e 's/bold_compare_at_price_varies/product.compare_at_price_varies/g' {} \;
find ./ -type f -exec sed -i -e 's/bold_selected_or_first_available_variant/product.selected_or_first_available_variant/g' {} \;
find ./ -type f -exec sed -i -e 's/bold_selected_or_first_available_variant/product.variants.first/g' {} \;
find ./ -type f -exec sed -i -e 's/bold_selected_or_first_available_variant/product.variants[0]/g' {} \;

Then just make sure you’ve done all the changes mentioned in their installation instructions (in reverse!) and you should be good to go.

Hope this helps someone else too!

Compiling R1Soft Backup Agent on Ubuntu 16.x or 14.x

** UPDATE FOR UBUNTU 16.X **

it’s a little different with these versions of ubuntu, you can follow the instructions below, but when it comes time to updating your grub config, do this instead.

# grep menuentry /boot/grub/grub.cfg

Which, will output all the kernels, which now you just have to ‘count’ the entries, so for example

if [ x"${feature_menuentry_id}" = xy ]; then
 menuentry_id_option="--id"
 menuentry_id_option=""
export menuentry_id_option
menuentry 'Ubuntu' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-8e6c4ba1-8970-4c10-8245-ff967b14dad5' {
submenu 'Advanced options for Ubuntu' $menuentry_id_option 'gnulinux-advanced-8e6c4ba1-8970-4c10-8245-ff967b14dad5' {
 menuentry 'Ubuntu, with Linux 4.4.0-62-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.0-62-generic-advanced-8e6c4ba1-8970-4c10-8245-ff967b14dad5' {
 menuentry 'Ubuntu, with Linux 4.4.0-62-generic (upstart)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.0-62-generic-init-upstart-8e6c4ba1-8970-4c10-8245-ff967b14dad5' {
 menuentry 'Ubuntu, with Linux 4.4.0-62-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.0-62-generic-recovery-8e6c4ba1-8970-4c10-8245-ff967b14dad5' {
 menuentry 'Ubuntu, with Linux 4.4.0-59-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.0-59-generic-advanced-8e6c4ba1-8970-4c10-8245-ff967b14dad5' {
 menuentry 'Ubuntu, with Linux 4.4.0-59-generic (upstart)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.0-59-generic-init-upstart-8e6c4ba1-8970-4c10-8245-ff967b14dad5' {
 menuentry 'Ubuntu, with Linux 4.4.0-59-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.0-59-generic-recovery-8e6c4ba1-8970-4c10-8245-ff967b14dad5' {
 menuentry 'Ubuntu, with Linux 3.16.0-69-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.16.0-69-generic-advanced-8e6c4ba1-8970-4c10-8245-ff967b14dad5' {
 menuentry 'Ubuntu, with Linux 3.16.0-69-generic (upstart)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.16.0-69-generic-init-upstart-8e6c4ba1-8970-4c10-8245-ff967b14dad5' {
 menuentry 'Ubuntu, with Linux 3.16.0-69-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.16.0-69-generic-recovery-8e6c4ba1-8970-4c10-8245-ff967b14dad5' {
menuentry 'Memory test (memtest86+)' {
menuentry 'Memory test (memtest86+, serial console 115200)' {

Now, you just need to ‘count’ the entries, so for us we want to ‘downgrade’ to kernel 3.16.0.69-generic, which, starting at 0, makes it be 7, on the advanced menu.

Because we have a sub menu to deal with, we’ll have to execute this command;

# sudo grub-set-default "1>7"

Which is telling it to use the 7th option, on the 1st option (the submenu for advanced). Now you just run update-grub, and reboot.

# sudo update-grub

Old article below:

If, like us, you use R1Soft backups, you may have recently encountered an error trying to get it to compile on your Ubuntu 14.x or 16.x machines.

This is because they are nearly a year out of date on compiling for the latest kernels, the newest one currently supported is actually 3.16, so, the agent will fail on anything newer than that. You can view all the available module versions from the R1soft repository, by clicking here.

Their support is basically useless [unless you pay], so, we had to find our own solution.

This isn’t the most elegant way to fix things, but, it works, so there’s that. [I guess]. Basically, 16.x comes with kernel 4.4, which won’t work, so what did we end up having to do? Downgrade the kernel!  

Well, not literally downgrade, we just used the older, supported kernel that was already installed.

To make this work for you, you’ll have to edit the grub configuration, by doing this.

# cp /etc/default/grub /etc/default/grub.bak

# nano /etc/default/grub

and make these changes

GRUB_DEFAULT=saved 
GRUB_TIMEOUT=2

then exit and save the file.

Now, we’re going to have to find out which kernels you have installed, for us, we simply did the following;

# grep menuentry /boot/grub/grub.cfg

Which, will give you output similar to the following;

menuentry 'Ubuntu, with Linux 4.4.0-31-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.0-31-generic-advanced-64f733aa-c9fe-4aed-b662-8fd6b99d6825' {
menuentry 'Ubuntu, with Linux 4.4.0-31-generic (upstart)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.0-31-generic-init-upstart-64f733aa-c9fe-4aed-b662-8fd6b99d6825' {
menuentry 'Ubuntu, with Linux 4.4.0-31-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.0-31-generic-recovery-64f733aa-c9fe-4aed-b662-8fd6b99d6825' {
menuentry 'Ubuntu, with Linux 3.16.0-77-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.16.0-77-generic-advanced-64f733aa-c9fe-4aed-b662-8fd6b99d6825' {
menuentry 'Ubuntu, with Linux 3.16.0-77-generic (upstart)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.16.0-77-generic-init-upstart-64f733aa-c9fe-4aed-b662-8fd6b99d6825' {
menuentry 'Ubuntu, with Linux 3.16.0-77-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.16.0-77-generic-recovery-64f733aa-c9fe-4aed-b662-8fd6b99d6825' {

In our case, we want to use the 3.16.0.77 version of the kernel, so, we simply issue these commands;

# grub-set-default "gnulinux-advanced-64f733aa-c9fe-4aed-b662-8fd6b99d6825>gnulinux-3.16.0-77-generic-advanced-64f733aa-c9fe-4aed-b662-8fd6b99d6825"
# grub-reboot "gnulinux-advanced-64f733aa-c9fe-4aed-b662-8fd6b99d6825>gnulinux-3.16.0-77-generic-advanced-64f733aa-c9fe-4aed-b662-8fd6b99d6825"
# update-grub

then, you’re ready to reboot into your shiny old kernel

# reboot

now, you can verify that the R1Soft agent is working again, using this;

# hcp -v

Idera Hot Copy 5.14.4 build 433 (http://www.r1soft.com)
Documentation http://wiki.r1soft.com
Forums http://forum.r1soft.com

Thank you for using Hot Copy!
Idera makes the only Continuous Data Protection software for Linux.

hcp driver module: 4.6.1 build: 41

and

# /usr/sbin/r1soft/bin/cdp -v
(R1Soft CDP Agent) version 5.14.4 build 433 2016/07/18 16:41:16

That’s it! you’ve got working backups again!