Analytics request

The analytics will make Airikr Blog better. If you accept the analytics request, the following data will be stored about you:

  • The device's IP address
  • Browser's user agent
  • What pages you visit
  • A timestamp when you agreed to the analytics
  • A timestamp for each page you've visited

Read more on how the website uses your data.

My backup/restore and install bash scripts

_
Cover

After I finally installed Linux Mint 20.2 Cinnamon and used my install.sh script, I fine-tuned the script to my needs since I'd missed to add a lot. Shortly after, I started to write a backup bash script. I have written such bash script for my Linux setup before, but they were not good. I thought I backup the files to Backblaze B2 Cloud Storage, but it felt more natural to just backup the files to my external HDD.

Instead of having my bash scripts on a git page like Codeberg, I have them on my personal wiki which is a self-hosted BookStack. And since version 20.2 of Linux Mint Cinnamon have WebApps, I have added Airikr Wiki to my taskbar. Perfect!

Since I am a total newbie to bash, my scripts might look very amateurish. But I am a learner and might improve my scripts along the way.

I love how simple it is to pass a command to to the bash script by running backtore.sh backup to run the backup process and backtore.sh restore to run the restore.

install.sh

#!/bin/bash

echo 'alias update="sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get autoclean -y && sudo apt-get autoremove -y && sudo apt-get clean"
alias listapps="sudo apt list --installed"
alias myip="curl https://airikr.me/myip?json"
alias run_yt="firefox http://localhost:8080 && cd ~/Downloads/youtube-local/ && pip3 install -r requirements.txt && python3 ~/Downloads/youtube-local/server.py"
alias stop_yt="fuser -k 8080/tcp"
alias smdfb="exiftool -all= /media/$USER/My\ Book/MEGA/Images/Religion/* && exiftool -delete_original /media/$USER/My\ Book/MEGA/Images/Religion/*"' >> ~/.bash_aliases

source ~/.bash_aliases

sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get autoclean -y && sudo apt-get autoremove -y && sudo apt-get clean

sudo apt install -y software-properties-common apt-transport-https wget

wget -O composer-setup.php https://getcomposer.org/installer
wget https://mullvad.net/download/app/deb/latest -O ~/Downloads/mullvad.deb
wget -O - https://deb.beekeeperstudio.io/beekeeper.key | sudo apt-key add -
wget -qO - https://packagecloud.io/AtomEditor/atom/gpgkey | sudo apt-key add -
wget -O - https://raw.githubusercontent.com/laurent22/joplin/dev/Joplin_install_and_update.sh | bash

sudo add-apt-repository -y ppa:git-core/ppa
sudo add-apt-repository -y ppa:papirus/papirus
sudo add-apt-repository -y ppa:agornostal/ulauncher
sudo add-apt-repository -y ppa:atareao/telegram

echo "deb https://deb.beekeeperstudio.io stable main" | sudo tee /etc/apt/sources.list.d/beekeeper-studio-app.list
sudo sh -c 'echo "deb [arch=amd64] https://packagecloud.io/AtomEditor/atom/any/ any main" > /etc/apt/sources.list.d/atom.list'

sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get autoclean -y && sudo apt-get autoremove -y && sudo apt-get clean

if [ $(which flatpak) ]
then
    flatpak install flathub org.gramps_project.Gramps
else
    sudo add-apt-repository ppa:alexlarsson/flatpak
    sudo apt update
    sudo apt install flatpak
    flatpak install flathub org.gramps_project.Gramps
fi

sudo apt install -y papirus-icon-theme openssh-server firefox pwgen digikam ulauncher git qbittorrent filezilla python3-pip libimage-exiftool-perl imagemagick ffmpeg beekeeper-studio atom unzip telegram
sudo dpkg -i ~/Downloads/mullvad.deb

sudo rm ~/Downloads/mullvad.deb

sudo apt install -y apache2 phpmyadmin mysql-server
sudo apt install -y php php-mbstring php-zip php-gd php-json php-curl php-fpm php-bcmath php-imagick php-cli
sudo phpenmod mbstring
sudo phpenmod bcmath
sudo a2enmod rewrite
sudo mysql_secure_installation

