Σάββατο 17 Ιουλίου 2021

New technologies in the Linux world


It seems that the computer science is like health science. Every few months new technologies arrise, and people in IT have to read and learn all new stuff about it.

The last years, after the virtualization revolution, we have a new technology approach, the containerized environment.

Containers are used for some years now, but after the initial implementations, some needs were created, so the community came acros adequate solutions. One of the problems, was the scaling and managability of the big number of containers across multiple hosts, which brought us two major players: Kubernetes and Openshift.

But before diving into the characteristics of those two, lets first get a glimpse of the containerized environment.

You can find information regarding containers from: Linux Containers and Wikipedia and a lot of other sources on the internet.

Basicaly what a container is could be explained in the schema from RedHat:


The well known virtualization, starts a virtual computer within a physical computer, and there a whole deployment of operating system and applications is being installed and runs.

On the other hand a container environment uses directly the host with the operating system installed, and a service that serves containers runs. This service takes a package of files, and runs the applications without the need of an extra operating system. Imaging a compressed zip file, that includes the application, the libraries, the configuration files and the content needed to be served as a whole application.

For example, you can have a web service, serving static content (which by the way can be scaled out and it is portable), including the web server, the content and the configuration within a single file/pod/container. This way, you can have more than one container serving a web page, in the same or more hosts.

Now comes the problem. How do you cenrally manage and manipulate all these services (also called micro services), from one location having a way to monitor them also?

The solution was an orchestration tool. 

The major, well know tools are two. Kubernetes and Openshift.

Kubernetes is more a pod manipulation system, targeting on the core of the containerized environment, giving the ability to fully manipulate containers any way the operator sees fit:


On the other hand Openshift is a platform for quickly and easily deploying application containers, which is based on a kubernetes cluster. So in terms of technological approach, kubernetes is the container cluster manipulation application, and Kubernetes extends the clustering into an application deploying solution based on containers.

https://www.openshift.com/products/features

There are various pages on the internet, explaining what are the differences of the two environments, and if someone googles the "kubernetes vs openshift" will find a ton of sites explaining the difference between the two.

Picture from : https://www.susla.edu/page/computer-science


It seems that we will continue learning as the computer technology kees inventing new things, in order to make our science better by the time.



Which is the best linux?


Whell the reply to the question which is the best linux (flavour), is quite easy, all and  none!

And let me explain.

Nowadays, linux has expanded so much that there is a flavour, a version, a distro, for a wide variety of applications. It is like having specific tools for all the things you want or need to do.
The right approach to selecting a linux distribution, flavour, version etc, is to identify what do you need it for, and use the one that is exactly for what you want to do, or at least is the closest one. If you want to drill a hole in the wall, you will not use a hammer or a chainsaw, you will use a drill. The last sentence best describes how you must see the different linux distributions.

Another very important factor is the time of the service delivery. This changes not by the year, as it used to be, but even quartely. Every three months, we have new kernels, distros, apps, technologies etc.

For example, it is very easy to distinguish between linux distros, if you are looking for a home desktop, and a server for hosting applications. For the first you will use something like fedora, or ubuntu, or arch or any other of the wonderfully combined linux distros and flavours, but for the latter you will have to use RedHat, Suse, etc. Please don't get me wrong! I am not suggesting one distro over the other, nor I recomend the ones I wrote as an example. There is a very big list of linux distros, and if you want to find the best one for you, for what you want to do, then have a look at Distrowatch or Wikipedia conserning that.

What you must have in mind, if you don't know what you can use is to research a little, and ask the community members of any known bloggers. But most important of all, use the one that you find easy and closest to what you know and understand. Don't go using productively an exotic flavour you just googled. Stick (at least at the beginning, because the fun in linux is the diversity), to the well known and tested ones.

Just for a hint, and not to be taken as advertisement you could use one of the following distros for destktop working:

Fedora

Linux Mint


Ubuntu

