Skip to main content

Posts

Showing posts from June, 2020

Kubernetes - Deploy speedtest in kubernetes

There's a very nice project for a self-hosted speedtest called ' librespeed ' which can be used to host your own speedtest page. Since everything is moving to containers, it's a nice way to get familiar with Kubernetes and Docker (yml file at the end). Requirements: - A Kubernetes Cluster of any size or form - Access to dockerhub I'll be using the adolfintel/speedtest image for my deployment and have 2 replicas. First, create a deployment [archy@kube01 ~]$ kubectl create deployment --image adolfintel/speedtest speedtest-kubernetes Change the replicas to 2 [archy@kube01 ~]$ kubectl edit deployment speedtest-kubernetes ... replicas: 2 ... Next up, expose the deployment. I'm using a very basic Kubernetes setup, so there are no loadbalancers available. I'll be using the NodePort type to expose a port on all Kubernetes-Nodes. [archy@kube01 ~]$ kubectl expose deployment speedtest-kubernetes --name=speedtest-kubernetes --port=80 --type=NodePort

Foreman - ERF64-6496 [Foreman::MaintenanceException] after update

If you're updating foreman, it might happen that the update (in terms of packages) may run through successfully but leave foreman in a maintenance state. After an update, I hit this error: ERF64-6496 [Foreman::MaintenanceException]: There are migrations pending in the system This, however, is fairly easy to fix. First, try to fix it using foreman rake by migrating and seeding the db. [archy@katello ~]$ sudo foreman-rake db:migrate [archy@katello ~]$ sudo foreman-rake db:seed If this doesn't work, you could always to the 'universal' fix for foreman. [archy@katello ~]$ sudo foreman-install --scenario katello --upgrade Ideally, you should've created a snapshot before updating your katello / foreman instance. When using KVM, this can be done using virsh [root@hyv01 ~]# virsh snapshot-create --domain katello.archyslife.lan Feel free to comment and / or suggest a topic.

Command Line Fu - Encrypt files and archives

When working with offsite backups and cloud storage, it's highly recommended to encrypt your data. While encryption can be done with GPG and OpenSSL, I'll be using OpenSSL in this example. First, let's create a unique random 64-character password which will be used to encrypt the files. $ < /dev/urandom tr -dc A-Z-a-z-0-9 | head -c ${1:-64} > key.txt I'd recommend to also save this key to your password manager (assuming you use one) just in case. Files can be encrypted using this syntax. $ openssl enc -e -aes256 -iter 8 -pass file:key.txt -in workingdir.tar.xz -out workingdir.tar.xz.enc -e will encrypt  -d will decrypt -aes256 is the encryption algorithm -iter 8 means 8 iterations will be done -pass file:key.txt will read the password from the file 'key.txt' -in is the file currently residing on the system that should be encrypted -out is the encrypted -in-file When working with archives, the content that is supposed to be archived can be piped to Ope