Good Afternoon

  • Artificial intelligence

    Welcome to this blog that will focus on Artificial Intelligence (AI). There will also be other articles here about things that I find interesting. You will find stuff about configuring things in Ubuntu here as well, I’ll also try and post solutions and articles here on stuff that is currently missing on the Internet right now.

    So what is Artificial Intelligence?

    I have thought much about it, and if you do a Google search you kinda get a repetitive and similar answer on all the sites in the search.

    Artificial intelligence is when machines are designed to think and learn like humans to solve different types of problems.

    Google Search

    So yeah, this is the common definition, but I currently like to illustrate it different when i tell people what Artificial Intelligent is. I try and focus more on the technical aspect, how the current and the state of the art Artificial Intelligence Technology works today.

    Artificial Intelligence are just like a super calculator. You input an question, then you calculate the answer, nothing is saved and restored from a database or a hard drive.

    Oyvind Winter

    What does this mean? When you ask a Large language model like ChatGTP a question, the answer is calculated by the Artificial Intelligence.

    This means that there are no questions and answers saved some place that is presented as the answer. You don’t need a hard disk with gigabytes of questions and answers saved.

    And the solution is very clever, and i wonder why someone haven’t thought of it before?

    We know how mathematics has worked for centuries: 1+1 =2. But why not take this further to texts, questions and answers: What is the capital in America = Washington

    The answer Washington is calculated, and this is only possible by the new technology based on Artificial Intelligence with the help of Natural Language Processing, Deep Learning and Transformer Architecture.

    I’ll will continue on this article later.

  • Swap Memory on Ubuntu Server.

    I’ll have done hundreds of installations of Ubuntu Servers, and the first thing I do after updating and upgrading the system is adding some extra swap memory. This is super important, even if you have plenty of ram on the server. I recommend that you add the same amount of swap space as the physical ram on the server.

    Running out of ram is critical and will result in that services or even the whole server crashing! But in some situations i don’t recommending adding swap at all, like when your running an artificial neural network like Ollama, but ill get back to that in those articles. This example will add 2 GB of swap memory to your new ubuntu server.

    # Create a swap file.
    
    # This solutions works on
    # Ubuntu 20.04, 22.04, 24.04
    
    # Change the 2G (2GB) option
    # to the amount ram you want.
    
    sudo fallocate -l 2G /swapfile
    sudo chmod 600 /swapfile
    sudo mkswap /swapfile
    sudo swapon /swapfile
    
    # Update the disk partition.
    # This is one long line!
    
    sudo echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab

    Copy and past each line to your bash terminal. Each new line begins with sudo.

    Longer lines may be split over several lines. Remember then to copy everything after each sudo as one line to your terminal.

    If you prefer you can download the bash script directly to your server.

    wget https://artificialz.org/1/add_swap.sh
    sudo chmod +x add_swap.sh
    sudo ./add_swap.sh