Rip CD to FLAC file using K3b on Fedora

If you want to rip your cd without loosing quality you can use the flac format to do so. K3b comes with a FLAC plugin but the flac encoder itself was missing on my Fedora 20 machine. Just install it you will be able to rip your cd to FLAC using K3B:

sudo yum -y install flac

Make the Fedora/CentOS/RHEL update service the fastest

Since I played with some publish and subscribe protocols in the last months, I came to an idea to speed up the notification and delivery of software updates over the existing mechanism while reducing, or better optimizing, the needed resources.

Here a graphic to show what I try to implement:

Drawing software update push service

As an example in RHEL/CentOs or Fedora you can start yum and pull the latest updates frequently to see if there are some new packages. This can be done with manual cron jobs or the yum-updatesd. Every machine pulls in a defined frequency the complete package index and looks if something new was released. In my understanding it would be more efficient if the system gets notified that some new package is available or even better the system is listening only to updates and information of packages that are installed on that specific machine and need  be monitored. This not only can speed up and optimize the client-server communication this also could be a good way of optimizing the distribution of packages between repository mirrors. Each mirror can be notified if there is a new package and gets it pushed to make the package available as fast as possible.

I am aware that distribution of packages does not need to be optimized by milliseconds but in some environments such a notification mechanism can save money and bandwidth if a lot of clients need to be updated.

My plan is to discuss this with a proposal for a concrete implementation for yum based systems an the developers mailing list of Fedora to get a feeling if this is a real world requirement or if there is no need in optimizing this situation.

Up to now MQTT looks quite promising for me to do the notification mechanism or even push packages to the subscribed machines. With some control server in back this can make package deployment more efficient and faster. The package verification mechanism can work as now only the transport mechanism or the notification of a new package needs to be added to the existing infrastructure. Since MQTT supports SSL/TLS based connections and Websockets there should no bigger problem with security or blocked ports then today.

Build Paho MQTT c library on Mac OS X

This post describes how to build the Paho MQTT library on Mac OS X with MacPorts openssl.

Prepare your system

Install the compiler

You need Xcode or the Xcode command line utils. If you’re not sure if they are already installed open a terminal and try to run the gcc command. If you need to install the compiler a popup will appear to do so.

Install Mac Ports

If not done already download and install the MacPort system and install the openssl library by executing the following command:

sudo port install openssl

You need at least openssl-1.0.1g_0 to not be affected by heartbleed bug!

Clone the repository

Get the latest version because there are some improvements done the last weeks.

git clone git://git.eclipse.org/gitroot/paho/org.eclipse.paho.mqtt.c.git

Prepare the build environment

Change to the build directory within the repository:

cd org.eclipse.paho.mqtt.c/build/

Now we need to export some environment variables:

export SSL_DIR=/opt/local/
export MQTTCLIENT_DIR=../src

If you want to build the samples:

export BUILD_SAMPLES=YES
export SAMPLES_DIR=../src/samples

Now give it a try and run make

make

There should now be some output shown and a darwin_ia64 folder should be created. There you find your paho c library files.

Hope this helps to build your paho library.

 

Setup Ruby development environment with rvm on Mac OS X

Since I experimented with some Ruby web application stuff the last weeks, I want to share some of my conclusions how to setup a development environment which is working for my two major platforms, Mac and Linux. This post will cover the setup of an easy to use development environment on Mac OS X. I am running Mavericks but this should work on all of the latest supported Mac OS X versions as well.

First install XCode or just the command line tools.

Try if the gcc command works for you in a terminal if gcc is not installed a window appears which allows you to install the necessary packages.

Next step is to install Mac Ports

Download the latest install package for your Mac OS X version from: http://www.macports.org/install.php

Install rvm:

Now it is time to install the rvm for your user. Open a new terminal and run the following command:

\curl -sSL https://get.rvm.io | bash -s stable

This will install rvm and add all necessary stuff to your bash profile. If you are using a different shell or something does not work for you please have a look at the rvm documentation: http://rvm.io/rvm/install

The install output gives you the advice to run the source command for your user, copy it and run it in your active shell to make rvm available in this shell. The command looks something like: source /Users/<YourUsername>/.rvm/scripts/rvm

Install ruby:

For my applications I am using the ruby 2.1 version. You can install any version you want or need and rvm allows you to switch your active ruby version on the fly.

Lets start with Ruby-2.1 for now:

rvm install ruby-2.1

Activate that ruby version and make it default ruby version for now:

rvm use ruby-2.1 --default

Test it:

ruby -version

Thats it. You should now have the Ruby-2.1 version active and you can start installing gems or start your development with Ruby. If you want to switch your active Ruby version just use the rvm command and install a different version and use it.

I hope this helps you to save some time and trouble setting your development environment up.

Import self signed certificate on Windows

If you run your ssl services like Email or internal Websites with self signed certificates you may want to get rid of the certification warning because your certificate is not signed by an official authority.

First generate a certificate which can be imported by Windows from your CA file:

openssl x509 -in <pathtoyourcafile> -outform DER -out ca.cer

