Skip to content
Home » Operating System

Operating System

Operating System / OS Information, How-To’s, Tips, Tools, and Guides for a variety of systems

UPGRADE PORTAINER COMMUNITY EDITION ON DOCKER / / RASPBERRY PI

Here is a quick how-to for the way I updated my portainer to the latest

SSH to the Raspberry Pi 5

login

sudo su –
docker stop portainer
docker rm portainer
docker pull portainer/portainer-ce:latest
docker run -d -p 8000:8000 -p 9443:9443 –name=portainer –restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:lates
t

Open a browser, navigate to your Raspberry Pi 5:9443 and then login

Success!

RUNNING OLLAMA ON UBUNTU 24.04 WITH NVIDIA GPU

Here is a quick step by step.

Install Ubuntu 24.04 Desktop. At the time Ubuntu Server 24.04 has issues. So run this on Desktop

Login and open a terminal
sudo su –

apt-get update

apt-get upgrade

nvidia-smi
(this should show you your NVidia GPU. These drivers work well. Keep them)

apt install curl

curl -fsSL https://ollama.com/install.sh | sh

If it errors, run it a second time. It fixes the error.
curl -fsSL https://ollama.com/install.sh | sh

sudo systemctl enable ollama.service

sudo systemctl start ollama.service

ollama pull llama3:8b

ollama run llama3:8b

Open a new terminal
watch -n 0.5 nvidia-smi
You can see the GPU work

Back in the LLama2 terminal
ctrl +c
this will kill the session

Add Docker’s official GPG key by selecting below and pasting it into the terminal:
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc

echo \
“deb [arch=$(dpkg –print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo “$VERSION_CODENAME”) stable” | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update

After the key installs:
apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

docker run -d –network=host -v open-webui:/app/backend/data -e OLLAMA_BASE_URL=http://127.0.0.1:11434 –name open-webui –restart always ghcr.io/open-webui/open-webui:main

sudo docker ps

Now open a browser and go to localhost:8080

Signup and create an account. this will be the administrator

Back in the Terminal, setup other modes:
ollama pull codegemma

ollama pull llama2:70b

ollama pull llama3:70b

ollama pull llama3

ollama pull dolphin-llama3:8b

ollama pull dolphin-llama3:8b-256k

ollama pull dolphin-llama3:70b-256k

ollama pull dolphin-llama3:70b-256k

ollama pull dolphin-llama3:70b

ollama pull llava

Now go and have fun

FLEXING COPILOT – INSTALL PYTHON ON WINDOWS

I have been finding out copilot’s limitations recently and to handle some items, I need to run python, using copilot generated code, so i can parse the data in my sharepoint library. For this article we will look at how to install python.

Open Windows Store

Search for Python

Click Install/Get

Once it is installed you can open a Command Prompt by:
Click Search in your Windows 11 task bar at the bottom of the screen

Type cmd

Then lets try to install some python packages at the C:\ prompt. You can do this by typing
pip install PyPDF2 pandas

If it installs, your python installation is successful

HOW TO SECURE YOUR TOR ONION KEYS

This is a quick guide on how to secure your Tor Onionsite from someone intercepting the keys and hijacking your domain.

Open a terminal and Type

sudo su –

Only hs_ed25519_secret_key is required for TOR to work

Copy other keys to a backup location

Do do this type:
mkdir /backup
mkdir /backup/current-tor-keys
cd /var/lib/tor/hidden_service/
cp -R ./* /backup/current-tor-keys/
rm hs_ed25519_public_key
sudo chown -R debian-tor: /var/lib/tor/hidden_service
sudo chmod -R u+rwX,og-rwx /var/lib/tor/hidden_service

Now use WinSCP and copy the keys off the server to a safe location and delete them from your /backup directory

AUTOMATIC UPDATES FOR UBUNTU 22.04

Setting up automatic updates is critical if you want to maintain a secure environment. Make sure you have automatic backups that occur prior to the updates, so you have a rollback plan.

Here are the commands to set it up.

Open a terminal:
sudo su –
apt install unattended-upgrades
systemctl status unattended-upgrades
apt install update-notifier-common
nano /etc/apt/apt.conf.d/50unattended-upgrades

Now remove the // before each of these lines, and change the values to make them relevant for your system
Unattended-Upgrade::Mail “youremailaddress@yourdomain.com”;
Unattended-Upgrade::MailReport “on-change”;
Unattended-Upgrade::Remove-Unused-Kernel-Packages “true”;
Unattended-Upgrade::Remove-Unused-Kernel-Packages “true”;
Unattended-Upgrade::Remove-Unused-Dependencies “true”;
Unattended-Upgrade::Automatic-Reboot “true”;
Unattended-Upgrade::Automatic-Reboot-WithUsers “true”;
Unattended-Upgrade::Automatic-Reboot-Time “06:00”;
Unattended-Upgrade::OnlyOnACPower “true”;

Save and Exit the file

nano /etc/apt/apt.conf.d/20auto-upgrades

Now replace the contents of the file with the info below:
APT::Periodic::Update-Package-Lists “1”;
APT::Periodic::Unattended-Upgrade “1”;

Save the File and Exit

dpkg-reconfigure -plow unattended-upgrades

Reboot your system instead of running a service restart

That’s it!

CLEAR COMMAND HISTORY IN LINUX

It is common practice to simply type in commands into a terminal and leave the terminal with never clearing the history. The problem is, if someone accesses your system, they can see everything you have done, which can be an issue.

To check your terminal history, Open a Terminal and type:
history

To clear the History, simply type:
history -c

Now you can check your history again by typing:
history

And you can see it is clear. Do this before you log off your computer every time for good measure

INSTALL TOR ON KALI 2024.1

This is a quick guide on how to install tor on the newest version of Kali Linux. By default the version that I am running does not have it.

Open a terminal and Type:
sudo apt-get update
sudo apt install tor -y
sudo apt install torbrowser-launcher -y

Now to run Tor you will need to open a second terminal

In the first terminal type:
tor
Press Enter. This will start the service

In the second terminal, type:
torbrowser-launcher
Press Enter

This will open the Browser

Try navigating to my Onion site to test it out:
longleycr37tvhhrxmbs3buk3ze6vtpyouz3gy6uytdqqfvoiqrf3yyd.onion

HOW TO SETUP A TOR ONIONSITE ON APACHE

Here is a simple how-to guide on setting it up in 2024

First you will want a server that has nothing on it and is not publicly available. I suggest getting a spare PC, or setting it up on a VM.

Make sure the PC/VM is on a standalone VLAN and behind a firewall so no other traffic can get to it. Open NO Ports, setup No NATs, TOR does not need them open to function properly.

First, Install Ubuntu Server 22.04 or Ubuntu Server 24.04

Then ssh into the server

Type:
sudo su –

dpkg –print-architecture

If it is either amd64, arm64 or i386, it will work, if it is not any of those structures, find a different system to run it on.

Type:
apt install apt-transport-https

lsb_release -a

What is your version of linux? It wil be listed as something like
Codename: focal
or
Codename: jammy
or whatever the latest flavor is

Install Apache:
apt-get update

apt install apache2

mv /var/www/html/index.html /var/www/html/index.html.orig

nano /var/www/html/index.html

Type in
Hi, You Found Me!

Save and Exit

Now Type:
cd /etc/apt/sources.list.d/

nano tor.list

paste in this:
deb     [signed-by=/usr/share/keyrings/tor-archive-keyring.gpg] https://deb.torproject.org/torproject.org <DISTRIBUTION> main
deb-src [signed-by=/usr/share/keyrings/tor-archive-keyring.gpg] https://deb.torproject.org/torproject.org <DISTRIBUTION> main

Change <DISTRIBUTION> to focal or jammy or whatever, so it looks like this:
deb [signed-by=/usr/share/keyrings/tor-archive-keyring.gpg] https://deb.torproject.org/torproject.org jammy main
deb-src [signed-by=/usr/share/keyrings/tor-archive-keyring.gpg] https://deb.torproject.org/torproject.org jammy main

Save and Exit

Now type:
wget -qO- https://deb.torproject.org/torproject.org/A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc | gpg –dearmor | tee /usr/share/keyrings/tor-archive-keyring.gpg >/dev/null

apt update

apt install tor deb.torproject.org-keyring

nano /etc/tor/torrc

Uncomment these lines by deleting the #

HiddenServiceDir /var/lib/tor/hidden_service/
HiddenServicePort 80 127.0.0.1:80

Save and Exit

systemctl restart tor

systemctl restart apache2

cat /var/lib/tor/hidden_service/hostname

and your onion site will show like this:
longleycr37tvhhrxmbs3buk3ze6vtpyouz3gy6uytdqqfvoiqrf3yyd.onion

Now you can go to a site like torgateway.com and browse to that onion site to ensure it is live. I would prefer if you actually used your own tor browser instead using a setup like the one I created here for Tor and Tails.

Enjoy the darkweb!

HOW TO ACCESS TOR SAFELY

This is a quick How-To on installing Tails OS to a USB Drive, so you can use TOR on any computer, Anywhere

To start, on your computer:

Download BalenaEtcher and install it

Visit https://tails.net/ to get your copy of Tails, which was created by the makers of TOR

Download Tails, the latest version

Insert a USB into your Computer

Open BalenaEtcher

Click Flash From File

Select Tails

Select Target

Select your USB Drive

Click Flash!

Once it is done being flashed, you can put it in a computer to use

Boot/Reboot the computer

Select your USB Drive on startup

Tails will begin!

Once you are in Tails, to use TOR, click Activities in the Top Left

Select Tor Browser

Connect the circuit to the tor network.

Once connected to Tor you can test it by visiting my website:

Go to https://jaylongley.com and navigate to the Contact Page

Note that UBlock Origin has found trackers on my website. It finds google analytics and whatnot. This is supposed to happen. You will see why in a minute.

There you will see a tor address. Copy that address

Open a new tab in Tor

Place the Onion address that you received from my contact page, and navigate there

You will see my darkweb page appear

Now note UBlock Origin, has NO trackers here. To use Tor and ensure your safety, only work with pages and sites that do not track you!

Happy Surfing