flanaras' adventures

Anything that I might come along :)

[No-Fix] Accidentally deleted nvidia’s driver files on openSUSE


some days ago I was cleaning up some old kernels that I had on my openSUSE installation and, then at point, I deleted by mistake the files on /lib/modules/4.1.12-1-default/.* which contains nvidia.ko, nvidia-modeset.ko, nvidia-uvm.ko and some other files.

After that, when I restarted my computer I had no graphics. I would get an error when the login screen should appear. Thankfully I was able to to switch to the terminal(s) [ctrl-alt{1-6}] and ctrl-alt-7 for the “graphic terminal” which would be the regular one.

I tried then to uninstall nvidia’s modules following the openSUSE guide for nvidia drivers but no luck. Nothing was happening when I disabled the repository and refreshed them through zypper. I also try to play with the blacklisted drivers in /etc/modprobe.d/.* and got to nowhere. Next thing I did is to search why and how the “> startx” would fail. Still at this I was working from the terminal, without any GUI yet, note there where a lot of attempts and reboots.

Finally, what fix the problem I caused to myself was to, manually uninstall the nvidia packages that they still existed in the system, reboot and many hours lost for no reason.

 > #This is the magic command when working
 > #with openSUSE and nvidia and something goes wrong
 > sudo zypper rm nvidia-computeG04 nvidia-gfxG04-kmp-default
 > sudo zypper rm nvidia-glG04 x11-video-nvidiaG04

I hope this doesn’t happen to anyone else, if it happens that he or she will find this article fast.


[update 05/09/2016]: There is not easy solution for this, I might had be able to get the graphics back but I was experiencing a lot of crashes so I would suggest you to make a clean installation. I ended up doing a clean installation 😦


Wish you the best

— flanaras


Install Gazebo on openSUSE Leap 42.1

I guess if you are here you have the same question as I did, how to install Gazebo on openSUSE.

What you have to do in order to install simulator Gazebo is to find or build it’s rpm package. Thankfully some guy who goes by the nickname awissu has already built an rpm package.

Go download and install it. In my case I downloaded gazebo-7.0.0-13.1.x86_64.rpm

> sudo zypper in gazebo-7.0.0-13.1.x86_64.rpm

Wow (!) installation succeeded, but if you go to run the gazebo you get an error:

> gazebo
> gazebo: error while loading shared libraries: cannot open shared object file: No such file or directory

Okay, now let’s go and solve this problem. Instructions on how to Build And Install ignition math follow. /* you will need to install package mercurial if you don’t already have it */

  1. Setup local repository:
    > hg clone /tmp/ign-math
    > cd /tmp/ign-math
    > hg up ign-math2
  2. Make build folder:
    > mkdir build
    > cd build
  3. Build and install:
    > cmake .. -DCMAKE_INSTALL_PREFIX=/usr
    > make -j4 ## Here put the number of your computer's cores instead of 4
    > sudo make install

Let’s try again!

> gazebo
> Error [] Unable to find or open SDF file[root.sdf]

Damn.. It still doesn’t work.
It’s time to install now SDFormat [Build And Install SDFormat]. Similar as ignition math we have:

  1. Init repo
    > hg clone /tmp/sdformat
    > cd /tmp/sdformat
    > hg up sdf3
  2. To make the build folder:
    > mkdir build
    > cd build
  3. And to actual build it:
    > cmake .. -DCMAKE_INSTALL_PREFIX=/usr
    > make -j4
    > sudo make install

Fingers crossed. Let’s hope third time is the charm. Yaaayyyy, it finally works!



Until next time.

— flanaras

Install Slack on openSUSE Leap 42.1

If you are trying to install slack from their fedora x64 package on openSUSE Leap 42.1 and you find that libXScrnSaver is missing and you can’t find it anywhere to install in, don’t worry! You actually don’t need this package. The package you need is libxss1.

Tested on: Leap 42.1, tumbleweed and Leap 42.2


Slack 2.0.2 working on openSUSE Leap 42.1

The first step is to be sure that you have libXss1 package. You can do this using the “1 Click Install” or simply type in a terminal:

 > sudo zypper in libXss1

Next step is to install slack. In my case I achieved this by typing: /* Note that you need to have in the same folder as the working folder in terminal */

 > sudo zypper in slack-2.0.2-0.1.fc21.x86_64.rpm

When you do so, you will get prompt to cancel the installation or to break slack by not providing a missing dependency. /* What actually happened with this is is that the package got renamed from libXScrnSaver to libXss1 but slack is still searching for the old name for some reason. I don’t know if it is available through repositories in fedora but it’s definitely not here on openSUSE.*/ Choose to break the installation and you’re done. You successfully installed slack on your openSUSE box!

To enable the auto-update function (as @Stane1983 said) you need to do one more step.

“While Slack installs it’s repository into system for update checking, it does not import GPG key of it’s repository which breaks software updates. To fix that issue, simply import GPG key by opening terminal and typing:

 > sudo rpm --import

“, as stated on his post [].

This is not only bound to Leap 42.1, it’s going to work with the rest of openSUSE’s versions. Probably it’s going to work for other rpm based distributions.

Until next time enjoy yourselves! 🙂

— flanaras

— update [19/03/2017]: Add instructions for auto-update.


Install Spotify on openSUSE Leap + Tumbleweed


