Skip to content
Home » Ubuntu » Page 2

Ubuntu

Visit Tacticalware.com for information related to this tag and others. We look forward to assisting in your tech projects with our in-depth knowledgebase…

INSTALL COMPOSER 2 ON UBUNTU 20.04

Quick How-To for getting composer 2 to work since composer 1 has been deprecated

Login to a terminal

sudo bash
apt-get update
apt-get upgrade
apt install php-cli unzip
exit
cd ~
curl -sS https://getcomposer.org/installer -o /tmp/composer-setup.php

HASH=`curl -sS https://composer.github.io/installer.sig`

echo hash

php -r “if (hash_file(‘SHA384’, ‘/tmp/composer-setup.php’) === ‘$HASH’) { echo ‘Installer verified’; } else { echo ‘Installer corrupt’; unlink(‘composer-setup.php’); } echo PHP_EOL;”

Installer will be verified

sudo php /tmp/composer-setup.php –install-dir=/usr/local/bin –filename=composer

Composer will download and install

Then Type:
composer

You should see a Composer info screen

UPGRADE MAUTIC ON UBUNTU 20.04

Quick how-to on the way I upgraded mautic, since upgrading through the web breaks my installations every time.

Login into your Virtualmin

Backup all of your virtual servers

Download the backups to your pc

Open Putty

SSH to Server

sudo su –

cd to your mautic directory (/home/user/html)

php bin/console mautic:update:find

php bin/console mautic:update:apply

php bin/console mautic:update:apply –finish

Open your mautic installation, refresh the web page, check the bottom right, and you will see the latest version. In my case it is 4.4.8

HOW TO UPDATE PI-HOLE

Quick How-To for updating pihole on Ubuntu

Open a terminal

Type:
sudo apt-get update
Enter in your password

Type
sudo apt-get dist-upgrade
Enter in your password

Type
pihole -up
Enter in your password

Pihole updates

That is it!

LINUX COMMAND LINE SHOW PUBLIC IP

This is a simple command that you can run on your local linux box, which will show you the public ip of the machine. Very helpful when mining on ethermine

First open a Terminal

Type:
dig +short myip.opendns.com @resolver1.opendns.com

That’s it. Your public IP will now show

INSTALL NVIDIA DRIVERS, CUDA, TENSORFLOW AND ANACONDA ON UBUNTU 20.04

Quick note on how to install the packages. It is in no particular order, these are raw notes my from my temporary build

Install Ubuntu

Open a terminal
sudo bash
apt-get update
apt-get dist-upgrade
nvidia-smi


Pick the version you want to use
apt install nvidia-utils-510
reboot


Open a terminal
sudo bash
nvidia-smi
ubuntu-drivers autoinstall
apt-get install curl


Go to the Anaconda site and download the latest build. For me it was the one below
cd Downloads/
bash Anaconda3-2021.11-Linux-x86_64.sh
source ~/.bashrc
conda info
conda update conda
conda update anaconda
sudo apt install nvidia-cuda-toolkit
reboot


Open a terminal
sudo bash
anaconda-navigator


Open a new notebook
pip install –upgrade tensorflow
Press run


Open a new notebook
import tensorflow as tf
print(tf.version)


Tensorflow will show the version

FIX MONGODB GPG ERROR ON UBUNTU

From time to time you will need to update your Mongo pgp key so you can run normal updates. Below is the procedure

When running
sudo apt-get update

You will receive an error such as this when the pgp keys for Mongo are out of date
W: GPG error: . and so on
E: The repository ‘https://repo.mongodb.org/apt/……..’ is not signed

To fix this run the following:
wget -qO – https://www.mongodb.org/static/pgp/server-5.0.asc | sudo apt-key add –

You will want to change the 5.0 above to the version listed in the error like this:
wget -qO – https://www.mongodb.org/static/pgp/server-4.2.asc | sudo apt-key add –

Press Enter
Mongo will get the new keys

Now you can run
sudo apt-get update
and you will not receive the errors

JUPYTER INSTALLATION ON A HEADLESS RASPBERRY PI 4 RUNNING UBUNTU 20.10

More and More, I am finding my way to Jupyter Notebooks. And guides online are scarce to come by, especially when you are running it on a Raspberry Pi 4. Below is a mixture of a few guides that I had found, and this is what worked for me.

