Thursday, June 18, 2015

Install Chromium on Fedora 22

Today I tried to install chromium on my new Fedora 22 installation.

The Chromium package is not present in Fedora's standard repositories.

Following Fedora's documentation I performed the following:

1. Download the new repo information containing the chromium package

wget https://repos.fedorapeople.org/repos/spot/chromium-stable/fedora-chromium-stable.repo

2. Copy the new repo into yum's respos folder

cp fedora-chromium-stable.repo /etc/yum.repos.d/.

3. Install Chromium package

yum install chromium


These 3 above steps are part of the official fedora configuration.

In my case though, the installation failed due to a  signature key error/missing


warning: /var/cache/dnf/x86_64/22/fedora-chromium-stable/packages/chromium-43.0.2357.124-2.fc22.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 93054260: NOKEY


Curl error (37): Couldn't read a file:// file for file:///etc/pki/rpm-gpg/spot.gpg [Couldn't open file /etc/pki/rpm-gpg/spot.gpg]

If the same happens to you, don't worry, it is just a matter to skip the signature key check.

Run the yum install command with the -nogpgcheck switch like this:

yum install chromium --nogpgcheck

I hope this helps you in some way folks.

Thursday, October 16, 2014

Create a small RAM disk for ultra fast I/O

In this simple guide I will explain how to create a virtual ram disk based on ext3 file system to be used for very fast I/O.

This example is very useful though it has important limitations, for example:



  • It does not allow big ram drives, as far as I know, the limit is 64 MB
  • Whatever is stored in the ram drive, is destroyed as soon as your system is restarted



In this example, we create a ram drive of 64 MB, we mount and set permissions so that your current user is the owner of the newly created file system.

Step 1: create the new file system, based on memory:

sudo mkfs -t ext3 -q /dev/ram1 65536

As you can see, the disk size is 64 MB, we use as device the /dev/ram1 (you can use by default up to ram15) and the file system used is ext3.



Step 2: Create the directory to be used to mount the new file system

sudo mkdir -p /ramdrive


Step3: Mount the file system

sudo mount /dev/ram1 /ramdrive -o defaults,rw



Step4: take the ownership of the new file system

sudo chown [USERNAME] /ramdrive -R



Replace the [USERNAME] part with your actual user name.....if you don't know who you are, try to check it with the whoami command.


This article, very simple, has a lot of limitations due to the small size of the disks you can create.
Planning to write an article on how to create bigger volumes with  tmpfs.

Side Note: Nowadays, using a 64bit OS, having a lot of RAM on your PC allows you to create quite big ram drives having incredible performances during read/write operations, sometimes it is useful to leverage on this to have ultra fast user experience.

Lenovo Thinkpad T410 and Ubuntu 12.10

(This article is rather old and was posted on another personal blog, I think it could help people anyway). Just as a side note, I stopped using Ubuntu since a while due to Unity. Now I work on Fedora 20 and Gnome 3, I love it.



 I have upgraded my laptop, a Lenovo T410 mounting integrated intel graphics, to Ubuntu 12.10.

As soon as the OS started I started getting errors on the xorg server about the drivers installed. The only option was to start the PC in low resolution. In addition to that many other problems were there like support for external monitors and so on.

Checking the ubuntu unity support utility the "Unity 3D supported"  was reported as No and the overall system performances were very bad.

I have luckily solved the problem in very long manner and therefore I want to write here what I have done to solve my problems hoping to help anyone having the same isse.

To start with, the drivers installed by UBUNTU (the gallium one) are not the right one, they doe their job but don't cover all the aspects of the system configuration.

To solve the issue I have done the following.



1. Install the required packages for the next steps:

Run in a terminal the following command:

 


sudo apt-get install build-essential libtool xutils-dev bison flex libx11-dev x11proto-gl-dev x11proto-dri2-dev libxext-dev libxdamage-dev libxdamage-dev libxfixes-dev libx11-xcb-dev libxcb-glx0-dev libxcb-dri2-0-dev libudev-dev libxcb-xfixes0-dev llvm-dev

This step is required in order to prepare the environment for the actual compile of the other components.



2. Go the intel OpenSource Technology website

https://01.org/linuxgraphics/downloads



3. In the download page, download the packages MESA, libdrm and xf86-video-intel - 2.20.12.

4. extract the content of the 3 files into separate directories.

5. Build and install of the libdrm package

 

    sudo ./configure
    sudo make
    sudo make install



6. Build and install the video intel (the 3rd package you downloaded)

 

    sudo ./configure
    sudo make
    sudo make install




7. Do the same for MESA (last one), it will take a very long time

 
   
    sudo ./configure
    sudo make
    sudo make install