If you can spare some time, you might try all of the above and keep the one that feels easy and closest to your needs. For example, if you know linux, you can use Fedora, which is bleeding edge, and if you are new, you could go with Ubuntu or Mint.
One thing you might want to check, is the community behind the distro. Some people feel comfortable with Ubuntu, because a lot of people are using it and the community has already heard and solved all the questions you might have.
Hint: Keep your data in a seperate disk or partition, so that if you run into a problem you can not fix, you can just reinstall the same distro, or use another one. Basic things, like internet browsing, mail, office applications, video, music etc. are mostly common on all.


And for server working you need to ask yourself the following questions.
1. What am I gong to serve from this server
2. Does the service I am planning to use have a prefered distro
3. Which distro I am able to configure/fine tune best
4. Where can I get help if something goes wrong

For example, if you just want to have web site, then ubuntu server or CentOS (Rocky linux now), migh be the best choice. The same applies for a database server like MySQL or Prostgresql.
In some cases, like oracle database, the right and straightforward solution would be Oracle Linux.
If you need a kubernetes cluster, then the easiest way to go is ubuntu. On the other hand, openshift is a RedHat child, which points the way no its own.

Finaly, from the words of wise men, the best distro is the one that you know best!
Install, test, experiment and be prepared to brake it. Have a quick re-installation plan and in no time you will be able to handle the distro you like.

Τρίτη 22 Μαΐου 2018

Fedora - Gentoo Μπρος πίσω!

Μετά από την προσωρινή μεταφορά 3 συστημάτων σε Fedora 28 γύρισα ξανά, για μία ακόμα φορά, στα δύσκολα του Gentoo.

Η εμπειρία μου με την Fedora δεν ήταν βέβαια αρνητική, καθώς το distro αυτό δεν είναι για αρχάριους, παρόλο που είναι εξαιρετικά εύκολο στην εγκατάσταση, διαχείριση και λειτουργία.
Για κάποιον που έχει ασχοληθεί λίγο με linux και θέλει το κάτι παραπάνω, η Fedora είναι μία από τις καλύτερες επιλογές. Πλήρες, εύκολο και ανοικτό.
Η δική μου δυσκολία (λόγω χρόνου κυρίως), ήταν η απλή διαδικασία της εγκατάστασης και χρήσης της java στον Firefox. Χρησιμοποιώντας την JDK έκδοση της oracle/sun Java είχα java στο σύστημα καθώς και το plugin αλλά δυστυχώς δεν δούλεψε στον Firefox όταν χρειάστηκε.

Με την πρώτη ευκαιρία, πάλι χρόνου, προτίμησα να ξαναγυρίσω στο χτίσιμο του Gentoo από την αρχή. Οι λόγοι ήταν δύο. Ο πρώτος, διότι στο Gentoo όλα "παίζουν", με την αντίστοιχη ενασχόληση και λειτουργία. Δεύτερον, η αίσθηση του πλήρως ανοικτού και της ταχύτητας είναι τελείως διαφορετική!

Η αλήθεια είναι ότι χτίζοντας ένα Gentoo σύστημα από την αρχή είναι πολύ πιο ελαφρύ, πολύ πιο γρήγορο και πολύ πιο καθαρό!

Τελικά μέσα σε ένα σαββατοκύριακο είχα τρία συστήματα πλήρως λειτουργικά με Gentoo (custom kernel, network tools, systemd, plasma kde, Xwindows, κλπ.)


Δευτέρα 10 Απριλίου 2017

Πίσω στα δύσκολα!

