WebStorm on Fedora Linux in 5 Minutes

webstorm and fedora logo
Standard

Installing Webstorm on Fedora made easy. With this short manual, you’ll get Webstorm up and running on Fedora in 5 Minutes.

Personally I’m a very enthusiastic about OpenSource software and I try to use it wherever possible, as long as it’s reasonable. And VIM in combination with TMUX is defiantly my personal favorite.
But I got a free licence for WebStorm from a nodejs Meetup here in Vienna. So I’m going to give it a shot and discover the pros and cos of using a IDE compared to my beloved VIM+TMUX setup.

1. Download and install OracleJDK.

OracleJDK can be downloaded from the Oracle Website.

Oracle Java Website screenshot

Click the the red framed “JAVA” logo and then select

To run Webstorm on Fedora, JetBrains recommends to to use OracleJDK instaed of OpenJDK, as the default environment, as there might be some bug’s and performance issues.

After you downloaded the rpm file, install OracleJDK using dnf: sudo dnf install jdk-8u*-linux-x64.rpm

2. Configure your System to use OracleJDK by default.

I’ve tried to run WebStorm with OpenJDK, but I got the following errors.

OpenJDK 64-Bit Server VM warning: ignoring option MaxPermSize=350m; support was removed in 8.0
log4j:WARN No appenders could be found for logger (io.netty.util.internal.logging.InternalLoggerFactory).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
[ 361] ERROR - nse.impl.GeneralLicenseManager - No valid license found 
java.lang.Throwable
 at com.intellij.openapi.diagnostic.Logger.error(Logger.java:115)
 at com.intellij.ide.a.g.cb.a(cb.java:119)
 at com.intellij.idea.MainImpl$1.start(MainImpl.java:44)
 at com.intellij.idea.StartupUtil.prepareAndStart(StartupUtil.java:120)
 at com.intellij.idea.MainImpl.start(MainImpl.java:39)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java.lang.reflect.Method.invoke(Method.java:497)
 at com.intellij.ide.plugins.PluginManager$2.run(PluginManager.java:90)
 at java.lang.Thread.run(Thread.java:745)
[ 363] ERROR - nse.impl.GeneralLicenseManager - WebStorm 11.0 Build #WS-143.381.46 
[ 363] ERROR - nse.impl.GeneralLicenseManager - JDK: 1.8.0_65 
[ 363] ERROR - nse.impl.GeneralLicenseManager - VM: OpenJDK 64-Bit Server VM 
[ 363] ERROR - nse.impl.GeneralLicenseManager - Vendor: Oracle Corporation 
[ 363] ERROR - nse.impl.GeneralLicenseManager - OS: Linux

It looks like we have an incompatibility here, that doesn’t allow us to run webstorm on fedora.
I don’t have the knowlage to analyse this problem and figure out if there are ways to get fix it from “user” site. The way I’ve got WebStrom running was by setting OracleJDK as the default Java environment.

For the people running software that depends on OpenJDK, I can’t give you a list of what works and in OracleJDK and what not. But I’ve made tests on how LibreOffice runs on OracleJDK. And my tests all have been successful.

To set OracleJDK as your default environment, execute the following:

sudo alternatives --config java

The command will spawn a little menu that looks like this:

There are 3 programs which provide 'java'.

 Selection Command
-----------------------------------------------
 1 /usr/java/jdk1.8.0_65/jre/bin/java
 2 /usr/java/jdk1.8.0_60/jre/bin/java
*+ 3 /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.65-3.b17.fc23.x86_64/jre/bin/java

Enter to keep the current selection[+], or type selection number:

In my case, the first option in the list is the desired one, so I type 1 into the bash and press enter.

The * shows you which java is used by default.
As you can see, I use OpenJDK by default, as most Fedora installations do.
OpenJDK gets installed by default because it’s a dependency of LibreOffice.

Finally we are set up to run Webstorm on Fedora.

3. Download and Install WebStorm on Fedora

The last step to run webstorm on Fedora, is to download WebStorm from their website and install it.

Extract the content to your home folder or wherever you keep your executeables. I personally keep my executeables in /home/zwarag/Applications.