For my setup I am running a Raspberry Pi 4 from a NVME M.2 Drive connected via USB 3.0. I am NOT using the slow micro SD card. To have the same setup as me, follow this guide:
https://tacticalware.com/boot-raspberry-pi-4-from-m-2-usb-drive/

After your Pi recognizes the M.2 NVME Drive, I then use Raspberry Pi Imager to write Ubuntu Server 20.10 to the USB Drive. Then I plug it into the Pi, to get ready for the steps below

Now boot your Raspberry Pi 4 and Login
Then
sudo bash
apt-get update
apt-get dist-upgrade
apt-get install net-tools
sudo hostnamectl set-hostname Jupyter
reboot
sudo bash
sudo rm /usr/bin/python
sudo ln -s /usr/bin/python3 /usr/bin/python
sudo apt-get install python3-pip
sudo pip3 install –upgrade pip
sudo apt-get install npm
sudo npm install -g configurable-http-proxy
sudo -H pip3 install notebook jupyterhub
jupyterhub –generate-config
sudo mv jupyterhub_config.py /root
nano /root/jupyterhub_config.py
ctrl +w
http://:8000

change to http://:8888
uncomment and delete space on this line c.JupyterHub.bind_url = ‘http://:8888’
ctrl +x
y
jupyterhub -f /root/jupyterhub_config.py

nano /lib/systemd/system/jupyterhub.service
[Unit]
Description=JupyterHub Service
After=multi-user.target

[Service]
User=root
ExecStart=/usr/local/bin/jupyterhub –config=/root/jupyterhub_config.py
Restart=on-failure

[Install]
WantedBy=multi-user.target

ctrl + x to exit
y to save

sudo systemctl daemon-reload
sudo systemctl start jupyterhub
sudo systemctl enable jupyterhub
sudo systemctl status jupyterhub.service

on a different computer
open an internet browser
http://Jupyter:8888
login as any user

Back on the Raspberry Pi
sudo -H pip3 install testresources
sudo -H pip3 install jupyterlab
jupyter serverextension enable –py jupyterlab –system
nano /root/jupyterhub_config.py
uncomment and modicy the c.Spawner.default line to reflect the following:
c.Spawner.default_url = ‘/lab’
ctrl + x
to exit
y to save
sudo apt-get install libatlas-base-dev
y
sudo -H pip3 install numpy
pip3 install seaborn
pip install Cython numpy
pip install cmake

sudo addgroup jupyter_admin
sudo adduser tacticalware
sudo usermod -aG jupyter_admin tacticalware
nano /root/jupyterhub_config.py

ctrl +x to exit
y
to save
Add this to the end of the file
c.PAMAuthenticator.admin_groups = {‘jupyter_admin’}
ctrl + x to exit

You are now finished. On the other computer
Open an internet browser
http://Jupyter:8888
And play!

Hardware that I used:
Raspberry Pi 4 (4gb)
https://amzn.to/3q551IO

Plugable USB C to M.2 NVMe Tool-free Enclosure
https://amzn.to/3lflV3L

CanaKit 3.5A Raspberry Pi 4 Power Supply (USB-C)
https://amzn.to/3fNTYPu

CanaKit Raspberry Pi 4 Micro HDMI Cable – 6 Feet
https://amzn.to/33u5hr9

Western Digital 500GB WD_Black SN750 NVMe
https://amzn.to/3nZ5pH4

INSTALL MONGODB ON RASPBERRY PI 4

By far the best guide I have found, in starting this journey, was written by Mark Smith on https://developer.mongodb.com/how-to/mongodb-on-raspberry-pi/

If you want to see why things work the way they do, please visit his guide. My guide below is just the commands, and how I am connecting into the database once it is setup.

To begin, first you will want to install Ubuntu Server 20.10 as described here:
https://tacticalware.com/install-ubuntu-server-20-10-64-bit-on-raspberry-pi-4-using-a-m-2-drive/

Once you are up and running, ssh into the Raspberry Pi
Login

From the terminal run the following:
sudo bash

wget -qO – https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add –

echo “deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse” | tee /etc/apt/sources.list.d/mongodb-org-4.4.list

apt-get update

apt-get install -y mongodb-org

systemctl daemon-reload

systemctl enable mongod

systemctl start mongod

systemctl status mongod

CTRL button +c to exit

mongo
use admin