Μετά από αρκετό καιρό και χρήση επέστρεψα και πάλι στο δύσκολο linux, το Gentoo.
Τα τελευταία τρία χρόνια προσπάθησα να χρησιμοποιήσω το Fedora linux, για αν γλιτώσω χρόνο από το compiling που χρειάζεται για την λειτουργία του συστήματός μου, αλλά τελικά δεν άξιζε τον κόπο, όπως φάνηκε στο τέλος. Και εξηγούμαι.
Εδώ και τρία χρόνια είχα σταματήσει να χρησιμοποιώ το Gentoo, διότι είχε προκύψει κάποιο πρόβλημα σε κάποια compiles που προσπαθούσα να κάνω, αλλά και στην έλλειψη χρόνου από πλευράς εργασίας. Για αυτό το λόγο δοκίμασα να χρησιμοποιήσω όποιο λειτουργικό linux μπορούσε να μου προσφέρει όλα όσα μπορώ να χρειαστώ σε επίπεδο επαγγελματικής αλλά και οικιακής χρήσης. Ξεκινώντας με την έκδοση 21 της Fedora, μπορώ να πω ότι λειτουργούσαν σχεδόν όλα όσα χρειαζόμουν, και με λίγο κόπο. Η προσθήκη του fedy, το οποίο παρέχει ότι δεν είναι ενσωματωμένο εξ αρχής ήταν και το κερασάκι στην τούρτα που είχε θετικό αντίκτυπο στην επιλογή αυτού του flavour.
Πριν φτάσω σε αυτή την επιλογή προσπάθησα να χρησιμοποιήσω Ubuntu, Kubuntu, Linux Mint, Suse, αλλά κανένα από αυτά δεν είχε την χρηστικότητα που χρειαζόμουν για επαγγελματική χρήση (τεχνική και δικτυακή προσέγγιση).
Τα προβλήματα άρχισαν να παρουσιάζονται μετά την έκδοση 22, και ειδικά στην 23, όπου το KDE ήταν απλώς UNSTABLE! Για αυτό βέβαια δεν είχε καμία ευθύνη η Fedora, αλλά κρίνοντας από την δουλειά που είχαν κάνει τόσα χρόνια, είχα την ελπίδα ότι κάτι θα κάνανε με το patchig που χρειαζόταν για να γίνει λίγο πιο σταθερό. Δοκίμασα την 24, και την 25, προσπαθώντας να αλλάξω το KDE με το XFCE αλλά μου έλειπε η λειτουργικότητα. Όπου είχα λειτουργικότητα δεν είχα ταχύτητα και σταθερότητα, όπου είχα σταθερότητα δεν είχα την ταχύτητα και την λειτουργικότητα που χρειαζόμουν.
Τώρα μετά από περίπου έναν μήνα χρήσης του Gentoo, μπορώ να πω ότι τα έχω όλα.
Ίσως το παλαιότερο πρόβλημα που με έκανε να απομακρυνθώ από το Gentoo ήταν η επιλογή των unstable packages, σε αντίθεση με τα stable. Χρησιμοποιώντας τα unstable, έχεις τις τελευταίες και πιο ενημερωμένες εκδόσεις, αλλά χάνεις στην σταθερότητα και την ασφάλεια του σωστού compile (κάποιες φορές έπρεπε να περιμένω μέρες για να σταθεροποιηθούν κάποια πακέτα για να τα βάλω στο σύστημά μου).
Βέβαια αυτό με έκανε να μάθω το μάθημά μου και τώρα, χρησιμοποιώντας μόνο το stable branch, έχω ένα (ή μάλλον τρία), σταθερό, γρήγορο, λειτουργικό σύστημα που μπορώ να βασιστώ επάνω του για να κάνω την δουλειά μου.
Ένας ακόμα παράγοντας που με έκανε (ίσως και παλαιότερα) να επιλέξω το Gentoo, δεν ήταν η ελευθερία του να έχεις τον κώδικα, αλλά η ασφάλεια που σου παρέχει η έλλειψη κλειστών binaries.

Δευτέρα 18 Ιανουαρίου 2016

Fedora 23 KDE