Then change directory to the webstorm/bin.

in there, execute the ./webstorm.sh file.

starting webstorm on fedora

Tada, webstorm should be starting now.

Additional Vim Love

If you love Vim and don’t want to loose those muscle memory gainz, check IdeaVim.
Yes, it’s a WebStorm Plugin to move your cursor like in vim.

How to install and run docker on Fedora 22

docker fedora logo
Standard

In this post we will learn how to install and run docker on Fedora 22. Docker has established itself in the DevOps scene for quite a while and is becoming more and more popular. With the brand new toolbox, it’s even easier to manage and work with docker.

While it is very well documented on how to run it on Ubuntu and how to use it on mac and windows, there is little documentation on how to install and run docker on Fedora.

Installation

1. add the docker repo to your dnf

sudo cat >/etc/yum.repos.d/docker.repo <<-EOF 
[dockerrepo] 
name=Docker Repository 
baseurl=https://yum.dockerproject.org/repo/main/fedora/22 
enabled=1 
gpgcheck=1 
gpgkey=https://yum.dockerproject.org/gpg 
EOF

2. install docker

sudo dnf install docker-engine -y

3. start the docker service

sudo service docker start

4. create a docker user group

This part is not necessary to run docker on Fedora, but I recommend at least reading over it as it’s about security.

Unlike most applications, docker uses the Unix socket instead of the TCP socket.
And that Unix socket is always owned by root as default.
That means you would have to run sudo in front of every docker command to make it work.
If you run docker in a restricted environment like a virtual or development machine, then you can do the following without concerns.
But if you run docker on your production machine, you certainly don’t want to do this.

To run docker without sudo: create a group and make the unix socket read/write-able by the docker group. Then add your user to that docker group.

By doing this, you can than execute docker commands without sudo.

sudo groupadd docker
sudo usermod -aG docker [[USERNAME]]

5. make docker start at boot

sudo chkconfig docker on
# OR
sudo systemctl enable docker

6. test if everything works right

docker run docker/whalesay cowsay "Everything just works™"

If everything works out, you should see something like this:

whalesay screenshot

(Optional) running docker on fedora that is set up on BTRFS

docker: Docker version 1.8.2-fc22, build cb216be/1.8.2

In this and current case, there is a little bug.
SELinux will not mount an already mounted partition with different security flags.

You might get this error:

lxlDrCortex docker[6971]: time="2015-11-02T15:13:41.473664945+01:00" level=info msg="Listening for HTTP on unix (/var/run/docker.sock)"
lxlDrCortex docker[6971]: time="2015-11-02T15:13:41.495953684+01:00" level=fatal msg="Error starting daemon: SELinux is not supported with the BTRFS graph driver"
lxlDrCortex systemd[1]: docker.service: main process exited, code=exited, status=1/FAILURE
lxlDrCortex systemd[1]: Failed to start Docker Application Container Engine.
lxlDrCortex systemd[1]: Unit docker.service entered failed state.
lxlDrCortex systemd[1]: docker.service failed.

This is actually a known bug, and smart people are working hard to solve this issue.

To solve this problem in the meanwhile, first we make sure that the socket is accessible by the docker group.

chown root:docker /var/run/docker.sock

And then we change comment out this line in /etc/sysconfig/docker
NOTE: This will disable SELinux on the docker process.

#OPTIONS='--selinux-enabled'

Vagrant

vagrant logo

I made a Vagrantfile for people who would like to see how to run docker on Fedora without installing docker directly on your host. Check out the GitHub project.

How to use systemd to run the mattermost chat platform.

mattermost-slack
Standard

A lot of us have waited for a alternative to slack which respects our privacy. This is an important topic for privates as well as corporate entities.

Finally the Mattermost Team have released their first stable release and that means that they are comfortable enough with the project to market it for production.

screenshot mattermost blog

If you would like to have a look at mattermost without having to set up all the production environment, have a look at their dockerized solution. It’s perfect for just spinning it up and tweaking it a little.

Setup with systemd

If you are like me and love cutting edge or just systemd per se, you’ll find that systems running on systemd are not officially supported yet.