This ca.cer file can now be imported as trusted root certificate authority. It is your own CA you trust here, so keep your CA keyfile save and secure. Now all certificates generated and signed by this CA will be accepted by your browser and Email program without showing further certification warnings. Some software uses there own certificate management, for example Firefox or Thunderbird. For this tools you need to import the CA certificate as well because they don’t ask the Windows certificate management.

 

 

Problem with booting pfSense from USB Stick

On an appliance I reinstalled with pfSense I was facing a problem booting the system from an usb stick.

The system was not able to mount the partition correctly because it wasn’t present at that time. For me this looks like a timing Problem. The system booted without a problem if I didn’t connect the USB stick directly. I used an USB-hub while installation and booting from that USB stick while it was connected through this hub worked like a charm.

My Problem was similar to this. https://redmine.pfsense.org/issues/495

The fix was quite easy. I booted the system using the USB-hub and modified the loader.conf

I just had to add this at the end of the file:

kern.cam.boot_delay=10000

and everything worked fine even if I connected the USB stick directly to the appliance.

Hope this helps you if you’re facing a similar problem.

Why Mozilla should make money with advertisment?

Last week I read some posts about Mozillas thoughts to sell space for advertisement in their Firefox Browser. Of course I don’t like advertisements in the web. And of course I don’t like apps with a lot of advertisement and much more I don’t like to be tracked on every webpage I go to but Mozilla is offering a service and a product I never paid something for.

And even if I am not the oldest Internet guru around I can remember times where Browsers where not included in every computer for free! The last thing I want to develop is a Browsers in this days. Sorry but you would have to pay me for that, too. All this standards and made up standards in the web-javascript-html-css-world would be like a torture for me. Beside  this Mozilla is one of these organizations which made it form a non-profit-dont-do-anything organizations to a great player in the Open Source business world. They spent money on developments and they are working on real world products. Even if they never will fight the iPhone back with there operation system for mobile devices they are someone who I would trust in building a good alternative based on open standards and software.

There are not many companies left who fight for open solutions and systems. And more a shame is that those who are doing it, are often blamed for making money. Please stop this give me everything for free mentality only because you can look into the source code!

Mozilla makes a good job and the organization needs a lot of money. Beside this it is not healthy to get the biggest amount of money from Google. Oh and Google makes most of their money out of their advertisement  business.

Latest kernel did not appear to be installed correctly in Fedora 20

Due to a known bug in Fedora 20 with some selinux updates I recognized a connected problem on my machine. While updating some packages I found this message:

Security: kernel-3.12.8-300.fc20.x86_64 is an installed security update
Security: kernel-3.12.7-300.fc20.x86_64 is the currently running version

To fix this and get the latest kernel visible in grub and set as default I needed to reinstall it by running:

yum remove kernel-3.12.8-300.fc20

and

yum update

again. After this procedure the new kernel was available.

Qt Creator problem on Fedora 20: couldn’t find IGL

To fix the “couldn’t find IGL” error you probably get after installing Qt 5.2 package on Fedora 20 and you try to compile the first project, you should install the missing mesa package by running the following install command as root or using sudo:

sudo yum install mesa-libGL-devel -y

This should fix it.

Problems with missing locale files on Fedora 20 made libvirtd service not starting

Since I am using Fedora 20 now for a while on two machines I came over some smaller bugs with my configuration.

I installed my systems using the KDE spin and installed with en_US language but a german keyboard layout. It looks like something after installation on my workstation did go wrong with local generation. Because I reinstalled the workstation for testing some different configurations with UEFI, I am quite sure this error is reproducible for me.

This is what I recognized first when I opened a shell and tried to use sudo I got messages like this one:

-bash: warning: setlocale: LC_CTYPE: cannot change locale (en_US.UTF-8): No such file or directory
-bash: warning: setlocale: LC_COLLATE: cannot change locale (en_US.UTF-8): No such file or directory
-bash: warning: setlocale: LC_MESSAGES: cannot change locale (en_US.UTF-8): No such file or directory
-bash: warning: setlocale: LC_NUMERIC: cannot change locale (en_US.UTF-8): No such file or directory
-bash: warning: setlocale: LC_TIME: cannot change locale (en_US.UTF-8): No such file or director

First I didn’t give it a lot of attention because the shell worked fine and I thought I need just to export my correct LC_ALL variable. But then I got problems running libvirtd service on that machine. It was a fresh installed Fedora 20 and the libvirtd service didn’t want to start and quite while initialization. After some searching I found that this two problems are related.

I am not sure what did go wrong while installation or post installation process but because it is not a common known problem I think it is related to my configuration regarding language and keyboard layout. But I have to investigate some more to report a more qualified bug report than the usual bullsh** I fire them on their bug tool in general.

To fix the problem you need to generate the missing local files. This is done with different tools on most distributions. Arch, Gentoo and Ubuntu mostly refer to the locale-gen script which is not present on a default Fedora installation.

To regenerate your locale on Fedora run this command to fix the problem:

localedef -v -c -i en_US -f UTF-8 en_US.UTF-8

Of course you need to modify it to your local you want to have or which is missing on your system.