echo
echo
echo "1. CREATE USER 'user'@'localhost' IDENTIFIED BY 'password';"
echo "2. GRANT ALL PRIVILEGES ON *.* TO 'user'@'localhost';"
echo "3. FLUSH PRIVILEGES;"
echo "4. ALTER USER  'root'@'localhost' IDENTIFIED BY 'password';"
echo "5. FLUSH PRIVILEGES;"
echo "6. quit"
echo
echo

sudo mysql
sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer
sudo systemctl restart apache2

sudo ufw allow ssh

sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get autoclean -y && sudo apt-get autoremove -y && sudo apt-get clean

echo
echo
echo "Manual installations:"
echo "- SmartGit (https://www.syntevo.com/smartgit/download/)"
echo "- kDrive (https://login.infomaniak.com/en/login)"
echo
echo "Final touch regarding mod_rewrite:"
echo "1. sudo nano /etc/apache2/apache2.conf"
echo "2. Change AllowOverride None to AllowOverride All for <Directory /var/www/>"
echo "3. sudo systemctl restart apache2"
echo
echo "Enabling backdrop-filter in Firefox:"
echo "1. Go to about:config"
echo "2. Set layout.css.backdrop-filter.enabled to true"
echo "3. Set gfx.webrender.all to true"
echo
echo

backtore.sh (backup or restore)

#!/bin/bash

bold=$(tput bold)
normal=$(tput sgr0)
dir="/media/$USER/My Book/linux-backups"
mysql_password="password"

if [ ! -z $1 ] && [ $1 == 'backup' ]
then
        rsync_='rsync -aP --delete'

        [ ! -d "$dir"/home ] && sudo mkdir "$dir"/home/
        [ ! -d "$dir"/home/$USER ] && sudo mkdir "$dir"/home/$USER
        [ ! -d "$dir"/home/$USER/.atom ] && sudo mkdir "$dir"/home/$USER/.atom
        [ ! -d "$dir"/home/$USER/.config ] && sudo mkdir "$dir"/home/$USER/.config
        [ ! -d "$dir"/home/$USER/.gramps ] && sudo mkdir "$dir"/home/$USER/.gramps
        [ ! -d "$dir"/home/$USER/.mozilla ] && sudo mkdir "$dir"/home/$USER/.mozilla
        [ ! -d "$dir"/home/$USER/.mozilla/firefox ] && sudo mkdir "$dir"/home/$USER/.mozilla/firefox

        $rsync_ ~/Documents/FreeFileSync/ "$dir"/home/$USER/Documents/FreeFileSync
        $rsync_ ~/Documents/bash/ "$dir"/home/$USER/Documents/bash
        $rsync_ ~/Downloads/youtube-local/ "$dir"/home/$USER/Downloads/youtube-local
        $rsync_ ~/.atom/ "$dir"/home/$USER/.atom
        $rsync_ ~/.config/ "$dir"/home/$USER/.config
        $rsync_ ~/.gramps/ "$dir"/home/$USER/.gramps
        $rsync_ ~/.mozilla/firefox/ "$dir"/home/$USER/.mozilla/firefox
        $rsync_ /var/www/ "$dir"/var/www

    notify-send Backup "The backup was successful."

elif [ ! -z $1 ] && [ $1 == 'restore' ]
then
        rsync_='rsync -aP'

        sudo chmod -R 777 /var/www

        $rsync_ "$dir"/home/$USER/Documents/bash/ ~/Documents/bash
        $rsync_ "$dir"/home/$USER/Documents/FreeFileSync/ ~/Documents/FreeFileSync
        $rsync_ "$dir"/home/$USER/Downloads/youtube-local/ ~/Downloads/youtube-local
        $rsync_ "$dir"/home/$USER/Pictures/ ~/Pictures
        $rsync_ "$dir"/home/$USER/.atom/ ~/.atom
        $rsync_ "$dir"/home/$USER/.config/ ~/.config
        $rsync_ "$dir"/home/$USER/.gramps/ ~/.gramps
        $rsync_ "$dir"/home/$USER/.mozilla/firefox/ ~/.mozilla/firefox
        $rsync_ "$dir"/var/www/ /var/www

        sudo rm /var/www/html/index.html

        notify-send Restore "The restore was successful."