When looking at why it is not supported yet, we’ll find out that that the devs might not have had time yet to test it or do not have experience in systemd.
In my tests, I could not find any problems running mattermost on systemd and because of that, here is a little guide:

All we need is to write a systemd.unit file.

  1. Install Mattermost and try making it run with command line only.
  2. Create a mattermost.service file in /etc/systemd/system.
  3. Fill in the following and adjust to your needs.
[Unit]
Description=mattermost
After=multi-user.target

[Service]
User=mattermost
WorkingDirectory=/var/www
ExecStart=/var/www/bin/platform
Restart=always
RestartSec=10

[Install]
WantedBy=multi-user.target

As you can see we have 3 segments.

First one is [Unit], where we tell systemd how the service is named and when it should be executed.
It will execute right after multi-user.target (which is quite “the equivalent” to runlevel 6).

Then we have the [Service] block, where we define everything that is directly related to the service itself.

  • User=”the user this service/daemon will run on/from”
  • WorkingDirectory=”the directory from where the execution will take place”
  • ExecStart=”the executable that will run”
  • Restart=”whatever happens, systemd will restart this service automatically”
  • RestartSec=”wait 10 seconds before restart”

The last piece is [Install], which is necessary for letting this unit be recognized as a service.

Upgrade fedora 21 to 22 using fedup.

fedora 22 image
Standard

In this post we are going to upgrade fedora 21 to 22 using fedup.

Fedora 22 has been released by 2015-05-26.

Prologue

An important thing to know about Fedora 22, is that the new default package manager has been switched to “dnf”. So “dnf” is the new “yum”.
For the end user, there is not much difference between yum and dnf.
Both yum and dnf can manage rpm packages.
And the only sensible difference is that is works faster than yum. Especially when it comes to detect the deltas between the packages and figuring out what dependencies need to be fulfilled.
If you would like to read up more about how dnf works and how it differs from yum, check out the following links.

Wikipedia: http://en.wikipedia.org/wiki/DNF_(software)
dnf-blog: http://dnf.baseurl.org/

Lets start with the upgrade fedora 21 to 22 using fedup.

1. lets make sure your system is up to date.

sudo dnf update

or

sudo yum update

2. Install the necessary tools needed to update your system.

The fedup tool is the programm that will update our Fedora to the new release.

sudo dnf install fedup

or

sudo yum install fedup

3. Prepare your system for the update.

Now we will use the fedup tool to prepare our system to be updated. Fedup will download a bunch of stuff and preconfigure our system to be updated.

Executing this command will not update your system.

However fedup will create a new entry in your boot menu to do a system upgrade. If you do not choose that option on in your boot menu, your system will not updated. (See point 4 for a screenshot of what I describe here).

sudo fedup --network 22

4. Update your system

Now to the real update. Reboot your system and choose the “System Upgrade (fedup)” option in your boot menu.

Grub Boot Menu with Upgrade option selected.

Grub Boot Menu with Upgrade option selected.

Now your system will update itself and reboot once it’s done.

After that your system will boot into the new Fedora 22 release.

Epilogue

So that’s it for our upgrade fedora 21 to 22 using fedup.

If you would like to know more about Fedup, follow this link to the wiki page of the fedup software: https://fedoraproject.org/wiki/FedUp

Virtualbox failed to create and remove snapshots.

Standard

After upgrading my Virtualbox I had some troubles with creating, removing snapshots.
The message “Failed to resume the execution of the virtual machine.” with the error code: NS_ERROR_CALL_FAILED (0x800706BE) was thrown.
So it seams as Virtualbox might be able to create the snapshot, but cannot execute that snapshot. Interestingly in my case, I was still able to restart the machine without problems.
Virtualbox Error Message

Solution

What I had to do was to re-enable the use of host I/O caching on the SATA controllers of all virtual machines where this error appeared on.

Go into the Settings page of your virtual machine and navigate to the storage option. There you need to alter the configuration of SATA: Controller.
Do that by clicking on it and then enable the “Use host I/O cache” option.

virtual machine settings page