If you want to install Spotify on openSUSE and you see that Spotify doesn’t provide rpm binaries don’t worry, you can still do it!

Image with Spotify working on openSUSE Leap 42.1

I have tested this with Leap 42.1 and Tumbleweed (20180124 and older). It should work with other versions of Leap.

It seems that there are two possibilities, on my installation of openSUSE I can use the script and download and package Spotify, although on a fresh installation the script will fail. You can try method (1) and check if it works, if it doesn’t the method (2) is for you.

Method (1):

Start by cloning the repository [opensuse-spotify-installer (master)]

After that, run: (at some point you will be asked to enter your root password)

 > ./

It will take some time to download and install. In order to run it type:

 > spotify

Method (2):

In this method clone the repository [opensuse-spotify-installer (old-but-working)]

Edit the version names and to the ones given at Spotify’s repository into and spotify-client.spec, then comment out {line #103} from file spotify-client.spec [%suse_update_desktop_file $desktop] and run:

 > ./

wait until it installs and launch it as in method (1).

— You can uninstall it by:

 > rpm -e spotify-client


 > ./ -u

Enjoy your music! 😀

— edit: changed the link of the repository to my fork, the repository I forked doesn’t work on leap after he updated his version.

— update [27/05/2016]: The repository that I cloned, got updated and now works with openSUSE Leap by default. Instructions got updated.

— update [20/06/2016]: Changes from the last update don’t work on a fresh installation.

— update [26/01/2018]: Changed title specifying a multi version solution and added the tested versions.

** Now the original repository may work but I redirect to mine in the case he does any changes and doesn’t work any more on Leap.

Connecting PHP with the Mongo Driver

Hello again,

Another challenge that I came over was to connect my PHP installation 5.5 with a MongoDB 3.2.

The mongodb-php-library isn’t well documented in my opinion. They don’t tell you how to do it or where to get the dll extension and what you need to do.

This is the new driver (mongodb) or php library as they call it. The old one is mongo, look this it doesn’t have the db in the end.

First of all you need to download and install composer. During the installation you will have to point to your php installation, if it doesn’t locate it by itself.

Then you need to download the mongodb extension which is appropriate for your version. Note, in order to get the correct file you need to press the DLL next to the windows logo. After that you will need to choose your php version, architecture 32 vs 64 bit and thread safe or not libraries. I would suggest to get the thread safe. In my case I got the version 1.1.1 => php 5.5, 32 bit and thread safe.

Next thing to do is to go to your php folder. You will need to copy your dll file to <path-to-php>/ext and edit <path-to-php>/php.ini and add the following line:


Restart your Apache server and go to the folder/project that you need to install the mongo driver, i.e. htdocs/mongoTest.

Open a command prompt there, a simple way is to right to do that is to right click on the folder that you want to open it while pressing shift, you shouldn’t have selected any files when you press the right click, and then would be a hidden option that will show <open command window here> and will open a cmd at that path 😀


> composer require "mongodb/mongodb=^1.0.0@beta"

This will make composer to download this library, mongodb, and the current folder. Notice that a new composer.json file was creating, which contains all the libraries and other restrictions in order to make your project run, for example mongodb lib and php >= 5.5.

To test that everything is set up correctly, make a new php file with the following code and replace your values, host/port, dbname and collection


//This line is to include the dependencies 
require 'vendor/autoload.php';

$serverName = "localhost";
$port = 12345;
$manager = new MongoDB\Driver\Manager("mongodb://$serverName:$port");
$collection = new MongoDB\Collection($manager, "database.someCollection");

//get all items
$result = $collection->find();

foreach ($result as $entry) {
    //print element _id and time
    echo $entry->_id, ': ', $entry->time, "</br>";

echo "IT works!";

Run it and if you have done everything correct it will work!

The way to access your values in the this driver is to directly access the $result-> members!




MongoDB: The toJson() problem

Currently I’m using MongoDB on a project and I’m accessing it through the Java driver 3.x.

The problem that I had, and some other people on stackoverflow but there were no answers, comes when you try to retrieve a document that you inserted in the JSON format, it returns it in JSON extended format or in JSON but in an altered structure.

Using this piece of code I get a wrong result:

Document document;
String json = document.toString();

I’m get this and this isn’t what I inserted in the database.

"source_status_id" : { "$numberLong" : "68578585501732352" }

This is what I inserted and want:

"source_status_id" : 68578585501732352

The way to overpass this problem is to create a JSONObject from an other library ie twitter4j and then use the toString() method from that object…

Document document = document;
String json = new twitter4j.JSONObject(document).toString();

Which works as a charm and returns it in the original JSON format! 😀

Twitter4j: Status object from/to String JSON

Have you ever worked with Twitter and twittter4j and wondered how to parse a Status object to a String in JSON format and the other way around??

Here is the solution!!

To convert it to the JSON string you just need to do this:

Status tweet;
String tweetJson = StriTwitterObjectFactory.getRawJSON(tweet);

And from the JSON string to Status:

String json; //a valid json string
Status status = null;
try {
    status = TwitterObjectFactory.createStatus(json);
} catch (TwitterException e) {

The exceptions it throws is in the case that the string you provide is not a JSON valid String.

Simple as that!

I’m Back

Hello world, I’m back on-line!

New snf

snf that is in use now:

Blog at

Up ↑