else
        echo -e "\e[31mYou can only choose ${bold}backup${normal} \e[31mor ${bold}restore${normal} \e[31mas commands."
fi

Starting afresh

_
Cover

I decided to do a fresh re-installation of Linux earlier today and was thinking about switching distribution. I have used Linux Mint Cinnamon since maybe 2018, so I wanted to try something else. I searched for the best light-weighted Linux distributions out there and found a distribution that I tried many years ago: Xubuntu.

My journey to a different Linux distribution turned out to be quite bumpy. After making my flash drive bootable with Xubuntu 20.04 LTS, I restarted the desktop and ran the installation. It went smoothly and when I finally got into the desktop environment, I headed to my own wiki page.

After copying the content of install.sh and pasted it in a new file with the same filename via the terminal, I run it and waited for it to be done.It turned out that it skipped a lot since none of the softwares I included got installed + some other things. I went through everything again, step-by-step, and that worked.

I opened Software & Drivers to see what graphic drivers I had to choose from. But to my surpise, all the options were disabled besides of the last one (the active one). I didn't think that much about it at the time.

I finished the installations and configurations and restarted the computer. When I came back to the desktop environment, the resolution was set to 640x480. "What in the world...", I thought to myself, and opened Display from settings. 640x480 was the only option! Restarted the computer again, nothing changed. Searched for a solution, found sudo apt install nvidia-460 so I ran that command and restarted the computer.

The issue persisted so I gave up and was going to restart the computer in order to boot to Windows 10. But, I couldn't. Nothing happened when I clicked on the whisker menu and no keyboard shortcuts worked. What the actual fuck?! I did the forbidden: a hard shutdown. I'm sorry, computer.

The end of the nightmare... sort of

After downloading the same ISO file but in Windows this time, and made the flash drive bootable again via Rufus, I restarted the computer and let it boot from the flash drive. The installation looked different. Fewer options compared to before.

After the installation, I went to my wiki page again and copied and pasted the content in install.sh, and ran the bash script. Huh. It actually installed everything this time. I went to Software & Drivers again and waited for the additional drivers to load. I was able to choose desire drivers! Woho!

Restarted the computer and hoped for the best. Everything loaded just fine. Yay! But! I can't change the top bar of every window, even if I choose a different theme (also downloaded ones). The top bar didn't change its appearance, more than making it light or dark depending on what theme I chose.

A screenshot showing the top bar in a window of a software in Linux.

Super annoying!

(You can open the screenshot into a new tab by right-clicking or long-pressing it and choose "Open image in New Tab".)

But that's not all! Having autism, I can annoy me even for a small thing like having Firefox and Atom in the wrong order in the taskbar when they are open. And I can't do shit about it, even if I first open Firefox and then Atom! Atom always come before Firefox! Gah!!

Switched back to Linux Mint Cinnamon

I liked Xubuntu at first, but after a while, I didn't liked it at all. I got tired of the issues and the thought about being forced to configure more than I had to. For an example, I didn't like the file manager (Thunar). So I ended up installing Linux Mint Cinnamon again.

Have now "perfected" the system to my liking and also improved my install.sh script. I also created a backup.sh which will backup my configurations and databases once in a while through crontab. The backup script will backup my files to Backblaze B2 CLoud Storage.

The biggest update yet

_
Cover

I have been working on a big update for my blog for maybe 2 whole months now (with some lazy days with no coding), and I am finally all done! This update gives the blog a worthy design for this type of websites and a lot of tweaks.

The update contains over 10 new features and a lot of fixed bugs and improvements. It is so much done in this update, that Firefox 90.0 for Linux almost crashed when I went to the changelog page on Codeberg So I had to start SmartGit in order to see the changelog.