8. Restart your ubuntu machine. At this point, going into the system settings/details applet of your ubuntu client you will notice that ubuntu will use a new driver (and you should notice the new look and feel too!)

If everything is OK, you should have something like this:









Thursday, April 3, 2014

The love and hate for shared libraries

 Since yesterday I have been playing around on the WII controller integration on my PATRIA 3D engine.



This is required in order to have a fully working accelerometer support for our games testing since it is quite an effort to perform real testings on the smartphones especially when you are still in the middle of the caos of code development.



I have been trying the libwiimote on my ubuntu 64 bit but unfortunately, for some reasons, it does not look like the best solution for me (thought the library is well done). In fact it has a lot of sleep/wait time in the implementation which cause the frame reate of the game Fantasy Racing to drop to 15/18 FPS on my laptop. It looks like that, if no input is made on the device, the wiimote_update function freezes my process.



I have then decided to go for libwiiuse and I find it fantastic though I have not yet completed the integration.

To cut a long story short, I have compiled the library, using the well done documentation, I have done all the required configuration steps in my eclipse environment but every time I have run a compiled program using the shared object library libwiiuse.so  I used to get this error message:



error while loading shared libraries: libwiiuse.so: cannot open shared object file: No such file or directory



This problem has kiled me since I spent a lot of time looking for an explanation to the root causes of it.



After I while I thought.....holy crap Maurizio, can you be such a stupid? The new library is a shared library which links other shared libraries, let's try to refresh the dynamic linker cache by running the command ldconfig

.

And....it actually solved it.

Lesson learnt, whenever you have problems linkind shared libraries, always remember to update the linker cache!!!

Android and HW differences

"This article was created on my old blog in 2012"


Since the release of the first game on the Android Market I have faced the usual problems on the HW differences of the different Android devices on the market.


I think this is the actual limitation of the Android platform, a lack in the HW standards.


This limitation forces every developer to perform endless sessions of quality testing on a multitude of devices that ofter represent a serious limitation for and indie team.

Not all the people of starting teams can afford to have tens of devices for testing and, even if they can, no one can guarantee that the application won't crash on a specific sub version of the HW or a specific version of Android.

As if it was not enough the presence of a multitude of custom Roms, custom access levels (root access), anti virus and anti spy-wares make the situation out of control and almost impossible to be handled by simple human beings.

Besides, if you decide to go for a custom code written in C, eventually using the Android NDK, things gets harder and harder.

Just to report an example of this, when we released the version 1.7 of Fantasy Racing, we started received bad reviews (four one star in one day, terrible!) and we didn't know how to react.
In the comments our users reported things like "always crashes" or "does not start" while on our devices the game was rock solid and very stable.

We realized that all the users reporting the errors were running the game either on Galaxy SII or Galaxy Note which are 2 very common devices in the Android market.
We started digging around and we found many forums talking about bugs specific for these devices. Bugs were pointing to ADMOB compatibility or the soundpool bug. We released fixes for these problems but apparently nothing changed, we continued to receive bad reviews from our users.

We decided then to procure some devices having the same specs and we found out that on a Galaxy SII of a friend of ours, the game went very smoothly while on a Galaxy SII of another friend it constantly crashed.

To cut a long story short, we found out that the problem was depending on our PATRIA3D Engine which used to ask the GPU to draw an "not existing" Vertex Buffer Object in some game conditions and that the GPU on these devices (Mali 400) raised an error blocking the game.

The same problem didn't happen on our testing devices using different GPU families such as PowerVR, Adreno or NVidia.

In simple words, the problem was caused by a bug in our code but we had different behaviors depending on the GPU installed on the devices (though I think it is mostly related to the OpenGL driver implementation of the device).

We have now fixed the problem and the game is rock solid on those devices but unfortunately the bad reviews remains like a stain we cannot remove.

We still cannot explain why on same Galaxy S2 devices the game worked fine but start thinking about them as mysteries of the Android World.
I am preparing the code I have to use for the Global Game Jam 2013 which will occur next week end, 25-27 of January 2013.

The idea is to use my 3D Engine, PATRIA for the development of the game but I would like to avoid to share the last 2 years efforts with everyone in the world. This considering as well that PATRIA3D is not only the results of my efforts but the result of the efforts of all the team members of the Team Novasoft.



Considering that PATRIA is a modular system where each component of the engine has its own .c and .h, the best solution is to compile the .c files of the core engine which most probably won't be altered during the JAM is static libraries.

In this way I will use just the .a (static library) and the header file .h

In order to do this operation, the following steps are required:



1. Compile the .c file you want to create the library


2. Once the file is compiled, you have the .o, the object file compiled by the GNU C Compiler.



3. Now, to create the static library, you need to use the ar command. Remember that a static library must start with the prefix lib and must end as ".a"