Έχει περάσει ένας μήνας από την ημέρα που ανακοινώθηκε η 23η έκδοση της Fedora.
Προσπάθησα να χρησιμοποιήσω την έκδοση (καθώς και την παλαιότερη -22-) οι οποίες δυστυχώς δεν μπόρεσαν να καλύψουν πλήρως τις ανάγκες που είχα σε επαγγελματικό επίπεδο.
Παίρνοντας τα πράγματα από την αρχή.
Η καινούρια εγκατάσταση της Fedora, έχει τις τελευταίες εκδόσεις από Gnome-shell, Plasma Desktop, XFCE κλπ. (δεν χρησιμοποιώ άλλες).
Εξακολουθώ να είμαι ακόλουθος του KDE, καθώς είναι πιο κοντά στις ιστορικές μου ενασχολήσεις με τους υπολογιστές. Στις περιπτώσεις όμως που υπάρχει άμεσο πρόβλημα και χρειάζομαι άμεση επαγγελματική χρήση χωρίς προβλήματα, αλλά και χωρίς όλα τα έξτρα καλούδια, τότε χρησιμοποιώ XFCE.
Αρχίζοντας με το καινούριο Plasma Desktop, διαπίστωσα αμέσως την έλλειψη σταθερότητας. Το αμέσως επόμενο πράγμα το οποίο με σύγχυσε, ήταν η έλλειψη δυνατοτήτων που είχε το παλαιότερο KDE (4). Μία από αυτές είναι και η ένδειξη αργιών στο ημερολόγιο.
Πέρα από αυτό, έλειπε ακόμα και η δυνατότητα να φαίνεται η σύντομη ημερομηνία κάτω από την ώρα. Η μόνη δυνατότητα που υπάρχει είναι είτε η πλήρης ημερομηνία (Όνομα ημέρας και μήνα), είτε μόνο αριθμοί. Και δεν δύνεται (τουλάχιστον από τα εργαλεία διαχείρισης) αυτή η δυνατότητα.
Εκείνο το οποίο ήταν σε πολύ καλύτερο επίπεδο ήταν η καινούρια έκδοση του xfce, η οποία είναι και σταθερότερη αλλά και αρκετά γρήγορη.
Βέβαια, το τελειωτικό χτύπημα το πήρα, προσπαθώντας να διαχειριστώ ένα VMware vsphere server από browser, ο οποίος απαιτεί ένα plugin. Ενώ το ίδιο το plugin εγκαθίσταται με την ίδια ευκολία που το είχα εγκαταστήσει σε όλες τις προηγούμενες εκδόσεις, η λειτουργία του δημιουργεί πρόβλημα (core dumped)...
Έχω πολλά χρόνια ιστορία με την RedHat/Fedora και γενικά RPM based συστήματα, αλλά η προσπάθεια της Fedora να είναι στις τελευταίες εκδόσεις μου δημιούργησε πρόβλημα.
Ελπίζω στο μέλλον να διορθωθεί και να γυρίσω και πάλι στην ευκολία της εγκατάστασης και παραμετροποίησης του linux όπως το κάνει η RedHat και όλο το community αυτής της συνομοταξίας, αλλά προς το παρόν στρέφομαι σε εναλλακτικές οδούς....
Οι δοκιμές και τα αποτελέσματα, σε νέο άρθρο.
Καλή συνέχεια Linux Freaks... :)


Κυριακή 18 Οκτωβρίου 2015

Encrypted data on the cloud!

Recently I was asked by a customer about the security of his data on the cloud.
Well, I had to be frank to him, so I told him that the engineers can have access to the raw data, which means that even when everything else is secure, the actual data are at the hands of the engineers responsible for the physical servers at the cloud premises.

Then an idea came to me, which I have implemented on a lab.
We have the tools, why not use them?
The idea is to have a shared location to store data in, and sync this on the cloud encrypted.
The tools are easy, share with samba, sync with any tool (I prefer copy.com for ease of access and linux native client), and encfs for encrypting everything that will be synced to the cloud.

The implementation is also quite easy. Lets see the theory behind this.

A couple of folders should be created, the one to hold the data, and the other to be used as "unencrypted" shared folder.

Then run the encfs utility, to create the encryption algorithm.

Start the sharing of the "encrypted" folder.

Share the "unencrypted" folder.

Thats it, it is done. You will have a shared folder which is encrypted and synced on the cloud. Even if you loose all your installation, you can just resync the "encrypted" folder to another server and mount your encrypted folder on a share, and voila, your data is there!

For the more technical part, you can follow the below instructions to make it hapen.

Make sure you have the latest updated linux software for your distro, and install samba, encfs and copy.com.
For Redhat, CentOS, Fedora and compatibles:
# yum install samba fuse-encfs wget