db.createUser( { user: "admin",
 
        pwd: "SuperSecretPassword",

        roles: [ "userAdminAnyDatabase",

                 "dbAdminAnyDatabase",

                 "readWriteAnyDatabase"] } )

exit

nano /etc/mongod.conf

Add these lines to the end of the file

security:

   authorization: enabled

CTRL +x to Exit
Y to Save

systemctl restart mongod

mongo

db.adminCommand({listDatabases: 1})

Make sure you had no errors

exit

mongo -u “admin” -p

Enter your admin password for mongo, aks your SuperSecretPassword

Type
db.adminCommand({listDatabases: 1})
This will list out your databases and ensure you created it properly

exit

nano /etc/mongod.conf
and Change the bind ip from 127.0.0.1 to 0.0.0.0

net:
   port: 27017
   bindIp: 0.0.0.0

CTRL +x to Exit
Y to Save

systemctl restart mongod

ufw allow 27017/tcp

MongoDB is now successfully setup and running. On to configuring the Windows 10 system

To connect to the MongoDB from a Windows 10 computer

Open an Internet Browser on your Windows 10 computer
Navigate to https://robomongo.org/
Download the Robomongo Robo 3T Client
Once you install it, add these settings to connect to your system
Click Create
Connection Tab
Type – Direct Connection
Address – The IP of your Raspberry Pi
Port 27017
Authentication Tab
Check mark Perform Authentication
Database is admin
User Name is admin
Password is your SuperSecretPassword
Auth is SCRAM
Click Save
Click Connect

You are now connected and ready to run with your MongoDB environment

Hardware that I used:
Raspberry Pi 4 (4gb)
https://amzn.to/3q551IO

CanaKit 3.5A Raspberry Pi 4 Power Supply (USB-C)
https://amzn.to/3fNTYPu

CanaKit Raspberry Pi 4 Micro HDMI Cable – 6 Feet
https://amzn.to/33u5hr9

Western Digital 500GB WD_Black SN750 NVMe
https://amzn.to/3nZ5pH4

Plugable USB C to M.2 NVMe Tool-free Enclosure
https://amzn.to/3lflV3L

UBUNTU 20.04, 1080 TI, ETH MINING IN 2021

This is a quick guide on how to use T-Rex on your Ubuntu 20.04 mining rig to allow your NVidia 1080 Ti cards to mine Ethereum in 2021.

On the rig
Open a Terminal
sudo bash
Enter your password
mkdir /tacticalware
cd /tacticalware

If you have Cuda 10 installed, download the following, otherwise find the one for your Cuda version
wget https://github.com/trexminer/T-Rex/releases/download/0.19.5/t-rex-0.19.5-linux-cuda10.0.tar.gz
Once it is downloaded
tar -zxvf t-rex-0.19.5-linux-cuda10.0.tar.gz
cp ETC-2miners.sh tacticalware-eth.sh
nano tacticalware-eth.sh

Now modify the contents of the file. I suggest replacing the mining site, and wallet address. My file looks like this:
./t-rex -a ethash –coin eth -o stratum+tcp://us1.ethermine.org:4444 -u 0xb6c1807520Fc60e39a29cD02a859c652B2910DB8 -w tacticalware

Note that there is a double dash before –coin and –fork. Sometimes your browser will show them as a double dash, sometimes it shows as a single long dash. they are double dashes

Save the file
Exit
Now you can launch it by running
./tacticalware-eth.sh

It will begin to mine. To monitor it you can do it through a web browser. Simply look for the address when the miner begins

The address will look something like this, and be displayed right when you begin mining
ubuntu t-rex


When you browse to that site you will see something that looks like this:

t-rex
That’t It. You are mining successfully. Thanks for reading

The hardware that I used in this guide:
Gigabyte AORUS GeForce GTX 1080 Ti (QTY 6):
https://amzn.to/2JqvXC8

Motherboard (QTY 1): 
https://amzn.to/2JqGJZ7

CPU (QTY 1): 
https://amzn.to/3qevp2X

Memory (QTY 1): 
https://amzn.to/2JqHn8Z

Hard Drive (QTY 1):  
https://amzn.to/3lic3X5

Risers (QTY 6):  
https://amzn.to/33rIgVE

Power Supplies (QTY 2):
https://amzn.to/3fTRpLR

Add2PSU (QTY 1):
https://amzn.to/39s4URY

Power Switch (QTY 1):  
https://amzn.to/3ljmNVk