4. At this point you have your library. The best choice in my humble opinion is to copy it into the OS /usr/lib so that it will be usable at system level. Copy it over there.



5. Include the library into the Eclipse project (if using eclipse. Otherwise just include the -llibname in the linker instructions




N.B. remember to remove in the eclipse library reference the lib and the extension!


Now you can build your project with your libraries and the code is safe!




Friday, February 13, 2009

Root access on Ubuntu

By default on Ubuntu systems the root account is disabled.

To run commands on console as root you have to use the sudo command in order to have root privileges on the required operation.

For instance, you can edit the X11 configuration file using root credentials with the following command:

sudo gedit X11/xorg.conf

Sometimes, you need to run a batch of commands on your console as root, to do this, usually on all the unix like systems you use the command su [Super User] and then you type the root's password.

In Ubuntu, by default, this option is disabled since the root account itself is disabled.

In order to enable the root account with your password and then use the su command, you have to run the following command:

sudo passwd root


In other words, using the sudo command, you run, with root priviliges the command passwd (set a password for a user) on the root account.

Type twice your password and that's all, you will be able to use the su command at your convenience.

Wednesday, October 22, 2008

How to: Configure Kismet on Ubuntu Hardy Heron (8.04) on Lenovo T60

This guide is quite generic and can be used for any laptop/wireless card.

It is anyway oriented mostly on my personal experience on my Lenovo T60.


I am running currently Ubuntu 8.04 Hardy Heron (with a custom kernel I have compiled which do not impact anyway the current topic).

First step, determine which wireless card you have installed on your PC.

Being a centrino solution from Intel you don't have to waste so much time to find which one it is but, anyway, do the following:

On a shell prompt, type the command:

lspci

or, if you prefer:

lspci | grep wireless

In the first case you will get a dump of all the devices seen by your OS, in the second case you should just receive something like the following:


03:00.0 Network controller: Intel Corporation PRO/Wireless 3945ABG Network Connection (rev 02)



Ok, checking the Kismet readme file (http://www.kismetwireless.net/documentation.shtml#readme)
you can easily determine that your wireless card is:

iwl3945 Intel/Centrino Linux iwl3945 Intel's new IPW drivers using the mac80211 kernel layer.


Ok, now we need to know how the interface is seen in your OS, to do this operation, type the following command:

iwconfig


lo no wireless extensions.

eth0 no wireless extensions.

irda0 no wireless extensions.

wmaster0 no wireless extensions.

eth1 IEEE 802.11g ESSID:"" Nickname:""
Mode:Managed Frequency:2.412 GHz Access Point: Not-Associated
Tx-Power=27 dBm
Retry min limit:7 RTS thr:off Fragment thr=2346 B
Power Management:off
Link Quality:0 Signal level:0 Noise level:0
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0



Ok, in my case it is evident that the interface is the eth1, it could be eth2, eth3 etc depending on how many interfaces you have on your PC.




OK, at this point, talking about Lenovo T60, we know that the card is an iwl3945 and the interface is an eth1.

Time to install Kismet.

Open a shell console:


1. sudo apt-get install kismet [To install the Kismet package]

2. sudo gedit /etc/kismet/kismet.conf [to open gedit on the Kismet configuration file]

3. Search the line "source=none,none,addme"

4. Modify it with the following line

source=YourCardModel, YourInterfaceName, wifi

In the case of a T60:

source=iwl3945,eth1,wifi


5. sudo kismet [To start the application]

Enjoy your wardriving expirience!!!


Cheers,
Mao

Tuesday, September 9, 2008

mmm troubles using GTK+ on UBUNTU 8.04

mmmm ok guys, I started to use the GTK+ libraries to develop a C application on my GNOME platform running on UBUNTU 8.0.4.


I have started the installation process.

As you know, it is composed of 3 different steps.
The first one, the creation of the Makefile:

./configure

and....up until here everything was ok.

The second one, the compile of the source files:

make


Ok, after several steps I got the following errors:

======================================================+
mkdir .libs
gcc -g -O2 -Wall -o .libs/autotestfilechooser autotestfilechooser.o ../gdk-pixbuf/.libs/libgdk_pixbuf-2.0.so -L/usr/local/lib ../gdk/.libs/libgdk-x11-2.0.so ../gtk/.libs/libgtk-x11-2.0.so /home//gtk+-2.12.6/gdk/.libs/libgdk-x11-2.0.so -lXext /home//gtk+-2.12.6/gdk-pixbuf/.libs/libgdk_pixbuf-2.0.so /usr/local/lib/libpangocairo-1.0.so /usr/local/lib/libpangoft2-1.0.so /usr/local/lib/libpango-1.0.so /usr/local/lib/libatk-1.0.so /usr/local/lib/libgobject-2.0.so /usr/local/lib/libgmodule-2.0.so -ldl /usr/local/lib/libglib-2.0.so /usr/lib/libcairo.so /usr/local/lib/libfreetype.so -lz -lfontconfig -lpng12 -lXrender -lX11 -lm
creating autotestfilechooser
/bin/bash ../libtool --mode=link -o autotestkeywords
libtool: unrecognized option `-o'
Try `libtool --help' for more information.
make[2]: *** [autotestkeywords] Error 1
make[2]: Leaving directory `/home//gtk+-2.12.6/tests'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home//gtk+-2.12.6'
make: *** [all] Error 2

======================================================+


mmmm, now, I tried different solutions:

- Upgrade the version of the libtool system to the lastest version.
- Review the generated Makefile
- Review all the installed libraries.


After several checks and hours spent googling for a solution, I found that a temporary workaround to the problem is to disable the compiling of the tests projects stored under the test folder.

To do this, open the generated MakeFile (from a shell you can you whatever program you prefer, vi, gedit or what you prefer).

Go to the line starting with SRC_SUBDIRS and remove the word tests.

from:

SRC_SUBDIRS = gdk-pixbuf gdk gtk modules demos tests perf contrib

to:

SRC_SUBDIRS = gdk-pixbuf gdk gtk modules demos perf contrib


Start again with the make of the project! that's all!

Enjoy your GTK+ programming experience!

Wednesday, August 6, 2008

Mmmm the power of Linux.....still surprising

mmmm need to pass a file to one of your friends....

you don't have a web space.....
you don't have samba installed nor you are in the same network.....


mmm you have linux! WOW great.

All you need is to have netcat installed (available easily on most of Linux distros...) and use this command:

Open a shell, move to root (su command) and use the following command:

while true; do nc -l -p 80 < thefileyouwanttoshare; done


Now, just provide your IP address to your friend and ask your friend to open a browser to your just provided IP address...and woila'!

I was so surprised by this simple, obvious command that I love it.

Cheers guys.

Maurizio

Monday, July 14, 2008

The Linux Prodigy

Another video from IBM about Linux.

Actually this new platform is really awesome.

I work with Linux workstations from years now (I am writing this post using UBUNTU running on an IBM Thinkpad laptop) and I can tell you that now this product reached a point of excellence.

I am running UBUNTU 64 bit at home and it is rock solid, faster than light.

I still can't understand how people can like microsoft OS, pay for applications, crack everything they need (yeah you do it!) and have an operating system which does not offer more than a linux OS.

Try and enjoy the cause. It is easy!

http://www.ubuntu.com/



IBM Servers consolidation using Linux

A nice video from IBM about servers consolidation over Linux.

I simply love that guy.

Friday, July 11, 2008

Drag Behind....finally a change in this trend from IBM?

Thinking about the trend of IBM products compared to MS and Opensource solutions, I have had always this feeling. IBM is dragging behind the market.

It's now 10 years I am working professionally with IBM products and very ofter I had the feeling to excuse IBM for the lacks of his products. Sometimes they offered excellent backbones but they lacked on the user interfaces or on fancies things.

Now, I think the trend is changing, with Quickr 8.1 and I finally feel like IBM is ahead the competitors, with integrated solutions for corporate users.

I can finally propose to my users community a solution very well integrated with the existing infrastructure, easy to be used, easy to be maintained.

Nice, great job IBM,

IBM, I dedicate this song to you, hoping that it won't happen again in the future.




Placebo - Drag

You're always ahead of the game
I drag behind
You never get caught in the rain
When I'm drenched to the bone every time
You're the first one to swim across the Seine
I lag behind
You're always ahead of the game
While I drag behind

I drag behind
I drag behind
I drag behind
I drag behind

You're always ahead of the pack
I drag behind
You posses every trait that I lack
By coincidence or by design
You're the monkey I've got on my back
That tells me to shine
You're always ahead of the pack
While I drag behind

I drag behind
I drag behind
I drag behind
I drag behind
I drag behind
I drag behind
I drag behind
I drag behind

You're always ahead of the rest
When I'm always on time
You got As on your algebra tests
I failed and they kept me behind
I just gotta get off my chest
That I think you're divine
You're always ahead of the rest
While I drag behind

I drag behind
I drag behind
I drag behind
I drag behind
I drag behind
I drag behind
I drag behind
I drag behind

Thursday, July 10, 2008

Ed Brill's presentation about Social Networking software

This presentation illustrates the evolution of the business from the traditional hierarchies to networked hierarchies illustrating the advantages of the usage of Blogs, Wikis and other collaboration tools (see the presentation!).

See you guys!

New sametime video

Here we are.

A new video from IBM about Sametime chat system.

I find this video awesome, let me know your opinion on this.