Browsing...

Safe code evaluation in Ruby with $SAFE

As you probably know, you can use eval() to evaluate Ruby code from Ruby. But evaluating things that come from the outside of the program like user inputs can be dangerous. Why they can be dangerous you ask? eval() evaluates anything as we would program it ourselves. Basically anything can happen. That’s why it’s best to avoid eval() for such inputs altogether. But we can evaluate Ruby in a safer manner too; with $SAFE.

Running test/unit suites with Minitest

Sometimes it happens that you want to run an old test suite, but you don’t have a correct version of the testing framework available. That happens a lot in Fedora since tooling around RPM supports only one version of each component and new rubies does not come with test/unit anymore. As we still need to run the tests, we have two options. Either go ahead and update the whole test suite to a new version or just use Ruby’s dynamic nature to actually run it. Let’s look how the latter can look like.

Creating default configuration for every Vagrant project

Are you tired of putting the same sane configuration options to every Vagrantfile? Here is how to make the life with Vagrant a little easier.

Vagrant NFS exports on Fedora 21

If you are using Vagrant chances are you would like to use NFS instead of rsync to speed up shared folders and avoid annoying vagrant rsync-auto command. But what to do when Vagrant just hang on Mounting NFS shared folders in Fedora?

Quick setup of nested virtualization in KVM and virt-manager

When I was testing Vagrant builds for Fedora I needed to run Vagrant in a virtual machine and then test vagrant libvirt integration there. So to say a needed to do virtualization on the virtual machine. Luckily for me it is possible with KVM and Rhys Oxenhams wrote about setting it up. This post is about setting it up and using it with virt-manager. First lets see whether we have nested KVM enabled: