Saturday, 2 February 2013

Using Oracle Java with libreoffice Fedora 18

Problem I was having was that I didn't want openjdk installed as I need Oracle's Java environment to be able to develop some android apps. I am not fully sure if I needed to remove the installation of the openjdk I guess I didn't and all I needed to do was to update the links and environment variables to point to the installation of Oracles Java. Anyhow I removed the openjdk instead and this is how I did it.

What I did here was to remove the installation of the openjdk without it trying to remove the libreoffice using following command. Use the appropriate version of the openjdk to remove it.

rpm -ev --nodeps java-1.7.0-openjdk

The --nodeps will remove the package without the libreoffice.

Now I installed Oracle's Java rpm downloaded from JavaSE Download, just by double clicking it, it then installs it. After completion of the installation, libreoffice seems fine and so does my development environment.

You can check which version of java is wired up if your not sure, by using the command:

java -version

When I was trying to do this I managed to get myself into a pickle with versions of java being installed, as I couldn't remove Oracle's Java using the software tool in Fedora 18. The software tool seemed to crash all the time, so I removed Oracle's Java from the command line instead, I used the following commands:

rpm -qa | grep jdk                            (This to find out the name of the package I wanted to remove)
rpm -ev jdk-1.7.0_13-fcs.x86_64    (This to remove the above package)

for some reason the software tool wasn't updated with the removal of the package but I ignored it for now.
So I found I had to do the order of removing the openjdk package, which I believe removes all the environment for java, so then installing Oracle's Java would reset them and then libreoffice continued to work.

I also imagine if there are any updates in the future that require openjdk to be installed it will be installed and thus wiping your Oracles Java environment variables. I haven't found this yet, but I am sure all I would need to do to reset them is too re-follow the above.

Remove openJDK, Remove Oracle Java, Re-Install Oracle Java. 

Hope this helps someone else too. :-)

Sunday, 27 January 2013

Fedora 17 and 18 headphone socket fix

The Problem...

My headphones produce no sound from jack socket when using Fedora 17 and also Fedora 18. The sounds card I have is:

  • 00:1b.0 Audio device: Intel Corporation 5 Series/3400 Series Chipset High Definition Audio (rev 06)
  • 02:00.1 Audio device: Advanced Micro Devices [AMD] nee ATI Redwood HDMI Audio [Radeon HD 5000 Series]

I found the above be executing the "lspci" command, you can use "lspci | grep Audio" and that should find similar to the above.


The Solution...

I got my solution from here.
All I did was to create the file /etc/modprobe.d/dist-alsa.conf and add the following lines:

  • options snd-hda-intel model=dell-m6-amic
  • options snd-hda-intel enable_msi=1
Ok I found an issue when I tried the above setting of setting the model to dell-m6-amic, my microphone stopped working, I then found a little information on this thread that stated that was for the analog mic, so I changed the setting to dell-m6-dmic which is for a digital mic.

How to know which model to choose this link is very useful! This has some info too but pretty much the same.

Then reboot, potentially you don't need to reboot and there is a command to restart the sound system, I am not sure on this, so reboot it was for me :-)

Hope this helps someone else out too :-)

Thursday, 24 January 2013

Installing ATI drivers on Fedora 18

I followed mostly what was in this link, but when installing the driver I just did yum install akmod-catalyst as it pulls in required dependencies.

I managed to get a black screen by just installing the akmod-catalyst without some of those instructions, so it was either the first instruction or last that fixed my black screen problem after booting. reinstalling mesa-libGL or the dracut of a new image after making sure the Radeon drivers were uninstalled.

Only problem I have is a nice watermark at the bottom right of my screen. Its not so bad for now, but would be nice to get rid of :-)

There are some fixes out there on how to remove it, but I am sure the new builds releases will come soon. :-)

Wednesday, 23 January 2013

Nice shortcut editor for Fedora 18

I used alacarte and seems to be able to set up all the shortcuts and modify the icons etc. Very nice! straight forward.

yum install alacarte

Setting up Fedora 18 for an SSD

Just some short points on setting up Fedora 18 or for that matter probably most Linux flavours for an SSD.

I've highlighted the bits I changed:

/etc/fstab changes:


  • /dev/sda   /   ext4   noatime,nodiratime,discard,errors=remount-ro 0 1
  • tmpfs   /tmp       tmpfs   defaults,noatime,mode=1777   0  0
  • tmpfs   /var/spool tmpfs   defaults,noatime,mode=1777   0  0
  • tmpfs   /var/tmp   tmpfs   defaults,noatime,mode=1777   0  0
  • tmpfs   /var/log   tmpfs   defaults,noatime,mode=0755   0  0 (only do this if you don't care about loosing logs on reboot!)
/etc/default/grub changes:
  • GRUB_CMDLINE_LINUX_DEFAULT="quiet splash elevator=deadline" add the elevator bit to the end.
  • grub2-mkconfig -o /boot/grub2/grub.cfg
Chrome to use its cache directory as the tmp director, which is in memory already add the following to the shortcut.
  • --disk-cache-dir="/tmp" --disk-cache-size=104857600

The link I got most this information from :-)

Setting up Broadcom 4312 with Fedora 18

This was a bit of a pain and felt like I had to jump through hoops to get this damn thing to work. In the end its not actually too much to do, you can either to try and follow the instructions in this link (I have had to do this recently) or mine.

First off, by using the command line rpm and yum commands I seemed to be more successful installing all the required packages.

So here goes...

Step 1:
Change user as root:
  • su -
Step 2:
You need to add a couple of repos, the rpmfusion free and nonfree repos.
  • rpm -Uvh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm
  • rpm -Uvh http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm
Step 3:
You will probably then need to download and import the keys for these repos from rpmfusion-keys:
  • get [attachment:RPM-GPG-KEY-rpmfusion-free-fedora-18]
  • get [attachment:RPM-GPG-KEY-rpmfusion-nonfree-fedora-18]
Step 4:
Import the keys:
  • rpm --import <Directory where you downloaded the [attachment:RPM-GPG-KEY-rpmfusion-free-fedora-18] Key>
  • rpm --import <Directory where you downloaded the [attachment:RPM-GPG-KEY-rpmfusion-nonfree-fedora-18] Key>
Step 5:
Now with these keys imported, you should now be able to update:
  • yum update
Step 6:
Ok this got a bit weird when I tried to install kmod-wl but try it out it could work straight out for you, but I had issues with it failing to install due to "uname -r" not matching with build of kmod-wl not correct.
  • yum install kmod-wl
If the above fails then try:
  • yum install akmod-wl
I think all the akmod-wl will do is bring all the dependencies it requires, which will be the kmod-wl and the broadcom-wl packages and a few others. I think all the akmod does is to be able to build a new version of the kmod-wl module against your version of the kernel if there doesn't exist one on the repos. Also if/when you update your kernel this akmod should make sure that the kmod-wl is built correctly.

So at this point akmod-wl, kmod-wl and broadcom-wl should be installed, and a few others required dependencies by the akmod-wl package.

Step 7:
Ok now I found at this point that there was a module loaded called ssb which conflicts with the wl module. I am not sure what this module is and why it conflicts I didn't look into it too much, so I had to remove this module permanently by adding it to a blacklist. First of all I tried:
  • echo "blacklist ssb" >> /etc/modprobe.d/blacklist.conf
which didn't seem to work, so I added it directly to the grub.conf, but what I did was add it too the /etc/default/grub file so as the time comes when you may need to call grub-mkconfig then it will keep the default added in that file, so I did:
  • added "rd.driver.blacklist=ssb" to the end of the GRUB_CMDLINE_LINUX in the /etc/default/grub
  • then ran, "grub2-mkconfig -o /boot/grub2/grub.cfg" this regenerated the /etc/grub2.cfg file.
I am not sure why I had to blacklist like this and if anyone can explain or help out that would be much appreciated :-) So all should be prepared at this point, just one more step.

Step 8:
I removed the ssb module and added the wl module.
  • rmmod ssb
  • modprobe wl
Now that should be it, as far as I remember, on the network icon then should show up wireless. Try rebooting also to make sure it comes up after a reboot also. If you get any problems or some parts don't work please let me know and I will try to correct it and help.

Some useful links I found and used.
Hope this helps out :-)

Saturday, 19 January 2013

Setting up QNAP to accept ssh connection from different users

This is a pain to do, and I always seem to forget one switch to turn on 1 file to set up 1 permission to configure. Always the same every time I need to do it. Well I have put together a few links that I have found useful and a few procedures I have found helpful to understand why a connection fails. :-)

So the steps and links I used are:

  1. For setting up new ssh software on the QNAP NAS I used this link: http://blog.jameslick.com/?p=1090 brilliant, excellent! worked for me and my model. I imagine it would be a slight tweak for other models if they have different names for equivalent mounts.
  2. Then I set up the users paths in /etc/passwd on the NAS box of the users.
  3. Setting up the ssh keys, omg! I used this link: http://superuser.com/questions/8077/how-do-i-set-up-ssh-so-i-dont-have-to-type-my-password. So I worked out the public key goes on the NAS box in the authorized_keys file in the user .ssh directory of the user, e.g. /home/JoeBloggs/.ssh/authorized_keys  <-- This user home path should be the same as what you specified in the /etc/passwd file. BE CAREFUL - When copying the public key that it doesn't gain spaces on the copy paste route, it needs to be as it is in the generated file (from point 1) You can add more than one key to this file for this user, if the same user connects from different machines, you can generate another key from the other machine and add the public key of that one to the same authorized_keys file. You press ENTER after the first one and then paste in the new one.
  4. Configure the sshd_config file this is in the location(s) specified in the link 1, don't forget to update both configs otherwise on reboot you will get your old one back. You can set up the config file with the users that are required to access via ssh.
    1. So there is a section to describe where to find the authorized keys file, and you can configure it to go to the home path of the user that tries to connect, using (I believe %h means the home directory of the user connecting, but I am not 100% sure): 
      • AuthorizedKeysFile %h/.ssh/authorized_keys
    2. There is also a section to allow certain users: 
      • AllowUsers JoeBloggs Fred
  5. There are also special permissions allowed only to the authorized_keys files which I found in this link: http://recursive-design.com/blog/2010/09/14/ssh-authentication-refused/
  6. Any problems that occur, when you test to connect to ssh JoeBloggs@<yourIP> you can run the ssh with a -v that can output much information that can give clues in why it fails.
  7. Also you can run the QNAP sshd manually with sshd -d and then connect from the client and watch the debug output that can give clues also :-). To do this I would stop the ssh service in the QNAP web client. Then locate the sshd on the QNAP, it is usually at /usr/sbin/sshd, so you will have to execute with full path specified e.g. /usr/sbin/sshd -d and this should then start up the daemon ready for connections.
  8. One more thing! If you want to map a network drive on a linux box to your QNAP, you will need to turn on the sftp option when turning on your ssh option in the web client of your QNAP box. You can also do this drive mapping nicely with sshfs JoeBloggs@<YourIP>:<Directory you want to go too on the QNAP> <Directory you want to map too on local computer> The "Directory you want to go too on the QNAP" default is your home directory of that user, so if you need somewhere out of that (and make sure you have permisions for the user set up on the QNAP), you have to specify a relative path from your home directory, e.g. sshfs JoeBloggs@<YourIP>:../../SomeSpecialData /home/JoeBloggs/SomeSpecialData
Ok I think that's it for now.

Hope it will help someone, again it will help me when I need to do this again :-)