For copy.com download and install the agent directly from the site, or download directly from the link below:
# wget https://copy.com/install/linux/Copy.tgz
Extract and run the agent.

Create a folder named encrypted
# mkdir /mnt/encrypted

Create a folder named unecrypted
# mkdir /mnt/unencrypted

Create the encryption mounting algorithm
# encfs /mnt/encrypted /mnt/unencrypted

Follow the instructions on setting up the encryption algorithm and prefer higher encryption (eg. AES 16byte cipher, 64 to 4096 digits) and 256 bit key, and try to encrypt the filenames also. For the rest if you are not sure you can just leave the defaults, and finally, you should add a password for the encrypted folder. Here you should be careful to select a difficult and complex password, and make sure it is more than 10-12 characters long.

That's it, you have an encrypted and unencrypted folder.
Now you can share the "unencrypted" folder through samba.

Last, you need to start the cloud syncing agent, in order to sync the encrypted folder on the cloud.

In order to make the service autostart, you can use any starting service on your linux box, in order to have it done automatically. I use the "rc.local" as a quick and dirty way with a couple of lines, as follows:

/bin/echo 'Encryption_Password' | /bin/encfs /mnt/encrypted/ /mnt/unencrypted/ -S

/root/copy/x86_64/CopyConsole -r=/mnt/encrypted/ -p=Cloud_Password -u=cloud_Username -daemon

and have samba enabled as a service.

If you run into problems, there are a lot of forums that can help in any direction.

Δευτέρα 8 Σεπτεμβρίου 2014

Encrypted Cloud Storage with copy.com

Recently I have landed on copy.com, while looking for cloud storage for linux.

After registering and getting the linux native client, I started experimanting with the potentials such a service can have, giving me the best out of what it can give me.

The next thing I had to do, was to have my data totaly and completely encrypted on the cloud, so that even in the event of hacking, theft of identity or any other matter, it would be secure.

Using linux, of cource gives you the best and most up to date tools to do whatever you need, even when you don't know any programming language.

An idea came to mind, and after a very short search I came to the very well folder encryption tool, "encfs". The tool was the best thing to have for a service like copy.com.

A little shell messing around and a manual page gave me all I needed to have a complete solution for what I needed.

The outcome of both (copy.com and encfs) is that I have a folder in my PC, which is synchronized automatically on the cloud, while being encrypted.

What I did was in two steps. First step is to have a local folder encrypted and synchronized on the cloud.
The second step took me a little further, having an encrypted folder directly on the cloud.
This means that I have a folder ~/mnt/cloud, which is a direct mount of the encrypted data on the cloud.

How is all done.

First of all you need to create an account on copy.com, which gives you 15 gig for free!
Get you username and password and download the linux application for your distro.
Unzip and run the application (lets say in bin folder in your home folder).
Run the application and register your account and select a synchronization folder (e.g. ~/mnt/copy)

Secondly you have to create the encryption folder (eg ~/mnt/cloud)

Then you have to run the encfs utility, in order to create the appropriate configuration for the encryption. Following the defaults is a safe choice, and finally you have to enter an encryption password for your encrypted folder.

Thats it, you now have a folder (e.g. ~/mnt/cloud) that whatever you create in there will be encrypted and transfered to the cloud. (Also if you already have done the procedure, you will find all your data in threre, unencrypted).

To reconnect your mount points (cloud and encryption) you have to run (or autorun) the copy.com appliation and run the encfs tool (the rest of the times, it only asks for the encryption password.)

On the second approach, you can use a pthon utility to directly mount the cloud storage to a folder on your linux box. The utility is called copy-fuse and it can be downloaded from the git clone https://github.com/copy-app/copy-fuse.

Then the only thing that changes is that you do not need to run the application from copy.com, but mount the drive directly with the utility (copyfuse.py [-h] [-d] [-s] [-f] [-o OPTIONS] EMAIL PASS MNTDIR)

Then you run the encfs utility on the mounted folder and voila, you have an online cloud encrypted folder!