Here's the complete changelog:

  • Added a new design with the touch of a real blog.
  • Added new method to load the posts on the home page. This reduces the page load a lot.
  • Added preparations for the edit feature. When this is done, whenever I edit a post, you can see what I've edited like in git (what I have added and what I have removed).
  • Added the possibility for visitors to send suggestions of a blog post (see example). You can find this feature below a blog post when you're reading it.
  • Added the possibility to randomly go to a blog post. You can find this link in the menu.
  • Added a page that shows all comments for all blog posts. You can find this link in the menu. This page is not yet ready for smaller screens, like smartphones.
  • Added a confirmation pop-up window when you click on "Send my comment" in the comment form.
  • Added JSON support for the RSS feed.
  • Added automatic detection of what theme you have on your system (dark or light). This feature is entirely based on JavaScript, so if you have JavaScript disabled, this feature will not work.
  • Added a transition when you switch themes.
  • Added a new system of how tags will be linked to a blog post. Before, tags was added to a single column in the database. Now, the tags are added to 2 tables: tags and tags_linked. tags handles the names and what language the tag are in, while tags_linked handles what tags are linked to what blog posts.
  • Added a "tag cloud" on the home page below all posts.
  • Added support for SMTP for upcoming features.
  • Changed how the comments are loaded and how you interact with the comments. No more page loads!
  • Changed how the email address for a comment will be stored. Before, it was encrypted with the comment's password. Now, it is hashed with SHA-256.
  • Improved the configuration file.
  • Deleted the about page and added the content to the side panel.

I gave the visitor experience more work because that matters more than what the admin panel are. Because of this, the admin pages are not as finished as what the rest of the blog are. Will work on it later on.

One downside with this update is that the website seems to be slower than before the update (according to GTMetrix). The performance went down from 98-100% to 83-85%. Will try to fix this some day.

If you find any bugs or errors, please report them to me as a comment blow or on Mastodon

Who... are we... and who am I?

_
Cover

Who are we? Who are we to make rights of other wild animals and put them in zoos? Or even have them as pets!? We trained wolves to be a part of our group thousands of years ago. Since then, we have manipulated their DNA to create our own versions of wolves. Who gave us the right to do that? Why should we even do that? What is the purpose more than have someone that cares about us and comfort us when we are feeling down or are sad - someone who are our best friend.

When I for an example brush my teeth, thoughts like those can occur. And far too many times these days, I ask myself, who am I? Why am I in this body? What am I doing with it, and what am I doing right now? Why can I strength out my arm and grab the toothpaste? I understand how that is possible, but why is it possible?

Why does religious exist? Why do we destroy so much that doesn't belong to us in the name of religion? What is the purpose of religion? There's no such thing as eternal life, so why are we so obsessed with it? Why do most people want to "live forever"?

Why do we even exist? We are the most dangerous animal on this planet and far too many of us are greedy, ego, and disrespectful towards everyone and everything.

Facebook are greedy as heck!

_
Cover

After a few hours of phone calls and a visit from the commune, I visited the Swedish news pages I always visit every day. On both of them, I found out that Facebook are trying to own your life even more by adding ads in already paid games for Oculus Guest. They are also making a podcast that you can add to your Facebook page.

The fact that Facebook are trying to own your life even more than they do today by adding more services to both Facebook and to their products, are not surprising. It is known that the founder of Facebook, Mark Zuckerberg, tries to care about his privacy online (source). It is also known that he demands others to let their lives be in his own hands via Facebook (source... isn't that obvious already?).

On one of these Swedish news pages I read today, they said that Facebook will add podcasts to the website. They also said that the VR set Oculus Quest will also show ads for the users, even if you have already given the developers money by purchasing the game (source). My question to them are, why? Why would you show ads in games that someone have bought? What is the exact purpose for the ads to be there, more than be able to control your users?

Facebook are known to not caring about your privacy, and they have been sued repeatably for that, but they simply don't care.

On the other Swedish news page had an article that said that Facebook will start its own podcast service. Again, why? Spotify has one. Apple has one too. Why Facebook too? For money? Nope. For more control over your life? Yes. Let me explain. Facebook adds a tracking code to all images on their websites, so they can monitor the spread of an image no matter where that image will be on the internet (source). Why? To get more control over the situation, and it is disgusting!

If you add a podcast to your Facebook page, and you discuss podcasts with your friends, Facebook will know more about you. You shall not feed the pig in the room.

Page 1 of 22